/* Базовые стили: сброс, типографика, раскладка экрана. Только var(--…) из tokens.css. */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  background: var(--bg);
}

::selection {
  background: var(--selection);
  color: var(--text);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  font-weight: var(--weight-regular);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  caret-color: var(--primary);
}

img {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
}

a {
  color: var(--primary);
  text-underline-offset: var(--underline-offset);
}

/* Кнопки, ссылки-кнопки: нажатие без задержки 300 мс */
button,
a,
[role="button"] {
  touch-action: manipulation;
}

input,
textarea,
select {
  font-size: var(--input-text); /* см. --input-text: мельче — iOS приближает страницу при вводе */
}

:focus-visible {
  outline: var(--focus-ring) solid var(--accent);
  outline-offset: var(--focus-ring);
}

h1,
h2,
h3,
p {
  margin: 0;
}

.screen {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-4) var(--screen-padding) calc(var(--nav-height) + var(--space-6) + var(--safe-bottom));
  animation: screen-in var(--duration-base) var(--ease-out);
}

.screen--no-nav {
  padding-bottom: calc(var(--space-6) + var(--safe-bottom));
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(var(--appear-shift));
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.screen-title {
  font-family: var(--font-display);
  font-size: var(--text-screen-title);
  line-height: var(--lh-screen-title);
  font-weight: var(--weight-display);
  letter-spacing: var(--letter-display);
  text-wrap: balance;
  margin-bottom: var(--space-4);
}

.block-title {
  font-family: var(--font-display);
  font-size: var(--text-block-title);
  line-height: var(--lh-block-title);
  font-weight: var(--weight-display);
  letter-spacing: var(--letter-display);
}

.section {
  margin-top: var(--space-6);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

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

.small {
  font-size: var(--text-small);
  line-height: var(--lh-small);
}

.price {
  font-family: var(--font-display);
  font-size: var(--text-price);
  line-height: var(--lh-price);
  font-weight: var(--weight-display);
  font-variant-numeric: tabular-nums;
}

.price-old {
  color: var(--price-old);
  text-decoration: line-through;
  font-size: var(--text-small);
  line-height: var(--lh-small);
  margin-left: var(--space-2);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5) var(--space-3);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.row--between {
  justify-content: space-between;
}

.visually-hidden {
  position: absolute;
  width: var(--border-width);
  height: var(--border-width);
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
