/* ─────────────────────────────────────────────────────────────────────────────
   StickitONE Shirt Builder — Styles
   Same visual language as the other StickitONE configurators:
   dark surface, chartreuse accent, Barlow Condensed headings + DM Mono labels.
   Self-host those two fonts the same way as the other apps for best perf.
───────────────────────────────────────────────────────────────────────────── */

/* Floating dropdown panels are appended to <body> (so they're never clipped
   by an ancestor's overflow) — meaning they sit OUTSIDE .ssb-wrap in the DOM
   and can't see variables scoped only to .ssb-wrap. Mirror the palette here
   at :root so those panels render with a real background instead of
   transparent (which was letting page content behind them show through). */
:root {
  --ssb-bg:         #0f1117;
  --ssb-surface:    #181c27;
  --ssb-surface-2:  #1f2436;
  --ssb-border:     #2a3048;
  --ssb-accent:     #e8ff00;
  --ssb-accent-dim: #b8cc00;
  --ssb-text:       #e8eaf0;
  --ssb-text-dim:   #7a8299;
  --ssb-success:    #00e07a;
  --ssb-error:      #ff4c60;
}

.ssb-wrap {
  --ssb-bg:         #0f1117;
  --ssb-surface:    #181c27;
  --ssb-surface-2:  #1f2436;
  --ssb-border:     #2a3048;
  --ssb-accent:     #e8ff00;
  --ssb-accent-dim: #b8cc00;
  --ssb-text:       #e8eaf0;
  --ssb-text-dim:   #7a8299;
  --ssb-success:    #00e07a;
  --ssb-error:      #ff4c60;
  --ssb-font-head:  'Barlow Condensed', sans-serif;
  --ssb-font-mono:  'DM Mono', monospace;
  --ssb-radius:     4px;
  --ssb-transition: 180ms ease;

  font-family:   var(--ssb-font-mono);
  background:    var(--ssb-bg);
  color:         var(--ssb-text);
  border-radius: 8px;
  border:        1px solid var(--ssb-border);
  box-shadow:    0 20px 60px rgba(0,0,0,.55);
  padding:       28px;
  max-width:     100%;
}

.ssb-header {
  position: relative;
  padding: 32px 32px 24px;
  background: var(--ssb-surface);
  border-bottom: 1px solid var(--ssb-border);
  border-radius: 8px 8px 0 0;
  margin: -28px -28px 24px;
  overflow: hidden;
}
.ssb-header-accent { position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--ssb-accent); }
.ssb-heading {
  font-family:    var(--ssb-font-head);
  font-size:      clamp(1.8rem, 4vw, 2.4rem);
  font-weight:    900;
  letter-spacing: .06em;
  text-transform: uppercase;
  color:          var(--ssb-accent);
  margin:         0 0 6px;
}

.ssb-header-html { color: var(--ssb-text-dim); margin: 0; font-size: .88rem; }

.ssb-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
@media (max-width: 860px) {
  .ssb-layout { grid-template-columns: 1fr; }
}

/* ── Preview column ─────────────────────────────────────────────────────── */
.ssb-preview-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 70px;
  align-self: start;
  max-height: calc(100vh - 90px);
}
@media (max-width: 860px) {
  .ssb-preview-col { position: static; max-height: none; }
}

/* Front/Back toggle now reuses .ssb-tier-toggle/.ssb-tier-btn styling
   directly (see below) — no separate rules needed here. */

.ssb-preview-stage {
  position: relative;
  background: var(--ssb-surface);
  border: 1px solid var(--ssb-border);
  border-radius: var(--ssb-radius);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  perspective: 1000px;
}
.ssb-preview-stage.ssb-flip-anim { animation: ssbFlip 0.5s ease; }
@keyframes ssbFlip {
  0%   { transform: rotateY(0deg); }
  50%  { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}
.ssb-preview-view { position: absolute; inset: 0; }
.ssb-garment-photo { width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }

.ssb-logo-layer-stack, .ssb-name-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.ssb-logo-slot-render {
  position: absolute;
}
.ssb-logo-slot-render svg { display: block; width: 100%; height: 100%; }

.ssb-safe-zone {
  position: absolute;
  border: 1px dashed rgba(232,255,0,.5);
  background: rgba(232,255,0,.04);
  pointer-events: none;
}

.ssb-preview-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15,17,23,.7);
  font-family: var(--ssb-font-head);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.ssb-preview-note { color: var(--ssb-text-dim); font-size: 12px; margin: 0; }

