/* ============================================================
   /design (custom one-off designer) page rules. Loads on top of
   bulk.css (the designer chrome) + cart.css.

   Mobile-first (2026-08-25): on phones the canvas sits at the top,
   the tools are a tab strip (Text / Shapes / Your art) so one panel
   shows at a time, a layer toolbar appears under the card when a
   piece is selected, and a sticky bottom bar carries Add to cart.
   ============================================================ */

.s-hero--custom .s-hero__title { font-size: clamp(40px, 6.4vw, 80px); }

/* ---------- tool tabs ---------- */
.tool-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 5px; background: var(--brand-tint); border-radius: 9999px; }
.tool-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; border: 0; border-radius: 9999px; background: transparent;
  font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text); cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.tool-tab__ico { font-size: 15px; opacity: .8; }
.tool-tab.is-active { background: var(--surface); box-shadow: 0 2px 8px rgba(34, 28, 23, 0.12); }
.tool-panel[hidden] { display: none; }

/* ---------- shapes ---------- */
.shape-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.shape-btn {
  aspect-ratio: 1; min-height: 44px; border: 1.5px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer; padding: 8px; display: grid; place-items: center;
  transition: border-color .15s, transform .15s;
}
.shape-btn svg { width: 100%; height: 100%; fill: var(--text); }
.shape-btn:hover { border-color: var(--brand); transform: translateY(-1px); }
.shape-btn:active { transform: scale(.96); }
.scw {
  width: 40px; height: 40px; border-radius: var(--r-full); border: 1px solid var(--border); cursor: pointer; padding: 0;
  box-shadow: 0 1px 3px rgba(34, 28, 23, 0.12);
}
.scw.is-active { outline: 2px solid var(--brand); outline-offset: 2px; }
.scw[data-scolor="auto"] { width: auto; padding: 0 12px; font-family: var(--font-display); font-size: 12px; font-weight: 600; background: var(--surface); color: var(--text); }

/* ---------- layer toolbar (under the card, appears on selection) ---------- */
.layer-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 12px auto 0; padding: 8px 10px; width: fit-content; max-width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: 9999px;
  box-shadow: 0 8px 24px rgba(34, 28, 23, 0.12);
  animation: lb-in .18s ease-out;
}
.layer-bar[hidden] { display: none; }
@keyframes lb-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.layer-bar__label { font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--text-muted); padding-left: 6px; }
.layer-bar__colors { display: inline-flex; align-items: center; gap: 6px; }
.layer-bar__colors[hidden] { display: none; }
.lbc { width: 30px; height: 30px; border-radius: 9999px; border: 1px solid var(--border); padding: 0; cursor: pointer; box-shadow: 0 1px 2px rgba(34, 28, 23, 0.15); }
.lbc.is-active { outline: 2px solid var(--brand); outline-offset: 2px; }
.lbc--custom { position: relative; overflow: hidden; background: conic-gradient(#e2352b, #d4a53f, #3f6b34, #05255e, #cfa0a1, #e2352b); }
.lbc--custom input { position: absolute; inset: -8px; width: 60px; height: 60px; opacity: 0; cursor: pointer; }
.layer-bar__actions { display: inline-flex; gap: 4px; margin-left: 2px; }
.lba { width: 36px; height: 36px; border-radius: 9999px; border: 1px solid var(--border); background: var(--surface); font-size: 15px; cursor: pointer; color: var(--text); }
.lba:hover { border-color: var(--brand); }
.lba--del { color: var(--oxblood); border-color: color-mix(in srgb, var(--oxblood) 40%, transparent); }

/* ---------- order rail ---------- */
.cu-order { border: 2px solid var(--brand); }
.cu-order__price { font-size: 17px; margin-top: -4px; }
.cu-order__price strong { font-family: var(--font-display); font-size: 26px; font-weight: 600; }
.cu-order__price s { margin-left: 6px; font-size: 14px; color: var(--text-muted); }
.cu-order__tag { display: inline-block; margin-left: 8px; padding: 3px 9px; border-radius: 9999px; background: var(--brand-tint); color: var(--text); font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; vertical-align: middle; }
.cu-order__meta { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.cu-qty { margin: 14px 0; display: flex; align-items: center; gap: 12px; }
.cu-qty__label { font-size: 14px; color: var(--text-muted); margin-right: auto; }
.cu-qty__btn { width: 40px; height: 40px; border-radius: 9999px; border: 1.5px solid var(--border); background: var(--surface); font-size: 20px; cursor: pointer; color: var(--text); }
.cu-qty__btn:hover { border-color: var(--brand); }
.cu-qty__num { min-width: 28px; text-align: center; font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.cu-buynow { margin-top: 8px; }
.cu-order .order__fine { margin-top: 10px; }
.cu-order .order__error { margin-top: 0; }

/* ---------- phone sticky bar (hidden on desktop) ---------- */
.cu-bar { display: none; }

/* ---------- reassurance line + FAQ accordion (mirrors styles.css) ---------- */
.order-reassure { display: flex; gap: 9px; align-items: flex-start; margin: 12px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--text-muted); }
.order-reassure__icon { width: 19px; height: 19px; flex: none; color: var(--brand-ink); }
.order-reassure strong { color: var(--text); font-weight: 700; }
.order-reassure a { color: inherit; }
.order-info { display: block; }
.order-acc { border-bottom: 1px solid var(--border); }
.order-acc summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 2px; cursor: pointer; list-style: none;
  font-family: var(--font-display); font-weight: 500; font-size: 17px; color: var(--text);
}
.order-acc summary::-webkit-details-marker { display: none; }
.order-acc__icon { font-size: 20px; font-weight: 500; color: var(--text-muted); transition: transform 0.2s ease; }
.order-acc[open] .order-acc__icon { transform: rotate(45deg); }
.order-acc__body { padding: 0 2px 16px; }
.order-acc__body p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--text-muted); }
.order-acc__body a { color: inherit; }
.order-acc__steps { margin: 0 0 10px; padding-left: 20px; font-size: 14.5px; line-height: 1.55; color: var(--text-muted); }
.order-acc__steps li { margin-bottom: 6px; }
.order-acc__steps li::marker { font-weight: 700; color: var(--text); }

