/* ===== URM — design system =====
   Strict grid (Lebedev) + warm delivery (IKEA)
   Warm neutral palette + single accent. Geometric sans (Onest).
   Ported verbatim from prototype styles.css — accent #E8442A fixed; tweaks panel removed. */

/* #region SECTION_GoogleFonts [CONCEPT(7): Typography] */
@import url('https://fonts.googleapis.com/css2?family=Onest:wght@400;450;500;550;600;650;700;750;800&display=swap');
/* #endregion SECTION_GoogleFonts */

/* #region SECTION_Variables [CONCEPT(9): DesignTokens, CSSCustomProperties] */
:root {
  /* palette — warm neutral */
  --bg:      #F6F2EB;   /* молочный */
  --panel:   #EFE7DA;   /* песок light */
  --sand:    #E4D7C3;   /* песок */
  --ink:     #1B1915;   /* графит */
  --ink-2:   #6E675B;   /* muted graphite */
  --line:    rgba(27,25,21,0.13);
  --line-2:  rgba(27,25,21,0.07);
  --accent:  #E8442A;   /* акцент */
  --accent-ink: #ffffff;

  --r: 18px;            /* card radius */
  --maxw: 1320px;
  --gutter: 40px;
  --header-h: 76px;

  --ff: "Onest", system-ui, -apple-system, sans-serif;
}
/* #endregion SECTION_Variables */

/* #region SECTION_Reset [CONCEPT(8): CSSReset] */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--ff);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01" 1;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
/* #endregion SECTION_Reset */

/* #region SECTION_Layout [CONCEPT(8): Grid, Container] */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
/* #endregion SECTION_Layout */

/* #region SECTION_Typography [CONCEPT(8): Typography, Scale] */
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.h-display {
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.96;
  margin: 0;
  text-wrap: balance;
}
.h-2 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin: 0;
}
.lede {
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-2);
  font-weight: 450;
  max-width: 46ch;
  margin: 0;
  text-wrap: pretty;
}
.page-head { margin-top: 18px; }
.page-head .lede { max-width: none; }
/* #endregion SECTION_Typography */

/* #region SECTION_Buttons [CONCEPT(8): Buttons, CTA] */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  transition: transform .18s cubic-bezier(.2,.7,.2,1), background .18s, color .18s, border-color .18s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: #d83b22; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn .arr { transition: transform .2s; }
.btn:hover .arr { transform: translateX(4px); }
/* #endregion SECTION_Buttons */

/* #region SECTION_Reveal [CONCEPT(8): Animation, ScrollReveal] */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  /* Also disable nav-sheet slide transition (Block 2, MobileAdaptationPlan) */
  .nav-sheet { transition: none; }
}
/* #endregion SECTION_Reveal */

/* #region SECTION_PDP [CONCEPT(8): ProductPage] */
.pdp-top { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.pdp-gallery { position: sticky; top: calc(var(--header-h) + 18px); }
.pdp-details-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; align-items: start; }
.pdp-cross-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
/* Thumbnail grid (Block 1 item 5) — keep 4-up, no collapse needed (fits 360px) */
.pdp-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 12px; }
/* Marketplace buy grid (Block 1 item 6) */
.pdp-buy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* Narrow-screen overflow guards (PDP details — pre-existing horizontal-scroll fix).
   Spec rows are flex with justify-content:space-between; their dt/dd default to
   min-width:auto and refuse to shrink below content, inflating the .pdp-details-grid
   1fr track and forcing page-wide horizontal scroll on ≤~430px. The instruction
   download row (#instructions-block a) likewise won't wrap. Let both shrink/wrap.
   Verified via Edge CDP: scrollWidth 429→360 at 360px; ovf:0 at 360/390/414/768/1024.
   Desktop unaffected (content already fits — these props are no-ops when it does). */
.pdp-details-grid dl dt,
.pdp-details-grid dl dd { min-width: 0; overflow-wrap: anywhere; }
#instructions-block a { flex-wrap: wrap; }
#instructions-block a > div { min-width: 0; }
/* #endregion SECTION_PDP */

/* #region SECTION_HowToBuy [CONCEPT(7): HowToBuy] */
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.shops-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) {
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .shops-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .steps-grid { grid-template-columns: 1fr; }
}
/* #endregion SECTION_HowToBuy */

/* #region SECTION_Support [CONCEPT(7): Support] */
.support-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; }
/* Base rule for sf-row (Block 1 item 4) — was inline, now a class */
.sf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) {
  .support-layout { grid-template-columns: 1fr; gap: 28px; }
  /* dropped !important — base rule + cascade wins cleanly */
  .sf-row { grid-template-columns: 1fr; }
}
/* #endregion SECTION_Support */

