/* Shared structure. Each template's theme.css sets the variables and personality. */
:root {
  --bg: #fff; --fg: #111; --muted: #555; --line: #e2e2e2; --surface: #f4f4f4;
  --accent: #111; --accent-fg: #fff; --sale: #c8102e; --ph-bg: #ececec;
  --radius: 0px; --btn-radius: 0px; --max: 1320px;
  --font-body: system-ui, sans-serif; --font-head: system-ui, sans-serif;
  --head-weight: 800; --head-transform: none; --head-style: normal; --head-spacing: 0;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 16px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
a:hover { opacity: .75; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, .logo { font-family: var(--font-head); font-weight: var(--head-weight); text-transform: var(--head-transform); font-style: var(--head-style); letter-spacing: var(--head-spacing); line-height: 1.02; margin: 0; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 28px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Demo bar (for client presentation only) */
.demo-bar { position: sticky; top: 0; z-index: 50; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between; padding: 8px 16px; background: #1b1b1b; color: #f2f2f2; font: 500 13px/1.3 system-ui, sans-serif; }
.demo-bar nav { display: flex; gap: 6px; flex-wrap: wrap; }
.demo-bar nav a { padding: 6px 10px; border: 1px solid #555; border-radius: 999px; }
.demo-bar nav a[aria-current] { background: #f2f2f2; color: #111; border-color: #f2f2f2; }
.demo-bar .demo-home { text-decoration: underline; }

/* Header */
.announce { text-align: center; font-size: 13px; padding: 8px 16px; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; padding-top: 18px; padding-bottom: 18px; }
.logo { font-size: 28px; }
.nav { display: flex; flex-wrap: wrap; gap: 6px 26px; }
.nav a { padding: 6px 0; }
.nav-sale { color: var(--sale); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.search { display: flex; align-items: center; height: 44px; border: 1.5px solid var(--fg); border-radius: 999px; overflow: hidden; }
.search input { border: 0; background: transparent; padding: 0 16px; height: 100%; width: 230px; min-width: 0; }
.search input:focus { outline: none; }
.search button { width: 44px; height: 44px; border: 0; background: var(--fg); color: var(--bg); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cart-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; font-weight: 700; }
/* Phone menu button and the search inside the drawer: hidden on desktop. */
.menu-toggle, .nav-search { display: none; }
.menu-toggle { width: 44px; height: 44px; margin-left: -10px; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; align-items: center; justify-content: center; }
.menu-toggle .i-close { display: none; }
.cart-count { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; align-items: center; justify-content: center; font-size: 12px; background: var(--accent); color: var(--accent-fg); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 28px; border-radius: var(--btn-radius); border: 1.5px solid transparent; font-weight: 700; cursor: pointer; text-align: center; }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-outline { background: transparent; border-color: currentColor; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.linkish { background: none; border: 0; padding: 0; min-height: 44px; text-decoration: underline; cursor: pointer; }

/* Placeholder product art */
.ph { position: relative; background: var(--ph-bg); border-radius: var(--radius); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ph .tee { width: 62%; height: auto; }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Cards + grids */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 32px 18px; }
.card { display: flex; flex-direction: column; gap: 8px; }
.card-media { position: relative; display: block; }
.card-media .ph { aspect-ratio: 3 / 4; }
.badge { position: absolute; top: 10px; left: 10px; padding: 5px 10px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--accent); color: var(--accent-fg); }
.badge.inline { position: static; display: inline-block; margin-bottom: 10px; }
.badge-sale { background: var(--sale); color: #fff; }
.card-body { display: flex; flex-direction: column; gap: 4px; }
.card-title { font-weight: 600; }
.price { font-weight: 700; }
.price-sale { color: var(--sale); font-weight: 700; }
.was { color: var(--muted); font-size: 14px; }
.card-meta { font-size: 13px; color: var(--muted); }
.dots { display: flex; gap: 6px; margin-top: 4px; }
.dot { width: 14px; height: 14px; border-radius: 999px; border: 1px solid rgba(128,128,128,.6); }
.quick-add { min-height: 44px; margin-top: 8px; }

/* Shop page */
.shop, .pdp, .cart, .confirm { padding-top: 24px; padding-bottom: 72px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.shop-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.shop-head h1 { font-size: 44px; }
.count { font-size: 16px; font-weight: 500; color: var(--muted); font-family: var(--font-body); text-transform: none; font-style: normal; letter-spacing: 0; }
.sort select { height: 44px; margin-left: 8px; padding: 0 10px; border: 1.5px solid var(--line); background: var(--bg); border-radius: var(--btn-radius); }
.shop-layout { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.filters { flex: 1 1 220px; max-width: 260px; display: flex; flex-direction: column; gap: 22px; }
.filters summary { font-weight: 800; cursor: pointer; margin-bottom: 14px; }
.filters fieldset { border: 0; margin: 0 0 22px; padding: 0; }
.filters legend { font-weight: 800; margin-bottom: 10px; padding: 0; }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.size-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.size-chip input { position: absolute; opacity: 0; }
.size-chip span { display: flex; align-items: center; justify-content: center; height: 44px; border: 1.5px solid var(--line); border-radius: var(--btn-radius); font-weight: 600; cursor: pointer; }
.size-chip input:checked + span { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.size-chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
#results { flex: 999 1 600px; min-width: 0; }
.empty { grid-column: 1 / -1; }

/* Product page */
.pdp-layout { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.gallery { flex: 1.2 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.gallery .main { aspect-ratio: 4 / 5; }
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.thumbs .ph { aspect-ratio: 1 / 1; }
.thumbs .active { outline: 2px solid var(--fg); outline-offset: 2px; }
.thumbs .alt1 { filter: brightness(.96); } .thumbs .alt2 { filter: brightness(.92); } .thumbs .alt3 { filter: brightness(.88); }
.info { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.info h1 { font-size: 46px; }
.pdp-price { font-size: 24px; font-weight: 700; margin: 0; }
.pdp-price small { font-size: 13px; font-weight: 400; color: var(--muted); }
.afterpay { margin: -10px 0 0; color: var(--muted); font-size: 14px; }
.specs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.specs li { background: var(--surface); padding: 10px 12px; border-radius: var(--radius); font-weight: 700; font-size: 14px; }
.specs span { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.info fieldset { border: 0; margin: 0; padding: 0; }
.info legend { padding: 0; margin-bottom: 10px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 44px; height: 44px; border-radius: 999px; border: 3px solid var(--bg); box-shadow: 0 0 0 1px rgba(128,128,128,.7); cursor: pointer; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--fg); }
.sizes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.size { height: 48px; border: 1.5px solid var(--line); background: var(--bg); border-radius: var(--btn-radius); font-weight: 700; cursor: pointer; }
.size[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.size[disabled] { text-decoration: line-through; opacity: .5; cursor: not-allowed; }
.stock { margin: 10px 0 0; font-size: 14px; font-weight: 600; color: #2f6b4f; }
.stock.low { color: #b4532a; }
.buy { display: flex; gap: 12px; flex-wrap: wrap; }
.buy .add { flex: 1 1 220px; min-height: 54px; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--btn-radius); }
.qty button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 20px; cursor: pointer; }
.qty span { min-width: 26px; text-align: center; font-weight: 700; }
.perks { list-style: none; margin: 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; color: var(--muted); }
.info details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.info summary { font-weight: 700; cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.info details p { margin: 8px 0 0; color: var(--muted); }
.related { margin-top: 72px; }
.related h2 { font-size: 34px; margin-bottom: 24px; }

/* Cart + confirmation */
.cart h1, .confirm h1 { font-size: 46px; margin-bottom: 24px; }
.cart-layout, .confirm-layout { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.lines { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.line { display: flex; gap: 16px; align-items: flex-start; padding: 14px; background: var(--surface); border-radius: var(--radius); }
.line-media { width: 96px; flex: none; }
.line-media .ph { aspect-ratio: 3 / 4; }
.line-info { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.line-title { font-weight: 700; }
.line-actions { display: flex; align-items: center; gap: 16px; margin-top: 6px; }
.freeship { margin: 4px 0 0; padding: 12px 16px; background: var(--accent); color: var(--accent-fg); font-weight: 600; border-radius: var(--radius); }
.empty-cart { padding: 40px; background: var(--surface); text-align: center; border-radius: var(--radius); }
.summary { flex: 1 1 320px; background: var(--surface); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.summary h2 { font-size: 22px; }
.summary fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.summary legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.ship { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1.5px solid var(--line); border-radius: var(--btn-radius); cursor: pointer; background: var(--bg); }
.ship.on { border-color: var(--fg); }
.ship input { accent-color: var(--accent); width: 18px; height: 18px; }
.ship span { flex: 1; display: flex; flex-direction: column; }
.ship small { color: var(--muted); }
.summary dl { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.summary dl div { display: flex; justify-content: space-between; }
.summary dd { margin: 0; }
.summary .grand { font-size: 20px; font-weight: 800; padding-top: 10px; border-top: 1px solid var(--line); }
.summary .checkout { min-height: 56px; }
.summary p { margin: 0; }
.pay-icons { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pay-icons span { font-size: 12px; font-weight: 700; padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }
.confirm-hero { background: var(--accent); color: var(--accent-fg); padding: 40px; border-radius: var(--radius); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.confirm-hero h1 { margin: 0; }
.confirm-hero p { margin: 0; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
.steps { list-style: none; margin: 0 0 24px; padding: 24px; background: var(--surface); border-radius: var(--radius); display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.steps li { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: 4px solid var(--line); }
.steps li.done { border-top-color: var(--accent); }
.steps span { font-size: 13px; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 28px; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 28px; font-size: 14px; }
.footer-grid > div { display: flex; flex-direction: column; gap: 8px; }
.footer-grid h2 { font-size: 15px; margin-bottom: 4px; }
.footer-grid .logo { font-size: 22px; }
.footer-grid p { color: var(--muted); margin: 0; }
.footer-base { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }

/* Toast + checkout overlay */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; transition: .25s; background: var(--fg); color: var(--bg); padding: 14px 20px; border-radius: 8px; font-weight: 600; z-index: 60; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 70; padding: 20px; }
.overlay-box { background: #fff; color: #111; padding: 32px; border-radius: 12px; max-width: 420px; text-align: center; }
.overlay-box .muted { color: #555; }
.spinner { width: 40px; height: 40px; margin: 0 auto 12px; border: 4px solid #ddd; border-top-color: #635bff; border-radius: 999px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } .toast { transition: none; } }

/* Phones */
@media (max-width: 800px) {
  .container { padding: 0 16px; }

  /* Phone header: [menu] [logo] [cart], with the menu as a drawer underneath.
     '.site-header' prefix so these win over each theme's desktop header rules. */
  .site-header .header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0 8px; padding-top: 10px; padding-bottom: 10px; }
  .site-header .menu-toggle { display: inline-flex; grid-column: 1; grid-row: 1; justify-self: start; }
  .site-header .logo { grid-column: 2; grid-row: 1; justify-self: center; font-size: 24px; white-space: nowrap; }
  .site-header .header-actions { grid-column: 3; grid-row: 1; justify-self: end; width: auto; }
  .site-header .header-search { display: none; }
  .site-header .cart-link { min-height: 40px; padding: 0 12px; }
  .site-header .nav { display: none; grid-column: 1 / -1; grid-row: 2; order: 0; flex-direction: column; flex-wrap: nowrap; gap: 0; padding: 12px 0 8px; margin-top: 10px; border-top: 1px solid var(--line); font-size: 18px; }
  .site-header .nav a { display: block; padding: 13px 0; border-bottom: 1px solid var(--line); }
  .site-header .nav a:last-child { border-bottom: 0; }
  .site-header .nav-search { display: flex; width: 100%; margin: 4px 0 10px; }
  .site-header .nav-search input { width: 100%; flex: 1; }
  .site-header.nav-open .nav { display: flex; }
  .site-header.nav-open .menu-toggle .i-open { display: none; }
  .site-header.nav-open .menu-toggle .i-close { display: block; }
  .filters { max-width: none; flex-basis: 100%; }
  .shop-head h1, .info h1, .cart h1, .confirm h1 { font-size: 34px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 10px; }
  .sizes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .specs { grid-template-columns: 1fr 1fr; }
  .line-media { width: 72px; }
}
