/* Dropship product frontend styles - options, addons, and PPSI price display */

#fd-dropship-ppsi,
#fd-dropship-gangsheet,
#fd-dropship-extras,
#fd-dropship-job-fields,
#fd-dropship-dtf-fields,
#fd-dropship-upload-section {
  display: block !important;
  float: none !important;
  clear: both !important;
  width: 100% !important;
  grid-column: 1 / -1 !important;
  margin: 0;
}

#fd-dropship-dtf-fields + #fd-dropship-ppsi,
#fd-dropship-ppsi + #fd-dropship-extras,
#fd-dropship-extras + #fd-dropship-upload-section,
#fd-dropship-job-fields + #fd-dropship-extras,
#fd-dropship-gangsheet + #fd-dropship-job-fields,
#fd-dropship-gangsheet + #fd-dropship-upload-section,
.fd-dropship-options,
.fd-dropship-addons {
  margin-top: 25px;
}

.fd-dropship-field {
  display: flex;
  align-items: center;
  margin-bottom: 0;
  gap: 10px;
}

#fd-dropship-job-fields .fd-dropship-field,
#fd-dropship-dtf-fields .fd-dropship-field,
#fd-dropship-upload-section .fd-dropship-field {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

#fd-dropship-job-fields .fd-dropship-field + .fd-dropship-field,
#fd-dropship-upload-section .fd-dropship-field + .fd-dropship-field {
  margin-top: 15px;
}

#fd-dropship-ppsi .fd-dropship-field + .fd-dropship-field {
  margin-top: 5px;
}

.fd-dropship-field label {
  margin-bottom: 0;
  min-width: 110px;
  font-weight: 400;
  font-size: 16px;
}

.fd-dropship-gangsheet-build-button {
  display: block;
  clear: both;
  margin-top: 10px;
  margin-bottom: 15px;
  padding: 10px;
  background-color: #eeeeee;
  border: 1px solid #cccccc;
  border-radius: 2px;
  cursor: pointer;
}

/* Shared heading style for product page headers and section labels */
.fd-product-page-header,
#fd-dropship-job-fields label.fd-product-page-header,
.fd-dropship-options-heading,
.fd-dropship-section-label,
.fd-dropship-size-heading,
.fd-dropship-addons-heading {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.fd-product-page-header,
#fd-dropship-job-fields label.fd-product-page-header {
  display: block;
  margin-bottom: 5px;
}

.fd-dropship-size-heading,
.fd-dropship-addons-heading {
  margin-bottom: 5px;
}

.fd-dropship-section-label {
  display: block;
}

.fd-dropship-select {
  flex: 1;
  min-width: 100px;
  background-color: #ffffff;
  padding: 10px;
  border: 1px solid #cccccc;
  border-radius: 2px;
}

#fd-dropship-upload-section .fd-dropship-field input,
#fd-dropship-upload-section textarea,
#fd-dropship-job-fields input,
#fd-dropship-job-fields textarea,
#fd-dropship-dtf-fields input,
#fd-dropship-dtf-fields textarea {
  width: 100%;
  padding: 10px;
  margin: 0;
}

.fd-dropship-price-display {
  font-size: 1.5em;
  font-weight: 700;
}

.fd-dropship-minimum-order {
  font-size: 16px;
  color: #666666;
  margin: 4px 0 0;
}

/* Addon and agreement rows */
.fd-dropship-addon-row,
.fd-dropship-agreement-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fd-dropship-addon-row {
  margin-bottom: 6px;
}

.fd-dropship-addon-row input[type="checkbox"],
.fd-dropship-agreement-row input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.fd-dropship-addon-row label,
.fd-dropship-agreement-row label {
  cursor: pointer;
  margin: 0;
  font-size: 16px;
}

.fd-dropship-agreement-row input[type="checkbox"] {
  flex-shrink: 0;
}

/* Upload section */
#fd-dropship-drop-zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  background: #eeeeee;
  border: 1px dashed #cccccc;
  cursor: pointer;
  margin-bottom: 12px;
  text-align: center;
}

.fd-dropship-upload-note {
  font-size: 14px;
  margin: 8px 0 20px;
}

.fd-dropship-agreement-row {
  margin-top: 25px;
  margin-bottom: 25px;
}

.fd-dropship-agreement-error {
  margin-top: 6px;
  color: red;
}

