/* Consuvino · mobile-first, no framework. The palette is the first block of :root and the brand's
   own rules are at the end of the file; nothing in between names a brand colour. */
:root {
    /* The brand. A copy of the app for another brand changes this block (and the logos). */
    --brand: #441070;           /* the purple of the logo's bottle: top bar, admin menu, login, banners */
    --brand-deep: #2e0b4d;      /* the same purple, darker: headings, the admin bar */
    --on-brand: #ffffff;
    --on-brand-soft: rgba(255, 255, 255, 0.15);
    --action: #8c1c2e;          /* primary buttons: red wine */
    --action-hover: #6e1423;
    --on-action: #ffffff;
    --link: #004877;            /* the navy of the logo's wordmark */
    --brand-soft: #f0e9f5;
    --brand-soft-ink: #441070;
    --accent: #e2bd62;          /* champagne gold: promos, counters, the active admin tab */
    --accent-ink: #2e0b4d;
    --panel: #004877;           /* promo slides: the navy of the wordmark */
    --panel-deep: #002f4f;
    --panel-shade: 0, 40, 66;
    --focus: rgba(68, 16, 112, 0.35);
    --ink: #1b2430;
    --muted: #5b6472;
    --line: #e6dfe2;
    --bg: #f7f4f2;
    --card: #ffffff;
    --ok: #1f8a4c;
    --ok-soft: #e3f4ea;
    --warn: #b7791f;
    --warn-soft: #fbf1dc;
    --danger: #c0392b;
    --danger-soft: #fbe5e2;
    --radius: 14px;
    --shadow: 0 6px 20px rgba(27, 36, 48, 0.08);
    --font: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-head: "Montserrat", "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;   /* headings, buttons, labels */
    --tabbar: 4.25rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
}
body.app { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5rem; font-weight: 800; }
h1, h2, h3, legend, th, .btn, .field label, .badge, .acc-title, .tab-btn, .tabbar .tab, .admin-nav a, .topbar .brand, .admin-top .brand { font-family: var(--font-head); }
h1 { font-size: clamp(1.5rem, 5vw, 2.1rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--link); }
img { max-width: 100%; height: auto; }
small, .small { font-size: 0.875rem; }
.text-muted { color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 0.75rem; align-items: center; justify-content: space-between; }
.grid-2 { display: grid; gap: 0.75rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout */
.wrap { width: 100%; max-width: 44rem; margin: 0 auto; padding: 1rem; }
.wrap-wide { max-width: 72rem; }
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding: 0.6rem 1rem; background: var(--brand); color: var(--on-brand);
    padding-top: calc(0.6rem + env(safe-area-inset-top));
}
.topbar .brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--on-brand); text-decoration: none; font-weight: 800; font-size: 1.1rem; }
.topbar-public { justify-content: center; padding: 1rem; }
.topbar-shop { font-size: 0.85rem; opacity: 0.9; text-align: right; }
.footer { padding: 1.5rem 1rem 2rem; text-align: center; color: var(--muted); font-size: 0.85rem; }
.footer-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 0.5rem; }
.footer .by { font-family: ui-monospace, Menlo, monospace; opacity: 0.7; }

/* Tab bar (customer app) */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: flex; background: var(--card); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom); height: calc(var(--tabbar) + env(safe-area-inset-bottom));
}
.tabbar .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
    color: var(--muted); text-decoration: none; font-size: 0.72rem; font-weight: 600; min-height: var(--tabbar);
}
.tabbar .tab.is-active { color: var(--link); }
.tabbar .tab .count { position: absolute; margin-left: 1.6rem; margin-top: -1.4rem; background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: 0.7rem; padding: 0 0.4rem; }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem; margin-bottom: 1rem; }
.card-flat { box-shadow: none; border: 1px solid var(--line); }
.card h2:first-child, .card h1:first-child { margin-top: 0; }
.hero { padding: 1rem 0 0.5rem; }
.hero .lead { font-size: 1.05rem; color: var(--muted); }
.hero-points { padding-left: 1.2rem; margin: 0 0 1rem; }
.hero-points li { margin-bottom: 0.35rem; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    min-height: 2.9rem; padding: 0.55rem 1.1rem; border-radius: 999px; border: 2px solid transparent;
    font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.2;
    transition: background 0.15s, transform 0.05s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--action); color: var(--on-action); }
