/* Design tokens. The "olive" template uses these defaults; other templates (bottom of this file)
   override them via <html data-theme="…">. Admin custom colours override --olive/--moss/--ochre. */
:root {
  --bg: #f7f6f1;
  --surface: #ffffff;
  --ink: #1e2417;
  --muted: #6b6f62;
  --line: #e3e2d9;
  --olive: #4f6229;
  --olive-dark: #3b4a1e;
  --moss: #26311b;
  --ochre: #d4a537;
  --sale: #a8322a;
  --error: #b3261e;
  --ok: #2f7d4f;
  --wa: #25d366;
  --soft: var(--soft);            /* subtle fills: chips, progress, badges */
  --media-bg: var(--media-bg);        /* behind product images */
  --on-primary: #fff;         /* text on --olive */
  --on-dark: #fff;            /* text on --moss bands (hero, footer, announcement) */
  --on-dark-muted: #c9cfbb;
  --on-accent: #26311b;       /* text on --ochre */
  --shadow: rgba(30, 36, 23, .12);
  --radius: 10px;             /* cards, inputs */
  --radius-lg: 16px;          /* hero, large panels */
  --pill: 999px;              /* buttons, chips */
  --border-w: 1px;
  --display-weight: 500;
  --display-spacing: -.01em;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- design templates: token overrides (picked in Admin → Branding & SEO) ---------- */

[data-theme="studio"] {
  --bg: #ffffff; --surface: #ffffff; --soft: #f2f2f2; --media-bg: #f0f0f0;
  --ink: #161616; --muted: #6f6f6f; --line: #e3e3e3;
  --olive: #161616; --olive-dark: #000000; --moss: #161616; --ochre: #2f5bff; --sale: #d4001a;
  --on-primary: #ffffff; --on-dark: #ffffff; --on-dark-muted: #b4b4b4; --on-accent: #ffffff;
  --shadow: rgba(0, 0, 0, .08);
  --radius: 0px; --radius-lg: 0px; --pill: 0px;
  --display-weight: 600; --display-spacing: -.03em;
  --serif: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

[data-theme="maison"] {
  --bg: #f5f0ec; --surface: #fffcfa; --soft: #efe6e0; --media-bg: #ece2db;
  --ink: #2b1a20; --muted: #7c6970; --line: #e4d8d2;
  --olive: #6b1e34; --olive-dark: #4e1325; --moss: #351019; --ochre: #c9a45c; --sale: #a3122a;
  --on-primary: #fffaf6; --on-dark: #fffaf6; --on-dark-muted: #dcc6cb; --on-accent: #351019;
  --shadow: rgba(53, 16, 25, .12);
  --radius: 2px; --radius-lg: 2px; --pill: 2px;
  --display-weight: 400; --display-spacing: .005em;
  --serif: Didot, 'Bodoni 72', 'Bodoni MT', 'Big Caslon', Georgia, serif;
  --sans: 'Gill Sans', 'Gill Sans MT', 'Avenir Next', -apple-system, 'Segoe UI', sans-serif;
}

[data-theme="market"] {
  --bg: #fff3df; --surface: #ffffff; --soft: #ffe8c2; --media-bg: #ffeacb;
  --ink: #121212; --muted: #4d4d4d; --line: #121212;
  --olive: #ff5b1f; --olive-dark: #e2440a; --moss: #1d2b6b; --ochre: #ffd23f; --sale: #e0115f;
  --on-primary: #121212; --on-dark: #ffffff; --on-dark-muted: #c8d0ff; --on-accent: #121212;
  --shadow: rgba(0, 0, 0, .18);
  --radius: 14px; --radius-lg: 22px; --pill: 12px; --border-w: 2px;
  --display-weight: 800; --display-spacing: -.02em;
  --serif: 'Avenir Next', Futura, 'Trebuchet MS', system-ui, sans-serif;
  --sans: 'Avenir Next', 'Trebuchet MS', system-ui, sans-serif;
}

[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #0f1722; --surface: #172131; --soft: #1f2c3f; --media-bg: #1c2738;
  --ink: #e9eef5; --muted: #95a3b6; --line: #2a3a50;
  --olive: #3ec1b0; --olive-dark: #5fd3c4; --moss: #0a1018; --ochre: #f3b55b; --sale: #ff6b6b; --error: #ff7b72;
  --on-primary: #06241f; --on-dark: #ffffff; --on-dark-muted: #9fb0c4; --on-accent: #1d1405;
  --shadow: rgba(0, 0, 0, .45);
  --radius: 12px; --radius-lg: 18px;
  --display-weight: 600; --display-spacing: -.02em;
  --serif: 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3 { font-family: var(--serif); font-weight: var(--display-weight); letter-spacing: var(--display-spacing); line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: 1.35rem; margin-top: 1.2em; }
h3 { font-size: 1.1rem; margin-top: 1.2em; }
a { color: var(--olive-dark); }
img { max-width: 100%; height: auto; display: block; }
s { color: var(--muted); font-weight: 400; }
code { background: var(--soft); padding: 2px 6px; border-radius: 4px; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
main { flex: 1; padding-block: 24px 64px; outline: none; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.upper { text-transform: uppercase; letter-spacing: .12em; }
.error { color: var(--error); }
.loading { color: var(--muted); padding: 40px 0; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; }

/* announcement bar, header, category nav */
.announce { background: var(--moss); color: var(--on-dark-muted); font-size: .82rem; }
.announce-inner { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; }
.announce a { color: var(--on-dark); }
.site-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; height: 72px; gap: 32px; }
.logo { font-family: var(--serif); font-size: 1.65rem; color: var(--ink); text-decoration: none; white-space: nowrap; letter-spacing: -.01em; }
.header-search { position: relative; display: flex; max-width: 560px; width: 100%; justify-self: center; }
.header-search input { border-radius: var(--pill) 0 0 var(--pill); border-right: 0; background: var(--bg); padding-left: 18px; }
.header-search input:focus { box-shadow: none; border-color: var(--ink); background: var(--surface); }
.header-search > button { border: 1px solid var(--ink); background: var(--ink); color: var(--bg); border-radius: 0 var(--pill) var(--pill) 0; padding: 0 18px; cursor: pointer; }
.suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 14px 40px var(--shadow); padding: 6px;
}
.suggest-all { display: block; padding: 10px; text-align: center; font-weight: 600; border-top: 1px solid var(--line); margin-top: 4px; }
.suggest-empty { margin: 0; padding: 12px; color: var(--muted); font-size: .9rem; }
.header-nav { display: flex; align-items: center; gap: 20px; }
.nav-icon { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; font-size: .92rem; }
.nav-icon:hover { color: var(--olive); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--olive); color: #fff; font-size: .75rem; font-weight: 600; }
.cart-btn { font: inherit; font-size: .92rem; font-weight: 600; border: 0; background: var(--olive); color: var(--on-primary); border-radius: var(--pill); padding: 9px 16px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.cart-btn:hover { background: var(--olive-dark); }
.cart-btn .count { background: var(--on-primary); color: var(--olive); }

.cat-nav { border-top: 1px solid var(--line); position: relative; }
.cat-nav-inner { list-style: none; display: flex; gap: 4px; margin: 0 auto; padding: 0; }
.cat-link { display: block; padding: 11px 14px; color: var(--ink); text-decoration: none; font-size: .93rem; font-weight: 500; border-bottom: 2px solid transparent; }
.cat-item:hover > .cat-link, .cat-item:focus-within > .cat-link { border-bottom-color: var(--ink); }
.cat-sale { color: var(--sale); }
.mega {
  display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); box-shadow: 0 24px 40px var(--shadow);
}
.cat-item:hover > .mega, .cat-item:focus-within > .mega { display: block; }
.cat-nav.suppress .mega { display: none; }
.mega-inner { display: grid; grid-template-columns: 220px 1fr; gap: 40px; padding: 26px 0 30px; }
.mega-links { display: grid; align-content: start; gap: 10px; }
.mega-links a { color: var(--ink); text-decoration: none; }
.mega-links a:hover { text-decoration: underline; }
.mega-products { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; }

.mini { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 6px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.mini:hover { background: var(--bg); }
.mini img { border-radius: 6px; width: 56px; height: 56px; object-fit: cover; }
.mini-name { font-size: .92rem; line-height: 1.3; }
.mini-price { font-weight: 600; font-size: .92rem; }

/* footer */
.site-footer { background: var(--moss); color: var(--on-dark-muted); padding: 48px 0 0; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.3fr 1fr; gap: 40px; padding-bottom: 40px; }
.site-footer h3 { color: var(--on-dark); font-family: var(--sans); font-size: .95rem; font-weight: 600; margin: 0 0 14px; }
.site-footer nav { display: grid; align-content: start; gap: 9px; }
.site-footer nav a { color: var(--on-dark-muted); text-decoration: none; font-size: .93rem; }
.site-footer nav a:hover { color: var(--on-dark); text-decoration: underline; }
.site-footer nav p { margin: 6px 0 0; line-height: 1.5; }
.logo-img { display: block; max-height: 44px; width: auto; max-width: 220px; }
.footer-brand .logo { color: var(--on-dark); display: block; margin-bottom: 8px; }
.footer-brand p { margin: 0 0 18px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, .12); padding: 16px 0 22px; }

/* buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 500; padding: 10px 20px; border-radius: var(--pill);
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn-primary { background: var(--olive); border-color: var(--olive); color: var(--on-primary); }
.btn-primary:hover { background: var(--olive-dark); border-color: var(--olive-dark); color: var(--on-primary); }
.btn-ghost { border-color: var(--line); }
.btn-ghost:hover { background: var(--soft); color: var(--ink); }
.btn-whatsapp { background: var(--wa); border-color: var(--wa); color: #073b1d; }
.btn-whatsapp:hover { background: #1fb457; color: #fff; }
.btn-block { width: 100%; margin-top: 10px; }
.btn:disabled, .btn.disabled { opacity: .5; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--olive-dark); text-decoration: underline; cursor: pointer; }
.link-btn.danger, .link-btn.armed { color: var(--error); }
.icon-btn { background: none; border: 0; font-size: 1.2rem; cursor: pointer; padding: 6px; color: var(--ink); }

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: .9rem; font-weight: 500; }
.form .hint { margin: -8px 0 0; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--surface);
  border: var(--border-w) solid var(--line); border-radius: min(var(--radius), 8px); padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--olive); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--olive) 20%, transparent); }
input:disabled { background: var(--soft); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: auto; }
.form label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error:empty { display: none; }
.form-error { margin: 0; }

/* shared chips (admin + filters) */
.shop-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; margin: 12px 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: .9rem; padding: 6px 14px; border-radius: var(--pill); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none;
}
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.shop-tools { display: flex; gap: 8px; }
.shop-tools input { width: 220px; }
.shop-tools select { width: auto; }

/* product cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 28px 20px; }
.card { position: relative; display: flex; flex-direction: column; }
.card-media { display: block; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--media-bg); aspect-ratio: 1; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding-top: 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.card-cat { font-size: .78rem; color: var(--muted); }
.card-title { color: var(--ink); text-decoration: none; line-height: 1.35; }
.card-title:hover { text-decoration: underline; }
.card-add {
  margin-top: auto; align-self: flex-start; font: inherit; font-size: .85rem; font-weight: 600; color: var(--olive-dark);
  background: none; border: 1px solid var(--line); border-radius: var(--pill); padding: 6px 14px; cursor: pointer; text-decoration: none;
}
.card-body .price { margin-bottom: 8px; }
.card-add:hover { border-color: var(--olive); background: var(--olive); color: var(--on-primary); }
.card-add.is-disabled { color: var(--muted); cursor: default; }
.card-add.is-disabled:hover { background: none; border-color: var(--line); color: var(--muted); }
.price { font-weight: 600; }
.price s { margin-left: 4px; }
.price.big { font-size: 1.4rem; margin-bottom: 12px; }
.tag { position: absolute; top: 10px; left: 10px; background: var(--surface); color: var(--ink); font-size: .75rem; padding: 3px 10px; border-radius: var(--pill); font-weight: 700; }
.price .tag { position: static; vertical-align: middle; }
.tag-sale { background: var(--sale); color: #fff; }
.tag-new { background: var(--ochre); color: var(--on-accent); }
.tag-muted { background: #55594d; color: #fff; }
.wish {
  position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--muted); font-size: 1.1rem; cursor: pointer;
}
.wish.on, .wish-btn.on { color: var(--sale); }

/* home */
.home-hero { display: grid; grid-template-columns: 2.1fr 1fr; grid-template-rows: 1fr 1fr; gap: 16px; margin-bottom: 28px; }
.hero-main {
  grid-row: span 2; background: var(--moss); color: var(--on-dark); border-radius: var(--radius-lg); overflow: hidden;
  display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; min-height: 460px;
}
.hero-copy { padding: 48px 0 48px 48px; }
.hero-copy h1 { font-size: clamp(2.1rem, 3.6vw, 3.3rem); line-height: 1.06; letter-spacing: -.015em; margin-bottom: 18px; color: var(--on-dark); }
.hero-copy p { color: var(--on-dark-muted); max-width: 40ch; margin: 0 0 26px; font-size: 1.05rem; }
.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-light { background: var(--on-dark); border-color: var(--on-dark); color: var(--moss); }
.btn-light:hover { background: var(--ochre); border-color: var(--ochre); color: var(--moss); }
.btn-outline-light { border-color: rgba(255, 255, 255, .45); color: #fff; }
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.hero-stack { position: relative; height: 100%; min-height: 380px; }
.stack { position: absolute; display: block; border-radius: var(--radius); overflow: hidden; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.stack img { width: 100%; height: 100%; object-fit: cover; }
.stack-0 { width: 62%; aspect-ratio: 1; top: 13%; left: 14%; z-index: 2; transform: rotate(-3deg); }
.stack-1 { width: 40%; aspect-ratio: 1; top: 6%; right: 6%; transform: rotate(5deg); }
.stack-2 { width: 38%; aspect-ratio: 1; bottom: 7%; right: 10%; z-index: 3; transform: rotate(2deg); }
.hero-tile {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; display: block; color: var(--on-dark); text-decoration: none; background: var(--media-bg);
}
.hero-tile img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.hero-tile-text {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 20px 18px; display: grid; gap: 2px;
  background: linear-gradient(to top, color-mix(in srgb, var(--moss) 92%, transparent), transparent);
}
.hero-tile-text strong { font-family: var(--serif); font-weight: 500; font-size: 1.45rem; line-height: 1.15; }
.hero-tile-text span { font-size: .9rem; color: var(--on-dark-muted); }
.hero-tile:hover strong { text-decoration: underline; }
.hero-tile:first-of-type .hero-tile-text strong { color: var(--ochre); }

.usp {
  list-style: none; margin: 0 0 12px; padding: 22px 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.usp li { display: flex; gap: 12px; align-items: flex-start; font-size: .88rem; color: var(--muted); line-height: 1.4; }
.usp svg { color: var(--olive); flex: none; }
.usp strong { color: var(--ink); font-size: .93rem; }

.home-section { margin-top: 44px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: clamp(1.45rem, 2.4vw, 1.9rem); }
.view-all { font-weight: 600; font-size: .92rem; white-space: nowrap; }
.rail-controls { display: flex; align-items: center; gap: 8px; }
.rail-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--ink); }
.rail-btn:hover { border-color: var(--ink); }
.rail-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 4 * 20px) / 5); gap: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px;
}
.rail-track::-webkit-scrollbar { display: none; }
.rail-track > .card { scroll-snap-align: start; }

