/* Test storefront. Light, neutral; each store's accent colour drives its own pages. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --soft: #f5f5f2;
  --soft-2: #ecebe6;
  --ink: #111110;
  --ink-2: #55534f;
  --muted: #77756f;
  --line: #e4e3dd;
  --accent: #2a78d6;
  --good: #0c7a0c;
  --crit: #c22f2f;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

.testbar { background: #111110; color: #e9e8e3; font-size: 12.5px; text-align: center; padding: 6px 16px; }
.testbar a { color: #9ec5f4; }

.top { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1160px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.logo { font-weight: 700; text-decoration: none; font-size: 17px; white-space: nowrap; }
.logo span { font-weight: 500; color: var(--muted); }
.crumb { text-decoration: none; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.search { flex: 1; max-width: 420px; }
.search input { width: 100%; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--soft); padding: 0 16px; }
.top-nav { margin-left: auto; display: flex; gap: 18px; align-items: center; white-space: nowrap; }
.top-nav a { text-decoration: none; font-weight: 550; }
.pill { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }

main.wrap { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }
.foot { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; color: var(--muted); font-size: 12.5px; padding-top: 18px; padding-bottom: 28px; border-top: 1px solid var(--line); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(0.94); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; }

.hero { border-radius: 18px; padding: 40px 36px; color: #fff; background: var(--accent); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); }
.hero h1 { font-size: 34px; }
.hero p { opacity: 0.92; margin-top: 6px; max-width: 560px; }
.hero .meta { margin-top: 14px; font-size: 13px; opacity: 0.85; }

.section { margin-top: 34px; }
.section-h { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-h h2 { font-size: 20px; }
.section-h .sp { flex: 1; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 550; font-size: 13.5px; cursor: pointer; text-decoration: none; }
.chip[aria-current="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.select { height: 36px; border-radius: 999px; border: 1px solid var(--line); background: #fff; padding: 0 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px 18px; }
/* Product card: flat in the grid, a raised surface on hover/focus (the surface is a pseudo-element, so
   images stay aligned with the section headings), a gentle image zoom, a "View" hint and a press effect. */