/* Shared spinner animation */
@keyframes fd-gs-spin {
  to { transform: rotate(360deg); }
}

/* Spinner ring — shared between PPSI upload progress and gang sheet save overlay */
.fd-gs-save-spinner,
#fd-dropship-progress-ring {
  width: 44px;
  height: 44px;
  border: 4px solid #e5e5e5;
  border-top-color: #111111;
  border-radius: 50%;
  animation: fd-gs-spin 0.8s linear infinite;
  flex-shrink: 0;
}

#fd-dropship-upload-progress {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.fd-dropship-progress-status {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: #333333;
  text-align: center;
}

.fd-dropship-hidden {
  display: none;
}

#fd-dropship-upload-preview {
  margin-bottom: 12px;
  padding: 25px;
  background-color: #eeeeee;
  border: 1px solid #cccccc;
}


/* Upload size feedback message shown under the Upload File label after finalize */
.fd-dropship-upload-size-message {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin: 8px 0 12px;
  border-radius: 2px;
  font-size: 14px;
}

.fd-dropship-upload-size-error {
  background-color: #fff0f0;
  color: #b30000;
  border: 1px solid #f2c6c6;
}

.fd-dropship-upload-size-success {
  background-color: #f0fff4;
  color: #0d7a2b;
  border: 1px solid #c6e8d0;
}

.fd-dropship-upload-error {
  margin-top: 8px;
  color: red;
  font-size: 0.9em;
}

.fd-dropship-preview-img {
  display: block;
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
}

/* Gang sheet builder modal */
.fd-dropship-gangsheet-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
}

.fd-dropship-gangsheet-modal-panel {
  background: #ffffff;
  width: 100%;
  height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.fd-dropship-gangsheet-modal-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e5e5;
}

.fd-dropship-gangsheet-modal-size {
  font-weight: 600;
}

.fd-dropship-gangsheet-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fd-dropship-gangsheet-modal-content {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Overlap warning banner — shown above the canvas when images intersect */
.fd-gs-overlap-warning {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background-color: #fff3cd;
  color: #7a5800;
  border-bottom: 1px solid #f0c040;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.fd-dropship-gangsheet-canvas-column {
  background: #fafafa;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.fd-dropship-gangsheet-canvas-workspace {
  width: 100%;
  flex: 1;
  min-height: 0;
  background: #C8C8C8;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 20px;
  box-sizing: border-box;
}

.fd-dropship-gangsheet-canvas-stage {
  flex-shrink: 0;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  position: relative;
}

/* Loading message shown over the canvas stage while draft resolves */
.fd-gs-draft-bootstrap-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.9em;
  color: #555555;
  pointer-events: none;
  z-index: 10;
}

.fd-dropship-gangsheet-canvas-stage canvas {
  display: block;
}

/* Shared sidebar style for both left (library) and right (tools) panels */
.fd-gs-sidebar {
  background: #eeeeee;
  width: 200px;
  flex-shrink: 0;
  padding: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 14px;
}

.fd-gs-tools-section {
  margin-bottom: 20px;
}

.fd-gs-tools-heading {
  font-weight: 600;
  margin: 0 0 8px;
  font-size: 0.82em;
  color: #444444;
}

.fd-gs-file-input {
  display: none;
}

.fd-gs-upload-btn {
  width: 100%;
  text-align: left;
}
.fd-gs-upload-hint {
  margin: 8px 0 0;
  color: #444444;
  font-size: 0.82em;
  text-align: left;
  line-height: 1.5;
}

/* Library section */
.fd-gs-library-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.fd-gs-library-empty {
  margin: 0;
  color: #888888;
  font-size: 0.9em;
}

.fd-gs-library-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.fd-gs-library-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #e5e5e5;
  background: #fafafa;
  cursor: pointer;
  border-radius: 2px;
}

.fd-gs-library-item:hover {
  background: #f0f0f0;
  border-color: #cccccc;
}