.cat-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.cat-tile { position: relative; display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5; color: var(--on-dark); text-decoration: none; background: var(--media-bg); }
.cat-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cat-tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, color-mix(in srgb, var(--moss) 85%, transparent), transparent 55%); }
.cat-tile-name, .cat-tile-count { position: absolute; left: 16px; z-index: 1; }
.cat-tile-name { bottom: 34px; font-family: var(--serif); font-size: 1.4rem; }
.cat-tile-count { bottom: 14px; font-size: .82rem; color: var(--on-dark-muted); }
.cat-tile:hover .cat-tile-name { text-decoration: underline; }

.spotlight {
  margin-top: 52px; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
}
.spot-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; }
.spot-body { padding: 44px; display: flex; flex-direction: column; justify-content: center; }
.spot-body h2 { margin: 0 0 12px; font-size: clamp(1.7rem, 3vw, 2.4rem); }
.spot-body > p { color: var(--muted); max-width: 46ch; margin: 0 0 18px; }
.spot-list { display: grid; gap: 2px; margin-bottom: 22px; border-top: 1px solid var(--line); padding-top: 10px; }
.spot-body .btn { align-self: flex-start; }

.how { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; }
.how h2 { margin: 0 0 20px; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.steps li { counter-increment: step; display: grid; gap: 4px; font-size: .92rem; color: var(--muted); }
.steps li::before {
  content: counter(step); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--moss); color: var(--on-dark); font-weight: 700; margin-bottom: 8px;
}
.steps strong { color: var(--ink); font-size: 1rem; }