.card { position: relative; isolation: isolate; text-decoration: none; display: flex; flex-direction: column; gap: 10px; transition: transform 0.12s ease; }
.card::before { content: ""; position: absolute; inset: -8px -8px -10px; z-index: -1; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 28px rgba(17, 17, 16, 0.08); opacity: 0; transform: scale(0.98); transition: opacity 0.15s ease, transform 0.15s ease; }
.card:hover::before, .card:focus-visible::before { opacity: 1; transform: none; }
.card:focus-visible { outline: none; }
.card:focus-visible::before { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42, 120, 214, 0.18), 0 12px 28px rgba(17, 17, 16, 0.08); }
.card:active { transform: scale(0.985); }
.card:hover .tile img { transform: scale(1.04); }
.card-b { display: flex; flex-direction: column; gap: 3px; }
.card .t { font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card .c { color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
.peek { position: absolute; right: 10px; bottom: 10px; background: rgba(255, 255, 255, 0.95); color: var(--ink); font-size: 12.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); opacity: 0; transform: translateY(4px); transition: opacity 0.15s ease, transform 0.15s ease; }
.card:hover .peek, .card:focus-visible .peek { opacity: 1; transform: none; }
@media (hover: none) { .peek { display: none; } }

.tile { aspect-ratio: 1 / 1; border-radius: var(--radius); background: var(--soft); display: grid; place-items: center; overflow: hidden; position: relative; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.2s ease, transform 0.35s ease; -webkit-user-drag: none; }
.tile .ini { font-size: 34px; font-weight: 700; color: var(--accent); opacity: 0.85; }
.tile.is-loading, .stage.is-loading { background: linear-gradient(100deg, var(--soft) 30%, #fbfbf9 50%, var(--soft) 70%) var(--soft); background-size: 300% 100%; animation: shimmer 1.3s linear infinite; }
.tile.is-loading img, .stage.is-loading > img { opacity: 0; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.tile .flag, .stage .flag { position: absolute; left: 10px; top: 10px; background: var(--crit); color: #fff; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; z-index: 1; }
.tile .flag.out, .stage .flag.out { background: var(--ink-2); }
.price { font-weight: 700; }

.stores { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
/* Store card: accent band (or the store's banner image), round logo badge overlapping it, soft gradient body. */
.store-card { --card-accent: var(--accent); position: relative; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; text-decoration: none; display: flex; flex-direction: column; background: linear-gradient(to bottom right, #fff 40%, var(--soft)); box-shadow: 0 1px 2px rgba(17, 17, 16, 0.04); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.store-card:hover, .store-card:focus-visible { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(17, 17, 16, 0.1); }
.store-card:focus-visible { outline: 2px solid var(--card-accent); outline-offset: 2px; }
.store-card:active { transform: translateY(-1px) scale(0.99); }
.store-card .band { position: relative; height: 92px; background-color: var(--card-accent); background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.2)); }
.store-card .band::after { content: ""; position: absolute; right: -40px; top: -60px; width: 170px; height: 170px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); }
.store-card .band > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.store-card .tile.logo { position: absolute; left: 16px; bottom: -26px; z-index: 1; width: 56px; height: 56px; aspect-ratio: auto; border-radius: 50%; background-color: #fff; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14); }
.store-card .tile.logo .ini { font-size: 19px; color: var(--card-accent); opacity: 1; }
.store-card .body { padding: 36px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.store-card h3 { font-size: 17px; }
.store-card .body p { color: var(--ink-2); font-size: 14px; flex: 1; }
.store-card .foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; }
.count-chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: var(--ink-2); font-weight: 600; }
.store-card .go { color: var(--card-accent); font-weight: 700; white-space: nowrap; }

.pd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.pd .tile .ini { font-size: 72px; }
.pd h1 { font-size: 28px; line-height: 1.2; }
.pd .price { font-size: 24px; margin-top: 10px; }
.pd .desc { color: var(--ink-2); margin-top: 16px; }
.pd .tags { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.pd .tags span { background: var(--soft); border-radius: 6px; padding: 2px 8px; font-size: 12.5px; color: var(--ink-2); }
.stock { margin-top: 10px; font-weight: 600; font-size: 14px; }
.stock.in_stock { color: var(--good); }
.stock.low { color: #b76e00; }
.stock.out { color: var(--crit); }
.buy { display: flex; gap: 12px; margin-top: 22px; align-items: center; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; height: 42px; }
.qty button { width: 38px; height: 100%; border: 0; background: none; cursor: pointer; font-size: 18px; }
.qty span { min-width: 28px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.panel { border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.two { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.lines { display: flex; flex-direction: column; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.line:first-child { border-top: 0; }
.line .tile { width: 64px; height: 64px; aspect-ratio: auto; border-radius: 10px; }
.line .tile .ini { font-size: 18px; }
.sum { display: grid; grid-template-columns: 1fr auto; gap: 8px; font-variant-numeric: tabular-nums; }
.sum .total { font-weight: 700; font-size: 18px; border-top: 1px solid var(--line); padding-top: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.form { display: flex; flex-direction: column; gap: 14px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea { width: 100%; min-width: 0; height: 42px; border-radius: 10px; border: 1px solid var(--line); padding: 0 12px; background: #fff; }
.field textarea { height: auto; padding: 10px 12px; min-height: 70px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.err { background: #fdecec; color: var(--crit); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; text-transform: capitalize; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.pending::before { background: #fab219; }
.status.paid::before, .status.shipped::before { background: #2a78d6; }
.status.processing::before, .status.confirmed::before { background: #6250d6; }
.status.delivered::before { background: #0ca30c; }
.status.cancelled::before, .status.returned::before { background: #d03b3b; }
.status.refunded::before { background: #ec835a; }
.order { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.order-h { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.order-h b { font-family: ui-monospace, Consolas, monospace; }
.order .sp { flex: 1; }

.done { text-align: center; padding: 50px 20px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.done .ok { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 30px; font-weight: 700; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); display: flex; flex-direction: column; gap: 14px; align-items: center; }
.pager { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 28px; }
.loading { opacity: 0.5; transition: opacity 0.15s; }

/* ---- layout helpers ---- */
.hero.dark { background: #16191f; }
.section-h h1 { font-size: 26px; }
.gap { margin-bottom: 12px; }
.narrow { max-width: 460px; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; }
.back:hover { color: var(--ink); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.actions.start { justify-content: flex-start; }
.link.danger { color: var(--crit); }
.link:disabled { opacity: 0.5; cursor: default; }

/* ---- loading, empty and error states ---- */
.loading-state { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); padding: 48px 0; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty .glyph { width: 56px; height: 56px; border-radius: 50%; background: var(--soft); color: var(--ink-2); display: grid; place-items: center; font-size: 26px; font-weight: 700; }
.empty.bad .glyph { background: #fdecec; color: var(--crit); }
.empty h2 { color: var(--ink); font-size: 20px; }
.empty p { max-width: 440px; }
.grid.is-empty { display: block; }
.grid > .inline-err { grid-column: 1 / -1; }
.inline-err { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: #fdecec; color: var(--crit); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.offline { background: #fff4d6; color: #6b4a00; text-align: center; font-size: 13.5px; padding: 6px 16px; border-bottom: 1px solid #f1dfa8; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--crit); box-shadow: 0 0 0 3px rgba(194, 47, 47, 0.12); }
.field small { font-size: 12.5px; }
/* Message next to an input: an error (server 422 or a missing field) or a softer format hint. */
.field-err { font-weight: 600; line-height: 1.4; }
.field-err.bad { color: var(--crit); }
.field-err.warn { color: #8a5a00; font-weight: 550; }
.field-err .link { font-size: 12.5px; }
.field textarea { resize: vertical; line-height: 1.45; }
.field select { text-overflow: ellipsis; }

/* ---- recently viewed strip ---- */
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 18px; overflow-x: auto; padding: 10px 10px 14px; margin: -10px -10px 0; scroll-snap-type: x proximity; }
.strip .card { scroll-snap-align: start; }
.card.mini { gap: 6px; }
.card.mini .t { font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card.mini .c { display: none; }
.card.mini .tile .ini { font-size: 24px; }
.card.mini .peek { display: none; }

/* ---- product gallery ---- */
.gallery { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.stage { position: relative; aspect-ratio: 1 / 1; border-radius: 18px; background: var(--soft); overflow: hidden; display: grid; place-items: center; cursor: zoom-in; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.stage > img { width: 100%; height: 100%; object-fit: contain; transition: opacity 0.2s ease, transform 0.25s ease; -webkit-user-drag: none; }
.stage.dragging { cursor: grabbing; }
.stage.dragging > img { transition: none; }
.stage .img-fallback { display: none; position: absolute; inset: 0; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); }
.stage .img-fallback .ini { font-size: 72px; font-weight: 700; color: var(--accent); opacity: 0.85; }
.stage.is-broken { cursor: default; }
.stage.is-broken > img, .stage.is-broken .expand { display: none; }
.stage.is-broken .img-fallback { display: flex; }
.stage .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.94); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15); font-size: 24px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0 0 3px; opacity: 0; transition: opacity 0.15s ease; }
.stage .nav:active { transform: translateY(-50%) scale(0.94); }
.stage .prev { left: 12px; }
.stage .next { right: 12px; }
.stage .count { position: absolute; right: 12px; bottom: 12px; background: rgba(17, 17, 16, 0.72); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.stage .expand { position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.95); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14); font-size: 13px; font-weight: 700; cursor: pointer; opacity: 0; transform: translateY(4px); transition: opacity 0.15s ease, transform 0.15s ease; }
.stage:hover .nav, .stage .nav:focus-visible, .stage:hover .expand, .stage .expand:focus-visible { opacity: 1; }
.stage:hover .expand, .stage .expand:focus-visible { transform: none; }
@media (hover: none) {
  .stage .nav, .stage .expand { opacity: 1; }
  .stage .expand { transform: none; }
  .stage .nav { width: 36px; height: 36px; }
}
.thumbs { position: relative; display: flex; gap: 8px; overflow-x: auto; padding: 3px; scroll-behavior: smooth; scrollbar-width: thin; }
.thumb { flex: 0 0 68px; height: 68px; border-radius: 12px; border: 2px solid transparent; padding: 0; overflow: hidden; background: var(--soft); cursor: pointer; display: grid; place-items: center; opacity: 0.72; transition: opacity 0.15s ease, border-color 0.15s ease, transform 0.12s ease; }
.thumb:hover { opacity: 1; }
.thumb:active { transform: scale(0.95); }
.thumb[aria-current="true"] { border-color: var(--accent); opacity: 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.thumb-x { font-weight: 800; color: var(--crit); }

/* ---- lightbox (native <dialog>: focus stays inside, Esc closes) ---- */
html.lb-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(12, 12, 11, 0.97); color: #fff; display: flex; flex-direction: column; }
dialog.lightbox:not([open]) { display: none; }
.lightbox::backdrop { background: rgba(12, 12, 11, 0.94); }
.lightbox :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.lb-bar .sp { flex: 1; }
.lb-title { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-count { color: rgba(255, 255, 255, 0.7); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lb-tools { display: flex; align-items: center; gap: 2px; background: rgba(255, 255, 255, 0.08); border-radius: 999px; padding: 3px; }
.lb-zoom { min-width: 46px; text-align: center; font-size: 13px; color: rgba(255, 255, 255, 0.8); font-variant-numeric: tabular-nums; }
.lb-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; color: #fff; font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.lb-btn:hover { background: rgba(255, 255, 255, 0.14); }
.lb-btn:disabled { opacity: 0.35; cursor: default; background: transparent; }
.lb-btn.close { background: rgba(255, 255, 255, 0.12); }
.lb-body { position: relative; flex: 1; min-height: 0; display: flex; }
.lb-stage { position: relative; flex: 1; min-width: 0; overflow: hidden; display: grid; place-items: center; cursor: zoom-in; touch-action: none; user-select: none; -webkit-user-select: none; }
.lb-stage.zoomed { cursor: grab; }
.lb-stage.dragging { cursor: grabbing; }
.lb-stage > img { max-width: none; max-height: none; object-fit: contain; transform-origin: center center; transition: opacity 0.2s ease; will-change: transform; -webkit-user-drag: none; }
.lb-stage > img.animate { transition: transform 0.22s ease, opacity 0.2s ease; }
.lb-stage.is-loading > img { opacity: 0; }
.lb-stage .spinner { position: absolute; display: none; }
.lb-stage.is-loading .spinner { display: block; }
.spinner.light { width: 28px; height: 28px; border-color: rgba(255, 255, 255, 0.25); border-top-color: #fff; }
.lb-fallback { position: absolute; display: none; flex-direction: column; align-items: center; gap: 6px; padding: 20px; text-align: center; color: rgba(255, 255, 255, 0.8); }
.lb-stage.is-broken { cursor: default; }
.lb-stage.is-broken > img { display: none; }
.lb-stage.is-broken .lb-fallback { display: flex; }
.lb-nav { position: absolute; top: 50%; z-index: 1; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(20, 20, 19, 0.55); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding-bottom: 4px; }
.lb-nav:hover { background: rgba(20, 20, 19, 0.8); }
.lb-nav.prev { left: 16px; }
.lb-nav.next { right: 16px; }
.lb-thumbs { position: relative; display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px 4px; scrollbar-width: thin; }
.lb-thumbs > :first-child { margin-left: auto; }
.lb-thumbs > :last-child { margin-right: auto; }
.lb-thumb { flex: 0 0 56px; height: 56px; border-radius: 10px; border: 2px solid transparent; padding: 0; overflow: hidden; background: rgba(255, 255, 255, 0.08); color: #fff; cursor: pointer; display: grid; place-items: center; opacity: 0.55; transition: opacity 0.15s ease; }
.lb-thumb:hover { opacity: 0.9; }
.lb-thumb[aria-current="true"] { border-color: #fff; opacity: 1; }
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lb-hint { text-align: center; font-size: 12.5px; color: rgba(255, 255, 255, 0.55); padding: 6px 16px 12px; }
@media (hover: none) { .lb-hint { display: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- cart lines ---- */
.line-t { font-weight: 600; text-decoration: none; }
.line-t:hover { text-decoration: underline; }
.line-qty { display: flex; gap: 14px; align-items: center; margin-top: 6px; }
.qty.sm { height: 32px; }
.qty.sm button { width: 32px; }

/* ---- orders ---- */
.orders { display: flex; flex-direction: column; gap: 12px; }
a.order { text-decoration: none; transition: border-color 0.12s, box-shadow 0.12s; }
a.order:hover { border-color: #cfcdc5; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05); }
.order-f { display: flex; justify-content: space-between; gap: 12px; }
.order .more { color: var(--accent); font-weight: 600; white-space: nowrap; }
.more-btn { align-self: center; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.steps li { position: relative; display: flex; flex-direction: column; gap: 2px; padding-top: 24px; min-width: 0; }
.steps li::before { content: ""; position: absolute; top: 7px; left: 20px; right: -6px; height: 2px; background: var(--line); }
.steps li:last-child::before { display: none; }
.steps .dot { position: absolute; top: 0; left: 0; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--line); }
.steps .is-done .dot { background: var(--good); border-color: var(--good); }
.steps .is-done::before { background: var(--good); }
.steps .is-current .dot { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(42, 120, 214, 0.16); }
.steps .is-stop .dot { background: var(--crit); border-color: var(--crit); }
.steps .is-stop b { color: var(--crit); }
.steps .is-todo b { color: var(--muted); font-weight: 600; }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.history li { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; }
.history p { flex-basis: 100%; color: var(--ink-2); }
.track { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 12px; align-items: end; }
.track > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.track b { overflow-wrap: anywhere; }

/* ---- account: address book ---- */
.box-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.addrs { display: flex; flex-direction: column; gap: 10px; }
.addr { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.addr > div { min-width: 0; overflow-wrap: anywhere; }
.badge { display: inline-block; margin-left: 8px; font-size: 11.5px; font-weight: 700; color: var(--ink-2); background: var(--soft); border-radius: 999px; padding: 1px 8px; vertical-align: 1px; }
.form.sub { border-top: 1px solid var(--line); padding-top: 14px; }
.addrs > .form.sub { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.addr-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.badge.warn { color: #8a5a00; background: #fff4d6; }
.warn-text { color: #8a5a00; margin-top: 4px; }

/* ---- checkout: account step, delivery block on the order page ---- */
.auth .tabs { margin-top: 4px; }
.auth-step { scroll-margin-top: 84px; }  /* clear of the sticky header */
.ship { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 8px 0 0; font-size: 14px; }
.ship dt { color: var(--muted); font-size: 13px; }
.ship dd { margin: 0; overflow-wrap: anywhere; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 550; z-index: 50; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); max-width: calc(100vw - 32px); }
.toast.bad { background: var(--crit); }

/* ---- product options (options.js): swatches, chips, select; native radios kept for the keyboard ---- */
.price .from { font-weight: 500; font-size: 0.7em; color: var(--muted); }
.opt { display: grid; gap: 16px; margin-top: 20px; }
.opt-group { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 8px; }
.opt-legend { padding: 0; font-size: 13.5px; font-weight: 600; color: var(--ink-2); display: flex; gap: 6px; }
.opt-legend .opt-name::after { content: ":"; }
.opt-picked { color: var(--ink); font-weight: 700; }
.opt-values { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-v { position: relative; cursor: pointer; }
.opt-r { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.opt-face { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; min-width: 44px; justify-content: center; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 600; font-size: 14px; transition: border-color 0.12s, box-shadow 0.12s; }
.opt-extra { font-weight: 500; font-size: 12px; color: var(--muted); }
.opt-v:hover .opt-face { border-color: var(--ink-2); }
.opt-r:focus-visible + .opt-face { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt-v.is-x .opt-l, .opt-v.is-off .opt-l { text-decoration: line-through; color: var(--muted); }
.opt-v.is-x .opt-face, .opt-v.is-off .opt-face { background: var(--soft); border-style: dashed; }
.opt-v.is-off { cursor: not-allowed; opacity: 0.55; }
[data-kind="swatch"] .opt-face { padding: 3px; min-width: 0; min-height: 0; border-radius: 999px; }
.opt-dot { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--sw, #ddd); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14); }
.opt-dot.none { background: repeating-linear-gradient(45deg, #fff 0 4px, #e8e7e2 4px 8px); }
/* Struck swatches keep their colour (a dimmed black would read as grey): a dark line with a white core shows on any colour. */
.opt-v.is-x .opt-dot, .opt-v.is-off .opt-dot { background-image: linear-gradient(to top right, transparent calc(50% - 2.5px), rgba(17, 17, 16, 0.75) calc(50% - 2.5px), rgba(17, 17, 16, 0.75) calc(50% - 1px), #fff calc(50% - 1px), #fff calc(50% + 1px), rgba(17, 17, 16, 0.75) calc(50% + 1px), rgba(17, 17, 16, 0.75) calc(50% + 2.5px), transparent calc(50% + 2.5px)); }
[data-kind="swatch"] .opt-v.is-off { opacity: 1; }
/* The chosen value stays marked as chosen even when struck (a sold-out combination). */
.opt-r:checked + .opt-face { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt-select { height: 42px; border-radius: 10px; border: 1px solid var(--line); padding: 0 12px; background: #fff; max-width: 320px; }
.opt-select[aria-invalid="true"] { border-color: var(--crit); }
.opt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.opt-err, .opt-combo { color: var(--crit); font-weight: 600; font-size: 13px; }
.line .opts { margin-top: 1px; }

/* ---- delivery choice at checkout: home delivery or stop desk, priced for the wilaya ---- */
.delivery { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 8px; }
.delivery legend { padding: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.delivery:focus { outline: none; }
.dopts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.dopt { position: relative; cursor: pointer; display: flex; }
.dopt-r { position: absolute; inset-block-start: 14px; inset-inline-end: 14px; margin: 0; accent-color: var(--accent); width: 16px; height: 16px; }
.dopt-face { flex: 1; display: grid; gap: 2px; padding-block: 12px; padding-inline: 14px 40px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.dopt-r:checked + .dopt-face { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.dopt-r:focus-visible + .dopt-face { outline: 2px solid var(--accent); outline-offset: 2px; }
.dopt-p { font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.dopt-p.free { color: var(--good); }
.dopt-p.off { color: var(--muted); font-weight: 600; font-size: 13px; }
.dopt.is-off { cursor: not-allowed; }
.dopt.is-off .dopt-face { background: var(--soft); border-style: dashed; color: var(--muted); }
.delivery[aria-invalid="true"] .dopt-face { border-color: var(--crit); }
.dlv-note:empty { display: none; }
.dlv-done { color: var(--ink-2); }
@media (max-width: 440px) { .dopts { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 820px) {
  .pd, .two { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .hero { padding: 28px 22px; }
  .hero h1 { font-size: 26px; }
  .top-in { flex-wrap: wrap; gap: 10px 14px; padding: 10px 16px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .wrap { padding: 0 16px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  /* Cart lines: dinar totals ("2,700.00 DZD") are wide; the middle column shrinks and Remove wraps. */
  .line { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; }
  .line .tile { width: 56px; height: 56px; }
  .line-qty { flex-wrap: wrap; gap: 6px 14px; }
  .crumb { max-width: 140px; }
  .section-h h1 { font-size: 22px; }
  .strip { grid-auto-columns: 128px; }
  .lb-bar { padding: 10px 12px; gap: 10px; }
  .lb-title { display: none; }
  .lb-nav { width: 40px; height: 40px; font-size: 26px; }
  .lb-nav.prev { left: 6px; }
  .lb-nav.next { right: 6px; }

  .steps { grid-auto-flow: row; grid-auto-columns: auto; gap: 0; }
  .steps li { padding: 0 0 16px 28px; }
  .steps li::before { top: 18px; left: 7px; right: auto; bottom: 0; width: 2px; height: auto; }
  .track { grid-template-columns: minmax(0, 1fr) auto; }
  .track > div:nth-child(2) { grid-column: 1; }
  .track > button { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