/* Shared dimensions for both real and placeholder thumbs */
.fd-gs-library-thumb,
.fd-gs-library-thumb--placeholder {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.fd-gs-library-thumb {
  object-fit: contain;
  background: #ffffff;
  border: 1px solid #e5e5e5;
}

.fd-gs-library-name {
  flex: 1;
  font-size: 0.85em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.fd-gs-library-delete {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 2px 6px;
  cursor: pointer;
  color: #999999;
  font-size: 1.1em;
  line-height: 1;
}

.fd-gs-library-delete:hover {
  color: #cc0000;
}

/* Restored item — previously uploaded file, no blob URL available */
.fd-gs-library-item--restored {
  opacity: 0.65;
  cursor: default;
}

/* Placeholder thumb for restored items */
.fd-gs-library-thumb--placeholder {
  display: block;
  background: #e5e5e5;
  border: 1px solid #cccccc;
  position: relative;
}

/* "?" icon centered in placeholder thumb */
.fd-gs-library-thumb--placeholder::after {
  content: '?';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85em;
  color: #888888;
  font-weight: 600;
}

/* Right sidebar — selection panel */
.fd-gs-sel-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.fd-gs-sel-dimensions {
  flex-direction: row;
  gap: 8px;
}

.fd-gs-sel-dimensions .fd-gs-sel-label {
  flex: 1;
}

.fd-gs-sel-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82em;
  font-weight: 600;
  color: #444444;
}

.fd-gs-sel-input {
  width: 100%;
  box-sizing: border-box;
  height: 34px;
  padding: 4px 6px;
  font-size: 0.9em;
  border: 1px solid #cccccc;
  background: #ffffff;
}

.fd-gs-sel-rotate-row .fd-gs-sel-input {
  margin-top: 4px;
}

/* Rotate row: input + left/right buttons on one line */
.fd-gs-sel-rotate-row {
  flex-direction: row;
  align-items: flex-end;
  gap: 6px;
  margin-bottom: 16px;
}

.fd-gs-sel-rotate-row .fd-gs-sel-label {
  flex: 1;
  min-width: 0;
  gap: 0;
  margin-bottom: 0;
}

.fd-gs-sel-rotate-row .fd-gs-rot-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 10px;
  font-size: 1.1em;
  line-height: 1;
}

.fd-gs-rot-btn {
  flex-shrink: 0;
  padding: 4px 7px;
  font-size: 1.1em;
  line-height: 1;
  border: 1px solid #999999;
  background: #cccccc;
  cursor: pointer;
  border-radius: 2px;
}

.fd-gs-sel-action-btn {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  text-align: center;
}

/* Top bar buttons */
.fd-dropship-gangsheet-modal-panel .fd-gs-undo-btn,
.fd-dropship-gangsheet-modal-panel .fd-gs-clear-btn,
.fd-dropship-gangsheet-modal-panel .fd-gs-save-btn,
.fd-dropship-gangsheet-modal-panel .fd-gs-cancel-btn {
  font-size: 14px;
  border-radius: 2px;
  padding: 4px 10px;
  cursor: pointer;
  line-height: normal;
  box-shadow: none !important;
  text-shadow: none !important;
  background-image: none !important;
}

.fd-dropship-gangsheet-modal-panel .fd-gs-undo-btn,
.fd-dropship-gangsheet-modal-panel .fd-gs-undo-btn:hover,
.fd-dropship-gangsheet-modal-panel .fd-gs-clear-btn,
.fd-dropship-gangsheet-modal-panel .fd-gs-clear-btn:hover {
  border: 1px solid #999999 !important;
  background-color: #eeeeee !important;
  color: #000000 !important;
}

.fd-dropship-gangsheet-modal-panel .fd-gs-save-btn,
.fd-dropship-gangsheet-modal-panel .fd-gs-save-btn:hover {
  border: 1px solid #666666 !important;
  background-color: #333333 !important;
  color: #ffffff !important;
}

.fd-dropship-gangsheet-modal-panel .fd-gs-cancel-btn,
.fd-dropship-gangsheet-modal-panel .fd-gs-cancel-btn:hover {
  border: 1px solid #999999 !important;
  background-color: #cccccc !important;
  color: #000000 !important;
}

/* Sidebar buttons — upload and selection action buttons */
.fd-dropship-gangsheet-modal-panel .fd-gs-upload-btn,
.fd-dropship-gangsheet-modal-panel .fd-gs-upload-btn:hover,
.fd-dropship-gangsheet-modal-panel .fd-gs-sel-action-btn,
.fd-dropship-gangsheet-modal-panel .fd-gs-sel-action-btn:hover {
  font-size: 14px;
  border-radius: 2px;
  border: 1px solid #999999 !important;
  background-color: #cccccc !important;
  color: #000000 !important;
  padding: 4px 10px;
  cursor: pointer;
  box-shadow: none !important;
  text-shadow: none !important;
  background-image: none !important;
}