/* pre-rendered category links (replaced by tiles once the app loads) */
.seo-links { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 0; list-style: none; }

/* shop listing */
.shop-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 36px; align-items: start; }
.filters { position: sticky; top: 140px; }
.filters summary { display: none; }
.filters fieldset { border: 0; border-bottom: 1px solid var(--line); margin: 0; padding: 0 0 16px; margin-bottom: 16px; display: grid; gap: 6px; }
.filters legend { font-weight: 700; font-size: .92rem; margin-bottom: 8px; }
.opt { display: flex; align-items: center; gap: 9px; font-size: .92rem; cursor: pointer; padding: 2px 0; }
.opt input { accent-color: var(--olive); margin: 0; }
.opt-count { margin-left: auto; color: var(--muted); font-size: .8rem; }
.shop-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 12px; }
.shop-toolbar h1 { margin: 0; }
.shop-toolbar p { margin: 2px 0 0; }
.sort { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); white-space: nowrap; }
.sort select { width: auto; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.active-filters:empty { display: none; }
.active-filters .chip { font-size: .82rem; padding: 4px 12px; }

/* product */
.crumbs { margin-bottom: 16px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.product { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: start; margin-bottom: 48px; }
.gallery img#main-img { border-radius: var(--radius); width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--media-bg); }
.thumbs { display: flex; gap: 8px; margin-top: 10px; }
.thumbs button { border: 2px solid transparent; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; }
.thumbs button.on { border-color: var(--olive); }
.product-info h1 { margin-bottom: .3em; }
.variant { border: 0; padding: 0; margin: 0 0 16px; }
.variant legend { font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.variant-options { display: flex; gap: 8px; flex-wrap: wrap; }
.variant-options input { position: absolute; opacity: 0; }
.variant-options span { display: inline-block; padding: 8px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.variant-options input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.variant-options input:focus-visible + span { outline: 2px solid var(--olive); outline-offset: 2px; }
.add-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0 8px; }
.add-row input { width: 80px; }

/* cart */
.cart-line { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-line img { border-radius: 8px; object-fit: cover; }
.cart-line.unavailable { opacity: .7; }
.cart-line-name { color: var(--ink); text-decoration: none; font-weight: 500; }
.cart-line-price { font-weight: 600; white-space: nowrap; }
.qty-row { display: flex; gap: 14px; align-items: center; margin-top: 8px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); }
.qty button { border: 0; background: none; width: 32px; height: 32px; font-size: 1rem; cursor: pointer; color: var(--ink); }
.qty span { min-width: 24px; text-align: center; }
.totals { margin: 16px 0 0; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals dt, .totals dd { margin: 0; }
.totals .grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: 1.1rem; }
.ship-progress { font-size: .9rem; padding: 12px 14px; background: var(--soft); border-radius: 8px; margin-bottom: 8px; }
.ship-progress.done { background: color-mix(in srgb, var(--olive) 14%, var(--surface)); color: var(--ink); }
.ship-progress .bar { height: 6px; background: var(--surface); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.ship-progress .bar span { display: block; height: 100%; background: var(--olive); }
.summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }

/* drawer */
.drawer-backdrop { position: fixed; inset: 0; background: color-mix(in srgb, var(--moss) 45%, transparent); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--surface); z-index: 50;
  transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(0, 0, 0, .08);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; }
.drawer-body { padding: 16px 20px 24px; overflow-y: auto; flex: 1; }

/* layout blocks */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel.left { text-align: left; }
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: start; }
.two-col.even { grid-template-columns: 1fr 1fr; }
.two-col > aside.panel { position: sticky; top: 84px; }
.narrow { max-width: 420px; margin: 24px auto; }
.empty { text-align: center; padding: 48px 0; color: var(--muted); }
.empty .btn { margin-top: 8px; }
.cod { background: var(--soft); }
.cod p { margin: 4px 0 0; }
.address-pick { display: grid; gap: 8px; }
.radio-card { display: flex !important; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 400 !important; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--olive); box-shadow: 0 0 0 1px var(--olive); }
.address { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.address-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
details summary { list-style: none; margin-top: 12px; }
details summary::-webkit-details-marker { display: none; }
details[open] summary { margin-bottom: 12px; }

/* confirmation */
.confirm { max-width: 620px; margin: 0 auto; text-align: center; display: grid; gap: 12px; justify-items: center; }
.confirm p { margin: 0; }
.confirm .panel { width: 100%; margin-top: 8px; }
.confirm-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--olive); color: var(--on-primary); display: grid; place-items: center; font-size: 2rem; }

