/* ShopEase design system. Mobile-first; breakpoints 48rem (tablet) and 64rem (desktop).
   No inline styles anywhere (CSP style-src 'self'): every visual lives here. */

:root {
  /* Colour: teal brand, marigold accent, warm neutrals. Text pairs meet WCAG AA. */
  --c-brand: #0f6e5c;
  --c-brand-strong: #0a5446;
  --c-brand-tint: #e3f1ed;
  --c-accent: #f4a623;
  --c-accent-strong: #d98b06;
  --c-on-brand: #ffffff;   /* text on brand-coloured surfaces (header, buttons) */
  --c-on-accent: #1b1f24;  /* text on accent-coloured surfaces */
  --c-badge: #c2410c;       /* sale corner ribbon (theme: badge colour) */
  --c-on-badge: #ffffff;
  --c-plum: #5b2a6e;
  --c-ink: #1b1f24;
  --c-muted: #555e69;
  --c-canvas: #f7f5f0;
  --c-surface: #ffffff;
  --c-line: #e2ded4;
  --c-success: #067647;
  --c-danger: #b42318;
  --c-warning: #8a4b00;
  --c-warning-tint: #fff4dc;
  --c-focus: #1d4ed8;

  /* Space (4px base) */
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem; --s-7: 2.5rem; --s-8: 3.5rem;

  /* Type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --t-xs: .75rem; --t-sm: .875rem; --t-md: 1rem; --t-lg: 1.125rem; --t-xl: 1.375rem; --t-2xl: 1.75rem; --t-3xl: 2.25rem;

  --radius-sm: 6px; --radius: 10px; --radius-lg: 16px; --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgb(27 31 36 / .06);
  --shadow: 0 2px 8px rgb(27 31 36 / .08), 0 1px 2px rgb(27 31 36 / .06);
  --container: 80rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: var(--t-md); line-height: 1.55;
  color: var(--c-ink); background: var(--c-canvas);
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
svg[aria-hidden="true"] { width: 1.25em; height: 1.25em; vertical-align: -.2em; flex: none; } /* icons */
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; margin: 0 0 var(--s-3); }
h1 { font-size: var(--t-2xl); }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-lg); }
p { margin: 0 0 var(--s-4); }
a { color: var(--c-brand); text-underline-offset: 2px; }
a:hover { color: var(--c-brand-strong); }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; border-radius: 2px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s-4); }
.stack > * + * { margin-top: var(--s-4); }
.muted { color: var(--c-muted); }
.small { font-size: var(--t-sm); }

