/* Справиться проще — разводящая страница. Источник: Figma (макеты 1440 / 375, 1920 = 1440 с боковыми полями 260). */

:root {
  --bg: #f2f4f7;
  --text: #1e1e1e;
  --muted: #7d7c7f;
  --brand: #366159;
  --brand-hover: #2b4f48;
  --mint: #f0fdfa;
  --violet-bg: #eeeaf8;
  --violet: #65529a;
  --border: #d8d9dc;
  --avatar-border: #5b4c3c;
  --icon: #47474d;
  --footer: #1e1e1e;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body.menu-open { overflow: hidden; }

h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.container {
  width: 100%;
  max-width: 1464px; /* 1400 контент + 2×32 поля */
  margin-inline: auto;
  padding-inline: 16px;
}

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: #fff; padding: 8px 16px; border-radius: 8px;
}
.skip-link:focus { top: 8px; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Header ---------- */
.header {
  position: relative;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 12px;
  min-height: 64px;
}
.header__logo img { height: 40px; width: auto; }

.header .header__social { display: none; }
.header__mobile-actions { display: flex; align-items: center; gap: 8px; }

.burger {
  width: 32px; height: 32px; padding: 0; border: 0; background: none;
  color: var(--brand); cursor: pointer; display: grid; place-items: center;
}
.burger__close { display: none; }
.is-open .burger__open { display: none; }
.is-open .burger__close { display: block; }

/* мобильная панель меню */
.header__nav {
  display: none;
  position: absolute; left: 0; right: 0; top: 100%;
  height: calc(100dvh - 65px);
  background: #fff;
  padding: 24px 16px;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}
.is-open .header__nav { display: flex; }
.header__nav .nav-link { font-size: 18px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.header__nav .header__nav-social { display: flex; justify-content: center; gap: 16px; margin-top: 24px; }

.nav-link { font-weight: 500; line-height: 1.4; white-space: nowrap; }
.nav-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.social-list { display: flex; gap: 16px; align-items: center; }
.social {
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 32px;
  color: var(--icon);
  background: rgba(251, 246, 240, 0.48);
  border: 1px solid #eeecea;
  transition: background-color .15s;
}
.social:hover { background: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%;
  padding: 16px 32px;
  border-radius: 28px;
  background: var(--brand);
  color: #fff;
  font-weight: 500; font-size: 16px; line-height: 24px;
  text-align: center; white-space: nowrap;
  transition: background-color .15s;
}
.btn:hover { background: var(--brand-hover); }
.btn:active { background: #233f3a; }

/* ---------- Hero ---------- */
.hero { padding-top: 40px; padding-bottom: 16px; }
.hero__title { font-weight: 500; font-size: 32px; line-height: 1.12; margin-bottom: 8px; }
.hero__lead { color: var(--muted); }
.help-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--brand); font-weight: 500; white-space: nowrap;
}
.help-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.help-link--desktop { display: none; }
.help-link--mobile { padding-block: 8px; align-self: flex-start; }

/* ---------- Formats ---------- */
.formats__grid { display: flex; flex-direction: column; gap: 16px; }

.format {
  display: flex; flex-direction: column; gap: 16px;
  background: #fff; border-radius: 24px; padding: 16px;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag {
  display: inline-flex; align-items: center;
  padding: 5px 8px; border: 2px solid transparent; border-radius: 16px;
  font-size: 14px; line-height: 1.45; white-space: nowrap;
}
.tag--green { background: var(--mint); color: var(--brand); }
.tag--violet { background: var(--violet-bg); color: var(--violet); border-color: rgba(242, 244, 247, .08); }

.format__about { display: flex; flex-direction: column; gap: 4px; }
.format__title { font-weight: 500; font-size: 22px; line-height: 1.34; }
.format__text { display: none; color: var(--muted); min-height: 56px; }

.plaque {
  display: flex; align-items: center; gap: 12px;
  background: var(--mint); border-radius: 16px; padding: 8px;
}
.plaque__label { font-size: 13px; line-height: 1.2; letter-spacing: .13px; color: var(--muted); white-space: nowrap; }
.plaque__value { font-weight: 500; font-size: 20px; line-height: 1.4; color: var(--brand); white-space: nowrap; }
.plaque__price { display: flex; flex-direction: column; gap: 4px; }
.plaque__divider { width: 1px; height: 40px; background: var(--brand); flex-shrink: 0; }
/* Ближайшее время: появляется только когда есть свежие данные (slots.json).
   На мобильной: если время есть — слева время, справа фото (цены нет);
   если времени нет — показываем фото и цену, чтобы плашка не пустовала. */
.plaque__time { order: -1; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.plaque__time[hidden] { display: none; }
.plaque.has-time { justify-content: space-between; }
.plaque.has-time .plaque__divider, .plaque.has-time .plaque__price { display: none; }
.plaque.has-time .faces { margin-left: auto; }

.faces { display: flex; align-items: center; flex-shrink: 0; }
.faces img {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
  background: #fff; border: 1px solid var(--avatar-border);
  margin-right: -14px;
}
.faces img:last-child { margin-right: 0; }

/* ---------- More ---------- */
.more { padding-top: 40px; padding-bottom: 48px; }
.more__title { font-weight: 500; font-size: 28px; line-height: 1.18; margin-bottom: 16px; }
.more__grid { display: flex; flex-direction: column; gap: 16px; }

.direction {
  display: flex; flex-direction: column; gap: 12px;
  background: #fff; border-radius: 8px; padding: 16px;
  transition: box-shadow .15s, transform .15s;
}
.direction__title { font-weight: 500; font-size: 18px; line-height: 1.36; letter-spacing: .18px; }
.direction__text { font-size: 14px; line-height: 1.45; color: var(--muted); }
/* Состояния hover/focus в макете не вынесены в кадры — подобраны ненавязчиво */
.direction:hover { box-shadow: 0 4px 16px rgba(30, 30, 30, .08); }
.direction:hover .direction__title { color: var(--brand); }
.direction:active { transform: translateY(1px); }

/* ---------- Footer ---------- */
.footer { background: var(--footer); color: #fff; padding-block: 16px; }
.footer__inner { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.footer__social { gap: 16px; padding-block: 8px 6px; align-self: center; justify-content: center; }
.social-plain { display: block; width: 24px; height: 24px; color: #fff; }
.social-plain:hover { opacity: .75; }
.footer__copy { font-size: 14px; line-height: 1.45; }
.footer__mail { font-size: 14px; line-height: 1.45; text-decoration: underline; text-underline-offset: 3px; }
.footer__mail:hover { opacity: .75; }

/* ---------- Tablet / desktop ---------- */
@media (min-width: 1024px) {
  .container { padding-inline: 32px; }

  .hero { padding-top: 56px; padding-bottom: 32px; }
  .hero__title { font-size: 48px; margin-bottom: 16px; }
  .hero__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
  .hero__lead { max-width: 920px; }
  .help-link--desktop { display: inline-flex; padding-bottom: 4px; }
  .help-link--mobile { display: none; }

  .formats__grid { flex-direction: row; align-items: stretch; gap: 32px; }
  .format { flex: 1 1 0; min-width: 0; padding: 32px; gap: 24px; }
  .tag { font-size: 14px; line-height: 1.45; padding-inline: 16px; border-radius: 32px; }
  .format__about { gap: 8px; }
  .format__title { font-size: 24px; }
  .format__text { display: block; }

  .plaque { gap: 24px; padding: 16px; margin-top: auto; }
  .plaque__label { font-size: 14px; line-height: 1.45; letter-spacing: 0; }
  .plaque__divider { height: 48px; }
  .plaque, .plaque.has-time { justify-content: flex-start; }
  .plaque__time { flex: 1 1 0; }
  .plaque.has-time .plaque__divider { display: block; }
  .plaque.has-time .plaque__price { display: flex; }
  .plaque.has-time .faces { margin-left: 0; }
  .faces img { margin-right: -12px; }
  .faces img:last-child { margin-right: 0; }

  .more { padding-top: 56px; padding-bottom: 72px; }
  .more__title { font-size: 34px; margin-bottom: 24px; }
  .more__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .direction { border-radius: 12px; padding: 24px; min-height: 132px; }

  .footer { padding-block: 32px; }
  .footer__inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
  .footer__copy { grid-column: 1; grid-row: 1; }
  .footer__social { grid-column: 2; grid-row: 1; padding: 0; }
  .footer__mail { grid-column: 3; grid-row: 1; justify-self: end; }
}

@media (min-width: 1200px) {
  .more__grid { grid-template-columns: repeat(4, 1fr); }
}

/* Десктопная шапка — с 1280, иначе меню не помещается */
@media (min-width: 1280px) {
  .header__inner { position: relative; min-height: 80px; padding-block: 16px; }
  .header__logo img { height: 48px; }
  .header__mobile-actions { display: none; }
  .header .header__social { display: flex; }

  .header__nav {
    display: flex; position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    height: auto; padding: 0; background: none; overflow: visible;
    flex-direction: row; gap: 16px; align-items: center;
  }
  .header__nav .nav-link { font-size: 16px; padding: 0; border: 0; }
  .header__nav .header__nav-social { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Попап «Первичная маршрутизация» ---------- */
body.modal-open { overflow: hidden; }
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(30, 30, 30, .55); }
.modal__dialog {
  position: relative;
  width: 100%; max-width: 540px; max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
  background: var(--brand); color: #fff;
  border-radius: 28px;
  box-shadow: 0 16px 40px -30px rgba(0, 0, 0, .64);
}
.modal__close {
  position: absolute; top: 16px; right: 16px;
  width: 24px; height: 24px; padding: 0; border: 0; background: none; color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.modal__close:focus-visible, .modal__link:focus-visible { outline-color: #fff; }
.modal__kicker { color: var(--bg); padding-right: 32px; }
.modal__title { font-weight: 500; font-size: 28px; line-height: 1.18; }
.modal__text { color: var(--bg); }
.modal__chips { display: flex; flex-wrap: wrap; gap: 16px; padding-bottom: 8px; }
.chip {
  padding: 14px 32px; border-radius: 28px;
  font-weight: 500; font-size: 16px; line-height: 1.28; letter-spacing: .16px;
}
.chip--solid { background: #fff; color: var(--text); white-space: nowrap; }
.chip--outline { border: 1px solid #fff; color: #fff; }
.modal__link { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; }
.modal__link:hover { text-decoration: underline; text-underline-offset: 4px; }

@media (min-width: 1024px) {
  .modal__dialog { padding: 32px; }
  .modal__title { font-size: 34px; }
}