/* ── Config column ──────────────────────────────────────────────────────── */
.ssb-step {
  background: var(--ssb-surface);
  border: 1px solid var(--ssb-border);
  border-radius: var(--ssb-radius);
  margin-bottom: 16px;
  transition: opacity var(--ssb-transition), filter var(--ssb-transition);
  overflow: hidden;
}
.ssb-step-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ssb-border);
}
.ssb-step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ssb-accent);
  color: #10120a;
  font-family: var(--ssb-font-head);
  font-size: 1rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ssb-step-title-wrap { min-width: 0; }
.ssb-step-title {
  font-family: var(--ssb-font-head);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ssb-text);
  margin: 0;
}
.ssb-step-subtitle { font-size: 12px; color: var(--ssb-text-dim); margin: 2px 0 0; font-family: var(--ssb-font-mono); }
.ssb-step-body { padding: 18px 20px; }

/* ── Locked state — greyed out, fully non-interactive ───────────────────── */
.ssb-step--locked {
  opacity: .45;
  pointer-events: none;
  user-select: none;
  filter: grayscale(30%);
}
.ssb-step--locked .ssb-step-header { border-bottom-color: transparent; }
.ssb-step--locked .ssb-step-number { background: var(--ssb-surface-2); color: var(--ssb-text-dim); }

.ssb-step-hint { color: var(--ssb-text-dim); font-size: 12px; font-family: var(--ssb-font-mono); text-transform: none; letter-spacing: 0; }

.ssb-field { margin-bottom: 14px; }
.ssb-color-slot-row { margin-bottom: 14px; }
.ssb-outline-hint { font-size: 11px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ssb-text-dim); margin-left: 6px; }
.ssb-field label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ssb-text-dim); margin-bottom: 6px; }

.ssb-pill-picker, .ssb-swatch-picker { display: flex; flex-wrap: wrap; gap: 8px; }

.ssb-pill {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--ssb-border);
  background: var(--ssb-surface-2);
  color: var(--ssb-text);
  cursor: pointer;
  font-size: 13px;
  transition: var(--ssb-transition);
}
.ssb-pill.is-selected { border-color: var(--ssb-accent); background: var(--ssb-accent); color: #10120a; font-weight: 700; }

.ssb-swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--ssb-border);
  cursor: pointer;
  transition: var(--ssb-transition);
  position: relative;
}
.ssb-swatch.is-selected { border-color: var(--ssb-accent); box-shadow: 0 0 0 2px var(--ssb-accent); }
.ssb-swatch.is-blocked { opacity: .25; cursor: not-allowed; }

#ssb-size-select {
  width: 100%;
  background: var(--ssb-surface-2);
  color: var(--ssb-text);
  border: 1px solid var(--ssb-border);
  border-radius: var(--ssb-radius);
  padding: 10px 12px;
  font-family: var(--ssb-font-mono);
}

.ssb-size-chart-link {
  background: none; border: none; color: var(--ssb-accent);
  text-decoration: underline; cursor: pointer; font-size: 11px;
  text-transform: none; letter-spacing: 0; margin-left: 8px;
}

/* ── Logo slots ────────────────────────────────────────────────────────── */
.ssb-logo-slot {
  border: 1px solid var(--ssb-border);
  border-radius: var(--ssb-radius);
  padding: 14px;
  margin-bottom: 10px;
  background: var(--ssb-surface-2);
}
.ssb-logo-slot-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ssb-logo-slot-label { font-family: var(--ssb-font-head); text-transform: uppercase; letter-spacing: .05em; font-size: 13px; color: var(--ssb-text-dim); }
.ssb-logo-slot-remove { background: none; border: none; color: var(--ssb-error); cursor: pointer; font-size: 13px; }