/* account & orders */
.account-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.account-head h1, .account-head h2 { margin: 0; }
.account-head > div { display: flex; gap: 8px; flex-wrap: wrap; }
.order-list { display: grid; gap: 10px; }
.order-row {
  display: grid; grid-template-columns: 1.4fr 1fr auto auto; gap: 16px; align-items: center;
  padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none;
}
.order-row:hover { border-color: var(--olive); }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 10px; border-radius: var(--pill); background: var(--soft); color: var(--ink); }
.status-new { background: #f4e7c6; color: #7a5a10; }
.status-confirmed { background: #dce8f3; color: #234e74; }
.status-shipped { background: #e6dcf2; color: #4b2f73; }
.status-delivered { background: #dcebd8; color: #2f5f27; }
.status-cancelled { background: #f1d9d6; color: #8a2b20; }
.timeline { list-style: none; padding: 0; margin: 0 0 12px; }
.timeline li { position: relative; padding: 0 0 14px 24px; color: var(--muted); }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); }
.timeline li::after { content: ''; position: absolute; left: 9px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.done { color: var(--ink); }
.timeline li.done::before { background: var(--olive); border-color: var(--olive); }

/* admin */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover { background: var(--bg); }
.wa-sent, .wa-dry_run { color: var(--ok); }
.wa-failed { color: var(--error); }
.wa-pending { color: var(--muted); }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }

/* admin: branding & SEO settings */
.settings { display: grid; gap: 20px; max-width: 860px; }
.settings > p { margin: 0; }
.settings-section { display: grid; gap: 16px; }
.settings-section h2 { margin: 0; }
.settings-section h3 { margin: 8px 0 0; }
.settings label { display: grid; gap: 6px; font-size: .9rem; font-weight: 500; }
.settings label.btn { display: inline-flex; width: auto; font-weight: 500; }
.settings label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.settings .hint { font-weight: 400; }
.settings fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.settings legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.counter { font-weight: 400; }
.counter.over { color: var(--sale); }
.color-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.colors input[type=color]:disabled { opacity: .55; cursor: not-allowed; }
.theme-picker { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px !important; }
.theme-card { display: grid !important; gap: 4px !important; align-content: start; cursor: pointer; padding: 8px; border: 2px solid transparent; border-radius: 10px; }
.theme-card:has(input:checked) { border-color: var(--olive); background: color-mix(in srgb, var(--olive) 6%, transparent); }
.theme-card:has(input:focus-visible) { outline: 2px solid var(--olive); outline-offset: 2px; }
.theme-card input { position: absolute; opacity: 0; pointer-events: none; }
.theme-name { font-weight: 700; margin-top: 4px; }
.theme-desc { font-weight: 400; line-height: 1.35; }
.theme-preview {
  display: grid; gap: 6px; padding: 0 0 10px; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px;
  background: var(--p-bg); color: var(--p-ink); border: 1px solid color-mix(in srgb, var(--p-ink) 15%, transparent); align-content: start;
}
.tp-bar { height: 18px; background: var(--p-dark); }
.tp-title { font-family: var(--p-font); font-size: 1.6rem; line-height: 1; padding: 6px 10px 0; font-weight: 600; }
.tp-line { height: 6px; margin: 0 10px; border-radius: 3px; background: color-mix(in srgb, var(--p-ink) 25%, transparent); }
.tp-short { width: 55%; }
.tp-row { display: flex; align-items: center; gap: 6px; padding: 4px 10px 0; }
.tp-btn { width: 52px; height: 16px; border-radius: 8px; background: var(--p-primary); }
.tp-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--p-accent); }
.colors label.color { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.colors input[type=color] { width: 44px; height: 36px; padding: 2px; flex: none; cursor: pointer; }
.image-field { display: grid; gap: 8px; }
.image-label { font-size: .9rem; font-weight: 500; }
.image-row { display: flex; gap: 16px; align-items: center; }
.image-preview { width: 160px; height: 80px; border: 1px dashed var(--line); border-radius: 8px; display: grid; place-items: center; background: var(--bg); overflow: hidden; }
.image-preview img { width: 100%; height: 100%; object-fit: contain; }
.image-actions { display: flex; gap: 12px; align-items: center; }
.image-actions .btn { display: inline-flex; font-size: .9rem; padding: 8px 16px; }
.serp { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-family: Arial, sans-serif; max-width: 600px; }
.serp-url { font-size: .82rem; color: #4d5156; }
.serp-title { font-size: 1.2rem; color: #1a0dab; line-height: 1.3; }
.serp-desc { font-size: .88rem; color: #4d5156; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.seo-row { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
details.seo-row summary { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
details.seo-row summary img { border-radius: 6px; }
details.seo-row:not([open]) { gap: 0; }
.settings-save { position: sticky; bottom: 0; background: var(--bg); padding: 14px 0; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; align-items: center; gap: 16px; }
.settings-save .form-error { margin-right: auto; }

/* admin: shipping */
.country-head, .country-row { display: grid; grid-template-columns: minmax(0, 1fr) 200px 70px; gap: 8px; align-items: center; }
.country-row { margin-bottom: 8px; }
.fee-input { display: block !important; }
.shipping-preview { background: var(--bg); border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px 16px; }
.shipping-preview p { margin: 0 0 6px; }
.radio-card.is-disabled { opacity: .6; cursor: not-allowed; }

/* admin: products */
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.admin-toolbar input { width: 240px; }
.admin-toolbar select { width: auto; }
.admin-toolbar .btn { margin-left: auto; }
.products-table td { vertical-align: middle; }
.products-table tr.is-hidden td { color: var(--muted); }
.products-table tr.is-hidden .product-thumb { opacity: .45; }
.product-thumb { border-radius: 6px; object-fit: cover; width: 48px; height: 48px; }
.nowrap { white-space: nowrap; }
.rail-btn:disabled { opacity: .3; cursor: default; }
.toggle { font: inherit; font-size: .8rem; font-weight: 600; border-radius: var(--pill); padding: 4px 12px; cursor: pointer; border: 1px solid var(--line); background: var(--bg); color: var(--muted); white-space: nowrap; }
.toggle.on { background: #dcebd8; border-color: #c4dcbe; color: #2f5f27; }
.toggle:disabled { opacity: .6; }
.category-list { display: grid; gap: 8px; }
.category-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px 36px 36px 60px; gap: 8px; align-items: center; }
.category-add { display: flex; gap: 8px; margin-top: 6px; }
.danger-btn { color: var(--error); border-color: #e7c4c0; }
.danger-btn:hover { background: #f8e9e7; color: var(--error); }
.slug-row { display: flex; align-items: center; gap: 4px; }
.narrow-field { max-width: 180px; }
.image-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.image-tile { position: relative; margin: 0; width: 120px; }
.image-tile img { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.image-tile figcaption { position: absolute; top: 6px; left: 6px; }
.image-tile-actions { display: flex; justify-content: center; gap: 4px; margin-top: 6px; }
.image-tile-actions .rail-btn { width: 30px; height: 30px; font-size: 1rem; }
.variant-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 8px; }
@media (max-width: 860px) {
  .variant-row { grid-template-columns: 1fr; }
  .category-row { grid-template-columns: minmax(0, 1fr) 36px 36px 60px; }
  .category-row > span { display: none; }
  .admin-toolbar .btn { margin-left: 0; }
}

/* toasts */
.toasts { pointer-events: none; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(420px, 100% - 32px); }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 8px; opacity: 0; transform: translateY(10px); transition: all .25s; box-shadow: 0 6px 20px rgba(0, 0, 0, .15); }
.toast.show { opacity: 1; transform: none; }
.toast-success { background: var(--olive-dark); }
.toast-error { background: var(--error); }

/* ---------- design templates: structural details ---------- */

/* Studio: hairlines instead of fills, quiet chrome */
[data-theme="studio"] .site-header { border-bottom-color: var(--ink); }
[data-theme="studio"] .hero-copy h1 { font-size: clamp(2.2rem, 4vw, 3.6rem); line-height: 1; }
[data-theme="studio"] .card-add { border-color: var(--ink); }
[data-theme="studio"] .panel, [data-theme="studio"] .how, [data-theme="studio"] .spotlight { border-color: var(--ink); }
[data-theme="studio"] .usp { border-color: var(--ink); }
[data-theme="studio"] .hero-tile:first-of-type .hero-tile-text strong { color: var(--on-dark); text-decoration: underline; text-decoration-color: var(--ochre); text-decoration-thickness: 3px; text-underline-offset: 6px; }

/* Maison: spaced small-caps style controls, centred editorial headings */
[data-theme="maison"] .btn, [data-theme="maison"] .cart-btn, [data-theme="maison"] .card-add,
[data-theme="maison"] .cat-link, [data-theme="maison"] .chip { text-transform: uppercase; letter-spacing: .14em; font-size: .76rem; }
[data-theme="maison"] .logo { font-size: 1.9rem; letter-spacing: .02em; }
[data-theme="maison"] .hero-copy h1 { font-style: italic; }
[data-theme="maison"] .section-head { justify-content: center; flex-direction: column; align-items: center; text-align: center; }
[data-theme="maison"] .section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
[data-theme="maison"] .card-body { text-align: center; align-items: center; }
[data-theme="maison"] .card-add { align-self: center; }

/* Market: chunky outlines and offset shadows */
[data-theme="market"] .card-media, [data-theme="market"] .hero-main, [data-theme="market"] .hero-tile,
[data-theme="market"] .cat-tile, [data-theme="market"] .spotlight, [data-theme="market"] .how, [data-theme="market"] .panel,
[data-theme="market"] .table-wrap, [data-theme="market"] .gallery img#main-img {
  border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
}
[data-theme="market"] .btn, [data-theme="market"] .cart-btn, [data-theme="market"] .card-add, [data-theme="market"] .chip {
  border: 2px solid var(--ink); font-weight: 700; box-shadow: 3px 3px 0 var(--ink); transition: transform .1s, box-shadow .1s;
}
[data-theme="market"] .btn:hover, [data-theme="market"] .cart-btn:hover, [data-theme="market"] .card-add:hover {
  transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink);
}
[data-theme="market"] .btn-outline-light, [data-theme="market"] .btn-light { box-shadow: 3px 3px 0 #000; }
[data-theme="market"] .site-header { border-bottom: 2px solid var(--ink); }
[data-theme="market"] .header-search > button { border-width: 2px; }
[data-theme="market"] .tag { border: 2px solid var(--ink); }
[data-theme="market"] .usp { border-width: 2px; border-color: var(--ink); }

/* Midnight: glow on primary actions, softer image edges */
[data-theme="midnight"] .site-header { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); }
[data-theme="midnight"] .btn-primary, [data-theme="midnight"] .cart-btn { box-shadow: 0 6px 20px color-mix(in srgb, var(--olive) 35%, transparent); }
[data-theme="midnight"] .card-media img, [data-theme="midnight"] .gallery img#main-img { opacity: .94; }
[data-theme="midnight"] .hero-main { background: radial-gradient(120% 120% at 0% 0%, #1b2a40 0%, var(--moss) 60%); }

/* responsive */
@media (max-width: 1100px) {
  .header-inner { gap: 20px; }
  .nav-icon span:not(.count) { display: none; }
  .rail-track { grid-auto-columns: calc((100% - 3 * 20px) / 4); }
  .hero-copy { padding-left: 36px; }
}
@media (max-width: 860px) {
  .product, .two-col, .two-col.even { grid-template-columns: 1fr; gap: 24px; }
  .two-col > aside.panel { position: static; }

  .announce-inner { justify-content: center; }
  .announce-inner span:not(:first-child) { display: none; }
  .header-inner { grid-template-columns: 1fr auto; grid-template-areas: 'logo nav' 'search search'; height: auto; padding: 10px 0; gap: 10px 16px; }
  .logo { grid-area: logo; }
  .header-nav { grid-area: nav; gap: 14px; }
  .header-search { grid-area: search; max-width: none; }
  .cat-nav-inner { overflow-x: auto; scrollbar-width: none; }
  .cat-link { white-space: nowrap; padding: 9px 12px; }
  .mega { display: none !important; }

  .home-hero { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .hero-main { grid-column: 1 / -1; grid-row: auto; grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding: 32px 28px 8px; }
  .hero-stack { min-height: 260px; }
  .stack-0 { width: 46%; left: 8%; top: 8%; }
  .stack-1 { width: 32%; right: 12%; top: 4%; }
  .stack-2 { width: 30%; right: 18%; bottom: 6%; }
  .hero-tile { aspect-ratio: 1; }
  .usp { grid-template-columns: repeat(2, 1fr); }
  .cat-tiles { grid-template-columns: repeat(5, 42%); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .cat-tile { scroll-snap-align: start; }
  .rail-track { grid-auto-columns: 38%; }
  .spotlight { grid-template-columns: 1fr; }
  .spot-body { padding: 28px; }
  .steps { grid-template-columns: repeat(2, 1fr); }

  .shop-layout { grid-template-columns: 1fr; gap: 12px; }
  .filters { position: static; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0 16px; }
  .filters summary { display: block; padding: 12px 0; font-weight: 600; cursor: pointer; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .settings-grid, .color-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .logo { font-size: 1.3rem; }
  .cart-btn { padding: 8px 12px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .shop-tools select { flex: 0 0 auto; }
  .shop-tools input { min-width: 0; }
  .shop-tools { width: 100%; }
  .shop-tools input { flex: 1; width: auto; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .chip { white-space: nowrap; }
  .order-row { grid-template-columns: 1fr auto; }
  .row { grid-template-columns: 1fr; }
  .rail-track { grid-auto-columns: 46%; gap: 12px; }
  .rail-btn { display: none; }
  .home-hero { gap: 10px; }
  .hero-tile-text { padding: 30px 12px 12px; }
  .hero-tile-text strong { font-size: 1.1rem; }
  .usp { gap: 14px 10px; padding: 18px 0; }
  .usp svg { width: 22px; height: 22px; }
  .steps { grid-template-columns: 1fr; }
  .how { padding: 24px; }
  .shop-toolbar { flex-direction: column; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
