/* ==========================================================================
   Handeco t-shirt configurator ("Design your own t-shirt")
   Uses the theme tokens (--cream, --paper, --sand, --ink, --clay, --sage, --gold ...).
   ========================================================================== */

.cfg-head { padding-bottom: 6px; }
.cfg-head .page-lead { max-width: 38em; }

.cfg { display: grid; grid-template-columns: minmax(300px, 5fr) 7fr; gap: 48px; align-items: start; margin-top: 36px; }
.cfg:before, .cfg:after { content: none; display: none; }

/* ---------- live preview ---------- */
.cfg-preview { position: sticky; top: calc(var(--header-h) + 24px); }
.cfg-stage {
  position: relative; background: var(--paper); border-radius: var(--radius-lg);
  padding: 28px 24px 18px; overflow: hidden; box-shadow: var(--shadow-sm);
}
.cfg-tee { position: relative; display: block; width: 100%; height: auto; filter: drop-shadow(0 10px 14px rgba(58, 45, 37, .14)); }
.cfg-tee path#cfg-tee-shape { transition: fill .45s ease; }
.cfg-tee #cfg-collar { transition: stroke .45s ease; }
.cfg-tee #cfg-art { opacity: 0; transition: opacity .35s ease; }
.cfg-preview h3 { margin: 22px 0 10px; font-size: 1.15rem; }
.cfg-chips { margin: 0; padding: 0; display: grid; gap: 8px; }
.cfg-chips li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 14px; background: #fffdf8; border: 1px solid var(--sand); border-radius: 12px; font-size: 14px; }
.cfg-chips li span { color: var(--ink-soft); }
.cfg-chips li strong { text-align: right; font-weight: 700; }

/* ---------- steps ---------- */
.cfg-controls { display: grid; gap: 30px; }
.cfg-step { background: #fffdf8; border: 1px solid var(--sand); border-radius: var(--radius-lg); padding: 26px 28px 28px; }
.cfg-step-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.cfg-step-head h2 { margin: 0; font-size: 1.35rem; }
.cfg-step-head p { margin: 2px 0 0; color: var(--ink-soft); font-size: 14px; }
.cfg-no {
  flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--clay); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 19px; line-height: 1; transition: background .3s;
}
.cfg-step:nth-child(2) .cfg-no { background: var(--sage); }
.cfg-step:nth-child(3) .cfg-no { background: var(--gold); }
.cfg-step.is-done .cfg-no { background: var(--ink); }
.cfg-step.is-done .cfg-no:after { content: none; }

