/* The base theme. Everything visual hangs on these tokens: a shop's
   theme.css gives them its own values and the whole shop changes. */
:root {
  --bg: #ffffff;
  --surface: #f5f4f1;
  --ink: #1b1a18;
  --muted: #6a6761;
  --line: #e3e0d9;
  --accent: #1b1a18;
  --on-accent: #ffffff;
  --sale: #b3341f;
  --alert: #a3341f;
  /* The large banners of the home page, one tone each. */
  --banner-1: #e9e2d6;
  --banner-2: #dfe6dc;
  --banner-3: #e3e1ea;
  --radius: 12px;
  --gap: 20px;
  --side: 248px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
h1 { font-size: clamp(26px, 3.4vw, 34px); line-height: 1.15; margin: 0 0 16px; letter-spacing: -0.01em; }
h2 { font-size: 22px; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 16px; }
ul { list-style: none; margin: 0; padding: 0; }
s { color: var(--muted); font-weight: 400; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* The frame: sections down the side, the page next to them. */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; padding: 24px 16px; border-right: 1px solid var(--line); background: var(--surface); }
.side__logo { display: block; font-weight: 700; font-size: 22px; text-decoration: none; padding: 0 12px 20px; }
.side__logo img { width: 100%; max-width: 190px; height: auto; }
.side__nav { display: grid; gap: 2px; }
.side__nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); text-decoration: none; color: var(--muted); }
.side__nav a:hover { color: var(--ink); background: var(--bg); }
.side__nav a[aria-current] { color: var(--ink); background: var(--bg); font-weight: 600; }
.side__nav .side__all { color: var(--ink); font-weight: 600; margin-bottom: 10px; }
.body { display: flex; flex-direction: column; min-width: 0; }
.top { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 28px; height: 64px; padding: 0 32px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 1; }
.top__langs { display: flex; gap: 2px; margin-right: auto; }
.top__langs a { padding: 4px 10px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 14px; }
.top__langs a:hover { color: var(--ink); }
.top__langs a[aria-current] { color: var(--ink); background: var(--surface); font-weight: 600; }
.top__phone { text-decoration: none; color: var(--muted); white-space: nowrap; }
.top__phone:hover { color: var(--ink); }
.top__cart { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.top__cart b { background: var(--accent); color: var(--on-accent); border-radius: 999px; min-width: 22px; padding: 0 6px; font-size: 13px; line-height: 22px; text-align: center; }
.main { flex: 1 0 auto; width: 100%; max-width: 1240px; padding: 28px 32px 72px; }
.foot { flex: none; display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 24px 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 24px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { opacity: 0.88; }
.btn--quiet { height: 38px; padding: 0 14px; background: transparent; color: var(--ink); border-color: var(--line); font-weight: 400; }
.btn--quiet:hover { opacity: 1; border-color: var(--ink); }
input, textarea { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; width: 100%; }
input[type="number"] { width: 84px; height: 46px; text-align: center; }
input[type="radio"] { width: auto; accent-color: var(--accent); }
input[aria-invalid] { border-color: var(--alert); }

/* The home page */
.hero { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--gap); margin-bottom: 44px; }
.banner { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-height: 260px; padding: 32px; border-radius: calc(var(--radius) * 1.5); background: var(--banner-1) center / cover no-repeat; }
.banner--2 { background-color: var(--banner-2); }
.banner--3 { background-color: var(--banner-3); }
.banner h2 { font-size: 26px; max-width: 14em; }
.banner p { margin: 0; color: var(--muted); max-width: 28em; }
.banner .btn { margin-top: auto; }
/* A banner with a picture: the words go to the bottom, onto a veil, so
   they read on any photo. */
.hero .banner--pic { justify-content: flex-end; color: #fff; position: relative; overflow: hidden; }
.hero .banner--pic::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / 0.16) 0%, rgb(0 0 0 / 0.56) 45%, rgb(0 0 0 / 0.84) 100%); }
.hero .banner--pic > * { position: relative; }
.hero .banner--pic h2 { text-shadow: 0 1px 12px rgb(0 0 0 / 0.5); }
.hero .banner--pic p { color: rgb(255 255 255 / 0.9); }
.hero .banner--pic .btn { margin-top: 6px; background: #fff; color: var(--ink); border-color: #fff; }
.hero .banner:first-child { grid-column: span 2; }
.hero .banner:first-child h2 { font-size: 34px; }
.block { margin-bottom: 48px; }
.block__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.block__head a { color: var(--muted); white-space: nowrap; }
.block__head a:hover { color: var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--gap); }
.tile { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.tile:hover { border-color: var(--ink); }
.tile b { font-size: 18px; }
.tile span { color: var(--muted); font-size: 14px; }
.tiles--sub { margin-bottom: 32px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.tiles--sub .tile { padding: 16px 18px; }
.tiles--sub .tile b { font-size: 16px; font-weight: 600; }
/* A shelf is one row: as many products as fit, the rest are a tap on
   "see all" away (on a phone the row scrolls and shows them all). */
.shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.shelf .card:nth-child(n+5) { display: none; }
.promo { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 48px; padding: 32px; border-radius: calc(var(--radius) * 1.5); background: var(--accent); color: var(--on-accent); }
.promo h2 { margin-bottom: 8px; }
.promo p { margin: 0; opacity: 0.75; max-width: 40em; }
.promo .btn { flex: none; background: var(--on-accent); color: var(--accent); border-color: var(--on-accent); }
.benefits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.benefits li { display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: var(--radius); background: var(--surface); }
.benefits span { color: var(--muted); font-size: 14px; }
.about { max-width: 720px; }
.about h2 { margin-bottom: 14px; }
.about p { color: var(--muted); white-space: pre-line; }

/* The catalogue page */
.tree { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 36px var(--gap); margin-top: 8px; }
.tree h2 { font-size: 20px; margin-bottom: 12px; }
.tree h2 a { text-decoration: none; }
.tree h2 a:hover, .tree li a:hover { text-decoration: underline; }
.tree ul { display: grid; gap: 8px; }
.tree li a { color: var(--muted); text-decoration: none; }

/* Listings */
.head { margin-bottom: 24px; max-width: 640px; }
.head p, .lead { color: var(--muted); font-size: 18px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.sorts { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.sorts a { flex: none; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 14px; white-space: nowrap; }
.sorts a:hover { color: var(--ink); }
.sorts a[aria-current] { border-color: var(--ink); color: var(--ink); }
.bar__count { flex: none; color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 28px var(--gap); }
.card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
.card__pic { position: relative; display: block; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface); margin-bottom: 6px; }
.card__pic img { width: 100%; height: 100%; object-fit: cover; }
.card__off { position: absolute; top: 10px; left: 10px; padding: 2px 8px; border-radius: 999px; background: var(--sale); color: #fff; font-size: 13px; font-weight: 600; }
.card:hover .card__name { text-decoration: underline; }
.card__price { font-weight: 600; }
.card__price s { margin-left: 4px; font-size: 14px; }
.card__out, .out { color: var(--muted); }
.nopic { display: grid; place-items: center; width: 100%; height: 100%; aspect-ratio: 1; background: var(--surface); color: var(--line); font-size: 96px; font-weight: 700; border-radius: var(--radius); }
.empty { color: var(--muted); margin: 24px 0; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 40px; color: var(--muted); }

/* Product */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.crumbs > * + *::before { content: "/"; margin-right: 6px; }
.crumbs span { color: var(--ink); }
.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.product__pics { display: grid; gap: var(--gap); }
.product__pics img { border-radius: var(--radius); width: 100%; }
.product__text { color: var(--muted); margin-top: 28px; white-space: pre-line; }
.price { font-size: 26px; font-weight: 700; margin-bottom: 20px; }
.price span, .price s { font-size: 16px; font-weight: 400; color: var(--muted); }
.variants { border: 0; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.variants legend { padding: 0; margin-bottom: 8px; color: var(--muted); font-size: 14px; }
.variant { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; }
.variant:has(:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.variant:has(:disabled) { color: var(--muted); cursor: default; }
.variant b { margin-left: auto; }
.buy__row { display: flex; gap: 12px; }

/* Cart, checkout, order */
.note { background: var(--surface); border-left: 3px solid var(--alert); padding: 14px 16px; border-radius: var(--radius); }
.lines { border-top: 1px solid var(--line); margin-bottom: 20px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto; align-items: center; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.line__name { text-decoration: none; font-weight: 600; }
.line__name:hover { text-decoration: underline; }
.line__price { color: var(--muted); }
.line__qty { display: flex; gap: 8px; align-items: center; }
.line__qty input { height: 38px; }
.line__total { min-width: 96px; text-align: right; }
.sum { display: flex; justify-content: space-between; align-items: baseline; font-size: 20px; margin: 0 0 24px; }
.checkout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 48px; align-items: start; }
.fields { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field span { font-size: 14px; color: var(--muted); }
.field em { font-style: normal; font-size: 14px; color: var(--alert); }
.summary { background: var(--surface); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.summary li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; }
.summary li b { white-space: nowrap; }
.summary .sum { border-top: 1px solid var(--line); margin: 12px 0 0; padding-top: 16px; }
.summary p { margin: 16px 0 0; color: var(--muted); }

@media (max-width: 1100px) {
  .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shelf .card:nth-child(n+4) { display: none; }
  .tiles, .benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* A phone: the side column becomes a strip under the logo, the shelves
   and the banners scroll sideways. */
@media (max-width: 820px) {
  .shell { display: block; }
  .side { position: static; height: auto; padding: 12px 16px 0; border-right: 0; background: var(--bg); overflow: visible; }
  .side__logo { padding: 0 0 8px; font-size: 20px; }
  .side__nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 10px; border-bottom: 1px solid var(--line); }
  .side__nav a { flex: none; padding: 8px 12px; white-space: nowrap; background: var(--surface); }
  .side__nav .side__all { margin-bottom: 0; }
  .top { position: absolute; top: 0; right: 0; height: 52px; padding: 0 16px; border: 0; background: none; gap: 16px; }
  .top__phone, .top__cart span { display: none; }
  .top__langs { margin-right: 0; }
  .side__logo img { max-width: 150px; }
  .main { padding: 20px 16px 56px; }
  .foot { padding: 20px 16px; }
  .hero { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; scrollbar-width: none; margin: 0 -16px 32px; padding: 0 16px; gap: 12px; }
  .hero .banner { flex: none; width: 86%; min-height: 220px; padding: 24px; scroll-snap-align: start; }
  .hero .banner h2, .hero .banner:first-child h2 { font-size: 24px; }
  .block { margin-bottom: 36px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile { padding: 16px; }
  .shelf { display: flex; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 16px; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; gap: 14px; }
  .shelf .card:nth-child(n) { display: flex; flex: none; width: 44%; scroll-snap-align: start; }
  .promo { flex-direction: column; align-items: flex-start; padding: 24px; margin-bottom: 36px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
  .bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .product, .checkout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .line { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; }
  .line__name { grid-column: 1 / -1; }
  .nopic { font-size: 64px; }
}
