@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Noto+Sans+Thai:wght@400;500;600;700&display=swap");

/* Mobile first: base rules target phones; min-width queries enlarge. */
:root {
  --ink: #2b2037;
  --muted: #675b72;
  --paper: #fffaf3;
  --white: #ffffff;
  --line: #2b2037;
  --soft-line: #e6dde4;
  --yellow: #ffd75a;
  --coral: #ff6f61;
  --pink: #ffc9d8;
  --mint: #bfeedb;
  --sky: #d4ecff;
  --lilac: #e6e5ff;
  --blue: #5546d7;
  --blue-dark: #4234bc;
  --red: #c83e3e;
  --radius: 18px;
  --radius-lg: 24px;
  --shadow-sm: 2px 2px 0 var(--ink);
  --shadow: 3px 3px 0 var(--ink);
  --bar-height: 76px;
  --display: "Fredoka", "Noto Sans Thai", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans Thai", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 12px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.storefront-page { padding-bottom: calc(var(--bar-height) + env(safe-area-inset-bottom)); background: radial-gradient(circle, #ffe8df 0 2.5px, transparent 3.5px) 14px 12px / 56px 56px, var(--paper); }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
button, a, input, summary, label { -webkit-tap-highlight-color: transparent; }
button, a, summary { touch-action: manipulation; }
button { cursor: pointer; }
svg { flex: none; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible, .product-stage:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.shell { width: min(880px, calc(100% - 24px)); margin-inline: auto; }

/* Header */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-block: 10px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.04em; line-height: 1; text-decoration: none; }
.brand-mark { display: grid; width: 36px; height: 36px; flex: none; place-items: center; color: var(--coral); background: var(--yellow); border: 2px solid var(--ink); border-radius: 11px; box-shadow: var(--shadow-sm); font-size: 21px; transform: rotate(-7deg); transition: transform 200ms ease; }
.brand:hover .brand-mark { transform: rotate(4deg) scale(1.04); }
.brand-name, .brand-name small { display: block; }
.brand-name small { display: none; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.language-switch { display: flex; padding: 3px; background: var(--white); border: 2px solid var(--ink); border-radius: 999px; }
.language-switch button { min-width: 44px; min-height: 38px; padding: 4px 10px; color: var(--muted); background: transparent; border: 0; border-radius: 999px; font-size: 14px; font-weight: 700; }
.language-switch button[aria-pressed="true"] { color: var(--white); background: var(--blue); }
.nav-link { display: none; min-height: 44px; align-items: center; padding: 8px 16px; color: var(--ink); border-radius: 999px; font-size: 14px; font-weight: 700; text-decoration: none; }
.nav-link:hover { background: var(--mint); }
.bag-link { position: relative; display: grid; width: 44px; height: 44px; place-items: center; color: var(--ink); background: var(--white); border: 2px solid var(--ink); border-radius: 50%; box-shadow: var(--shadow-sm); text-decoration: none; }
.bag-link svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.bag-count { position: absolute; top: -6px; right: -6px; display: grid; min-width: 22px; height: 22px; padding: 0 5px; place-items: center; color: var(--white); background: var(--coral); border: 2px solid var(--ink); border-radius: 999px; font-size: 12px; font-weight: 800; line-height: 1; animation: pop 320ms cubic-bezier(.3,1.6,.5,1); }

/* Type & buttons */
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
h2 { font-size: 26px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: .1em; }
.button { display: inline-flex; min-height: 50px; align-items: center; justify-content: center; gap: 10px; padding: 10px 20px; border: 2px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm); font-weight: 700; text-align: center; text-decoration: none; transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease; }
.button:not(:disabled):active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.primary { color: var(--white); background: var(--blue); }
.secondary { color: var(--ink); background: var(--white); }
.full { width: 100%; }
button:disabled { cursor: not-allowed; opacity: .45; }
.button:disabled { box-shadow: none; }
.text-button { display: inline-flex; min-height: 44px; align-items: center; padding: 7px 0; color: var(--blue); background: none; border: 0; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.help { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.error { margin: 8px 0; color: var(--red); font-size: 14px; font-weight: 600; }
.error:empty { display: none; }
@keyframes pop { from { transform: scale(.4); } to { transform: scale(1); } }
@media (hover: hover) {
  .button:not(:disabled):hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
  .primary:not(:disabled):hover { background: var(--blue-dark); }
  .text-button:hover { color: var(--blue-dark); text-decoration-thickness: 2px; }
}

/* Hero: a slim strip on phones so the product owns the first screen */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 74px; align-items: center; gap: 8px; margin-block: 2px 12px; padding: 14px 16px; background: var(--yellow); border: 2px solid var(--ink); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.hero h1 { font-size: 25px; line-height: 1.08; letter-spacing: -.03em; }
.hero h1 span { color: var(--blue); }
.hero-lede { margin: 6px 0 0; font-size: 13px; line-height: 1.4; }
.hero-cta { display: none; }
.hero-button { min-height: 50px; background: var(--ink); border-radius: 999px; box-shadow: 3px 3px 0 var(--coral); }
.hero-points { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: 14px; font-weight: 600; }
.hero-points li { display: inline-flex; align-items: center; gap: 7px; }
.hero-points li::before { width: 18px; height: 18px; flex: none; content: ""; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235546d7' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat; border: 1.5px solid var(--ink); border-radius: 50%; }
.hero-art { position: relative; height: 84px; }
.hero-paw { position: absolute; top: 4px; left: 0; width: 56px; height: 56px; padding: 8px; color: var(--blue); background: var(--mint); border: 2px solid var(--ink); border-radius: 15px; box-shadow: var(--shadow-sm); transform: rotate(-12deg); animation: bob 5s ease-in-out infinite; }
.hero-heart { position: absolute; right: 0; bottom: 0; display: grid; width: 38px; height: 38px; place-items: center; color: var(--coral); background: var(--white); border: 2px solid var(--ink); border-radius: 28% 45% 35% 45%; box-shadow: var(--shadow-sm); font-size: 23px; transform: rotate(12deg); animation: bob 5s ease-in-out -2.5s infinite; }
.hero-spark { position: absolute; top: -12px; right: 0; color: var(--blue); font-size: 22px; animation: twinkle 3.2s ease-in-out infinite; }
@keyframes bob { 50% { translate: 0 -5px; } }
@keyframes twinkle { 50% { scale: .82; rotate: 20deg; } }

/* Studio card */
.studio { scroll-margin-top: 8px; }
#design-form { min-width: 0; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.preview-panel { min-width: 0; padding: 8px; background: var(--white); border: 2px solid var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow); }

/* Stage: the product fills it; controls float on top within thumb reach */
.product-stage { position: relative; width: 100%; height: min(124vw, calc(100svh - 230px)); min-height: 360px; margin: 0 auto; overflow: hidden; background: radial-gradient(circle at 50% 44%, rgb(255 255 255 / 85%), rgb(255 255 255 / 0) 62%), var(--sky); border-radius: 18px; perspective: 1100px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.preview-panel[data-product="tote"] .product-stage { background-color: var(--mint); }
.product-stage.has-3d { cursor: pointer; }
.product-stage.has-3d:active { cursor: grabbing; }
.preview-panel.is-dropping .product-stage { box-shadow: inset 0 0 0 3px var(--blue); }
.stage-glow { position: absolute; inset: 14% 8% 8%; background: radial-gradient(circle, rgb(255 255 255 / 92%), rgb(255 255 255 / 0) 68%); border-radius: 50%; }
.stage-top, .stage-bottom { position: absolute; z-index: 4; right: 10px; left: 10px; display: flex; align-items: center; pointer-events: none; }
.stage-top > *, .stage-bottom > * { pointer-events: auto; }
.stage-top { top: 10px; justify-content: center; }
.stage-bottom { bottom: 10px; justify-content: space-between; gap: 8px; }
.stage-hint { position: absolute; z-index: 3; right: 12px; bottom: 62px; left: 12px; margin: 0; color: rgb(43 32 55 / 70%); font-size: 12px; font-weight: 600; text-align: center; pointer-events: none; }
.product-stage:not(.has-3d) .stage-hint { display: none; }
#studio-status { margin: 10px 4px 0; color: var(--red); font-size: 14px; font-weight: 600; }

.product-options { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; background: rgb(255 255 255 / 88%); border: 2px solid var(--ink); border-radius: 999px; box-shadow: var(--shadow-sm); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.product-options label { position: relative; min-width: 0; cursor: pointer; }
.product-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.product-options span { display: flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 4px 14px; color: var(--muted); border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.product-options svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.product-options input:checked + span { color: var(--ink); background: var(--yellow); }
.product-options input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.view-switch { display: flex; padding: 3px; background: rgb(255 255 255 / 88%); border: 1.5px solid rgb(43 32 55 / 18%); border-radius: 999px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.view-switch button { min-width: 0; min-height: 40px; padding: 4px 14px; white-space: nowrap; color: var(--muted); background: transparent; border: 0; border-radius: 999px; font-size: 14px; font-weight: 700; }
.view-switch button[aria-pressed="true"] { color: var(--white); background: var(--blue); }
.studio-tools { display: flex; gap: 4px; }
.studio-tools button { display: grid; width: 42px; height: 42px; place-items: center; padding: 0; color: var(--ink); background: rgb(255 255 255 / 88%); border: 1.5px solid rgb(43 32 55 / 18%); border-radius: 50%; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.studio-tools svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Phones zoom by pinching; zoom buttons appear on wider screens, roll buttons on desktop. */
.tool-roll, .studio-tools [data-studio-action="in"], .studio-tools [data-studio-action="out"] { display: none !important; }
.preview-panel:not(:has(.has-3d)) .studio-tools { display: none; }

/* Photo details under the stage */
.photo-step { padding: 0 4px; }
.upload-help { margin: 8px 0 0; text-align: center; }
.photo-summary { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 0 12px; margin-top: 8px; padding: 8px; background: var(--paper); border-radius: 14px; }
.photo-summary img { grid-row: span 2; width: 48px; height: 48px; object-fit: cover; border: 1.5px solid var(--ink); border-radius: 10px; }
.photo-summary .help { margin: 0; font-size: 12px; }
.photo-summary .text-button { min-height: 32px; padding: 2px 0 0; justify-self: start; font-size: 14px; }
.photo-step:has(.photo-summary:not([hidden])) .upload-help { display: none; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.adjustments { margin-top: 4px; }
.adjustments summary, .faq summary { position: relative; display: flex; min-height: 48px; align-items: center; padding: 12px 32px 12px 0; cursor: pointer; font-size: 15px; font-weight: 700; }
.adjustments summary::after, .faq summary::after, .chevron { position: absolute; right: 6px; width: 10px; height: 10px; content: ""; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); transition: transform 200ms ease; }
details[open] > summary::after, details[open] .chevron { transform: translateY(2px) rotate(-135deg); }
.adjustment-grid { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 4px 12px; }
.adjustment-grid label { color: var(--muted); font-size: 14px; }
.adjustment-grid input[type="range"] { width: 100%; min-height: 40px; accent-color: var(--blue); }
.shirt-settings { display: inline-block; margin: 12px 4px 4px; color: var(--blue); font-size: 14px; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.shirt-options { margin: 14px 4px; font-size: 14px; }
.shirt-options > summary { cursor: pointer; font-weight: 700; }
.shirt-option-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.shirt-option-fields label { display: grid; gap: 4px; min-width: 0; }
.shirt-option-fields select { width: 100%; min-height: 44px; border: 1px solid var(--ink); border-radius: 10px; padding: 8px; background: white; color: var(--ink); font: inherit; }
.preview-panel[data-product="tee"][data-shirt-color="BLACK"] .product-shape { background: linear-gradient(104deg,#151515,#343434 50%,#1e1e1e); }
.preview-panel[data-product="tote"] .shirt-settings { display: none; }

/* Order bar: fixed in the thumb zone on phones */
.order-bar { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: rgb(255 250 243 / 94%); border-top: 2px solid var(--ink); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.order-bar .error { max-width: 880px; margin: 0 auto 8px; }
.order-row { display: flex; align-items: center; gap: 10px; max-width: 880px; margin-inline: auto; }
.quantity-field { margin: 0; }
#save-design { flex: 1; min-width: 0; min-height: 52px; padding-inline: 12px; font-size: 17px; white-space: nowrap; }
.stepper { display: inline-flex; align-items: center; padding: 3px; background: var(--white); border: 2px solid var(--soft-line); border-radius: 14px; }
.stepper button { display: grid; width: 40px; height: 42px; place-items: center; padding: 0; color: var(--ink); background: var(--paper); border: 0; border-radius: 10px; font-size: 20px; font-weight: 700; line-height: 1; }
.stepper input { width: 40px; min-height: 42px; padding: 0; color: var(--ink); background: transparent; border: 0; font-size: 17px; font-weight: 700; text-align: center; appearance: textfield; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.stepper:focus-within { border-color: var(--blue); }
.stepper input:focus-visible { outline: none; }

/* CSS fallback product (used when WebGL is unavailable) */
.product-model { --rotation: 0deg; position: absolute; z-index: 2; inset: 0; transform: rotateY(var(--rotation)); transform-style: preserve-3d; transition: transform 480ms cubic-bezier(.2,.75,.25,1); }
.product-model.is-dragging { transition: none; }
.product-face { position: absolute; inset: 0; backface-visibility: hidden; transform-style: preserve-3d; }
.product-front { transform: translateZ(12px); }
.product-back { transform: rotateY(180deg) translateZ(12px); }
.product-shape { position: absolute; top: 20%; left: 19%; width: 62%; height: 67%; background: linear-gradient(104deg, #e9e4dc 0%, #fffefa 29%, #f8f5ef 70%, #ded8cf 100%); border: 1px solid rgb(59 50 43 / 13%); border-radius: 4px 4px 18px 18px; filter: drop-shadow(0 23px 19px rgb(42 36 52 / 20%)); transform: translateZ(20px); }
.product-shape::before { position: absolute; z-index: -1; top: -25%; left: 25%; width: 50%; height: 34%; content: ""; border: 14px solid #f4f0e9; border-bottom: 0; border-radius: 999px 999px 0 0; box-shadow: inset 2px 0 rgb(50 40 30 / 10%), 2px 0 rgb(50 40 30 / 7%); }
.product-detail { position: absolute; inset: 8px; border: 1px solid rgb(85 76 66 / 12%); border-radius: 2px 2px 14px 14px; pointer-events: none; }
.preview-panel[data-product="tee"] .product-shape { top: 10%; left: 7%; width: 86%; height: 80%; border: 0; border-radius: 0; clip-path: polygon(0 18%, 25% 0, 36% 5%, 42% 11%, 50% 13%, 58% 11%, 64% 5%, 75% 0, 100% 18%, 87% 43%, 76% 34%, 79% 100%, 21% 100%, 24% 34%, 13% 43%); }
.preview-panel[data-product="tee"] .product-shape::before { z-index: 2; top: 1%; left: 42%; width: 16%; height: 13%; border: 0; background: #ddd7cf; border-radius: 0 0 999px 999px; box-shadow: inset 0 -3px 5px rgb(31 24 19 / 8%); }
.preview-panel[data-product="tee"] .product-detail { inset: 4% 18% 5%; border: 0; border-left: 1px solid rgb(85 76 66 / 8%); border-right: 1px solid rgb(85 76 66 / 8%); border-radius: 0; }
.product-back .product-shape { background: linear-gradient(256deg, #e9e4dc 0%, #fffefa 29%, #f8f5ef 70%, #ded8cf 100%); }
.print-zone { position: absolute; z-index: 3; top: 21%; left: 23%; width: 54%; transition: opacity 200ms ease, filter 200ms ease; }
.preview-panel[data-product="tee"] .print-zone { top: 25%; left: 32%; width: 36%; }
.photo-viewport { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 8px; }
.photo-render { display: block; width: 100%; height: 100%; object-fit: cover; }
.preview-panel[data-product="tee"] .photo-viewport { aspect-ratio: var(--print-aspect, 2 / 3); }
.preview-panel[data-product="tee"] .photo-render { opacity: 0; }
.photo-composite { position: absolute; inset: 0; width: 100%; height: 100%; }
.photo-placeholder { display: grid; width: 100%; height: 100%; place-items: center; align-content: center; color: #867e88; background: rgb(255 255 255 / 50%); border: 1.5px dashed rgb(80 71 86 / 42%); border-radius: 8px; }
.photo-placeholder span { display: grid; width: 34px; height: 34px; place-items: center; color: var(--white); background: var(--coral); border-radius: 50%; font-size: 22px; line-height: 1; }
.photo-placeholder p { margin: 7px 0 0; font-size: 11px; font-weight: 750; }
.product-model[data-print-side="front"] .product-back .print-zone,
.product-model[data-print-side="back"] .product-front .print-zone { opacity: 0; }
.product-model[data-view="front"] .product-back .face-label,
.product-model[data-view="back"] .product-front .face-label { visibility: hidden; }
.face-label { position: absolute; right: 13%; bottom: 4%; padding: 5px 9px; color: #5f5866; background: rgb(255 255 255 / 74%); border-radius: 999px; font-size: 11px; font-weight: 800; transform: translateZ(32px); }
.product-shadow { position: absolute; z-index: 1; right: 25%; bottom: 6%; left: 25%; height: 8%; background: rgb(39 34 52 / 18%); border-radius: 50%; filter: blur(13px); }
.studio-canvas { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: auto; touch-action: none; }
.has-3d .product-model, .has-3d .product-shadow, .has-3d .stage-glow { display: none; }

/* Design bag & checkout */
.design-bag { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 16px; margin-top: 20px; padding: 16px; background: var(--white); border: 2px solid var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow); scroll-margin-top: 8px; }
.design-bag:focus { outline: none; }
.design-bag:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.bag-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 20px; padding-bottom: 12px; border-bottom: 1.5px solid var(--soft-line); }
.bag-heading h2 { font-size: 26px; }
.bag-heading > p { margin: 0; color: var(--muted); font-size: 13px; }
.empty-state { margin: 20px 0 0; padding: 24px; color: var(--muted); background: var(--paper); border: 1.5px dashed #c9bfc8; border-radius: 16px; text-align: center; }
.bag-item { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: start; gap: 14px; padding-block: 14px; border-bottom: 1.5px solid var(--soft-line); animation: rise 280ms ease-out; }
.bag-item img { width: 72px; height: 72px; object-fit: cover; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 14px; }
.bag-item h3 { margin: 2px 0 8px; overflow-wrap: anywhere; font-size: 17px; }
.bag-quantity { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; font-weight: 600; }
.bag-quantity input { width: 64px; min-height: 40px; padding: 6px 8px; color: var(--ink); background: var(--paper); border: 2px solid var(--soft-line); border-radius: 10px; font-weight: 700; }
.bag-quantity input:focus { border-color: var(--blue); outline: none; }
.design-actions { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; margin-top: 6px; }
.bag-actions { margin-top: 16px; gap: 12px 20px; }
#bag-status { margin: 12px 0 0; color: var(--blue); font-size: 14px; font-weight: 600; }
#bag-status:empty { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.checkout-panel { display: grid; gap: 14px; padding: 16px; background: var(--lilac); border: 2px solid var(--ink); border-radius: 20px; }
.checkout-panel h3 { margin: 0 0 6px; font-size: 21px; }
.checkout-panel p { margin: 0; color: var(--muted); font-size: 14px; }
.checkout-panel .button { width: 100%; }
.recipient-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.recipient-form legend { padding: 0; font-weight: 700; }
.recipient-form #recipient-help { margin-block: 6px 12px; font-size: 13px; }
.recipient-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.recipient-grid label { display: grid; min-width: 0; gap: 4px; font-size: 13px; font-weight: 600; }
.recipient-wide { grid-column: 1 / -1; }
.recipient-grid input { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; background: var(--white); border: 1.5px solid #b9aec4; border-radius: 8px; }
.recipient-grid input:focus { border-color: var(--blue); }
#checkout-status:empty { display: none; }
.quote-details { padding: 16px; background: var(--white); border-radius: 14px; }
.quote-details dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 18px; margin: 0; }
.quote-details dt, .quote-details dd { margin: 0; }
.quote-details dd { font-variant-numeric: tabular-nums; text-align: right; }
.quote-details dt:last-of-type, .quote-details dd:last-of-type { padding-top: 8px; border-top: 1.5px solid var(--line); font-weight: 800; }

/* Order status */
.order-status { max-width: 720px; min-height: 52vh; padding-block: 48px; }
.order-status h2 { font-size: clamp(32px, 9vw, 60px); }
.order-status #order-copy { max-width: 520px; color: var(--muted); font-size: 17px; }
.order-production { margin-top: 24px; padding: 16px; background: var(--white); border: 1.5px solid var(--soft-line); border-radius: 14px; }
.order-production h3 { font-size: 19px; }
.order-production p { margin: 8px 0 0; overflow-wrap: anywhere; }
.order-production #supplier-test-mode { color: var(--muted); font-size: 13px; }
.order-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 24px; }
.storefront-page:has(#order-status:not([hidden])) { padding-bottom: 0; }
.storefront-page:has(#order-status:not([hidden])) .order-bar { display: none; }

/* AI try-on, just under the preview */
.tryon { margin-top: 8px; background: var(--paper); border-radius: 16px; }
.tryon summary { position: relative; display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 10px 44px 10px 10px; cursor: pointer; }
.tryon .chevron { right: 20px; top: 50%; margin-top: -6px; }
.tryon-thumbs { display: flex; flex: none; padding-left: 10px; }
.tryon-thumbs img { width: 38px; height: 50px; margin-left: -10px; object-fit: cover; border: 2px solid var(--ink); border-radius: 9px; box-shadow: var(--shadow-sm); transition: transform 200ms ease; }
.tryon-thumbs img:nth-child(1) { transform: rotate(-8deg); }
.tryon-thumbs img:nth-child(3) { transform: rotate(8deg); }
.tryon-title { display: grid; min-width: 0; }
.tryon-title strong { font-family: var(--display); font-size: 18px; font-weight: 600; line-height: 1.2; }
.tryon-title small { color: var(--muted); font-size: 13px; }
.tryon-content { padding: 0 12px 14px; }
.tryon-help { color: var(--muted); font-size: 14px; line-height: 1.6; }
.tryon-content > .tryon-help:first-child { margin-top: 0; padding-top: 12px; border-top: 1.5px solid var(--soft-line); }
.tryon-uploads { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.tryon-uploads > div { min-width: 0; }
.tryon-upload { display: grid; gap: 4px; padding: 14px; background: var(--white); border: 2px dashed #c9bfc8; border-radius: 14px; cursor: pointer; font-weight: 700; }
.tryon-upload small { color: var(--muted); font-size: 13px; font-weight: 500; }
.tryon-upload input { width: 100%; min-width: 0; margin-top: 8px; font-size: 14px; font-weight: 500; }
.tryon-person { display: flex; gap: 16px; align-items: center; margin: 12px 0 0; }
.tryon-person img { width: 70px; height: 90px; object-fit: cover; border: 1.5px solid var(--ink); border-radius: 10px; }
.tryon-person button { min-height: 44px; padding: 0; color: var(--blue); background: none; border: none; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
#tryon-generate { width: 100%; margin-top: 4px; }
#tryon-status { font-size: 13px; line-height: 1.6; }
#tryon-status:empty { display: none; }
.tryon-results { display: grid; gap: 12px; margin-top: 16px; }
.tryon-hero { margin: 0; }
.tryon-hero img { display: block; width: 100%; max-height: 560px; object-fit: contain; background: #e4e6dc; border-radius: 16px; }
.tryon-hero figcaption { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 14px; }
.tryon-hero figcaption a { color: var(--blue); font-weight: 600; }
.tryon-thumbnails { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tryon-thumbnails button { padding: 4px; color: inherit; background: transparent; border: 2px solid transparent; border-radius: 12px; font: inherit; font-size: 13px; }
.tryon-thumbnails button[aria-pressed="true"] { border-color: var(--ink); }
.tryon-thumbnails img { display: block; width: 100%; margin-bottom: 6px; aspect-ratio: 3/4; object-fit: cover; border-radius: 8px; }

/* FAQ & footer */
.faq { padding-block: 28px 16px; }
.faq h2 { margin-bottom: 6px; font-size: 24px; }
.faq details { border-bottom: 1.5px solid var(--soft-line); }
.faq summary::after { top: 50%; margin-top: -5px; }
.faq details p { margin: 0 0 16px; color: var(--muted); font-size: 15px; }
.site-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding-block: 20px 28px; border-top: 1.5px solid var(--soft-line); }
.site-footer .brand { margin-right: auto; font-size: 20px; }
.site-footer .brand-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 16px; }
.site-footer .text-button { font-size: 14px; }
.site-footer p { width: 100%; margin: 0; color: var(--muted); font-size: 13px; }

/* Larger phones and up */
@media (min-width: 420px) {
  .studio-tools [data-studio-action="in"], .studio-tools [data-studio-action="out"] { display: grid !important; }
  .hero { grid-template-columns: minmax(0, 1fr) 92px; padding: 16px 18px; }
  .hero h1 { font-size: 28px; }
  .hero-art { height: 96px; }
  .hero-paw { width: 66px; height: 66px; padding: 10px; border-radius: 18px; }
  .hero-heart { width: 44px; height: 44px; font-size: 27px; }
}

/* Tablets and desktop: the bar returns into the card, the hero opens up */
@media (min-width: 720px) {
  :root { --radius-lg: 28px; --shadow: 4px 4px 0 var(--ink); }
  .shell { width: min(880px, calc(100% - 48px)); }
  .storefront-page { padding-bottom: 0; }
  .site-header { padding-block: 16px; }
  .brand { font-size: 26px; }
  .brand-mark { width: 40px; height: 40px; border-radius: 12px; font-size: 23px; }
  .nav-link { display: inline-flex; }
  .hero { grid-template-columns: minmax(0, 1fr) 200px; gap: 24px; margin-block: 4px 24px; padding: 32px 40px; border-radius: var(--radius-lg); }
  .hero h1 { font-size: clamp(40px, 5.4vw, 58px); line-height: 1.02; }
  .hero-lede { max-width: 470px; margin-top: 12px; font-size: 18px; line-height: 1.5; }
  .hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 20px; }
  .hero-art { height: 180px; }
  .hero-paw { top: 22px; width: 130px; height: 130px; padding: 17px; border-radius: 30px; box-shadow: var(--shadow); }
  .hero-heart { width: 80px; height: 80px; font-size: 48px; box-shadow: 3px 3px 0 var(--ink); }
  .hero-spark { top: -4px; right: 12px; font-size: 44px; }
  .preview-panel { padding: 14px; }
  .product-stage { height: 540px; border-radius: 20px; }
  .stage-top { top: 14px; }
  .stage-bottom { right: 14px; bottom: 14px; left: 14px; }
  .stage-hint { bottom: 70px; }
  .tool-roll { display: grid !important; }
  .photo-step { padding: 0 2px; }
  .tryon { margin-top: 12px; }
  .tryon summary { gap: 16px; min-height: 80px; padding: 12px 52px 12px 14px; }
  .tryon-thumbs img { width: 52px; height: 64px; margin-left: -12px; }
  .tryon-title strong { font-size: 22px; }
  .tryon-title small { font-size: 14px; }
  .tryon-uploads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-bar { position: static; margin-top: 14px; padding: 14px 2px 2px; background: none; border-top: 1.5px solid var(--soft-line); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .design-bag { grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr); gap: 24px; margin-top: 28px; padding: 24px; }
  .bag-heading h2 { font-size: 32px; }
  .bag-item { grid-template-columns: 84px minmax(0, 1fr); }
  .bag-item img { width: 84px; height: 84px; }
  .checkout-panel { position: sticky; top: 16px; padding: 22px; }
  .faq { padding-block: 40px 24px; }
  .site-footer p { width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation: none !important; }
}