.ssb-tier-toggle { display: flex; gap: 8px; margin-top: 10px; }
.ssb-tier-btn {
  flex: 1;
  padding: 8px;
  text-align: center;
  border: 1px solid var(--ssb-border);
  border-radius: var(--ssb-radius);
  background: var(--ssb-surface);
  color: var(--ssb-text-dim);
  cursor: pointer;
  font-size: 12px;
}
.ssb-tier-btn.is-selected { border-color: var(--ssb-accent); color: var(--ssb-accent); }

.ssb-outline-upcharge-toggle { margin-top: 8px; font-size: 12px; color: var(--ssb-text-dim); }

.ssb-add-logo-slot {
  width: 100%;
  padding: 12px;
  border: 1px dashed var(--ssb-border);
  border-radius: var(--ssb-radius);
  background: transparent;
  color: var(--ssb-text-dim);
  cursor: pointer;
  font-family: var(--ssb-font-mono);
}

/* ── Dropdown picker (font) ───────────────────────────────────────────── */
.ssb-dropdown-picker { position: relative; }
.ssb-dropdown-display {
  border: 1px solid var(--ssb-border);
  background: var(--ssb-surface-2);
  padding: 10px 12px;
  border-radius: var(--ssb-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
}
.ssb-dropdown-display.has-value { border-color: var(--ssb-accent); }
.ssb-dropdown-display-inner { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.ssb-dropdown-placeholder { color: var(--ssb-text-dim); }
.ssb-dropdown-arrow { color: var(--ssb-text-dim); flex-shrink: 0; }
.ssb-dropdown-row-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ssb-dropdown-none-option { color: var(--ssb-text-dim); font-style: italic; }
.ssb-dropdown-row-text small { color: var(--ssb-text-dim); }

.ssb-dropdown-panel {
  position: absolute; z-index: 20; top: 100%; left: 0; right: 0;
  background: var(--ssb-surface-2);
  border: 1px solid var(--ssb-border);
  max-height: 220px; overflow-y: auto;
  border-radius: var(--ssb-radius);
}
.ssb-dropdown-panel > div { padding: 10px 12px; cursor: pointer; }
.ssb-dropdown-panel > div:hover, .ssb-dropdown-panel > div.is-selected { background: var(--ssb-surface); color: var(--ssb-accent); }

/* Floating panel (logo/size/color pickers) — lives on <body> so it's never
   clipped by a parent's overflow, same approach as Decal Bundle Builder. */
.ssb-dropdown-panel-floating {
  position: absolute;
  z-index: 9999;
  background: var(--ssb-surface-2);
  color: var(--ssb-text);
  border: 1px solid var(--ssb-border);
  border-radius: var(--ssb-radius);
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
}
.ssb-dropdown-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
}
.ssb-dropdown-row:hover { background: var(--ssb-surface); color: var(--ssb-accent); }
.ssb-dropdown-row.is-disabled { opacity: .3; cursor: not-allowed; pointer-events: none; }

.ssb-dropdown-thumb {
  width: 32px; height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  background: rgba(255,255,255,.06);
  border-radius: 3px;
}
.ssb-dropdown-thumb-placeholder {
  width: 32px; height: 32px;
  flex-shrink: 0;
  background: rgba(255,255,255,.06);
  border-radius: 3px;
}
.ssb-dropdown-swatch {
  width: 24px; height: 24px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.25);
}

/* ── Order summary ────────────────────────────────────────────────────── */
.ssb-order-summary { background: var(--ssb-surface-2); padding: 18px 20px; }
.ssb-order-summary h3 { font-family: var(--ssb-font-head); text-transform: uppercase; letter-spacing: .05em; font-size: 1.1rem; margin: 0 0 14px; }
#ssb-summary-lines div { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--ssb-border); }
.ssb-summary-total { display: flex; justify-content: space-between; font-family: var(--ssb-font-head); font-size: 1.2rem; margin-top: 10px; }

