/* ── yourChoice Configurator ─────────────────────────────── */

#yc-configurator {
  margin: 24px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.yc-configurator-inner {
  border: 2px solid #e0e8f0;
  border-radius: 10px;
  padding: 24px;
  background: #fafcff;
}

.yc-section-title {
  font-size: 1.2rem;
  color: #1b4f8a;
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #d6e4f0;
}

/* Steps */
.yc-step {
  margin-bottom: 20px;
}

.yc-step-label {
  display: block;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

/* Option buttons (positions, techniques) */
.yc-configurator-inner .yc-option-btn,
#yc-configurator .yc-option-btn {
  display: inline-flex !important;
  flex-direction: column;
  align-items: center;
  padding: 10px 16px;
  margin: 0 8px 8px 0;
  border: 2px solid #cbd8e8;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  color: #444;
  transition: all 0.15s ease;
  line-height: 1.3;
  width: auto !important;
  float: none !important;
  clear: none !important;
  box-sizing: border-box;
}

.yc-option-btn small {
  font-size: 0.75rem;
  color: #888;
  margin-top: 3px;
}

.yc-option-btn:hover {
  border-color: #1b4f8a;
  background: #edf4fb;
  color: #1b4f8a;
}

.yc-option-btn.selected {
  border-color: #1b4f8a;
  background: #1b4f8a;
  color: #fff;
}

.yc-option-btn.selected small {
  color: #b8d4ee;
}

/* Colours row */
.yc-colours-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.yc-colours-row input[type="number"],
#yc-quantity-input {
  width: 80px;
  padding: 8px;
  border: 2px solid #cbd8e8;
  border-radius: 6px;
  font-size: 1rem;
}

/* Upload area */
.yc-upload-area {
  border: 2px dashed #cbd8e8;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  background: #fff;
  transition: border-color 0.15s;
  position: relative;
}

.yc-upload-area.drag-over {
  border-color: #1b4f8a;
  background: #edf4fb;
}

.yc-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.yc-upload-label {
  cursor: pointer;
  pointer-events: none;
  color: #555;
  line-height: 1.8;
}

.yc-upload-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 6px;
  color: #1b4f8a;
}

#yc-upload-status {
  margin-top: 12px;
  font-size: 0.9rem;
}

.yc-error   { color: #c0392b; }
.yc-artwork-fee { color: #e67e22; display: block; margin-top: 4px; font-size: 0.85rem; }
.yc-vector-ok   { color: #27ae60; display: block; margin-top: 4px; font-size: 0.85rem; }

/* Canvas preview */
#yc-preview-container {
  margin-top: 16px;
}

#yc-preview-canvas {
  border: 1px solid #ddd;
  border-radius: 8px;
  max-width: 100%;
  background: #f5f5f5;
}

/* Price summary */
.yc-price-summary {
  margin-top: 20px;
  border-top: 2px solid #e0e8f0;
  padding-top: 16px;
}

.yc-price-summary h4 {
  margin: 0 0 12px;
  color: #1b4f8a;
}

.yc-price-line,
.yc-price-total {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 0.9rem;
  color: #555;
  border-bottom: 1px solid #f0f0f0;
}

.yc-price-total {
  font-weight: 700;
  font-size: 1.05rem;
  color: #1b4f8a;
  border-bottom: none;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 2px solid #1b4f8a;
}

.yc-price-subtotal {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #444;
  border-top: 1px solid #ccc;
  margin-top: 4px;
}

.yc-price-per-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

/* Loading state */
.yc-loading {
  color: #888;
  font-style: italic;
  font-size: 0.9rem;
}

/* ── Admin styles ──────────────────────────────────────────── */
.yc-admin .yc-cards {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  margin-top: 20px;
}

.yc-admin .yc-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
}