/* ---------- toast (same look as styles.css) ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  padding: 12px 20px; border-radius: 9999px;
  background: var(--brand); color: var(--on-brand);
  font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   PHONES + small tablets
   ============================================================ */
@media (max-width: 860px) {
  .s-hero--custom { padding-top: 40px; }
  .s-hero--custom .s-hero__title { font-size: clamp(38px, 11vw, 52px); }
  .s-hero__cta .btn { min-height: 48px; }
  .s-steps { padding: 36px 0; }

  .s-builder { padding: 20px 0 40px; }
  .s-builder__head { margin-bottom: 16px; }
  .builder--custom { gap: 14px; }
  .builder--custom .builder__stage { position: static; }
  /* The card is the hero: fill the width, keep ~half the viewport, crop the
     photo's dead margins (bulk.css already scales the canvas 1.4x at <=640). */
  .builder--custom .canvas-wrap { width: 100%; padding: 8px; border-radius: 22px; }
  .builder--custom #cardCanvas { max-height: 52vh; width: 100%; height: auto; }
  .builder--custom .colorways { gap: 14px; margin: 14px 0 26px; }
  .builder--custom .sw { width: 44px; height: 44px; }
  .builder--custom .sw span { font-size: 11px; width: 64px; }
  .builder--custom .stage-note { display: none; }

  .layer-bar { width: 100%; justify-content: space-between; border-radius: 18px; padding: 8px; }
  .layer-bar__label { display: none; }
  .lbc { width: 32px; height: 32px; }
  .lba { width: 40px; height: 40px; }

  .builder--custom .panel-block { padding: 14px; }
  .tool-tab { min-height: 46px; font-size: 14px; }
  .shape-grid { grid-template-columns: repeat(7, 1fr); gap: 6px; }
  .shape-btn { padding: 7px; }
  .tfont { min-height: 44px; }
  .builder--custom .panel-tip { font-size: 12.5px; }

  /* Order rail collapses into the sticky bar (keeps error + guarantee). */
  .cu-order h4, .cu-order .cu-qty, .cu-order .cu-buynow, .cu-order #cuAddBtn { display: none; }
  .cu-order { border-width: 1px; }
  .cu-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: rgba(251, 248, 236, 0.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border); box-shadow: 0 -10px 30px rgba(34, 28, 23, 0.1);
  }
  .cu-bar__qty { display: inline-flex; align-items: center; gap: 6px; }
  .cu-bar__qty .cu-qty__btn { width: 38px; height: 38px; }
  .cu-bar__qty .cu-qty__num { min-width: 22px; font-size: 18px; }
  .cu-bar__add { flex: 1; min-height: 50px; white-space: nowrap; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(90px + env(safe-area-inset-bottom)); }
  .vc__panel { width: 100vw; }
}
@media (max-width: 400px) {
  .shape-grid { grid-template-columns: repeat(4, 1fr); }
  .tool-tab__ico { display: none; }
}

/* ---------- ticker (2026-08-25: one line, no underline) ---------- */
.s-ticker .ticker__link { color: inherit; text-decoration: none; display: inline-block; white-space: nowrap; }
.s-ticker .ticker__cta { text-decoration: underline; text-underline-offset: 3px; font-weight: 700; margin-left: 4px; }
@media (max-width: 560px) { .s-ticker { font-size: 12.5px; padding: 8px 10px; } }

/* ---------- one-of-each pack strip (2026-08-25) ---------- */
.pack-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px auto 0; max-width: 560px; }
.pack-strip__card { position: relative; padding: 0; border: 2px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; overflow: hidden; transition: border-color .15s, transform .15s; }
.pack-strip__card canvas { display: block; width: 100%; height: auto; }
.pack-strip__card span { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 5px 4px 7px; letter-spacing: .03em; }
.pack-strip__card:hover { transform: translateY(-2px); }
.pack-strip__card.is-active { border-color: var(--brand); }
.pack-strip__note { text-align: center; font-size: 12.5px; color: var(--text-muted); margin: 10px auto 22px; max-width: 48ch; }
.colorways--preview[hidden] { display: none; }
@media (max-width: 860px) { .pack-strip { gap: 8px; } .pack-strip__card span { font-size: 10px; } .pack-strip__note { margin-bottom: 14px; } }
