/* shop.css — public shop layout. Colours, buttons, cards and form fields come
   from /assets/css/styles.css (tokens at its top). */

.shop { font-size: 15px; min-height: 100dvh; display: flex; flex-direction: column; }
.shop-wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }

/* ---------- header ---------- */
.shop-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.shop-head .shop-wrap { display: flex; align-items: center; gap: 12px; height: 64px; }
.shop-head .brand { display: flex; align-items: center; gap: 10px; padding: 0; min-width: 0; }
.shop-head .brand-text { min-width: 0; }
.shop-head .brand-text strong { font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 9px; flex: none; }
.lang button { border: 0; background: transparent; padding: 5px 9px; border-radius: 6px; font-size: .75rem; font-weight: 700; color: var(--ink-3); }
.lang button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.basket-btn { position: relative; min-height: 40px; flex: none; }
.basket-btn b { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: .75rem; line-height: 20px; text-align: center; }
.basket-btn b:empty { display: none; }

/* ---------- page ---------- */
.shop-main { flex: 1; padding-block: 28px 72px; outline: none; }
.shop-main > * + * { margin-top: 24px; }
.perk { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--good) 13%, transparent); color: var(--good); font-weight: 600; font-size: .85rem; }
.perk .i { width: 16px; height: 16px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; font-size: .9rem; }
.back:hover { color: var(--ink); }
.center { text-align: center; }
.small-print { font-size: .8rem; }
.btn.lg { padding: 12px 20px; font-size: 1rem; min-height: 48px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.loading { text-align: center; padding: 60px 0; }

.tag { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 2px 9px; border-radius: 999px; font: 700 .72rem var(--font-ui); letter-spacing: .02em; }
.tag.out { background: var(--surface-2); color: var(--ink-3); }
.tag.low { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.price { font-weight: 700; font-size: 1.1rem; }
.price.big { font-size: 1.7rem; }
.instock { display: flex; align-items: center; gap: 6px; color: var(--good); font-weight: 600; font-size: .9rem; }
.instock .i { width: 16px; height: 16px; stroke-width: 3; }

/* ---------- product picture ---------- */
.pic { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic.ph { display: grid; place-items: center; border: 0; color: hsl(var(--h) 45% 34%);
  background: linear-gradient(135deg, hsl(var(--h) 55% 90%), hsl(var(--h) 45% 80%)); }
.pic.ph .i { width: 36%; height: 36%; stroke-width: 1.3; opacity: .7; }
:root[data-theme="dark"] .pic.ph { color: hsl(var(--h) 50% 78%); background: linear-gradient(135deg, hsl(var(--h) 30% 24%), hsl(var(--h) 30% 17%)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pic.ph { color: hsl(var(--h) 50% 78%); background: linear-gradient(135deg, hsl(var(--h) 30% 24%), hsl(var(--h) 30% 17%)); } }

/* ---------- catalogue ---------- */
.cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats button { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: .85rem; color: var(--ink-2); min-height: 38px; }
.cats button:hover { border-color: var(--ink-3); color: var(--ink); }
.cats button.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 28px 20px; }
.grid-empty { grid-column: 1 / -1; }
.product { display: flex; flex-direction: column; gap: 12px; }
.product .pic { transition: transform .2s, box-shadow .2s; }
.product a:hover .pic { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.product-info { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.product-info h2 { font-size: 1rem; font-weight: 600; line-height: 1.3; }
.product-info h2 a:hover { color: var(--accent); }
.product-info .kicker { margin: 0; color: var(--ink-3); letter-spacing: .08em; }
.product-info .btn { margin-top: auto; justify-content: center; min-height: 44px; }
.product-info .price { margin-bottom: 6px; }

/* ---------- product page ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: clamp(24px, 5vw, 56px); align-items: start; }
.detail-body > * + * { margin-top: 12px; }
.detail-body h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.blurb { font-size: 1rem; line-height: 1.65; color: var(--ink-2); max-width: 60ch; white-space: pre-line; }
.buy { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 8px; }
.section-title { font-size: 1.05rem; font-weight: 700; padding-top: 16px; border-top: 1px solid var(--line); margin-top: 20px !important; }

/* ---------- basket ---------- */
.lines { padding: 8px 20px 16px; }
.line { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line-pic .pic { width: 64px; border-radius: 8px; }
.line-info { display: flex; flex-direction: column; min-width: 0; }
.line-total { min-width: 90px; text-align: right; font-variant-numeric: tabular-nums; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.stepper button { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 9px; }
.stepper button:hover:not(:disabled) { background: var(--surface-2); }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper output { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.actions-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.sum-row { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; font-variant-numeric: tabular-nums; }
.sum-row > span:last-child, .sum-row > strong { white-space: nowrap; }
.sum-row.total { padding-top: 12px; font-size: 1.1rem; font-weight: 700; }
.sum-row.total strong { color: var(--accent); }
.sum-row small { display: inline; }

/* ---------- checkout ---------- */
.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.checkout form > * + * { margin-top: 20px; }
.checkout h1 { font-size: 1.6rem; }
.summary { position: sticky; top: 84px; }
.summary h2, .order-grid h2 { margin-bottom: 10px; }
.checkout input:not([type=radio]):not([type=checkbox]), .checkout textarea { min-height: 44px; font-size: 16px; } /* 16px stops phones zooming in on focus */
.field .check { font-size: .85rem; margin-top: 2px; }
.field.invalid textarea { border-color: var(--alert); }
.choice { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
.choice legend { font-size: .8rem; font-weight: 600; color: var(--ink-2); padding: 0; margin-bottom: 6px; }
.choice legend b { color: var(--accent); margin-left: 2px; }
.choice .err { color: var(--alert); font-size: .78rem; }
.choice .err:empty { display: none; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.option { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.option:hover { border-color: var(--ink-3); }
.option:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.option input[type=radio] { margin: 3px 0 0; padding: 0; border: 0; box-shadow: none; background: none; accent-color: var(--accent); width: 16px; height: 16px; min-height: 0; flex: none; }
.option span { display: flex; flex-direction: column; }
.option small { color: var(--ink-3); font-size: .8rem; }
.choice.invalid .option { border-color: var(--alert); }
.wide-btn { width: 100%; justify-content: center; }
.form-error { color: var(--alert); font-weight: 600; }
.form-error:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- order page ---------- */
.thanks { text-align: center; padding-top: 16px; }
.tick { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); margin-bottom: 12px; }
.tick .i { width: 28px; height: 28px; stroke-width: 2.5; }
.steps { list-style: none; margin-inline: auto; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); max-width: 640px; }
.steps li { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: .8rem; color: var(--ink-3); position: relative; }
.steps li::before { content: ''; position: absolute; top: 14px; right: 50%; width: 100%; height: 2px; background: var(--line-2); }
.steps li:first-child::before { display: none; }
.steps li.done::before, .steps li.now::before { background: var(--good); }
.steps i { position: relative; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); font-style: normal; font-weight: 700; }
.steps i .i { width: 15px; height: 15px; stroke-width: 3; }
.steps .done i { background: var(--good); border-color: var(--good); color: #fff; }
.steps .now i { border-color: var(--good); color: var(--good); }
.steps .now span { color: var(--ink); font-weight: 700; }
.closed { text-align: center; }
.closed .tag { font-size: .9rem; padding: 6px 14px; }
.order-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.order-grid .gap { margin-top: 18px; }
.bank { margin: 10px 0 0; }
.bank div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.bank dt { color: var(--ink-3); }
.bank dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, Consolas, monospace; }

/* ---------- footer ---------- */
.shop-foot { border-top: 1px solid var(--line); background: var(--surface); padding-block: 28px; font-size: .9rem; }
.shop-foot .shop-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px 32px; }
.shop-foot a { display: inline-flex; align-items: center; gap: 6px; }
.shop-foot a:hover { color: var(--accent); }
.shop-foot .i { width: 15px; height: 15px; }
.shop-foot .small-print { grid-column: 1 / -1; }

/* ---------- phones ---------- */
@media (max-width: 820px) {
  .detail, .checkout, .order-grid { grid-template-columns: 1fr; }
  .detail-pic { max-width: 360px; }
  .summary { position: static; order: -1; }
}
@media (max-width: 560px) {
  .shop-head .shop-wrap { height: 56px; gap: 8px; }
  .shop-head .brand-text strong { font-size: .95rem; }
  #basket-label { display: none; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .product-info h2 { font-size: .92rem; }
  .product-info .btn { font-size: .82rem; padding-inline: 8px; }
  .line { grid-template-columns: 52px minmax(0, 1fr) auto; row-gap: 8px; }
  .line-pic .pic { width: 52px; }
  .line .stepper { grid-column: 2; justify-self: start; }
  .line-total { grid-column: 3; grid-row: 2; min-width: 0; }
  .line .icon-btn { grid-column: 3; grid-row: 1; justify-self: end; }
  .lines { padding-inline: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .actions-row .btn { flex: 1; justify-content: center; }
  .steps li { font-size: .7rem; }
}
@media (max-width: 560px) {
  .shop-head .brand-text strong { white-space: normal; line-height: 1.1; font-size: .9rem; display: block; }
}

/* ---------- KPX Group look: soft peach hero, near-black footer ---------- */
.shop-foot { background: var(--bar); border-top: 0; color: var(--bar-ink-2); }
.shop-foot strong { color: var(--bar-ink); }
.shop-foot .muted { color: var(--bar-ink-3); }
.shop-foot a:hover { color: var(--bar-link); }
.lang[hidden] { display: none; }

/* ---------- doodle background (small cars and car bits, like a chat wallpaper) ----------
   The drawing is /assets/img/doodles.svg. It sits behind everything and stays put while
   the page scrolls. To make it fainter or stronger, change the opacity below. */
.shop::before, .login-page::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url(/assets/img/doodles.svg) 0 0 / 330px 330px repeat; opacity: .22; }
/* Products get a card so their name and price never sit directly on the drawings. */
.product { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 10px 12px; box-shadow: var(--shadow); }
.product .pic { border-radius: calc(var(--radius) - 4px); }
.product-info { padding-inline: 4px; }
@media (max-width: 560px) {
  .product { padding: 8px 8px 10px; }
  .product-info { padding-inline: 2px; }
}
@media print { .shop::before, .login-page::before { display: none; } }

/* =====================================================================
   Shop extras: offers and badges, category tiles, rows,
   free-delivery bar, slide-in basket, phone buy bar, WhatsApp button
   ===================================================================== */
.product-info h3 { font-size: 1rem; font-weight: 600; line-height: 1.3; }
.product-info h3 a:hover { color: var(--accent); }
.page-title { display: inline-block; padding: 6px 14px; margin-left: -14px; border-radius: 12px; background: var(--bg); }
.row-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 14px; display: inline-block; padding: 4px 12px; margin-left: -12px; border-radius: 10px; background: var(--bg); }
.extras { display: flex; flex-direction: column; gap: 32px; }
.extras[hidden] { display: none; }
.shop-main > section + section, .extras + section { margin-top: 32px; }

/* price with an offer */
.price s { color: var(--ink-3); font-weight: 500; font-size: .85em; margin-left: 4px; }
.price:has(s) > span { color: var(--sale-text); }

/* badges on the photo */
.pic { position: relative; }
.marks { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; }
.mark { padding: 3px 8px; border-radius: 999px; font: 700 .72rem var(--font-ui); letter-spacing: .02em; color: #fff; box-shadow: 0 1px 3px rgb(9 9 11 / .2); }
.mark.off { background: var(--sale); }
.mark.new { background: var(--brand); color: var(--brand-ink); }

/* hero notes */
.perks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.perks .perk { margin-top: 0; }
.detail-body .perk { background: color-mix(in srgb, var(--good) 13%, transparent); }



/* free-delivery progress */
.freebar { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .875rem; }
.freebar p { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.freebar .i { width: 17px; height: 17px; flex: none; }
.freebar .track { height: 6px; margin-top: 8px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.freebar .track span { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .35s cubic-bezier(.2, .8, .2, 1); }
.freebar.done { background: color-mix(in srgb, var(--good) 13%, transparent); color: var(--good); }
.freebar.done .track span { background: var(--good); }

/* basket and order pages: text sits on cards, not on the doodles */
.detail-body.card { padding: clamp(18px, 3vw, 28px); }
.thanks.card { padding-block: 28px; }
.thanks .steps { margin-top: 24px; }
.shop-main > .card > .empty-state { padding-block: 56px; }

/* slide-in basket */
dialog.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(410px, 100vw); height: 100dvh; max-height: 100dvh; border-radius: 0; box-shadow: var(--shadow-lg); }
dialog.drawer[open] { animation: slide-in .26s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide-in { from { transform: translateX(100%); } }
.drawer-box { display: flex; flex-direction: column; height: 100%; }
.drawer-box > header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.drawer-box h2 { font-size: 1.15rem; font-weight: 700; }
.drawer-box h2 small { color: var(--ink-3); font-weight: 500; }
.drawer-lines { flex: 1; overflow-y: auto; padding: 4px 20px; }
.dline { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.dline-pic .pic { width: 64px; border-radius: 8px; }
.dline-info { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.dline-info strong { font-size: .92rem; line-height: 1.3; }
.dline-info span { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dline .stepper button { width: 34px; height: 34px; }
.drawer-box > footer { padding: 14px 20px 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.drawer-box > footer .freebar { margin-top: 0; }
.drawer-box > footer .sum-row.total { padding-top: 2px; }
.drawer-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 20px; }

/* basket badge bounce */
.basket-btn b.bump { animation: bump .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes bump { 40% { transform: scale(1.45); } }

/* fixed buy bar on phones (product page) */
.buybar { display: none; }
@media (max-width: 820px) {
  .buybar { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgb(9 9 11 / .08); }
  .buybar span { display: flex; flex-direction: column; min-width: 0; }
  .buybar small { color: var(--ink-3); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .buybar .btn { flex: none; min-height: 46px; }
  .has-buybar .shop-foot { padding-bottom: 96px; }
  .has-buybar .wa { bottom: 82px; }
  .has-buybar .toasts { bottom: 82px; }
}

/* floating WhatsApp button */
.wa { position: fixed; right: 16px; bottom: 16px; z-index: 16; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #25d366; color: #fff; box-shadow: 0 6px 20px rgb(9 9 11 / .25); transition: transform .18s, background-color .18s; }
.wa:hover { transform: scale(1.07); background: #1ebe5a; }
.wa[hidden] { display: none; }
.wa .i { width: 30px; height: 30px; stroke-width: 1.7; }
.wa span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* social links in the footer */
.social { display: flex; gap: 10px; margin-top: 6px; }
.shop-foot .social a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--bar-line); }
.shop-foot .social a:hover { border-color: var(--bar-link); }
.shop-foot .social .i { width: 19px; height: 19px; }

@media (max-width: 560px) {
  .row-title { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  dialog.drawer[open], .basket-btn b.bump { animation: none; }
}
@media print { .wa, .buybar { display: none; } }

/* =====================================================================
   Photo gallery, sizes and colours, and the day / night look
   ===================================================================== */
/* gallery on the product page: the big photos sit side by side and slide; small ones below pick one */
.gallery { display: flex; flex-direction: column; gap: 10px; }
.gallery-main { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.shots { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; outline-offset: -2px; }
.shots::-webkit-scrollbar { display: none; }
.shots .pic { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; border: 0; border-radius: 0; }
.shot-nav { position: absolute; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink); box-shadow: var(--shadow); }
.shot-nav.prev { left: 10px; }
.shot-nav.next { right: 10px; }
.shot-nav:disabled { opacity: 0; pointer-events: none; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.thumbs::-webkit-scrollbar { display: none; }
.thumbs button { flex: none; width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--surface-2); transition: border-color .15s; }
.thumbs button:hover { border-color: var(--line-2); }
.thumbs button.on { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (hover: none), (max-width: 820px) { .shot-nav { display: none; } } /* phones swipe instead */

/* sizes and colours */
.opts-name { font-size: .85rem; color: var(--ink-2); margin-bottom: 8px; }
.opts-name strong { color: var(--ink); }
.opt-list { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-width: 48px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); font-weight: 600; font-size: .9rem; transition: border-color .15s, box-shadow .15s; }
.opt:hover:not(:disabled) { border-color: var(--ink-3); }
.opt.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); color: var(--accent); }
.opt:disabled { color: var(--ink-3); text-decoration: line-through; background: var(--surface-2); cursor: not-allowed; opacity: .7; }
.opt-note { color: var(--ink-2); font-size: .8rem; }
a.btn { text-align: center; }

/* day / night switch */
.theme-btn { width: 40px; height: 40px; flex: none; }
.theme-btn .i { width: 20px; height: 20px; }

/* night look: the pieces that have their own fixed colours by day */
:root[data-theme="dark"] .shop-foot { border-top: 1px solid var(--line); }
:root[data-theme="dark"] .shop::before, :root[data-theme="dark"] .login-page::before { opacity: .16; }
:root[data-theme="dark"] .buybar { box-shadow: 0 -4px 16px rgb(0 0 0 / .5); }
:root[data-theme="dark"] .pic img { background: #fff; }

@media (prefers-reduced-motion: reduce) { .shots { scroll-behavior: auto; } .thumbs button, .opt { transition: none; } }
@media print { .theme-btn, .shot-nav { display: none; } }

/* =====================================================================
   Marketplace-style layout: dark top bar with a big search, a row of
   categories under it, a sliding banner, cards of products, a shelf
   ===================================================================== */
.shop-wrap { max-width: 1280px; }

/* ---------- top bar ---------- */
.shop-head { background: var(--bar); color: var(--bar-ink); border-bottom: 0; backdrop-filter: none; }
.shop-head .shop-wrap.bar { gap: 16px; height: 64px; }
.shop-head .brand { flex: none; color: var(--bar-ink); }
.shop-head .brand-mark { background: var(--brand); color: var(--brand-ink); }
.top-search { flex: 1; display: flex; min-width: 0; height: 42px; border-radius: 10px; background: #fff; overflow: hidden; }
.top-search:focus-within { box-shadow: 0 0 0 3px var(--brand-soft); }
.top-search select, .top-search input { height: 100%; min-height: 0; border: 0; border-radius: 0; box-shadow: none; outline: 0; color: #09090b; }
.top-search select { flex: none; max-width: 170px; padding: 0 10px; background: #f4f4f5; border-right: 1px solid #d4d4d8; color: #3f3f46; font-size: .82rem; font-weight: 600; cursor: pointer; }
.top-search input { flex: 1; min-width: 0; padding: 0 14px; background: #fff; font-size: 16px; }
.top-search input::placeholder { color: #71717b; }
.top-search input:focus, .top-search select:focus { box-shadow: none; border: 0; }
.top-search select:focus-visible { background: #e4e4e7; }
.top-search button { flex: none; width: 50px; border: 0; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); transition: background-color .15s; }
.top-search button:hover { background: var(--brand-dark); }
.top-search button .i { width: 20px; height: 20px; }
.shop-head .theme-btn { color: var(--bar-ink-2); }
.shop-head .theme-btn:hover { background: var(--bar-3); color: var(--bar-ink); }
.shop-head .basket-btn { background: transparent; border-color: var(--bar-line); color: var(--bar-ink); }
.shop-head .basket-btn:hover { border-color: var(--bar-ink-3); background: var(--bar-2); }
.shop-head .basket-btn b { background: var(--brand-soft); color: #09090b; }

/* row of categories */
.strip { background: var(--bar-2); border-top: 1px solid var(--bar-3); }
.shop-head .strip .shop-wrap { height: 42px; gap: 4px; padding-bottom: 0; align-items: center; }
.strip .cats button { min-height: 32px; padding: 5px 11px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--bar-ink-2); font-weight: 500; font-size: .85rem; white-space: nowrap; }
.strip .cats button:hover { border-color: var(--bar-ink-3); color: var(--bar-ink); }
.strip .cats button.on { background: var(--bar-ink); border-color: var(--bar-ink); color: var(--bar); font-weight: 700; }
.strip .cats button.deal:not(.on) { color: var(--sale-on-bar); font-weight: 700; }

/* ---------- banner ---------- */
.shop-main { padding-top: 20px; }
.banner { position: relative; border-radius: 18px; overflow: hidden; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; gap: 24px;
  min-height: 430px; padding: 48px 76px 190px; color: var(--banner-ink); }
.slide h1, .slide h2 { font: 700 clamp(1.9rem, 4.2vw, 3.1rem)/1.08 var(--font-display); letter-spacing: -.03em; }
.slide .sub { margin-top: 12px; font-size: 1.1rem; max-width: 44ch; }
.slide .kicker { color: inherit; opacity: .85; }
.slide .btn { margin-top: 18px; }
.s-main { background: var(--banner); }
.s-main .sub { color: var(--banner-ink-2); }
.s-main .perk { background: #ffffffb3; color: #15803d; }
.s-main .btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.s-offers { background: var(--offer-banner); color: #fff; }
.s-new { background: radial-gradient(90% 120% at 85% 10%, #3b3a6b 0%, #18181b 55%, #09090b 100%); color: #fff; }
.s-offers .btn, .s-new .btn { background: #fff; border-color: #fff; color: #09090b; }
.s-offers .btn:hover, .s-new .btn:hover { background: #e4e4e7; border-color: #e4e4e7; }
.slide-art { display: flex; justify-content: flex-end; align-items: flex-start; gap: 16px; padding-top: 4px; }
.slide-art a { flex: 0 1 172px; min-width: 0; transition: transform .2s; }
.slide-art a:nth-child(1) { rotate: -4deg; margin-top: 18px; }
.slide-art a:nth-child(2) { rotate: 3deg; }
.slide-art a:nth-child(3) { rotate: -2deg; margin-top: 26px; }
.slide-art a:hover { transform: translateY(-4px); }
.slide-art .pic { border: 0; border-radius: 18px; box-shadow: 0 14px 34px rgb(9 9 11 / .28); }
/* the banner melts into the page, and the first cards sit on top of its lower part */
.banner::after { content: ''; position: absolute; inset: auto 0 0 0; height: 150px; background: linear-gradient(to bottom, transparent, var(--bg) 92%); pointer-events: none; }
.banner .shot-nav { top: 130px; translate: none; z-index: 2; }
.banner .shot-nav.prev { left: 16px; }
.banner .shot-nav.next { right: 16px; }
.banner .shot-nav:disabled { opacity: 1; pointer-events: auto; }
.dots { position: absolute; top: 16px; right: 22px; z-index: 2; display: flex; gap: 6px; }
.dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: rgb(9 9 11 / .28); transition: width .2s, background-color .2s; }
.dots button.on { width: 24px; border-radius: 5px; background: var(--brand); }
.dots button:hover { background: rgb(9 9 11 / .55); }
.dots button.on:hover { background: var(--brand); }

/* ---------- cards of products ---------- */
.deck { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.deck.lift { position: relative; z-index: 1; margin-top: -192px; padding-inline: 18px; }
.deck-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.deck-card h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; }
.quad { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.quad.n1 { grid-template-columns: 1fr; }
.quad-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: .78rem; }
.quad-item .pic { border-radius: 8px; margin-bottom: 4px; transition: opacity .15s; }
.quad-item:hover .pic { opacity: .86; }
.quad-item span { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quad-item b { font-size: .85rem; }
.more { margin-top: auto; align-self: flex-start; min-height: 32px; padding: 4px 0; border: 0; background: none; color: var(--accent); font-weight: 600; font-size: .88rem; }
.more:hover { text-decoration: underline; }

/* ---------- shelf: one row of products that slides sideways ---------- */
.shelf { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.shelf h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 14px; }
.shelf-box { position: relative; }
.shelf-track { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 2px 8px; scrollbar-width: thin; }
.shelf-track .product { flex: 0 0 196px; scroll-snap-align: start; box-shadow: none; }
.shelf .shot-nav { top: 96px; translate: none; }
.shelf .shot-nav.prev { left: -6px; }
.shelf .shot-nav.next { right: -6px; }

/* ---------- footer ---------- */
.shop-foot { padding-top: 0; }
.to-top { display: block; width: 100%; margin-bottom: 28px; padding: 14px; border: 0; background: var(--bar-3); color: var(--bar-ink); font-weight: 600; font-size: .85rem; }
.to-top:hover { background: var(--bar-line); }

/* ---------- night look ---------- */
:root[data-theme="dark"] .s-main { color: #fafafa; background:
    radial-gradient(60% 70% at 85% 15%, rgb(124 134 255 / .30) 0%, rgb(124 134 255 / 0) 70%),
    radial-gradient(120% 100% at 15% 0%, #241f52 0%, #1a1a24 55%, #141418 100%); }
:root[data-theme="dark"] .s-main .sub { color: #d4d4d8; }
:root[data-theme="dark"] .s-main .perk { background: rgb(74 222 128 / .14); color: #4ade80; }
:root[data-theme="dark"] .dots button { background: rgb(250 250 250 / .3); }
:root[data-theme="dark"] .dots button.on { background: var(--brand-soft); }
:root[data-theme="dark"] .shop-head { border-bottom: 1px solid var(--bar-3); }
.s-offers .dots button, .s-new .dots button { background: rgb(250 250 250 / .4); }

/* ---------- smaller screens ---------- */
@media (max-width: 1000px) {
  .slide { padding: 40px 60px 180px; }
  .slide-art a:nth-child(3) { display: none; }
}
@media (max-width: 820px) {
  .shop-head { position: static; } /* three rows are too much to keep fixed on a phone */
  .shop-head .shop-wrap.bar { flex-wrap: wrap; height: auto; padding-block: 10px; gap: 10px 8px; }
  .shop-head .brand { margin-right: auto; }
  .top-search { order: 5; flex: 0 0 100%; }
  .top-search select { display: none; }
  .slide { grid-template-columns: 1fr; min-height: 0; padding: 30px 22px 150px; }
  .slide-art { display: none; }
  .banner .shot-nav { display: none; }
  .deck.lift { margin-top: -142px; padding-inline: 10px; }
  .deck { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .deck-card { padding: 14px; }
}
@media (max-width: 560px) {
  .shop-head .shop-wrap.bar { height: auto; }
  .deck { grid-template-columns: 1fr; }
  .deck.lift { grid-template-columns: 1fr; }
  .quad { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .quad.n1, .quad.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quad.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quad-item b { font-size: .78rem; }
  .shelf { padding: 14px; }
  .shelf-track .product { flex-basis: 158px; }
  .shelf .shot-nav { display: none; }
}
@media (prefers-reduced-motion: reduce) { .slide-art a, .dots button, .quad-item .pic { transition: none; } }
@media print { .strip, .top-search, .banner .shot-nav, .dots, .to-top { display: none; } }

/* banner and search details */
#q, #q-cat { border: 0; border-radius: 0; box-shadow: none; color: #09090b; }
#q { background: #fff; }
#q-cat { background: #f4f4f5; border-right: 1px solid #d4d4d8; color: #3f3f46; }
.s-offers .sub, .s-new .sub { color: inherit; opacity: .92; }
.dots { padding: 5px 8px; border-radius: 999px; background: rgb(255 255 255 / .78); }
:root[data-theme="dark"] .dots { background: rgb(9 9 11 / .6); }
.banner { border-radius: 18px 18px 0 0; }
.banner::after { background: linear-gradient(to bottom, transparent, var(--bg) 80%); }

/* =====================================================================
   Phones and tablets: one slim bar that stays on top (shop mark, search,
   day/night, basket), and everything tappable at least 44px tall
   ===================================================================== */
@media (max-width: 820px) {
  /* the header box steps aside so the bar can stick to the top while the row of categories scrolls away */
  .shop-head { display: contents; }
  .shop-head .shop-wrap.bar { position: sticky; top: 0; z-index: 20; flex-wrap: nowrap; height: auto; gap: 6px; max-width: none;
    padding: calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); background: var(--bar); }
  .shop-head .brand { margin-right: 2px; min-height: 44px; }
  .shop-head .brand-text { display: none; } /* the mark alone; the name is in the banner and the footer */
  .top-search { order: 0; flex: 1 1 auto; height: 44px; }
  .top-search button { width: 46px; }
  .shop-head .theme-btn { width: 44px; height: 44px; }
  .shop-head .basket-btn { min-height: 44px; padding-inline: 12px; }
  #basket-label { display: none; }
  .shop-head .strip .shop-wrap { height: 52px; }
}
@media (max-width: 820px), (pointer: coarse) {
  .strip .cats button { min-height: 44px; padding-inline: 13px; }
  .more { min-height: 44px; }
  .back { min-height: 44px; }
  .shop .btn { min-height: 44px; }
  .shop .icon-btn { width: 44px; height: 44px; }
  .stepper button, .dline .stepper button { width: 44px; height: 44px; }
  .field .check { min-height: 44px; align-items: center; }
  .shop-foot a { min-height: 44px; }
  .shop-foot .social a { width: 44px; height: 44px; }
  .to-top { min-height: 48px; }
  .thumbs button { width: 68px; height: 68px; }
  /* banner dots: small to look at, a full fingertip to press */
  .dots { gap: 2px; padding: 0 6px; }
  .dots button { position: relative; width: 28px; height: 44px; border-radius: 0; background: none; }
  .dots button.on { width: 40px; background: none; }
  .dots button:hover, .dots button.on:hover { background: none; }
  .dots button::before { content: ''; position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgb(9 9 11 / .35); opacity: .75; }
  .dots button.on::before { width: 24px; border-radius: 5px; background: var(--brand); box-shadow: 0 0 0 1.5px #fff; opacity: 1; }
  .dots { top: 4px; right: 10px; background: none; }
  :root[data-theme="dark"] .dots { background: none; }
}