/* #region SECTION_Catalog [CONCEPT(8): Catalog, Filter] */
.cat-layout { display: grid; grid-template-columns: 256px 1fr; gap: 40px; align-items: start; }
.cat-sidebar { position: sticky; top: calc(var(--header-h) + 18px); display: flex; flex-direction: column; gap: 26px; }
.filter-block { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.filter-block:last-child { border-bottom: none; padding-bottom: 0; }
.filter-title { font-size: 12.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 12px; }
.cat-chips { display: flex; gap: 10px; margin-top: 26px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.cat-chips::-webkit-scrollbar { height: 0; }
.chip {
  display: inline-flex; align-items: center; padding: 10px 18px; border-radius: 999px;
  font-size: 15px; font-weight: 550; white-space: nowrap; border: 1px solid var(--line);
  background: transparent; color: var(--ink); cursor: pointer;
  transition: background .18s, border-color .18s, color .18s;
}
.chip.is-active, .chip:hover { background: var(--ink); color: #F6F2EB; border-color: var(--ink); }
/* #endregion SECTION_Catalog */

/* #region SECTION_Placeholder [CONCEPT(6): Placeholder] */
.ph {
  background: repeating-linear-gradient(135deg, var(--sand) 0 14px, var(--panel) 14px 28px);
  display: flex; align-items: flex-end; justify-content: flex-start;
  color: var(--ink-2);
}
.ph span {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px; letter-spacing: .04em;
  background: var(--bg); padding: 6px 10px; margin: 14px; border-radius: 6px;
  border: 1px solid var(--line);
}
/* #endregion SECTION_Placeholder */

/* #region SECTION_Cards [CONCEPT(8): ProductCard, CategoryCard] */
.product-card {
  display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden;
  background: var(--bg); border: 1px solid var(--line);
  transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s;
  text-decoration: none; color: inherit;
}
.product-card:hover { transform: translateY(-6px); box-shadow: 0 26px 54px -34px rgba(27,25,21,.4); }
.product-card:hover .card-arrow { background: var(--accent); color: #fff; }
.product-card:hover .card-img { transform: scale(1.05); }
.card-img { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.card-arrow {
  width: 36px; height: 36px; border-radius: 999px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 16px;
  background: var(--panel); color: var(--ink);
  transition: background .25s, color .25s;
}
.is-hidden { display: none !important; }
/* #endregion SECTION_Cards */

/* #region SECTION_HeroLayout [CONCEPT(8): Hero, Grid; DOMAIN(7): Home] */
/* Hero split grid (Block 1 item 1) — was inline 1.05fr 0.95fr */
.hero-split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
/* Hero stats flex row (Block 1 item 2) — was inline display:flex;gap:44px */
.hero-stats {
  display: flex;
  gap: 44px;
  margin-top: 48px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
/* #endregion SECTION_HeroLayout */

/* #region SECTION_FooterLayout [CONCEPT(8): Footer, Grid; DOMAIN(7): Footer] */
/* Footer columns grid (Block 1 item 7) — was inline 1.3fr 1fr 1fr */
.footer-cols {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 48px;
  align-items: start;
}
/* #endregion SECTION_FooterLayout */

/* #region SECTION_Responsive [CONCEPT(9): Responsive, Mobile] */
@media (max-width: 980px) {
  .pdp-top { grid-template-columns: 1fr; gap: 36px; }
  .pdp-gallery { position: static; }
  .pdp-details-grid { grid-template-columns: 1fr; gap: 40px; }
  .pdp-cross-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-layout { grid-template-columns: 220px 1fr; gap: 28px; }
}
@media (max-width: 760px) {
  /* Hero split → single column (Block 1 item 1) */
  .hero-split { grid-template-columns: 1fr; gap: 32px; }
  .cat-layout { grid-template-columns: 1fr; }
  .cat-sidebar { position: static; flex-direction: row; flex-wrap: wrap; gap: 18px 36px;
    padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
  .filter-block { border-bottom: none; padding-bottom: 0; flex: 1 1 200px; }
  /* Hero stats — keep row, allow wrap, tighten gap (Block 1 item 2) */
  .hero-stats { gap: 28px; }
}
@media (max-width: 700px) {
  :root { --gutter: 22px; }
  .pdp-cross-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
@media (max-width: 460px) {
  .cat-grid { grid-template-columns: 1fr; }
  /* Marketplace buy tiles → single column (Block 1 item 6) */
  .pdp-buy-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  /* Footer columns → single column (Block 1 item 7) — replaces !important descendant hack */
  .footer-cols { grid-template-columns: 1fr; }
}
/* #endregion SECTION_Responsive */

/* #region SECTION_MobileNav [CONCEPT(9): Responsive, Navigation; DOMAIN(8): Header, MobileMenu] */
/* === Desktop: show desktop nav, hide mobile controls === */
@media (min-width: 761px) {
  .nav-burger,
  .nav-sheet { display: none; }
  .nav-desktop { display: flex; }
}

/* === Mobile (≤760px): swap desktop nav for burger + sheet === */
@media (max-width: 760px) {
  .nav-desktop { display: none; }

  /* Burger button — inline-flex, ≥44px hit area */
  .nav-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    padding: 0;
    transition: background .18s, border-color .18s;
    justify-self: end;
  }
  .nav-burger:hover { background: rgba(27,25,21,0.06); }

  /* Nav sheet — fixed panel directly under the sticky header */
  .nav-sheet {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    top: var(--header-h);
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    /* start hidden: shifted up + transparent */
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: transform .22s, opacity .22s, visibility .22s;
    z-index: 49; /* just below header z-index:50 */
  }
  .nav-sheet.is-open {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  /* Sheet links — full-width rows, ≥48px tap target */
  .nav-sheet a {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 14px var(--gutter);
    font-size: 17px;
    font-weight: 550;
    letter-spacing: -0.01em;
    color: var(--ink);
    border-bottom: 1px solid var(--line-2);
    min-height: 48px;
    transition: background .15s;
  }
  .nav-sheet a:last-child { border-bottom: none; }
  .nav-sheet a:hover { background: rgba(27,25,21,0.05); }
}

/* #endregion SECTION_MobileNav */
