/* ==========================================================================
   Spot — сброс, типографика, сетка
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 56px);
}

body, h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
  padding: 0;
}

ul[role='list'], ol[role='list'] { list-style: none; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color var(--dur-slow) var(--ease),
              color var(--dur-slow) var(--ease);
}

body.is-locked { overflow: hidden; }

/* при первой отрисовке гасим переходы, чтобы тема не «мигала» */
[data-theme-boot] *,
[data-theme-boot] *::before,
[data-theme-boot] *::after {
  transition: none !important;
}

img, picture, svg, video {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

:target { scroll-margin-top: calc(var(--header-h) + 56px); }

/* ---------- заголовки ---------- */
h1, h2, h3, h4 {
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); font-weight: var(--fw-medium); }

p { text-wrap: pretty; }

strong, b { font-weight: var(--fw-bold); }

/* ---------- служебная типографика ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--accent-text);
}

.lead {
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: var(--maxw-text);
}

.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }

.price {
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* ---------- сетка и контейнеры ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section--sunken { background: var(--bg-sunken); }

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4) var(--sp-6);
  margin-bottom: var(--sp-6);
}

.section__title { margin-bottom: var(--sp-2); }

.stack > * + * { margin-top: var(--sp-4); }

.grid { display: grid; gap: var(--sp-5); }

.grid--cards {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 265px), 1fr));
}

.grid--branches {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

/* ---------- доступность ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -120%);
  z-index: var(--z-toast);
  padding: var(--sp-3) var(--sp-5);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: var(--fw-bold);
  border-radius: 0 0 var(--r-md) var(--r-md);
  transition: transform var(--dur-base) var(--ease);
}

.skip-link:focus-visible { transform: translate(-50%, 0); }

/* ---------- скроллбар ---------- */
@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: var(--bg-sunken); }
  ::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--r-pill);
    border: 2px solid var(--bg-sunken);
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }
}

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

/* прячем горизонтальные скроллбары у лент категорий */
.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ---------- печать ---------- */
@media print {
  .site-header, .fab, .menu-toolbar, .lightbox, .modal { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding-block: 1rem; break-inside: avoid; }
}