/* colour swatches */
.cfg-swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.cfg-swatch {
  position: relative; width: 46px; height: 46px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(58, 45, 37, .16); box-shadow: inset 0 0 0 3px rgba(255, 253, 248, .0);
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.cfg-swatch.is-light { border-color: rgba(58, 45, 37, .32); }
.cfg-swatch:hover { transform: scale(1.1); }
.cfg-swatch.is-on { border-color: var(--ink); box-shadow: 0 0 0 4px #fffdf8, 0 0 0 6px var(--ink); transform: scale(1.04); }

/* art prints */
.cfg-arts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cfg-art { padding: 0; background: transparent; border: 0; cursor: pointer; text-align: center; }
.cfg-art-img {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 1; padding: 10px;
  background: var(--paper); border: 2px solid transparent; border-radius: var(--radius);
  transition: border-color .2s, transform .25s var(--ease), background .2s;
}
.cfg-art-img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.cfg-art:hover .cfg-art-img { transform: translateY(-3px); background: #efe4cf; }
.cfg-art.is-on .cfg-art-img { border-color: var(--clay); background: #f6e4da; }
.cfg-art-name { display: block; margin-top: 7px; font-size: 13px; line-height: 1.25; color: var(--ink); font-weight: 600; }
.cfg-art.is-on .cfg-art-name { color: var(--clay); }

/* sizes */
.cfg-sizes { display: flex; flex-wrap: wrap; gap: 10px; }
.cfg-size {
  padding: 10px 18px; border: 1.5px solid var(--sand); border-radius: 999px; background: #fffdf8; color: var(--ink);
  font-weight: 700; font-size: 14px; cursor: pointer; transition: all .2s;
}
.cfg-size:hover { border-color: var(--sage); color: var(--sage-dark); }
.cfg-size.is-on { background: var(--ink); border-color: var(--ink); color: var(--cream); }

/* buy box */
.cfg-buy { background: var(--paper); border-radius: var(--radius-lg); padding: 26px 28px 24px; }
.cfg-buy-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.cfg-price span, .cfg-qty > span { display: block; font-size: 13px; color: var(--ink-soft); font-weight: 600; margin-bottom: 2px; }
.cfg-price strong { font-family: var(--font-display); font-size: 2rem; font-weight: 500; line-height: 1.1; }
.cfg-qty-box { display: inline-flex; align-items: center; border: 1.5px solid var(--sand); border-radius: 999px; background: #fffdf8; }
.cfg-qty-btn { width: 40px; height: 42px; border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--ink); }
.cfg-qty-btn:hover { color: var(--clay); }
.cfg-qty-input { width: 44px; height: 42px; border: 0; background: transparent; text-align: center; font-weight: 700; font-size: 16px; padding: 0; box-shadow: none; }
.cfg-add { width: 100%; }
.cfg-add[disabled] { opacity: .7; cursor: progress; }
.cfg-error { margin: 14px 0 0; padding: 11px 16px; border-radius: 12px; background: #f6ddd5; color: #8c3320; font-weight: 600; font-size: 14px; }
.cfg-error[hidden], .cfg-ok[hidden] { display: none; }
.cfg-ok { margin-top: 14px; padding: 16px 18px; border-radius: 14px; background: var(--sage-soft); color: var(--sage-dark); }
.cfg-ok p { margin: 0 0 12px; font-weight: 700; }
.cfg-ok-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cfg-ok-actions .btn { padding: 9px 20px; }
.cfg-note { margin: 14px 0 0; font-size: 12.5px; color: var(--ink-soft); text-align: center; }

/* ---------- banner on the Clothing category page ---------- */
.cfg-banner {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin: 8px 0 30px; padding: 26px 34px; border-radius: var(--radius-lg);
  background: var(--sage); color: #f3ecdc; box-shadow: var(--shadow-sm);
}
.cfg-banner:before { content: ''; position: absolute; width: 240px; height: 240px; right: -70px; top: -110px; border-radius: 50%; background: rgba(251, 246, 236, .09); }
.cfg-banner > * { position: relative; }
.cfg-banner h2 { margin: 0 0 4px; color: #fff; font-size: 1.5rem; }
.cfg-banner p { margin: 0; color: #e6efe9; max-width: 38em; }
.cfg-banner .btn { flex: none; background: var(--cream); border-color: var(--cream); color: var(--ink); }
.cfg-banner .btn:hover { background: #fff; border-color: #fff; color: var(--clay-dark); }

/* ---------- responsive ---------- */
@media (max-width: 991px) {
  .cfg { grid-template-columns: 1fr; gap: 26px; }
  .cfg-preview { position: static; }
  .cfg-stage { padding: 20px 16px 10px; }
  .cfg-tee { max-width: 380px; margin: 0 auto; }
  .cfg-arts { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 575px) {
  .cfg-step, .cfg-buy { padding: 20px 18px 22px; }
  .cfg-arts { grid-template-columns: repeat(2, 1fr); }
  .cfg-swatch { width: 42px; height: 42px; }
  .cfg-banner { flex-direction: column; align-items: flex-start; padding: 22px 20px; }
}
@media (prefers-reduced-motion: reduce) { .cfg * { transition: none !important; } }

/* ==========================================================================
   Configurator v2: who is it for -> model -> design
   ========================================================================== */
.cfg-wide { grid-column: 1 / -1; min-width: 0; }
.cfg-view-head { text-align: center; margin: 4px auto 28px; max-width: 40em; }
.cfg-view-head h2 { margin: 0 0 6px; font-size: 2rem; }
.cfg-view-head p { margin: 0; color: var(--ink-soft); }
.cfg-stage-models .cfg-view-head { margin-top: 0; }

/* step 1 */
.cfg-who-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; max-width: 980px; margin: 0 auto; }
.cfg-who-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 22px 26px;
  background: #fffdf8; border: 1px solid var(--sand); border-radius: var(--radius-lg); cursor: pointer; color: var(--ink);
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
.cfg-who-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md, 0 14px 30px rgba(58, 45, 37, .12)); border-color: var(--clay); }
.cfg-who-img { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1; margin-bottom: 10px; background: var(--paper); border-radius: 50% 50% var(--radius) var(--radius); overflow: hidden; }
.cfg-who-img img { width: 78%; height: auto; transition: transform .5s var(--ease); }
.cfg-who-card:hover .cfg-who-img img { transform: scale(1.06); }
.cfg-who-card strong { font-family: var(--font-display); font-size: 1.7rem; font-weight: 500; line-height: 1.1; }
.cfg-who-text { color: var(--ink-soft); font-size: 14px; max-width: 18em; }
.cfg-who-count { margin-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--clay); text-transform: uppercase; letter-spacing: .08em; }
.cfg-shop-link { text-align: center; margin: 34px 0 0; }
.cfg-shop-link a { font-weight: 700; color: var(--ink-soft); border-bottom: 1.5px solid var(--sand); }
.cfg-shop-link a:hover { color: var(--clay); border-color: var(--clay); }

/* back links */
.cfg-back { background: none; border: 0; padding: 0; color: var(--ink-soft); font-weight: 700; font-size: 14px; cursor: pointer; }
.cfg-back:hover { color: var(--clay); }
.cfg-crumbs { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cfg-crumb-sep { color: var(--sand-dark, #cdbf9f); }
.cfg-crumbs-wrap { margin-bottom: -22px; }
.cfg-stage-models .cfg-back { display: inline-block; margin-bottom: 16px; }

/* step 2 */
.cfg-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 28px; }
.cfg-pill { padding: 9px 20px; border: 1.5px solid var(--sand); border-radius: 999px; background: #fffdf8; color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer; transition: all .2s; }
.cfg-pill:hover { border-color: var(--sage); color: var(--sage-dark); }
.cfg-pill.is-on { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.cfg-model-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.cfg-model-card {
  display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden; cursor: pointer; color: var(--ink);
  background: #fffdf8; border: 1px solid var(--sand); border-radius: var(--radius-lg);
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
.cfg-model-card:hover { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(58, 45, 37, .12); border-color: var(--clay); }
.cfg-model-img { display: block; background: var(--paper); aspect-ratio: 4 / 5; overflow: hidden; }
.cfg-model-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.cfg-model-card:hover .cfg-model-img img { transform: scale(1.04); }
.cfg-model-body { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px 16px; }
.cfg-model-body strong { font-family: var(--font-display); font-size: 1.2rem; font-weight: 500; line-height: 1.2; }
.cfg-model-sub { color: var(--ink-soft); font-size: 13.5px; }
.cfg-model-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 12.5px; color: var(--ink-soft); }
.cfg-model-price { font-weight: 700; color: var(--clay); }

/* step 3: photo preview */
.cfg-photo { position: relative; width: 100%; max-width: 460px; margin: 0 auto; }
.cfg-garment { display: block; width: 100%; height: auto; transition: opacity .25s ease; }
.cfg-garment.is-swap { opacity: .55; }
.cfg-print { position: absolute; display: block; opacity: 0; transition: opacity .35s ease; pointer-events: none; }
.cfg-print-img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center top; }
.cfg-stage { padding: 20px 18px 14px; }
.cfg-color-name { margin: 14px 0 0; font-size: 14px; font-weight: 700; color: var(--ink-soft); min-height: 1.4em; }

@media (max-width: 991px) {
  .cfg-model-grid { grid-template-columns: repeat(3, 1fr); }
  .cfg-photo { max-width: 380px; }
}
@media (max-width: 767px) {
  .cfg-who-grid { grid-template-columns: 1fr; max-width: 360px; gap: 18px; }
  .cfg-who-card { flex-direction: row; text-align: left; align-items: center; gap: 4px 16px; padding: 14px 16px; display: grid; grid-template-columns: 96px 1fr; }
  .cfg-who-img { grid-row: 1 / 5; aspect-ratio: 1; margin: 0; border-radius: var(--radius); }
  .cfg-who-card strong { font-size: 1.4rem; }
  .cfg-who-text { max-width: none; }
  .cfg-view-head h2 { font-size: 1.6rem; }
  .cfg-model-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .cfg-model-body { padding: 11px 12px 13px; }
  .cfg-model-body strong { font-size: 1.05rem; }
}
.cfg-stage:has(.cfg-photo) { background: transparent; box-shadow: none; padding: 0; overflow: visible; }
.cfg-photo .cfg-garment { filter: drop-shadow(0 14px 18px rgba(58, 45, 37, .16)); }

/* ---- front / back + print-area guide (v2) ---- */
.cfg-print-img { object-position: center center; }
.cfg-print.is-guide { border: 1.5px dashed rgba(255, 255, 255, .95); box-shadow: 0 0 0 1px rgba(58, 45, 37, .35), inset 0 0 0 1px rgba(58, 45, 37, .25); }
.cfg-print.is-guide .cfg-print-img { display: none; }
.cfg-sides { display: flex; justify-content: center; gap: 8px; margin: 14px 0 0; }
.cfg-side { padding: 8px 22px; border: 1.5px solid var(--sand); border-radius: 999px; background: #fffdf8; color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer; transition: all .2s; }
.cfg-side:hover { border-color: var(--sage); color: var(--sage-dark); }
.cfg-side.is-on { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.cfg-area-note { margin: 10px 0 0; text-align: center; font-size: 12.5px; color: var(--ink-soft); }
.cfg-arts[hidden], .cfg-sides[hidden], .cfg-step [hidden] { display: none !important; }

/* ---- model name under the crumbs + info tabs (description / size guide / printing guide) ---- */
.cfg-crumbs-wrap { margin-bottom: 0; }
.cfg-model-title { margin: 14px 0 0; font-size: 2.2rem; line-height: 1.15; }
.cfg-model-title small { display: block; margin-top: 4px; font-family: var(--font-body); font-size: 15px; font-weight: 600; color: var(--ink-soft); }
.cfg-info { margin-top: 10px; }
.cfg-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1.5px solid var(--sand); }
.cfg-tab { position: relative; padding: 12px 22px; margin-bottom: -1.5px; background: none; border: 0; border-bottom: 3px solid transparent; font-weight: 700; font-size: 15px; color: var(--ink-soft); cursor: pointer; transition: color .2s, border-color .2s; }
.cfg-tab:hover { color: var(--clay); }
.cfg-tab.is-on { color: var(--ink); border-bottom-color: var(--clay); }
.cfg-tab-panel { padding: 26px 4px 6px; max-width: 920px; min-height: 80px; }
.cfg-rich p { margin: 0 0 12px; }
.cfg-rich ul { margin: 0 0 14px; padding-left: 20px; }
.cfg-rich li { margin-bottom: 4px; }
.cfg-rich h4 { margin: 16px 0 6px; font-size: 1.1rem; }
.cfg-pg { margin: 0 0 14px; padding-left: 20px; }
.cfg-pg li { margin-bottom: 8px; }
.cfg-sizes-line { color: var(--ink-soft); font-weight: 600; }
.cfg-guide { display: flex; gap: 30px; align-items: flex-start; flex-wrap: wrap; }
.cfg-guide-img { flex: none; width: 320px; max-width: 100%; height: auto; background: #fff; border-radius: var(--radius); padding: 10px; }
.cfg-table-wrap { flex: 1 1 300px; min-width: 0; overflow-x: auto; }
.cfg-table-wrap table { width: 100%; border-collapse: collapse; background: #fffdf8; border: 1px solid var(--sand); border-radius: 12px; overflow: hidden; }
.cfg-table-wrap th, .cfg-table-wrap td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--sand); font-size: 14px; white-space: nowrap; }
.cfg-table-wrap th { background: var(--paper); font-weight: 700; }
.cfg-table-wrap tr:last-child td { border-bottom: 0; }
@media (max-width: 575px) { .cfg-model-title { font-size: 1.7rem; } .cfg-tab { padding: 10px 14px; font-size: 14px; } .cfg-guide { gap: 16px; } }

/* preview + controls grid (sticky preview is confined to it) */
.cfg-main { display: grid; grid-template-columns: minmax(300px, 5fr) 7fr; gap: 48px; align-items: start; margin-top: 8px; }
.cfg-main:before, .cfg-main:after { content: none; display: none; }
.cfg-info { margin-top: 36px; }
@media (max-width: 991px) { .cfg-main { grid-template-columns: 1fr; gap: 26px; } }

/* ---- pre-order ---- */
.cfg-model-img { position: relative; }
.cfg-preorder-tag { position: absolute; top: 10px; left: 10px; padding: 4px 11px; border-radius: 999px; background: var(--clay); color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.cfg-preorder { margin: 0 0 16px; padding: 11px 14px; border-radius: 12px; background: #f6e4da; color: #7a3a22; font-size: 13.5px; line-height: 1.45; }
.cfg-preorder strong { text-transform: uppercase; letter-spacing: .05em; font-size: 12.5px; }

/* ---- type scale (sizes come from the shared --fs-* tokens in handeco.css) ---- */
.cfg-step-head p, .cfg-chips li, .cfg-note, .cfg-qty > span, .cfg-price span, .cfg-who-text, .cfg-color-name, .cfg-area-note { font-size: var(--fs-sm); }
.cfg-chips li { font-size: var(--fs-sm); }
.cfg-art-name { font-size: 14px; }
.cfg-size, .cfg-pill, .cfg-side, .cfg-tab, .cfg-back { font-size: var(--fs-sm); }
.cfg-model-sub { font-size: var(--fs-sm); }
.cfg-model-meta { font-size: var(--fs-xs); }
.cfg-who-count { font-size: var(--fs-xs); }
.cfg-error, .cfg-preorder, .cfg-table-wrap th, .cfg-table-wrap td { font-size: var(--fs-sm); }
.cfg-preorder-tag { font-size: 12px; }
.cfg-model-title small { font-size: var(--fs-base); }
.cfg-tab-panel, .cfg-rich { font-size: var(--fs-base); }
.cfg-view-head p, .cfg-banner p { font-size: var(--fs-base); }
.cfg-qty-input { font-size: var(--fs-base); }

/* ---- type scale: headings (this file loads after handeco.css, so these must live here) ---- */
.cfg-step-head h2 { font-size: 22px; }
.cfg-preview h3 { font-size: 19px; }
.cfg-model-title { font-size: clamp(28px, 3.4vw, 36px); }
.cfg-view-head h2 { font-size: clamp(26px, 3vw, 32px); }
.cfg-rich h4 { font-size: 19px; }
.cfg-price strong { font-size: 30px; }
.cfg-who-card strong { font-size: 26px; }
.cfg-model-body strong { font-size: 19px; }
.cfg-banner h2 { font-size: 24px; }
@media (max-width: 767px) {
  .cfg-who-card strong { font-size: 22px; }
  .cfg-view-head h2 { font-size: 26px; }
  .cfg-model-body strong { font-size: 17px; }
}
@media (max-width: 575px) { .cfg-model-title { font-size: 26px; } }
.cfg-model-meta { font-size: 14px; }
.cfg-model-price { font-size: var(--fs-sm); }
.cfg-price-note { display: block; margin-top: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--clay); }

/* Phones: photo and print side first, then the choices, then the summary of what was picked right above the price */
@media (max-width: 767px) {
  .cfg-main { display: flex; flex-direction: column; align-items: stretch; }
  .cfg-controls > .cfg-step, .cfg-controls > .cfg-buy, .cfg-preview > .cfg-pin { width: 100%; box-sizing: border-box; }
  .cfg-preview, .cfg-controls { display: contents; }
  .cfg-preview > .cfg-pin { order: 1; }
  .cfg-preview > .cfg-area-note { order: 3; }
  .cfg-controls > .cfg-step { order: 4; }
  .cfg-preview > h3, .cfg-preview > .cfg-chips { order: 5; }
  .cfg-preview > .cfg-chips { width: 100%; margin-bottom: 18px; }
  .cfg-controls > .cfg-buy { order: 6; }
}

/* Phones: the preview (photo + front/back switch) stays in view under the header while the options scroll past */
@media (max-width: 767px) {
  .cfg-pin { position: sticky; top: 68px; z-index: 20; background: var(--cream); padding: 6px 0 8px; margin-bottom: 10px; box-shadow: 0 8px 14px -12px rgba(58, 45, 37, .45); }
  .cfg-pin .cfg-stage { max-width: 190px; margin: 0 auto; }
  .cfg-pin .cfg-sides { margin-top: 8px; }
}