.btn-primary:hover { background: var(--action-hover); }
.btn-secondary { background: var(--accent); color: var(--accent-ink); }
.btn-outline { background: transparent; color: var(--link); border-color: var(--link); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-block { width: 100%; }
.btn-sm { min-height: 2.2rem; padding: 0.3rem 0.8rem; font-size: 0.9rem; }
.btn[disabled], .btn.is-disabled { opacity: 0.5; cursor: not-allowed; }
.btn-wa { background: #25d366; color: #0b2b16; }
.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; }

/* Forms */
.form .field { margin-bottom: 0.9rem; }
.field label, .field legend { display: block; font-weight: 700; margin-bottom: 0.3rem; font-size: 0.95rem; }
.field .hint { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }
.field-error { display: flex; gap: 0.4rem; align-items: flex-start; color: var(--danger); font-size: 0.9rem; margin: 0.35rem 0 0; font-weight: 700; }
.field-error::before { content: "!"; flex: none; width: 1.15rem; height: 1.15rem; margin-top: 0.1rem; border-radius: 50%; background: var(--danger); color: #fff; font-size: 0.75rem; font-weight: 800; line-height: 1.15rem; text-align: center; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"],
input[type="date"], input[type="datetime-local"], input[type="search"], input[type="url"], select, textarea {
    width: 100%; min-height: 2.9rem; padding: 0.55rem 0.8rem; font: inherit; color: var(--ink);
    background: #fff; border: 1.5px solid var(--line); border-radius: 10px;
}
textarea { min-height: 5.5rem; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
/* A field in error: red label, thick red border on a soft red ground, and its message below.
   .has-error goes on the field's wrapper (server: views; browser: js/app.js data-validate). */
.has-error > label, .has-error > legend, .check-field.has-error .check { color: var(--danger); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"],
.has-error input, .has-error select, .has-error textarea {
    border: 2px solid var(--danger); background-color: var(--danger-soft); box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.14);
}
.has-error input:focus, .has-error select:focus, .has-error textarea:focus { outline-color: rgba(192, 57, 43, 0.45); }
.has-error .file-input, .radio-list.has-error, .check-field.has-error .check {
    border: 2px solid var(--danger); border-radius: 10px; background: var(--danger-soft); padding: 0.6rem 0.8rem; box-shadow: none;
}
.has-error input[type="checkbox"], .has-error input[type="radio"] { box-shadow: none; accent-color: var(--danger); }
.radio-list.has-error label { background: #fff; }
.field.has-error, .check-field.has-error, .radio-list.has-error { scroll-margin-top: 5rem; }
.error-summary ul { margin: 0.4rem 0 0; padding-left: 1.2rem; font-weight: 600; }
.error-summary li { margin-bottom: 0.2rem; }
.error-summary a { color: inherit; }
/* What the server kept from an earlier try of the form (photo, password). */
.kept { display: flex; gap: 0.75rem; align-items: center; margin: 0 0 0.5rem; padding: 0.6rem 0.8rem; border-radius: 10px; background: var(--ok-soft); color: var(--ok); font-weight: 700; font-size: 0.95rem; }
.kept img { flex: none; width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: 8px; }
details.change { margin-bottom: 0.9rem; }
details.change > summary { cursor: pointer; font-weight: 700; color: var(--link); padding: 0.3rem 0; }
details.change[open] > summary { margin-bottom: 0.6rem; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 500; }
.check input { width: 1.3rem; height: 1.3rem; margin-top: 0.15rem; flex: none; }
.radio-list { display: grid; gap: 0.5rem; }
.radio-list label { display: flex; gap: 0.6rem; align-items: center; padding: 0.7rem 0.9rem; border: 1.5px solid var(--line); border-radius: 10px; font-weight: 600; }
.radio-list input { width: 1.2rem; height: 1.2rem; }
.form-links { margin-top: 0.75rem; text-align: center; }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
fieldset legend { font-size: 1.05rem; font-weight: 800; margin-bottom: 0.75rem; }
.file-input { padding: 0.5rem 0; }
.honeypot { position: absolute; left: -9999px; }

/* Alerts and badges */
.alert { padding: 0.8rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 600; border: 1px solid transparent; }
.alert-success { background: var(--ok-soft); color: var(--ok); }
.alert-error, .alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-warning { background: var(--warn-soft); color: var(--warn); }
.alert-info { background: var(--brand-soft); color: var(--brand-soft-ink); }
.badge { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: var(--brand-soft); color: var(--brand-soft-ink); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: #e9edf2; color: var(--muted); }
.badge-promo { background: var(--accent); color: var(--accent-ink); }

/* Lists and products */
.list { list-style: none; padding: 0; margin: 0; }
.list > li { display: flex; gap: 0.75rem; align-items: center; padding: 0.75rem 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.product { display: grid; grid-template-columns: 3.5rem 1fr; gap: 0.75rem; align-items: start; }
.product-thumb { width: 3.5rem; height: 3.5rem; border-radius: 10px; background: var(--brand-soft); object-fit: cover; display: grid; place-items: center; color: var(--link); font-weight: 800; font-size: 0.8rem; }
.product-name { font-weight: 700; margin: 0; }
.product-meta { color: var(--muted); font-size: 0.85rem; margin: 0; }
.price { font-weight: 800; }
.price-old { color: var(--muted); text-decoration: line-through; font-weight: 500; margin-right: 0.3rem; }
.price-promo { color: var(--danger); }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button { width: 2.6rem; height: 2.6rem; border: 0; background: var(--brand-soft); color: var(--link); font-size: 1.3rem; font-weight: 800; cursor: pointer; }
.qty input { width: 3.4rem; min-height: 2.6rem; border: 0; text-align: center; font-weight: 700; font-size: 1rem; border-radius: 0; }
.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 0.25rem 0.7rem; font: inherit; font-size: 0.82rem; font-weight: 700; color: var(--link); cursor: pointer; }
.chip:hover, .chip.is-active { background: var(--brand-soft); border-color: var(--link); }
.product-actions { grid-column: 1 / -1; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.product-actions form { display: contents; }
.banner { display: block; border-radius: var(--radius); overflow: hidden; background: var(--brand); color: var(--on-brand); text-decoration: none; margin-bottom: 1rem; }
.upload-preview { display: block; max-width: 14rem; max-height: 10rem; border-radius: 10px; margin-bottom: 0.5rem; object-fit: cover; }
.thumb-inline { float: left; margin-right: 0.6rem; }
.banner img { display: block; width: 100%; aspect-ratio: 2.4 / 1; object-fit: cover; }
.banner-body { padding: 0.8rem 1rem; }
.banner-body h3 { margin: 0; }
.banner-body p { margin: 0; opacity: 0.9; font-size: 0.9rem; }
.banner-placeholder { aspect-ratio: 2.4 / 1; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-deep)); font-size: 2rem; }
.hscroll { display: flex; gap: 0.75rem; overflow-x: auto; padding-bottom: 0.5rem; scroll-snap-type: x mandatory; }
.hscroll > * { flex: 0 0 82%; scroll-snap-align: start; }

/* Order tracker */
.tracker { list-style: none; padding: 0; margin: 0.5rem 0 1rem; display: grid; gap: 0; }
.tracker li { display: grid; grid-template-columns: 1.6rem 1fr; gap: 0.6rem; align-items: start; min-height: 2.4rem; color: var(--muted); font-weight: 600; position: relative; }
.tracker li::before { content: ""; width: 1rem; height: 1rem; border-radius: 50%; border: 3px solid var(--line); background: #fff; margin-top: 0.2rem; }
.tracker li::after { content: ""; position: absolute; left: 0.45rem; top: 1.35rem; bottom: -0.2rem; width: 3px; background: var(--line); }
.tracker li:last-child::after { display: none; }
.tracker li.is-done { color: var(--ink); }
.tracker li.is-done::before { background: var(--ok); border-color: var(--ok); }
.tracker li.is-done::after { background: var(--ok); }
.tracker li.is-current { color: var(--link); }
.tracker li.is-current::before { border-color: var(--link); background: var(--accent); }
.tracker li.is-cancelled { color: var(--danger); }
.tracker li.is-cancelled::before { border-color: var(--danger); background: var(--danger); }
.tracker small { display: block; font-weight: 500; color: var(--muted); }

/* Tables that stack on phones */
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.table .num { text-align: right; white-space: nowrap; }
@media (max-width: 40rem) {
    .table-stack thead { display: none; }
    .table-stack tr { display: block; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
    .table-stack td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: 0.15rem 0; }
    .table-stack td::before { content: attr(data-label); color: var(--muted); font-size: 0.8rem; }
    .table-stack td.num { text-align: right; }
}
.totals { margin-top: 0.75rem; }
.totals div { display: flex; justify-content: space-between; padding: 0.25rem 0; }
.totals .grand { font-size: 1.2rem; font-weight: 800; border-top: 2px solid var(--line); margin-top: 0.3rem; padding-top: 0.5rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-size: 0.85rem; }
.kv dd { margin: 0; font-weight: 600; }

/* Login card */
.card-login { margin-top: 0.5rem; }
.legal h2 { margin-top: 1.25rem; font-size: 1.05rem; }

/* Admin */
body.admin { background: var(--bg); }
.admin-top { background: var(--brand-deep); color: var(--on-brand); padding: 0.6rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.admin-top .brand { color: var(--on-brand); text-decoration: none; font-weight: 800; display: inline-flex; align-items: center; gap: 0.5rem; }
.admin-top .who { font-size: 0.85rem; opacity: 0.9; }
.admin-nav { display: flex; gap: 0.25rem; overflow-x: auto; background: var(--brand); padding: 0.4rem 0.75rem; scrollbar-width: none; }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav a { color: var(--on-brand); text-decoration: none; font-weight: 700; font-size: 0.9rem; padding: 0.45rem 0.75rem; border-radius: 999px; white-space: nowrap; }
.admin-nav a.is-active { background: var(--accent); color: var(--accent-ink); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.stat { background: var(--card); border-radius: var(--radius); padding: 0.9rem; box-shadow: var(--shadow); }
.stat .n { display: block; font-size: 1.6rem; font-weight: 800; color: var(--link); }
.stat .l { color: var(--muted); font-size: 0.85rem; }
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters a { padding: 0.35rem 0.8rem; border-radius: 999px; background: #fff; border: 1.5px solid var(--line); text-decoration: none; font-weight: 700; font-size: 0.85rem; color: var(--muted); }
.filters a.is-active { background: var(--action); border-color: var(--action); color: var(--on-action); }
.bar-chart { display: grid; gap: 0.35rem; }
.bar-chart .bar { display: grid; grid-template-columns: minmax(6rem, 30%) 1fr auto; gap: 0.5rem; align-items: center; font-size: 0.85rem; }
.bar-chart .bar i { display: block; height: 0.9rem; background: var(--brand); border-radius: 4px; min-width: 2px; }
.bar-chart .bar b { white-space: nowrap; }
.login-shell { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-deep)); padding: 1rem; }
.login-shell .card { width: min(26rem, 100%); }

@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
@media print { .tabbar, .topbar, .admin-nav, .btn, .footer { display: none !important; } body.app { padding: 0; } }

/* No inline styles anywhere (the CSP forbids them): helpers for the few dynamic cases. */
.grow { flex: 1; min-width: 0; }
.list-cards { display: grid; gap: 0.75rem; }
.upper { text-transform: uppercase; }
.btn-light { background: var(--on-brand-soft); color: var(--on-brand); }
.bar-chart .bar i.w0 { width: 1%; } .bar-chart .bar i.w5 { width: 5%; } .bar-chart .bar i.w10 { width: 10%; } .bar-chart .bar i.w15 { width: 15%; }
.bar-chart .bar i.w20 { width: 20%; } .bar-chart .bar i.w25 { width: 25%; } .bar-chart .bar i.w30 { width: 30%; } .bar-chart .bar i.w35 { width: 35%; }
.bar-chart .bar i.w40 { width: 40%; } .bar-chart .bar i.w45 { width: 45%; } .bar-chart .bar i.w50 { width: 50%; } .bar-chart .bar i.w55 { width: 55%; }
.bar-chart .bar i.w60 { width: 60%; } .bar-chart .bar i.w65 { width: 65%; } .bar-chart .bar i.w70 { width: 70%; } .bar-chart .bar i.w75 { width: 75%; }
.bar-chart .bar i.w80 { width: 80%; } .bar-chart .bar i.w85 { width: 85%; } .bar-chart .bar i.w90 { width: 90%; } .bar-chart .bar i.w95 { width: 95%; } .bar-chart .bar i.w100 { width: 100%; }

/* ================= Components: tabs, accordions, slider, toast, progress ================= */
[hidden] { display: none !important; }
body.app h1 { font-size: 1.45rem; margin-bottom: 0.75rem; }
.card { box-shadow: 0 1px 2px rgba(27, 36, 48, 0.06), 0 4px 14px rgba(27, 36, 48, 0.05); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin: 1.25rem 0 0.6rem; }
.section-title h2 { margin: 0; font-size: 1.05rem; }
.section-title a { font-size: 0.9rem; font-weight: 700; text-decoration: none; }

/* Tabs */
.tabs-list { display: flex; gap: 0.15rem; overflow-x: auto; scrollbar-width: none; border-bottom: 2px solid var(--line); margin: 0 0 1rem; }
.tabs-list::-webkit-scrollbar { display: none; }
.tab-btn { flex: 0 0 auto; border: 0; background: none; font: inherit; font-weight: 700; font-size: 0.95rem; color: var(--muted); padding: 0.7rem 0.85rem; border-bottom: 3px solid transparent; margin-bottom: -2px; cursor: pointer; white-space: nowrap; text-decoration: none; min-height: 2.9rem; display: inline-flex; align-items: center; gap: 0.35rem; }
.tab-btn[aria-selected="true"], .tab-btn.is-active { color: var(--link); border-bottom-color: var(--link); }
.tab-count { background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: 0.72rem; padding: 0.05rem 0.45rem; }
.no-js .tabs-list[role="tablist"] { display: none; }
.js .tab-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.no-js .tab-panel { margin-bottom: 1.5rem; }

/* Accordions (native <details>) */
details.acc { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(27, 36, 48, 0.06), 0 4px 14px rgba(27, 36, 48, 0.05); margin-bottom: 0.75rem; overflow: hidden; }
details.acc > summary { list-style: none; display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1.1rem; font-weight: 800; cursor: pointer; min-height: 3.25rem; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: ""; flex: none; width: 0.55rem; height: 0.55rem; border-right: 2.5px solid var(--muted); border-bottom: 2.5px solid var(--muted); transform: rotate(45deg); transition: transform 0.15s; margin-left: 0.25rem; }
details.acc[open] > summary::after { transform: rotate(-135deg); }
.acc-title { flex: 1; min-width: 0; }
.acc-meta { font-weight: 600; color: var(--muted); font-size: 0.85rem; text-align: right; }
.acc-body { padding: 0 1.1rem 1.1rem; }
.card details.acc, details.acc details.acc { box-shadow: none; border: 1px solid var(--line); }
.acc-steps { counter-reset: step; }
.acc-steps > details.acc > summary::before { counter-increment: step; content: counter(step); flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--brand-soft); color: var(--link); display: grid; place-items: center; font-size: 0.85rem; }
.acc-steps > details.acc[open] > summary::before { background: var(--action); color: var(--on-action); }
.acc-steps > details.acc.has-problem > summary::before { background: var(--danger); color: #fff; }
.no-js [data-acc-next] { display: none; }
details.acc fieldset legend.visually-hidden + * { margin-top: 0; }

/* Promo slider */
.slider { position: relative; margin: 0 -1rem 1rem; }
.slider-track { display: flex; gap: 0.75rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 0 1rem; scroll-padding: 0 1rem; -webkit-overflow-scrolling: touch; }
.slider-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; position: relative; min-height: 11.5rem; border-radius: var(--radius); overflow: hidden; display: grid; align-items: end; color: #fff; background: linear-gradient(135deg, var(--panel), var(--panel-deep) 70%); }
.slide-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide.has-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(var(--panel-shade), 0.05) 20%, rgba(var(--panel-shade), 0.88)); }
.slide-off { position: absolute; top: 0.75rem; right: 0.75rem; z-index: 2; background: var(--accent); color: var(--accent-ink); font-weight: 800; border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.95rem; }
.slide-body { position: relative; z-index: 1; padding: 1rem; }
.slide-body h3 { margin: 0 0 0.15rem; font-size: 1.15rem; }
.slide-body p { margin: 0; font-size: 0.9rem; opacity: 0.95; }
.slide-price { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.slide-price s { font-size: 0.95rem; font-weight: 500; opacity: 0.8; margin-left: 0.35rem; }
.slide-actions { display: flex; gap: 0.5rem; margin-top: 0.7rem; flex-wrap: wrap; align-items: center; }
.slide-actions form { display: contents; }
.slide-actions .btn-outline { color: #fff; border-color: rgba(255, 255, 255, 0.7); }
.slider-dots { display: flex; justify-content: center; gap: 0.4rem; margin-top: 0.6rem; }
.slider-dots button { width: 0.55rem; height: 0.55rem; border-radius: 999px; border: 0; padding: 0; background: #c5cfdc; cursor: pointer; transition: width 0.2s, background 0.2s; }
.slider-dots button.is-active { width: 1.4rem; background: var(--link); }
.slider-arrow { display: none; position: absolute; top: 40%; z-index: 3; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.92); color: var(--link); font-size: 1.2rem; font-weight: 800; cursor: pointer; box-shadow: var(--shadow); }
.slider-arrow[data-dir="-1"] { left: 1.4rem; }
.slider-arrow[data-dir="1"] { right: 1.4rem; }
@media (hover: hover) and (min-width: 40rem) { .js .slider-arrow { display: block; } }

/* Order progress (horizontal) */
.progress { list-style: none; display: flex; padding: 0; margin: 0.75rem 0 0.4rem; }
.progress li { flex: 1; position: relative; height: 1rem; }
.progress li::before { content: ""; position: absolute; left: 50%; top: 50%; width: 0.8rem; height: 0.8rem; margin: -0.4rem 0 0 -0.4rem; border-radius: 50%; background: #fff; border: 2.5px solid var(--line); z-index: 1; box-sizing: border-box; }
.progress li::after { content: ""; position: absolute; left: 50%; right: -50%; top: 50%; height: 3px; margin-top: -1.5px; background: var(--line); }
.progress li:last-child::after { display: none; }
.progress li.is-done::before { background: var(--ok); border-color: var(--ok); }
.progress li.is-done::after { background: var(--ok); }
.progress li.is-current::before { background: var(--accent); border-color: var(--link); width: 1.1rem; height: 1.1rem; margin: -0.55rem 0 0 -0.55rem; }
.progress li.is-cancelled::before { background: var(--danger); border-color: var(--danger); }
.progress-label { font-weight: 800; color: var(--link); margin: 0; }
.progress-label.is-cancelled { color: var(--danger); }
.progress-label small { font-weight: 500; color: var(--muted); }

/* Product cards */
.pcard { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); padding: 0.85rem; display: grid; grid-template-columns: 3.25rem 1fr auto; gap: 0.2rem 0.75rem; align-items: start; }
.pcard.is-promo { border-color: var(--accent); }
.pcard .product-thumb { width: 3.25rem; height: 3.25rem; }
.pcard-buy { grid-column: 1 / -1; display: flex; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.pcard-buy .btn { flex: 1; }
.pcard-chips { grid-column: 1 / -1; display: flex; gap: 0.35rem; margin-top: 0.45rem; }
.pcard-chips .chip { flex: 1; padding: 0.35rem 0.3rem; text-align: center; }
.fav-btn { border: 0; background: none; font-size: 1.45rem; line-height: 1; color: #b9c2cf; cursor: pointer; width: 2.4rem; height: 2.4rem; border-radius: 50%; }
.fav-btn[aria-pressed="true"] { color: var(--accent); }
.in-cart { display: inline-block; margin-top: 0.15rem; font-size: 0.8rem; font-weight: 700; color: var(--ok); }
.brand-heading { margin: 1.1rem 0 0.5rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0.75rem -1rem 0.5rem; padding: 0 1rem; }
.filters::-webkit-scrollbar { display: none; }
.filters a { flex: 0 0 auto; }
.wrap-wide .filters { margin-left: 0; margin-right: 0; padding: 0; }
.searchbar { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: 0.5rem 0; margin: -0.5rem 0 0; }
.hello { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.hello h1 { margin: 0; }
.hello p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.mini-card { display: flex; align-items: center; gap: 0.75rem; }
.sticky-actions { position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 0.5rem); z-index: 5; background: var(--card); border-radius: 999px; box-shadow: var(--shadow); padding: 0.4rem; display: flex; gap: 0.4rem; }
.sticky-actions .btn { flex: 1; }
body.admin .sticky-actions { bottom: 0.75rem; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 0.9rem); transform: translate(-50%, 0.5rem); background: var(--ink); color: #fff; padding: 0.65rem 1.1rem; border-radius: 999px; font-weight: 700; font-size: 0.92rem; z-index: 60; box-shadow: var(--shadow); max-width: 92vw; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--danger); }
body.admin .toast { bottom: 1rem; }
@media (prefers-reduced-motion: reduce) { .toast, .slider-dots button, details.acc > summary::after { transition: none; } }
.list.list-cards > li { border-top: 0; }
.list.list-cards > li.pcard { display: grid; padding: 0.85rem; }
.list.list-cards > li.brand-heading { display: block; padding: 0; }
.list.list-cards > li.brand-heading:first-child { margin-top: 0.25rem; }
a.card { display: block; color: inherit; text-decoration: none; }
.order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.order-head h1 { margin: 0; }
.profile { display: flex; align-items: center; gap: 0.85rem; }
.profile img, .profile .product-thumb { width: 3.5rem; height: 3.5rem; border-radius: 50%; object-fit: cover; flex: none; }
body.admin h1 { font-size: 1.4rem; }
body.admin h1 small { font-size: 1rem; font-weight: 600; }
details.acc > summary::after { margin-top: -0.25rem; }
details.acc[open] > summary::after { margin-top: 0.25rem; }

/* ---- Consuvino ----
   Colours from the logo (purple #441070, navy #004877) plus two wine colours that are not in it:
   red wine #8c1c2e for buttons and champagne gold #e2bd62 for accents. Type as on their site: Montserrat for titles and buttons, Open Sans for text. */
@font-face { font-family: "Montserrat"; src: url("/fonts/montserrat.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("/fonts/open-sans.woff2") format("woff2"); font-weight: 300 800; font-style: normal; font-display: swap; }
.topbar .brand img, .admin-top .brand img { display: block; }
h1, h2, h3 { color: var(--brand-deep); letter-spacing: -0.01em; }
.slide h1, .slide h2, .slide h3, .banner h2, .login-shell h1 { color: inherit; }