/* Skip link */
.skip-link { position: absolute; left: var(--s-2); top: -4rem; z-index: 100; background: var(--c-surface);
  padding: var(--s-2) var(--s-3); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.skip-link:focus { top: var(--s-2); }

/* ---------- Buttons & form controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
  padding: .7rem 1.2rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--c-brand); color: var(--c-on-brand); min-height: 2.75rem;
}
.btn:hover { background: var(--c-brand-strong); color: var(--c-on-brand); }
.btn-accent { background: var(--c-accent); color: var(--c-on-accent); }
.btn-accent:hover { background: var(--c-accent-strong); color: var(--c-on-accent); }
.btn-outline { background: var(--c-surface); color: var(--c-brand); border-color: var(--c-brand); }
.btn-outline:hover { background: var(--c-brand-tint); color: var(--c-brand-strong); }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .65; cursor: progress; }
.btn-link { font: inherit; color: var(--c-brand); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

label { font-weight: 600; font-size: var(--t-sm); }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="tel"], input[type="url"], input[type="datetime-local"], select, textarea {
  font: inherit; width: 100%; padding: .6rem .75rem; min-height: 2.75rem;
  border: 1px solid #9aa2ab; border-radius: var(--radius-sm); background: var(--c-surface); color: var(--c-ink);
}
input:focus-visible, select:focus-visible { border-color: var(--c-focus); }
.field { display: flex; flex-direction: column; gap: var(--s-1); margin-bottom: var(--s-4); }
.field-row { display: flex; gap: var(--s-3); }
.field-row > * { flex: 1; }
.check { display: flex; align-items: flex-start; gap: var(--s-2); margin-bottom: var(--s-4); font-weight: 400; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: .2rem; accent-color: var(--c-brand); }
.field-error, .validation-summary-errors, .form-errors { color: var(--c-danger); font-size: var(--t-sm); }
.form-errors ul, .validation-summary-errors ul { margin: 0 0 var(--s-4); padding-left: 1.25rem; }
.validation-summary-valid { display: none; }
.input-validation-error { border-color: var(--c-danger) !important; }

/* Notices */
.notice { padding: var(--s-3) var(--s-4); border-radius: var(--radius-sm); margin-bottom: var(--s-4); border: 1px solid; }
.notice-success { background: #ecfdf3; border-color: #abefc6; color: var(--c-success); }
.notice-error { background: #fef3f2; border-color: #fecdca; color: var(--c-danger); }
.notice-info { background: var(--c-brand-tint); border-color: #b6dcd2; color: var(--c-brand-strong); }
/* A top-of-page message shown as a toast when the page kept its scroll position after a save (site.js). */
.flash-toast { position: fixed; z-index: 1000; left: 50%; bottom: var(--s-4); transform: translateX(-50%); width: max-content;
  max-width: calc(100vw - 2rem); margin: 0; box-shadow: var(--shadow); cursor: pointer; }
@media (prefers-reduced-motion: no-preference) {
  .flash-toast { animation: flash-in .2s ease-out; }
  @keyframes flash-in { from { opacity: 0; transform: translate(-50%, .5rem); } }
}

/* ---------- Header ---------- */
.site-header { position: relative; background: var(--c-brand); color: var(--c-on-brand); }
.header-bar {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "brand . actions" "search search search";
  align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4);
}
.brand { grid-area: brand; display: inline-flex; align-items: center; gap: var(--s-2); color: var(--c-on-brand); text-decoration: none; }
.brand:hover { color: var(--c-on-brand); }
.brand-mark { width: 2rem; height: 2rem; flex: none; }
.brand-name { font-size: var(--t-xl); font-weight: 800; letter-spacing: -.02em; }
.brand-name span { color: var(--c-accent); }
.header-search { grid-area: search; display: flex; }
.header-search input {
  border: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); min-height: 2.75rem;
}
.header-search button {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 0 var(--s-4);
}
.header-actions { grid-area: actions; display: flex; align-items: center; gap: var(--s-1); }
.header-link {
  color: var(--c-on-brand); text-decoration: none; font-size: var(--t-sm); font-weight: 600;
  display: inline-flex; align-items: center; gap: var(--s-1); padding: var(--s-2); border-radius: var(--radius-sm); min-height: 2.75rem;
}
.header-link:hover { color: var(--c-on-brand); background: color-mix(in srgb, var(--c-on-brand) 12%, transparent); }
.header-link svg { width: 1.35rem; height: 1.35rem; }
.header-link .label { display: none; }
.menu-toggle { background: none; border: 1px solid color-mix(in srgb, var(--c-on-brand) 50%, transparent); color: var(--c-on-brand); }

.category-nav { background: var(--c-surface); border-bottom: 1px solid var(--c-line); }
.category-nav > ul { list-style: none; margin: 0; padding: var(--s-2) var(--s-4); display: flex; flex-direction: column; }
.category-nav a { display: block; padding: var(--s-2) var(--s-1); color: var(--c-ink); text-decoration: none; font-weight: 600; font-size: var(--t-sm); }
.category-nav a:hover, .category-nav a[aria-current="page"] { color: var(--c-brand); }
.category-nav .sub { list-style: none; padding-left: var(--s-4); margin: 0; }
.category-nav .sub a { font-weight: 400; }
/* JS collapses the nav on small screens; without JS it simply stays open. */
.js .category-nav:not(.is-open) { display: none; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-1); padding: 0; margin: var(--s-4) 0; font-size: var(--t-sm); }
.breadcrumbs li + li::before { content: "›"; color: var(--c-muted); margin-right: var(--s-1); }
.breadcrumbs [aria-current="page"] { color: var(--c-muted); }

/* ---------- Sections ---------- */
.section { margin: var(--s-6) 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.section-head h2 { margin: 0; }
.panel { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: var(--s-5); box-shadow: var(--shadow-sm); }

/* ---------- Banners ---------- */
.banner {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: var(--s-6) var(--s-5);
  color: #fff; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-3); min-height: 11rem;
}
.banner h2 { font-size: var(--t-2xl); margin: 0; max-width: 22ch; }
.banner p { margin: 0; max-width: 40ch; opacity: .95; }
.banner::after { /* decorative rangoli-inspired rings */
  content: ""; position: absolute; right: -3rem; bottom: -3rem; width: 12rem; height: 12rem; border-radius: 50%;
  border: 1.5rem solid rgb(255 255 255 / .12); box-shadow: 0 0 0 1.5rem rgb(255 255 255 / .06);
}
.banner-teal { background: linear-gradient(135deg, var(--c-brand) 0%, #13896f 100%); }
.banner-marigold { background: linear-gradient(135deg, #f4a623 0%, #f6c35b 100%); color: var(--c-ink); }
.banner-marigold::after { border-color: rgb(27 31 36 / .08); box-shadow: 0 0 0 1.5rem rgb(27 31 36 / .04); }
.banner-plum { background: linear-gradient(135deg, var(--c-plum) 0%, #7d3f94 100%); }
.banner .btn { position: relative; z-index: 1; }
.banner-teal .btn, .banner-plum .btn { background: var(--c-accent); color: var(--c-ink); }
.banner-marigold .btn { background: var(--c-ink); color: #fff; }

/* ---------- Category tiles & chips ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); list-style: none; padding: 0; margin: 0; }
.tile {
  display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4); height: 100%;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius);
  text-decoration: none; color: var(--c-ink); box-shadow: var(--shadow-sm);
}
.tile:hover { border-color: var(--c-brand); color: var(--c-ink); }
.tile-icon {
  flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--c-brand-tint); color: var(--c-brand-strong); font-weight: 800; font-size: var(--t-lg);
}
.tile strong { display: block; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; padding: 0; margin: 0 0 var(--s-4); }
.chip {
  display: inline-flex; align-items: center; min-height: 2.5rem; padding: var(--s-1) var(--s-4);
  border: 1px solid var(--c-line); background: var(--c-surface); border-radius: var(--radius-pill);
  color: var(--c-ink); text-decoration: none; font-size: var(--t-sm); font-weight: 600;
}
.chip:hover { border-color: var(--c-brand); color: var(--c-brand); }
.chip[aria-current="true"] { border-color: var(--c-brand); background: var(--c-brand-tint); color: var(--c-brand-strong); }
.chip.is-unavailable { color: var(--c-muted); text-decoration: line-through; }

/* ---------- Product cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); list-style: none; padding: 0; margin: 0; }
.card {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: var(--shadow); }
.card-media { aspect-ratio: 1 / 1; background: var(--c-canvas); display: grid; place-items: center; }
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: var(--s-3); }
.placeholder {
  width: 100%; height: 100%; display: grid; place-items: center; font-size: 2.5rem; font-weight: 800;
  color: var(--c-brand); background: radial-gradient(circle at 30% 30%, var(--c-brand-tint), var(--c-canvas) 70%);
}
.card-body { padding: var(--s-3); display: flex; flex-direction: column; gap: var(--s-1); flex: 1; }
.card-brand { font-size: var(--t-xs); color: var(--c-muted); text-transform: uppercase; letter-spacing: .04em; }
.card-title { font-size: var(--t-sm); font-weight: 600; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a { color: var(--c-ink); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.card-title a:focus-visible { outline: none; }
.card:focus-within { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.card-foot { margin-top: auto; padding-top: var(--s-1); }
.card .card-actions { position: relative; z-index: 1; padding: 0 var(--s-3) var(--s-3); }

.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-2); }
.price-now { font-weight: 700; font-size: var(--t-lg); }
.price-mrp { color: var(--c-muted); text-decoration: line-through; font-size: var(--t-sm); }
.price-off { color: var(--c-success); font-weight: 700; font-size: var(--t-sm); }
.price-lg .price-now { font-size: var(--t-3xl); }
.tax-note { font-size: var(--t-xs); color: var(--c-muted); }

.badge { display: inline-block; font-size: var(--t-xs); font-weight: 700; padding: .15rem .5rem; border-radius: var(--radius-pill); }
.badge-out { background: #f2f4f7; color: #475467; }
.badge-low { background: var(--c-warning-tint); color: var(--c-warning); }
.badge-in { background: #ecfdf3; color: var(--c-success); }

/* ---------- Listing ---------- */
.listing { display: grid; gap: var(--s-5); }
.listing-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-5); }
.listing-head h1 { margin: 0; }
.filters .panel { padding: var(--s-4); }
.filters fieldset { border: 0; padding: 0; margin: 0 0 var(--s-4); }
.filters legend { font-weight: 700; margin-bottom: var(--s-2); padding: 0; }
.filters .check { margin-bottom: var(--s-2); }
.filters-toggle { width: 100%; }
.js .filters-body:not(.is-open) { display: none; }
.sort-form { display: flex; align-items: center; gap: var(--s-2); }
.sort-form select { width: auto; }

/* Pager */
.pager ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-1); padding: 0; margin: var(--s-6) 0 0; }
.pager a, .pager span {
  display: inline-grid; place-items: center; min-width: 2.75rem; min-height: 2.75rem; padding: 0 var(--s-3);
  border: 1px solid var(--c-line); border-radius: var(--radius-sm); background: var(--c-surface); text-decoration: none; font-weight: 600;
}
.pager [aria-current="page"] { background: var(--c-brand); color: #fff; border-color: var(--c-brand); }
.pager .gap { border: 0; background: none; }

/* Empty states */
.empty { text-align: center; padding: var(--s-7) var(--s-4); background: var(--c-surface); border: 1px dashed var(--c-line); border-radius: var(--radius); }
.empty svg { width: 4rem; height: 4rem; margin: 0 auto var(--s-3); color: var(--c-brand); }
.empty .chips { justify-content: center; margin-top: var(--s-4); }

/* ---------- Product page ---------- */
.product { display: grid; gap: var(--s-5); }
.gallery-main { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; padding: var(--s-5); }
.thumbs { display: flex; gap: var(--s-2); list-style: none; padding: 0; margin: var(--s-3) 0 0; }
.thumbs a { display: block; width: 4.5rem; height: 4.5rem; border: 2px solid var(--c-line); border-radius: var(--radius-sm); background: var(--c-surface); overflow: hidden; }
.thumbs a[aria-current="true"] { border-color: var(--c-brand); }
.thumbs img { width: 100%; height: 100%; object-fit: contain; padding: var(--s-1); }
.product-info h1 { font-size: var(--t-2xl); }
.product-brand { color: var(--c-muted); font-weight: 600; margin-bottom: var(--s-2); }
.buy-box { display: grid; gap: var(--s-4); }
.delivery-form { display: flex; gap: var(--s-2); }
.delivery-form input { max-width: 10rem; }
.delivery-result { min-height: 1.5rem; margin: var(--s-2) 0 0; font-size: var(--t-sm); }
.delivery-result.is-ok { color: var(--c-success); }
.delivery-result.is-bad { color: var(--c-danger); }
.description { white-space: pre-line; }
.wish-btn[aria-pressed="true"] { background: var(--c-brand-tint); }
.status-line { min-height: 1.25rem; font-size: var(--t-sm); margin: var(--s-2) 0 0; }

/* ---------- Content pages ---------- */
.page-layout { display: grid; gap: var(--s-5); margin: var(--s-5) 0 var(--s-7); }
.prose { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: var(--s-5); }
.prose h2 { margin-top: var(--s-5); }
.prose ul { padding-left: 1.25rem; }
.side-nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.side-nav a { display: block; padding: var(--s-2) var(--s-3); border-radius: var(--radius-sm); text-decoration: none; color: var(--c-ink); background: var(--c-surface); border: 1px solid var(--c-line); font-size: var(--t-sm); }
.side-nav a[aria-current="page"] { border-color: var(--c-brand); color: var(--c-brand-strong); font-weight: 700; }
details.faq { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-sm); margin-bottom: var(--s-2); }
details.faq summary { cursor: pointer; padding: var(--s-3) var(--s-4); font-weight: 600; }
details.faq > div { padding: 0 var(--s-4) var(--s-3); }

/* Auth & account */
.auth { max-width: 28rem; margin: var(--s-6) auto; }
.auth .panel { padding: var(--s-6) var(--s-5); }
.auth-alt { text-align: center; margin-top: var(--s-4); font-size: var(--t-sm); }
.account-grid { display: grid; gap: var(--s-3); list-style: none; padding: 0; }

/* Error pages */
.error-page { text-align: center; max-width: 36rem; margin: var(--s-8) auto; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--c-brand); line-height: 1; margin-bottom: var(--s-3); }
.error-page form { display: flex; gap: var(--s-2); margin: var(--s-5) 0; }

/* ---------- Footer ---------- */
.site-footer { background: #13201d; color: #d6ddd9; margin-top: var(--s-8); font-size: var(--t-sm); }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.footer-grid { display: grid; gap: var(--s-5); padding: var(--s-6) var(--s-4); }
.footer-grid h2 { font-size: var(--t-md); color: #fff; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
.footer-bottom { border-top: 1px solid rgb(255 255 255 / .12); padding: var(--s-4); text-align: center; }
.pay-note { display: inline-flex; gap: var(--s-2); align-items: center; }

/* ---------- Tablet ---------- */
@media (min-width: 48rem) {
  h1 { font-size: var(--t-3xl); }
  .header-bar { grid-template-columns: auto 1fr auto; grid-template-areas: "brand search actions"; padding: var(--s-3) var(--s-5); gap: var(--s-5); }
  .header-link .label { display: inline; }
  .banner:first-child { grid-column: 1 / -1; min-height: 14rem; }
  .banner:first-child h2 { font-size: var(--t-3xl); }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
  .product { grid-template-columns: 1fr 1fr; align-items: start; }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Desktop ---------- */
@media (min-width: 64rem) {
  .menu-toggle { display: none; }
  .js .category-nav:not(.is-open) { display: block; }
  .category-nav > ul { flex-direction: row; flex-wrap: wrap; gap: var(--s-1) var(--s-5); padding: 0 var(--s-5); max-width: var(--container); margin: 0 auto; }
  .category-nav > ul > li { position: relative; }
  .category-nav a { padding: var(--s-3) 0; }
  .category-nav .sub {
    display: none; position: absolute; top: 100%; left: calc(-1 * var(--s-3)); z-index: 20; min-width: 14rem;
    background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: var(--s-2) var(--s-3);
  }
  .category-nav li:hover > .sub, .category-nav li:focus-within > .sub { display: block; }
  .category-nav .sub a { padding: var(--s-2) 0; }
  .banner:first-child { grid-column: 1; grid-row: 1 / span 2; min-height: 18rem; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .listing { grid-template-columns: 16rem 1fr; align-items: start; }
  .filters-toggle { display: none; }
  .js .filters-body:not(.is-open) { display: block; }
  .page-layout { grid-template-columns: 15rem 1fr; align-items: start; }
  .side-nav ul { flex-direction: column; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; padding: var(--s-7) var(--s-5); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Cart, checkout, account (Module 5) ---------- */
.cart-count {
  min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem; border-radius: var(--radius-pill);
  background: var(--c-accent); color: var(--c-ink); font-size: var(--t-xs); font-weight: 800; display: inline-grid; place-items: center;
}
.add-to-cart { display: flex; align-items: flex-end; gap: var(--s-3); }
.add-to-cart .field { margin: 0; width: 6rem; }
.add-to-cart .btn { flex: 1; }
.cart-layout { display: grid; gap: var(--s-5); align-items: start; margin-bottom: var(--s-6); }
.cart-lines { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.cart-line {
  display: grid; grid-template-columns: 5rem 1fr; gap: var(--s-3); background: var(--c-surface);
  border: 1px solid var(--c-line); border-radius: var(--radius); padding: var(--s-3);
}
.cart-line.is-unavailable { opacity: .75; }
.cart-thumb { width: 5rem; height: 5rem; background: var(--c-canvas); border-radius: var(--radius-sm); overflow: hidden; display: grid; place-items: center; }
.cart-thumb img { width: 100%; height: 100%; object-fit: contain; }
.cart-thumb .placeholder { font-size: 1.5rem; }
.cart-name { font-size: var(--t-md); margin: 0; }
.cart-name a { color: var(--c-ink); text-decoration: none; }
.cart-info .price { margin: var(--s-1) 0; }
.cart-info .actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }

.cart-line-total { grid-column: 2; font-weight: 700; margin: 0; }
.cart-summary h2 { font-size: var(--t-lg); }
.totals { margin: 0 0 var(--s-4); display: grid; gap: var(--s-2); }
.totals div { display: flex; justify-content: space-between; gap: var(--s-3); }
.totals dt, .totals dd { margin: 0; }
.totals-discount dd { color: var(--c-success); font-weight: 700; }
.totals-grand { border-top: 1px solid var(--c-line); padding-top: var(--s-2); font-size: var(--t-lg); font-weight: 800; }
.totals-tax { color: var(--c-muted); font-size: var(--t-sm); }
.checkout-items { list-style: none; padding: 0; margin: 0 0 var(--s-3); display: grid; gap: var(--s-2); }
.checkout-items li { display: flex; justify-content: space-between; gap: var(--s-3); }

/* Order progress: a vertical timeline. Done steps get a filled brand dot joined by a solid line; upcoming steps are hollow and grey. */
.timeline { list-style: none; margin: var(--s-3) 0 0; padding: 0; }
.timeline-step { position: relative; padding: 0 0 var(--s-5) var(--s-6); }
.timeline-step:last-child { padding-bottom: 0; }
.timeline-step::before { content: ""; position: absolute; left: 0; top: .2rem; width: 1rem; height: 1rem; border-radius: 50%;
  border: 2px solid var(--c-line); background: var(--c-surface); box-sizing: border-box; }
.timeline-step::after { content: ""; position: absolute; left: calc(.5rem - 1px); top: 1.3rem; bottom: .1rem; width: 2px; background: var(--c-line); }
.timeline-step:last-child::after { display: none; }
.timeline-step.is-done::before { background: var(--c-brand); border-color: var(--c-brand); }
.timeline-step.is-done::after { background: var(--c-brand); }
.timeline-step.is-done:has(+ .is-todo)::after { background: var(--c-line); }
.timeline-step.is-bad::before { background: var(--c-danger); border-color: var(--c-danger); }
.timeline-title { display: block; font-weight: 600; }
.timeline-meta { display: block; font-size: var(--t-sm); color: var(--c-muted); }
.timeline-step.is-todo .timeline-title { font-weight: 400; color: var(--c-muted); }
.address-choices { border: 0; padding: 0; margin: 0 0 var(--s-3); display: grid; gap: var(--s-2); }
.address-choice { display: flex; gap: var(--s-3); align-items: flex-start; font-weight: 400; padding: var(--s-3);
  border: 1px solid var(--c-line); border-radius: var(--radius-sm); cursor: pointer; }
.address-choice:has(input:checked) { border-color: var(--c-brand); background: var(--c-brand-tint); }
.address-choice input { margin-top: .3rem; accent-color: var(--c-brand); }

/* "Free delivery" badge under prices and in the cart drawer. */
.free-delivery-line { margin: var(--s-1) 0 0; }
.free-delivery { display: inline-block; padding: 1px var(--s-2); border-radius: var(--radius-pill); background: #ecfdf3; color: var(--c-success);
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .02em; }

/* Delivery method: two cards, each a submit button; the chosen one is highlighted like a selected address. */
.delivery-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--s-2); margin-bottom: var(--s-3); }
.delivery-method { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: var(--s-3) var(--s-4);
  border: 1px solid var(--c-line); border-radius: var(--radius-sm); background: var(--c-surface); color: var(--c-ink); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.delivery-method:hover { border-color: var(--c-brand); }
.delivery-method[aria-pressed="true"] { border: 2px solid var(--c-brand); background: var(--c-brand-tint); cursor: default; }
.delivery-method-tick { color: var(--c-brand); font-size: var(--t-lg); }
.delivery-message { margin: 0; }
.policy-points { padding-left: 1.1rem; }
.address-grid, .order-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.address-grid .actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.order-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3); }
.order-list h2 { margin: 0; }
.order-meta { display: flex; flex-direction: column; align-items: flex-end; gap: var(--s-1); }
@media (min-width: 48rem) {
  .cart-line { grid-template-columns: 6rem 1fr auto; }
  .cart-thumb { width: 6rem; height: 6rem; }
  .cart-line-total { grid-column: auto; }
  .address-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 64rem) {
  .cart-layout { grid-template-columns: 1fr 22rem; }
  .cart-summary { position: sticky; top: var(--s-4); }
}

.qty-input { width: 5rem; }

.message-list { list-style: none; padding: 0; margin: 0; }
.message-list li { display: flex; flex-wrap: wrap; gap: .25rem .75rem; padding: .75rem 0; border-bottom: 1px solid #eaecf0; }
.message-list strong { flex-basis: 100%; }

/* Focus must stay visible on the dark header and footer (3:1 non-text contrast). */
.site-header :focus-visible, .site-footer :focus-visible { outline-color: #fff; }

/* Cart drawer (native <dialog>, slides in from the right). */
.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; height: 100%; max-height: none; width: min(420px, 100vw); max-width: 100vw;
  border: 0; padding: var(--s-4); background: #fff; box-shadow: -8px 0 24px rgb(0 0 0 / .15); overflow-y: auto; box-sizing: border-box; }
.drawer[open] { display: flex; flex-direction: column; gap: var(--s-3); animation: drawer-in .2s ease-out; }
.drawer::backdrop { background: rgb(0 0 0 / .4); }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .drawer[open] { animation: none; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer-head h2 { margin: 0; font-size: 1.15rem; }
.drawer-close { font-size: 1.75rem; line-height: 1; background: none; border: 0; cursor: pointer; padding: 0 var(--s-2); }
.drawer-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.drawer-lines li { display: grid; grid-template-columns: 64px 1fr; gap: var(--s-3); align-items: start; }
.drawer-lines li > div { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.drawer-lines img, .drawer-lines .placeholder { width: 64px; height: 64px; object-fit: contain; border-radius: var(--radius-sm); }
.drawer-subtotal { display: flex; justify-content: space-between; border-top: 1px solid #eaecf0; padding-top: var(--s-3); margin: 0; }
.drawer-actions { display: grid; gap: var(--s-2); margin-top: auto; }

/* Reviews */
.stars { color: #c47f00; letter-spacing: 1px; }
.rating-summary a { color: inherit; text-decoration: none; }
.rating-summary a:hover { text-decoration: underline; }
.reviews-layout { display: grid; gap: var(--s-5); }
@media (min-width: 48rem) { .reviews-layout { grid-template-columns: 260px 1fr; } }
.reviews-summary { display: grid; gap: var(--s-2); align-content: start; }
.reviews-average { margin: 0; font-size: 1.1rem; }
.rating-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
.rating-bars li { display: grid; grid-template-columns: 3.5rem 1fr 2rem; gap: var(--s-2); align-items: center; font-size: var(--t-sm, .875rem); }
.rating-bars meter { width: 100%; }
.reviews-list { display: grid; gap: var(--s-4); }
.review { border-bottom: 1px solid #eaecf0; padding-bottom: var(--s-4); }
.review p { margin: 0 0 var(--s-2); }
.review-body { white-space: pre-line; }
.verified { color: var(--c-success); font-weight: 600; }
.review-photos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.review-photos img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius-sm); display: block; }
.review-thumb { padding: 0; border: 0; background: none; border-radius: var(--radius-sm); cursor: zoom-in; }

/* Native pop-ups ([popover]): centred card over a dimmed page. Used for the review photo viewer and admin confirmations. */
.photo-pop, .confirm-pop { margin: auto; border: 0; border-radius: var(--radius); padding: 0; background: var(--c-surface); color: var(--c-ink);
  box-shadow: 0 20px 50px rgb(0 0 0 / .3); }
.photo-pop::backdrop, .confirm-pop::backdrop { background: rgb(15 18 22 / .6); }
.confirm-pop { width: min(28rem, calc(100vw - 2rem)); padding: var(--s-5); }
.confirm-pop h2 { font-size: var(--t-lg); margin: 0 0 var(--s-2); }
.confirm-pop .actions { margin-top: var(--s-4); }
.photo-pop:popover-open { width: min(60rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); display: grid; grid-template-columns: 1fr; overflow: auto; }
/* Fixed size whatever the photo's shape, so stepping between photos only swaps the picture. */
.photo-pop-media { position: relative; background: #111; height: min(55vh, 28rem); }
.photo-pop-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.photo-pop-body { padding: var(--s-4) var(--s-5) var(--s-5); overflow: auto; }
.photo-nav, .photo-close { position: absolute; border: 0; border-radius: 50%; width: 2.5rem; height: 2.5rem; font-size: 1.6rem; line-height: 1;
  background: rgb(255 255 255 / .9); color: var(--c-ink); cursor: pointer; box-shadow: var(--shadow); }
.photo-nav { top: 50%; transform: translateY(-50%); }
.photo-prev { left: var(--s-3); }
.photo-next { right: var(--s-3); }
.photo-close { top: var(--s-3); right: var(--s-3); }
.photo-count { position: absolute; bottom: var(--s-3); left: 50%; transform: translateX(-50%); padding: 2px var(--s-2); border-radius: var(--radius-pill);
  background: rgb(0 0 0 / .6); color: #fff; font-size: var(--t-sm); }
@media (min-width: 48rem) {
  .photo-pop:popover-open { grid-template-columns: minmax(0, 3fr) minmax(16rem, 2fr); height: min(85vh, 36rem); }
  .photo-pop-media { height: 100%; }
}
.star-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; border: 0; padding: 0; margin: 0; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 2rem; color: #d0d5dd; cursor: pointer; line-height: 1; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #c47f00; }
.star-input input:focus-visible + label { outline: 3px solid var(--c-focus); outline-offset: 2px; }

/* Quantity stepper: − [n] + */
.qty-stepper { display: inline-flex; align-items: stretch; border: 1px solid #d0d5dd; border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.qty-stepper .qty-step { width: 2.5rem; min-height: 2.5rem; border: 0; background: #f2f4f7; font-size: 1.25rem; line-height: 1; cursor: pointer; color: inherit; }
.qty-stepper .qty-step:hover:not(:disabled) { background: #e4e7ec; }
.qty-stepper .qty-step:disabled { color: #98a2b3; cursor: not-allowed; }
.qty-stepper input[name=quantity] { width: 3.25rem; min-height: 2.5rem; border: 0; border-inline: 1px solid #d0d5dd; border-radius: 0; text-align: center; padding: 0; -moz-appearance: textfield; appearance: textfield; }
.qty-stepper input[name=quantity]::-webkit-outer-spin-button, .qty-stepper input[name=quantity]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-stepper noscript .btn { margin-left: var(--s-2); }
[aria-busy="true"] .qty-stepper { opacity: .6; }
.drawer-line-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-1); }

/* Sales, countdowns and admin-built home sections */
.sale-strip { color: #fff; font-size: var(--t-sm); }
.sale-strip-inner { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); align-items: center; justify-content: center; padding-block: var(--s-2); text-align: center; }
.sale-strip a { color: inherit; font-weight: 700; text-decoration: underline; }
.countdown { display: inline-flex; gap: .4ch; align-items: baseline; }
.countdown-value { font-variant-numeric: tabular-nums; font-weight: 700; }
.countdown-panel { color: #fff; border-radius: var(--radius-lg, 12px); padding: var(--s-6) var(--s-5); margin-block: var(--s-5); text-align: center; }
.countdown-panel h1, .countdown-panel h2 { color: inherit; margin: 0 0 var(--s-2); }
.countdown-big { font-size: 1.5rem; }
.badge-sale { background: #fdecea; color: #b42318; }
.card-media { position: relative; }
.card-media img { transition: opacity .2s; }
.sale-note { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin: 0 0 var(--s-2); font-size: var(--t-sm); }
.text-block { max-width: 60ch; margin-inline: auto; text-align: center; padding-block: var(--s-5); }
.sale-strip.banner-marigold, .countdown-panel.banner-marigold { color: var(--c-ink); }

/* ---------- Home hero slider ---------- */
.hero { position: relative; margin-top: var(--s-4); border-radius: var(--radius-lg); overflow: hidden; background: var(--c-brand); }
.hero-track { display: grid; }
.hero-slide {
  grid-area: 1 / 1; position: relative; display: flex; align-items: center; min-height: clamp(17rem, 40vw, 30rem);
  color: #fff; opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility .7s;
}
.hero-slide.is-active { opacity: 1; visibility: visible; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-slide:has(.hero-img) { color: #fff; }
.hero-slide:has(.hero-img)::before { /* keeps the text readable on any picture */
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgb(10 20 25 / .72) 0%, rgb(10 20 25 / .45) 45%, rgb(10 20 25 / 0) 75%);
}
.hero-content { position: relative; z-index: 2; padding: var(--s-6) clamp(1.25rem, 5vw, 4rem) 4.5rem; max-width: 36rem; display: grid; gap: var(--s-3); justify-items: start; }
.hero-content h2 { font-size: clamp(1.8rem, 4.2vw, 3.2rem); line-height: 1.08; margin: 0; }
.hero-content p { margin: 0; font-size: clamp(1rem, 1.6vw, 1.2rem); opacity: .95; }
.hero-content .btn { background: var(--c-accent); color: var(--c-ink); }
.hero { touch-action: pan-y; }
.hero-progress { position: absolute; z-index: 3; left: clamp(1.25rem, 5vw, 4rem); bottom: var(--s-3); display: flex; gap: .4rem; }
html:not(.js) .hero-progress { display: none; }
.hero-seg { width: 3rem; height: 1.5rem; padding: 0; border: 0; background: none; cursor: pointer; display: flex; align-items: center; }
.hero-seg-fill { position: relative; display: block; width: 100%; height: 3px; border-radius: 3px; background: rgb(255 255 255 / .35); overflow: hidden; }
.hero-seg-fill::after { content: ""; position: absolute; inset: 0; background: #fff; transform: scaleX(0); transform-origin: left; }
.hero-seg.is-done .hero-seg-fill::after, .hero-seg[aria-current="true"] .hero-seg-fill::after { transform: scaleX(1); }
.hero-seg-fill.run::after { animation: hero-fill 5s linear forwards; }
.hero.is-held .hero-seg-fill.run::after { animation-play-state: paused; }
.hero-seg:hover .hero-seg-fill { background: rgb(255 255 255 / .6); }
@keyframes hero-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hero :focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .hero-slide { transition: none; } }

/* ---------- Product card actions and rating ---------- */
.card-wish, .card-cart { position: relative; z-index: 2; } /* above the whole-card link */
.card-wish { position: absolute; top: var(--s-2); right: var(--s-2); margin: 0; }
.wish-icon {
  width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  background: rgb(255 255 255 / .92); border: 1px solid var(--c-line); color: var(--c-ink); box-shadow: var(--shadow-sm);
}
.wish-icon svg { width: 1.25rem; height: 1.25rem; }
.wish-icon:hover { color: var(--c-danger); }
.wish-icon[aria-pressed="true"] { color: var(--c-danger); }
.wish-icon[aria-pressed="true"] svg { fill: currentColor; }
.card-rating { margin: 0; font-size: var(--t-xs); display: flex; align-items: center; gap: .3rem; }
.card-rating .stars { color: #e6a100; letter-spacing: .05em; font-size: var(--t-sm); }
.card-cart { margin-top: var(--s-2); }
.card-cart .btn, a.card-cart { gap: .4rem; }
.card-cart svg { width: 1.1rem; height: 1.1rem; }

/* Sale page banner with an optional picture behind the text */
.sale-banner { position: relative; overflow: hidden; isolation: isolate; }
.sale-banner > :not(.sale-banner-img) { position: relative; z-index: 1; }
.sale-banner-img { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; }
.sale-banner.has-image { color: #fff; min-height: clamp(14rem, 30vw, 22rem); display: grid; align-content: center; }
.sale-banner.has-image::before { content: ""; position: absolute; inset: 0; z-index: 1; background: rgb(10 20 25 / .5); } /* keeps the text readable */
.sale-banner.has-image > :not(.sale-banner-img) { z-index: 2; }

/* Store logo and footer contact (Admin → Settings) */
.brand-logo { display: block; height: 40px; width: auto; max-width: 200px; object-fit: contain; }
.footer-tagline { font-weight: 600; margin-top: 0; }
.footer-contact, .footer-social { list-style: none; padding: 0; margin: var(--s-2) 0 0; display: grid; gap: .3rem; }
.footer-social { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: var(--s-3); }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }

/* ---------- Site theme decorations (pictures set by the active theme's stylesheet, /theme/{id}.css) ---------- */
.theme-header-art { display: none; height: 30px; background-repeat: repeat-x; background-position: center top; background-size: auto 100%; }
.theme-corner {
  display: none; position: fixed; left: 10px; bottom: 10px; z-index: 4; width: 104px; height: 104px;
  background-repeat: no-repeat; background-position: center; background-size: contain; pointer-events: none;
}
.theme-corner-right { left: auto; right: 10px; transform: scaleX(-1); } /* mirrored pair, one in each bottom corner */
@media (max-width: 47.99rem) { .theme-header-art { height: 22px; } .theme-corner { width: 60px; height: 60px; } }
@media print { .theme-header-art, .theme-corner { display: none !important; } body::before { display: none !important; } }

/* Category tiles with a background picture (Admin → Categories → Tile picture) */
.tile-image { position: relative; overflow: hidden; min-height: 6.5rem; color: #fff; border-color: transparent; }
.tile-image:hover { color: #fff; border-color: var(--c-accent); }
.tile-bg { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.tile-image::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgb(10 15 20 / .68), rgb(10 15 20 / .2)); }
.tile-image > :not(.tile-bg) { position: relative; z-index: 2; }
.tile-image strong { text-shadow: 0 1px 2px rgb(0 0 0 / .5); }
.tile-image .tile-icon { background: rgb(255 255 255 / .92); }
.tile-image:hover .tile-bg { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) { .tile-bg { transition: none; } }

/* Sale corner ribbon on product cards (colour: theme badge colour) */
.sale-ribbon { position: absolute; top: 0; left: 0; z-index: 1; width: 7rem; height: 7rem; overflow: hidden; pointer-events: none; }
.sale-ribbon > span {
  position: absolute; top: 1.3rem; left: -2.6rem; width: 10rem; transform: rotate(-45deg);
  padding: .3rem 0; text-align: center; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: var(--c-badge); color: var(--c-on-badge); box-shadow: 0 2px 4px rgb(0 0 0 / .2);
}
