/* Дім Дрім — customer site. White, single light theme; brand blue for actions/prices, brand red only for discounts. */
:root {
  --bg: #ffffff;
  --soft: #f4f5f9;
  --ink: #14172e;
  --muted: #5e6378;
  --line: #e2e4ec;
  --blue: #0010c6;
  --blue-soft: #e8eafc;
  --red: #e20026;
  --green: #1d7a46;
  --amber: #a15c00;
  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 12px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--body); }
img { max-width: 100%; }
a { color: var(--blue); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
h1, h2 { text-wrap: balance; }

.wrap {
  max-width: 1080px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Header with a two-colour rule taken from the logo */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding-top: env(safe-area-inset-top, 0px); }
.top::after { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--red) 0 50%, var(--blue) 50% 100%); }
.top-row { display: flex; align-items: center; gap: 16px; padding-block: 14px; }
.logo { display: block; line-height: 0; }
.logo img { height: 26px; width: auto; }
.back { margin-left: auto; font-weight: 700; font-size: 15px; text-decoration: none; padding: 8px 0; }

main { padding-block: 24px 56px; }

/* Catalog */
.cat-head { display: grid; gap: 14px; margin-bottom: 22px; }
.cat-head h1 { margin: 0; font: 800 clamp(24px, 6vw, 34px)/1.1 var(--display); letter-spacing: -0.01em; }
.search { display: flex; gap: 8px; }
.search input {
  flex: 1; min-width: 0; padding: 12px 14px; font-size: 16px;
  border: 1.5px solid var(--line); border-radius: var(--r); background: var(--bg);
}
.search input:focus { border-color: var(--blue); outline: none; }
.search button {
  padding: 0 18px; border: 0; border-radius: var(--r); background: var(--blue); color: #fff;
  font-weight: 700; cursor: pointer;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px;
}
.chip:hover { border-color: var(--blue); }
.chip[aria-current="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.count { margin: 0; color: var(--muted); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 16px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.card {
  display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; color: inherit; text-decoration: none; background: var(--bg);
  transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: var(--blue); box-shadow: 0 6px 20px rgba(0, 16, 198, .08); }
.card > img, .card > .no-photo { aspect-ratio: 1; width: 100%; height: auto; object-fit: cover; display: block; background: var(--soft); }
.card-body { padding: 12px; display: grid; gap: 4px; align-content: start; flex: 1; }
.card .meta { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.card .name { font-weight: 700; line-height: 1.3; }
.empty { color: var(--muted); }

.no-photo { display: grid; place-items: center; align-content: center; gap: 10px; background: var(--soft); color: var(--muted); font-size: 14px; }
.no-photo img { width: 36%; max-width: 120px; opacity: .25; filter: grayscale(1); }
.no-photo-lg { aspect-ratio: 1; border-radius: var(--r); }

/* Price */
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-variant-numeric: tabular-nums; }
.price .now { font: 800 18px/1.15 var(--display); color: var(--blue); }
.price .now-sale { color: var(--red); }
.price .unit { font-size: 13px; color: var(--muted); }
.price .old { font-size: 14px; color: var(--muted); text-decoration: line-through; }
.badge { font-size: 12px; font-weight: 800; color: #fff; background: var(--red); padding: 2px 7px; border-radius: 6px; }
.price-lg .now { font-size: clamp(30px, 8vw, 40px); }
.price-lg .unit { font-size: 15px; }
.price-lg .old { font-size: 16px; }
.price-none { font-size: 14px; font-weight: 600; color: var(--muted); }
@media (max-width: 520px) { .card .price .now { font-size: 16px; } .card .price .old { font-size: 12px; } }

/* Product */
.product { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 880px) {
  .product { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: start; }
  .gallery { position: sticky; top: 80px; }
}
.gallery, .info { min-width: 0; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--r); background: var(--soft); scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slides img { flex: 0 0 100%; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; scroll-snap-align: start; display: block; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumbs button { width: 60px; height: 60px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--soft); }
.thumbs button[aria-current="true"] { border-color: var(--blue); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

.info { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.info .meta { font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.info h1 { margin: 6px 0 0; font: 800 clamp(22px, 5vw, 30px)/1.2 var(--display); letter-spacing: -0.01em; }
.price-block .sub { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 14px; }
.stock { color: var(--green); font-weight: 700; }
.stock-out { color: var(--amber); }
.code { color: var(--muted); font-variant-numeric: tabular-nums; }

.panel { background: var(--soft); border-radius: var(--r); padding: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }

.size { display: flex; align-items: center; gap: 14px; }
.tile-scale { flex: none; color: var(--ink); }
.tile-scale-fill { fill: var(--blue-soft); stroke: var(--blue); stroke-width: 1.5; }
.size b { display: block; font: 800 18px/1.25 var(--display); }
.size span { font-size: 14px; color: var(--muted); }

.calc label { display: block; font-weight: 700; margin-bottom: 8px; }
.calc input[type="number"] {
  width: 140px; padding: 10px 12px; font-size: 18px; font-variant-numeric: tabular-nums;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg);
}
.calc input[type="number"]:focus { border-color: var(--blue); outline: none; }
.calc .chk { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-weight: 500; color: var(--muted); }
.calc .chk input { width: 18px; height: 18px; accent-color: var(--blue); }
.calc .out { display: grid; gap: 6px; margin-top: 14px; font-variant-numeric: tabular-nums; }
.calc .out div { display: flex; justify-content: space-between; gap: 12px; }
.calc .out .total { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 800; font-size: 18px; }
.calc .out .total span:last-child { color: var(--blue); }
.calc .note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

.desc { margin: 0; max-width: 62ch; }
.specs { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.specs dt, .specs dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--muted); padding-right: 12px; }
.specs dd { font-weight: 600; overflow-wrap: anywhere; }
.specs > :nth-last-child(-n + 2) { border-bottom: 0; }

/* Footer */
.foot { background: var(--soft); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); font-size: 15px; }
.foot-grid { display: grid; gap: 18px; padding-block: 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.foot-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.foot-label { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.foot a { color: var(--ink); font-weight: 600; }

.notfound { text-align: center; padding-block: 40px; }
.notfound h1 { font: 800 28px/1.2 var(--display); }

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