/* ── Actions ───────────────────────────────────────────────────────────── */
.ssb-actions { display: flex; gap: 10px; }
.ssb-btn {
  flex: 1;
  padding: 14px;
  border-radius: var(--ssb-radius);
  border: none;
  font-family: var(--ssb-font-head);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
  cursor: pointer;
  transition: var(--ssb-transition);
}
.ssb-btn-primary { background: var(--ssb-accent); color: #10120a; }
.ssb-btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.ssb-btn-secondary { background: var(--ssb-surface-2); color: var(--ssb-text); border: 1px solid var(--ssb-border); }

.ssb-cart-message { margin-top: 10px; padding: 10px; border-radius: var(--ssb-radius); font-size: 13px; }
.ssb-cart-message.success { background: rgba(0,224,122,.1); color: var(--ssb-success); }

/* ── Step 5: Add to Cart ──────────────────────────────────────────────── */
.ssb-step5-total-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ssb-border);
}
.ssb-step5-total-label {
  font-family: var(--ssb-font-head);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ssb-text-dim);
}
.ssb-step5-total-price {
  font-family: var(--ssb-font-head);
  font-size: 34px;
  font-weight: 700;
  color: var(--ssb-accent);
  letter-spacing: -.02em;
  line-height: 1;
}

#ssb-quantity-input {
  width: 80px;
  background: var(--ssb-surface-2);
  color: var(--ssb-text);
  border: 1px solid var(--ssb-border);
  border-radius: var(--ssb-radius);
  padding: 10px 12px;
  font-family: var(--ssb-font-mono);
}

.ssb-atc-row { margin-top: 16px; }

.ssb-atc-btn {
  display: inline-flex;
  align-items: center;
  width: 100%;
  justify-content: center;
  padding: 14px 32px;
  font-family: var(--ssb-font-head);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  border: 2px solid var(--ssb-border);
  border-radius: var(--ssb-radius);
  background: transparent;
  color: var(--ssb-text-dim);
  cursor: not-allowed;
  transition: var(--ssb-transition);
}
.ssb-atc-btn.ssb-atc-btn--ready {
  background: var(--ssb-accent);
  border-color: var(--ssb-accent);
  color: #10120a;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(232,255,0,.3);
}
.ssb-atc-btn.ssb-atc-btn--ready:hover { filter: brightness(0.92); transform: translateY(-1px); }
.ssb-atc-btn:disabled { opacity: .5; cursor: not-allowed; }

.ssb-atc-msg {
  font-size: 13px;
  color: var(--ssb-error);
  margin-top: 10px;
  line-height: 1.5;
}
.ssb-atc-msg ul { margin: 4px 0 0 16px; padding: 0; list-style: disc; }
.ssb-atc-msg li { margin-bottom: 2px; }

.ssb-atc-reqs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.ssb-req {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-family: var(--ssb-font-head);
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: var(--ssb-transition);
}
.ssb-req--unmet { border-color: var(--ssb-border); color: var(--ssb-text-dim); }
.ssb-req--met { border-color: var(--ssb-accent); color: var(--ssb-accent); }
.ssb-cart-message.error   { background: rgba(255,76,96,.1); color: var(--ssb-error); }

/* ── Modals ────────────────────────────────────────────────────────────── */
.ssb-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
}
.ssb-modal-inner {
  background: var(--ssb-surface);
  border: 1px solid var(--ssb-border);
  border-radius: var(--ssb-radius);
  padding: 24px;
  max-width: 400px;
  color: var(--ssb-text);
  font-family: var(--ssb-font-mono);
}
.ssb-modal-inner--chart { max-width: 90vw; max-height: 90vh; overflow: auto; position: relative; }
.ssb-modal-close { position: absolute; top: 10px; right: 14px; background: none; border: none; color: var(--ssb-text); font-size: 24px; cursor: pointer; }
.ssb-modal-actions { display: flex; gap: 10px; margin-top: 16px; }

/* Disable right-click/drag on preview art, same protection as other apps */
.ssb-preview-stage img, .ssb-preview-stage svg { -webkit-user-drag: none; user-select: none; }

/* ── Mobile responsive (matches the other StickitONE apps' breakpoints) ── */
@media (max-width: 620px) {
  .ssb-step-body { padding: 14px 16px; }
  .ssb-step-header { padding: 12px 16px; }
  .ssb-header { padding: 24px 20px 20px; }
}
@media (max-width: 860px) and (orientation: landscape) {
  .ssb-preview-col { max-width: 300px; }
}
