/*
 * Дизайн-система starterfenix.ru.
 * Основа — система сайта Автоплюса (tula-avtoservis.ru): Tilda Sans, плашки
 * #172126 / #F2F6F7, кнопки со скруглением 5px, карточки 15–20px.
 * Отличие одно — акцент: малиновый логотипа «Феникса» вместо оранжевого #F47D32.
 * Образец всех компонентов — design-system.html. Новые стили страниц сначала
 * ищем здесь, «похожих» классов не заводим.
 */

@font-face {
  font-family: "Tilda Sans";
  font-style: normal;
  font-weight: 250 1000;
  font-display: swap;
  src: url("../fonts/TildaSans-VF.woff2") format("woff2-variations"),
       url("../fonts/TildaSans-VF.woff2") format("woff2"),
       url("../fonts/TildaSans-VF.woff") format("woff");
}

:root {
  /* colour */
  --accent: #b40001;
  --accent-hover: #8e0001;
  --accent-tint: #fbe8e8;
  --accent-soft: #ffd3d3;
  --text: #2e2e2e;
  --black: #000;
  --muted: #687176;
  --dark: #172126;
  --dark-line: #2c3a41;
  --light: #f2f6f7;
  --line: #dfe5e7;
  --white: #fff;

  /* type */
  --font: "Tilda Sans", system-ui, sans-serif;
  /* one scale for the whole site: 56 / 40 / 28 / 22 / 18 / 15 — no sizes outside it */
  --fs-h1: clamp(36px, 4.2vw, 56px);
  --fs-h2: clamp(28px, 3vw, 40px);
  --fs-h3: clamp(22px, 2vw, 28px);
  --fs-lead: clamp(19px, 1.6vw, 22px);
  --fs-body: 18px;
  --fs-small: 15px;

  /* shape and space */
  --r-btn: 5px;
  --r-card: 15px;
  --r-panel: 20px;
  --container: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(48px, 7vw, 96px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--text); font: 400 var(--fs-body)/1.55 var(--font); }
img { max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.on-accent :focus-visible, .panel--dark :focus-visible { outline-color: var(--white); }

.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }

/* type */
.h1, .h2, .h3 { margin: 0; font-weight: 600; color: var(--text); }
.h1 { font-size: var(--fs-h1); line-height: 1.12; letter-spacing: -.015em; }
.h2 { font-size: var(--fs-h2); line-height: 1.22; }
.h3 { font-size: var(--fs-h3); line-height: 1.2; }
.sub { margin: 0; font-size: var(--fs-h3); line-height: 1.3; font-weight: 500; }
.lead { font-size: var(--fs-lead); line-height: 1.5; }
.small { font-size: var(--fs-small); line-height: 1.45; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.section-title { text-align: center; }
.nw { white-space: nowrap; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 55px; padding: 0 32px; border: 2px solid transparent; border-radius: var(--r-btn); font: 600 var(--fs-body)/1.2 var(--font); text-align: center; text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.btn--sm { min-height: 42px; padding: 0 22px; }
.btn--fill { background: var(--accent); color: var(--white); }
.btn--fill:hover { background: var(--accent-hover); }
.btn--outline { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn--outline:hover { background: var(--accent-tint); }
.btn--dark { background: transparent; border-color: var(--black); color: var(--black); }
.btn--dark:hover { background: var(--black); color: var(--white); }
.btn--light { background: var(--white); color: var(--accent); }
.btn--light:hover { background: var(--accent-tint); }

/* chips — как «Ремонт АКПП» у Автоплюса */
.chip { display: inline-flex; align-items: center; min-height: 48px; padding: 10px 24px; border: 1px solid var(--accent); border-radius: var(--r-btn); background: var(--white); color: var(--accent); font: 400 var(--fs-body)/1.25 var(--font); text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s; }
.chip:hover { background: var(--accent-tint); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--white); }
.chip--sm { min-height: 36px; padding: 6px 14px; font-size: var(--fs-small); }
.chip[aria-current="page"] { background: var(--accent); color: var(--white); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }

/* form fields */
.field { display: grid; gap: 6px; }
.field__label { font-size: var(--fs-small); color: var(--muted); }
.field input { width: 100%; min-height: 55px; padding: 0 18px; border: 1px solid var(--line); border-radius: var(--r-btn); background: var(--white); color: var(--text); font: 400 var(--fs-body)/1.2 var(--font); }
.field input:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field input[aria-invalid="true"] { border-color: var(--accent); }
.field__error { font-size: var(--fs-small); color: var(--accent); }

/* surfaces */
.panel { padding: clamp(24px, 4vw, 48px); border-radius: var(--r-card); background: var(--light); }
.panel--dark { background: var(--dark); color: var(--white); }
.panel--dark .h1, .panel--dark .h2, .panel--dark .h3 { color: var(--white); }
.panel--accent { background: var(--accent); color: var(--white); }
.panel--accent .h1, .panel--accent .h2, .panel--accent .h3 { color: var(--white); }
.panel--xl { border-radius: var(--r-panel); }
.card { padding: 24px 28px; border-radius: var(--r-card); background: var(--light); }
.photo { display: block; margin: 0; border-radius: var(--r-card); overflow: hidden; background: #3b4146 center / cover no-repeat; }

/* header */
.site-header { position: relative; background: var(--white); box-shadow: 0 1px 0 var(--line); }
.site-header__top { display: flex; align-items: center; gap: 24px 40px; padding-block: 14px; }
.site-header__logo img { display: block; height: 74px; width: auto; }
.site-header__places { display: flex; gap: 16px 40px; margin-left: auto; }
.site-header__cta { flex: none; }
.place__addr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; font-size: var(--fs-small); }
.place__map { color: var(--muted); }
.place__tels { display: flex; flex-wrap: wrap; gap: 0 16px; }
.place__tel { font-size: var(--fs-lead); font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }
.place__tel:hover { color: var(--accent); }
.site-nav { border-top: 1px solid var(--line); }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0 32px; margin-block: 0; padding-block: 0; list-style: none; }
.site-nav a { display: block; padding-block: 12px; font-size: var(--fs-body); font-weight: 500; text-decoration: none; }
.site-nav a:hover, .site-nav [aria-current] { color: var(--accent); }
.menu-btn { display: none; }

/* contact blocks */
.hours { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; margin: 0; font-variant-numeric: tabular-nums; }
.hours dt { font-weight: 600; }
.hours dd { margin: 0; }

/* brands */
.brands { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; }
.brands__title { margin-right: 8px; font-weight: 600; }
.brands ul { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; padding: 0; list-style: none; color: var(--muted); }

@media (max-width: 1240px) {
  .site-header__places { display: none; }
  .site-header__top { flex-wrap: wrap; }
  .site-header__cta { margin-left: auto; }
}
@media (max-width: 760px) {
  .site-header__top { flex-wrap: nowrap; gap: 10px; padding-block: 10px; }
  .site-header__logo img { height: 58px; }
  .place__tel { font-size: var(--fs-body); }
  .menu-btn { display: inline-flex; margin-left: auto; }
  .site-header__cta { margin-left: 0; padding: 0 16px; }
  .site-nav { display: none; }
  .site-nav.open { display: block; position: absolute; left: 0; right: 0; z-index: 10; background: var(--white); box-shadow: 0 1px 0 var(--line); }
  .site-nav.open ul { flex-direction: column; }
  .site-nav.open a { font-size: var(--fs-lead); padding-block: 10px; }
  .btn--block-sm { width: 100%; }
}

/* places strip under header (shown where the header has no room for them) */
.places-strip { display: none; background: var(--light); }
.places-strip .container { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; padding-block: 12px; }
@media (max-width: 1240px) { .places-strip { display: block; } }
@media (max-width: 560px) { .places-strip .container { grid-template-columns: 1fr; } }
