/**
 * База: сброс, типографика, элементы по умолчанию.
 */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background: var(--color-surface);
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  cursor: pointer;
}

/* ── Заголовки ───────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  line-height: var(--lh-tight);
  font-weight: var(--fw-bold);
  color: var(--color-text);
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

@media (min-width: 768px) {
  h1 { font-size: var(--fs-4xl); }
  h2 { font-size: var(--fs-3xl); }
}

p {
  margin: 0 0 var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

ul, ol {
  margin: 0;
  padding: 0;
}

/* ── Утилиты текста ──────────────────────────────────── */

.text-muted { color: var(--color-text-muted); }
.text-soft  { color: var(--color-text-soft); }
.text-faint { color: var(--color-text-faint); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-sale { color: var(--color-sale); }

.text-xs { font-size: var(--fs-xs); }
.text-sm { font-size: var(--fs-sm); }
.text-lg { font-size: var(--fs-lg); }
.text-xl { font-size: var(--fs-xl); }
.text-2xl { font-size: var(--fs-2xl); }

.fw-medium { font-weight: var(--fw-medium); }
.fw-semibold { font-weight: var(--fw-semibold); }
.fw-bold { font-weight: var(--fw-bold); }
.fw-black { font-weight: var(--fw-black); }

.nowrap { white-space: nowrap; }
.text-center { text-align: center; }

/* Доступное скрытие: невидимо глазом, читается скринридером */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.is-hidden {
  display: none !important;
}

/*
 * Совместимость на время миграции: JS темы (корзина, счётчик, кнопки)
 * переключает Tailwind-классы .hidden/.flex. На страницах без Tailwind
 * их некому объявить — объявляем сами. Убрать вместе с последним
 * classList.toggle('hidden') в assets/js.
 */
.hidden { display: none !important; }
.flex { display: flex; }


/* Переход по якорю (в том числе с другой страницы, /#podbor): блок встаёт
   под липкой шапкой, а не прячет под неё свой заголовок */
[id] {
  scroll-margin-top: calc(var(--header-height) + var(--space-3));
}