/* Align buttons */
.fd-dropship-gangsheet-modal-panel .fd-gs-align-btn,
.fd-dropship-gangsheet-modal-panel .fd-gs-align-btn:hover {
  flex: 1;
  padding: 5px 4px;
  text-align: center;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 14px;
  border-radius: 2px;
  border: 1px solid #999999 !important;
  background-color: #cccccc !important;
  color: #000000 !important;
  cursor: pointer;
  box-shadow: none !important;
  text-shadow: none !important;
  background-image: none !important;
}

.fd-gs-align-btn svg {
  display: block;
  flex-shrink: 0;
}

.fd-gs-undo-btn:disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

/* Zoom control */
.fd-gs-zoom-wrap {
  display: inline-flex;
  align-items: center;
  border: 1px solid #999999;
  border-radius: 2px;
  background-color: #eeeeee;
  overflow: hidden;
  height: 28px;
}

.fd-gs-zoom-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 8px;
  color: #000000;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  text-shadow: none;
}

.fd-gs-zoom-btn:hover {
  background-color: #dddddd;
}

.fd-gs-zoom-reset-btn {
  border-left: 1px solid #999999;
  font-size: 13px;
}

.fd-gs-zoom-display {
  font-size: 13px;
  min-width: 44px;
  text-align: center;
  color: #000000;
  border-left: 1px solid #999999;
  border-right: 1px solid #999999;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  user-select: none;
}

/* BG Color control — UI only */
.fd-gs-bg-color-wrap {
  position: relative;
  display: inline-block;
}

.fd-gs-bg-color-btn {
  border-bottom-width: 3px !important;
}

.fd-gs-bg-palette {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 200;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  background-color: #eeeeee;
  border: 1px solid #999999;
  border-radius: 2px;
  padding: 6px 8px;
  margin-top: -1px;
  white-space: nowrap;
}

.fd-gs-bg-color-wrap:hover .fd-gs-bg-palette {
  display: flex;
}

.fd-gs-bg-swatch {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  border: 1px solid #999999;
  cursor: pointer;
  padding: 0;
  box-shadow: none !important;
  text-shadow: none !important;
  flex-shrink: 0;
}

.fd-gs-bg-swatch--active {
  outline: 2px solid #333333;
  outline-offset: 2px;
}

.fd-gs-sidebar-divider {
  border: none;
  border-top: 1px solid #e5e5e5;
  margin: 12px 0;
}

.fd-gs-align-row {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

/* Gang sheet save overlay — covers modal panel during upload/preview */
.fd-gs-save-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
  padding: 24px;
  text-align: center;
}

.fd-gs-save-msg {
  margin: 0;
  font-size: 0.95em;
  color: #333333;
}

.fd-gs-save-success {
  font-weight: 700;
  color: #2a7a2a;
  font-size: 1.1em;
}

.fd-gs-save-warning {
  color: #996600;
}

.fd-gs-save-error {
  color: #cc0000;
}

/* Preview images */
.fd-gs-save-preview-img,
.fd-dropship-gangsheet-preview-img {
  object-fit: contain;
  border: 1px solid #e5e5e5;
  background: #f5f5f5;
}

.fd-gs-save-preview-img {
  max-width: 320px;
  max-height: 260px;
}

.fd-dropship-gangsheet-preview-block {
  margin-top: 12px;
  margin-bottom: 10px;
  padding: 15px;
  background-color: #eeeeee;
  border: 1px solid #cccccc;
  text-align: center;
}

.fd-dropship-gangsheet-preview-img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  margin-bottom: 8px;
}

.fd-dropship-gangsheet-preview-note {
  margin: 0;
  font-size: 0.88em;
  color: #555555;
}

@media (max-width: 900px) {
  .fd-dropship-gangsheet-modal-content {
    flex-direction: column;
    overflow: auto;
  }
  .fd-gs-sidebar {
    width: 100%;
  }
  .fd-dropship-gangsheet-canvas-workspace {
    min-height: 280px;
    padding: 8px;
  }
}

/*-- Hide Sidebar --*/
#main-content .container:before {
  background: none !important;
}

#left-area {
  width: 100% !important;
  padding: 23px 0 0 !important;
  float: none !important;
}

#sidebar {
  display: none;
}