.yc-admin .yc-card h3 {
  margin-top: 0;
  color: #1b4f8a;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.yc-admin .yc-card > .button,
.yc-admin .yc-card p > .button {
  display: block;
  margin-bottom: 8px;
  text-align: center;
}

.yc-status {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}
.yc-status-success { background: #d4edda; color: #155724; }
.yc-status-error   { background: #f8d7da; color: #721c24; }
.yc-status-partial { background: #fff3cd; color: #856404; }

@media (max-width: 768px) {
  .yc-admin .yc-cards { grid-template-columns: 1fr; }
  .yc-option-btn { font-size: 0.82rem; padding: 8px 12px; }
}

/* ── Fabric.js canvas ──────────────────────────────────────── */
#yc-canvas-wrap {
  margin: 4px 0 20px;
}

#yc-canvas-container {
  position: relative;
  display: block;
  width: 100%;
  max-width: 520px;
  max-height: 520px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid #dde6f0;
  box-shadow: 0 2px 8px rgba(27,79,138,0.08);
  background: #f0f0f0;
  cursor: default;
}

#yc-canvas-container canvas {
  display: block;
  width: 100% !important;
  height: auto !important;
}

#yc-print-area-label {
  font-size: 0.78rem;
  color: #888;
  margin: 5px 0 0;
}

/* Snap-back warning */
.yc-snap-warning {
  display: none;
  margin-top: 6px;
  padding: 6px 12px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #7a5c00;
}

/* DPI warnings */
.yc-dpi-warning {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.yc-dpi-warn {
  background: #fff8e1;
  border: 1px solid #ffe082;
  color: #7a5c00;
}

.yc-dpi-block {
  background: #fff0f0;
  border: 1px solid #ffcdd2;
  color: #b71c1c;
}

/* Upload note (for vector/no-preview files) */
.yc-upload-note {
  margin-top: 8px;
  padding: 6px 10px;
  background: #f0f4ff;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #4338ca;
}

/* ── Preview button ────────────────────────────────────────── */
.yc-preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 10px 20px;
  background: #1b4f8a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.yc-preview-btn:hover {
  background: #163e6e;
  transform: translateY(-1px);
}

.yc-preview-btn:active {
  transform: translateY(0);
}

/* ── Preview modal ─────────────────────────────────────────── */
.yc-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.yc-preview-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
}

.yc-preview-modal-box {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 14px;
  padding: 28px 28px 22px;
  max-width: min(560px, 92vw);
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  animation: ycModalIn 0.2s ease;
}

@keyframes ycModalIn {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.yc-preview-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: #888;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.1s, background 0.1s;
}

.yc-preview-modal-close:hover {
  color: #333;
  background: #f0f0f0;
}

.yc-preview-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1b4f8a;
  margin: 0 0 16px;
}

.yc-preview-modal-img-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e8e8e8;
  background: #f8f8f8;
  line-height: 0;
}

.yc-preview-modal-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.yc-preview-modal-note {
  font-size: 0.78rem;
  color: #999;
  margin: 10px 0 0;
  text-align: center;
  font-style: italic;
}

/* Prevent body scroll when modal open */
body.yc-modal-open {
  overflow: hidden;
}

@media (max-width: 480px) {
  .yc-preview-modal-box {
    padding: 20px 16px 18px;
    border-radius: 10px;
  }
}

/* ── Blank/unbranded order option ─────────────────────────── */
.yc-blank-order-wrap {
  margin-top: 16px;
  padding: 14px 16px;
  background: #f8fafb;
  border: 1px solid #dde6f0;
  border-radius: 8px;
}

.yc-blank-order-wrap label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: #444;
  cursor: pointer;
  font-weight: 600;
}

.yc-blank-order-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.yc-blank-order-note {
  margin-top: 6px;
  font-size: 0.82rem;
  color: #888;
  padding-left: 28px;
}

/* ── Canvas control buttons ────────────────────────────────── */
.yc-canvas-controls {
  margin-top: 10px;
}

.yc-canvas-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.yc-ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: #fff;
  border: 1.5px solid #cbd8e8;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #1b4f8a;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.yc-ctrl-btn:hover {
  background: #edf4fb;
  border-color: #1b4f8a;
}

.yc-ctrl-btn:active {
  background: #1b4f8a;
  color: #fff;
}
