/* ============================================================
   Общая обвязка сайта: плавающая шапка и подвал.
   Подключается после style.css, использует его токены из :root.
   ============================================================ */

/* Запасные токены для страниц без style.css (хаб, гайд). Значения совпадают с :root в style.css;
   :where() обнуляет вес, поэтому любой :root страницы или style.css их перекрывает. */
:where(:root) {
  --text-primary: #070707;
  --text-secondary: #74757a;
  --text-caption: #8f8f91;
  --blue: #2384e8;
  --blue-dark: #1568c7;
  --blue-border: #b9ddf5;
  --bg-secondary: #f8f8fc;
  --surface: #fff;
  --border: #ebeaf1;
  --border-input: #e2e4ec;
  --r-md: 16px;
  --r-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
}

/* ---------- Шапка: плавающая плашка, прилипает к верху ---------- */

/* Переход по якорю останавливается под шапкой: 12px от верха, 12px отступа и плашка 56px */
html {
  scroll-padding-top: 80px;
}

.egrn-header {
  position: sticky;
  top: 12px;
  z-index: 900;
  padding: 12px 20px 0;
  text-align: left;
}

/* Плашка режима работы над плавающей шапкой не прилипает: прилипшая, она закрывает шапку при прокрутке,
   а две прилипшие полосы на телефоне занимают больше четверти экрана */
.vacation-banner {
  position: relative;
}

/* Между шапкой и main стоят её скрипты, поэтому соседа ищем через «~», а не «+» */
.egrn-header ~ main {
  padding-top: 40px;
}

/* Первый блок страницы начинается на одном расстоянии от шапки, какой бы отступ у него ни был */
.egrn-header ~ main > :first-child {
  margin-top: 0;
}

.egrn-header__bar {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 56px;
  padding: 0 10px 0 16px;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(235, 234, 241, 0.9);
  border-radius: var(--r-md);
  box-shadow: 0 6px 24px rgba(13, 71, 161, 0.06);
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

.egrn-header.is-scrolled .egrn-header__bar {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 30px rgba(13, 71, 161, 0.12);
}

.egrn-header__brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.egrn-header__brand img {
  height: 24px;
  width: auto;
  display: block;
}

.egrn-header__nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.egrn-header__link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.egrn-header__link:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-decoration: none;
}

.egrn-header__link.is-active {
  color: var(--text-primary);
}

.egrn-header__cta {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  margin-left: 6px;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s ease;
}

.egrn-header__cta:hover {
  background: var(--blue-dark);
  color: #fff;
  text-decoration: none;
}

/* Кнопка меню: четыре точки, при открытии поворачиваются */
.egrn-header__burger {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.egrn-header__burger:hover {
  background: var(--bg-secondary);
}

.egrn-header__burger:focus:not(:focus-visible) {
  outline: none;
}

.egrn-header__burger:focus-visible {
  outline: 2px solid var(--blue-border);
  outline-offset: 2px;
}

.egrn-header__burger-dots {
  position: relative;
  display: block;
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.egrn-header__burger-dots i {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 1px;
  background: currentColor;
}

.egrn-header__burger-dots i:nth-child(1) { top: 0; left: 0; }
.egrn-header__burger-dots i:nth-child(2) { top: 0; right: 0; }
.egrn-header__burger-dots i:nth-child(3) { bottom: 0; left: 0; }
.egrn-header__burger-dots i:nth-child(4) { bottom: 0; right: 0; }

.egrn-header.is-open .egrn-header__burger-dots {
  transform: rotate(45deg);
}

/* Выпадающее меню для узких экранов */
.egrn-header__menu {
  display: none;
  position: absolute;
  left: 20px;
  right: 20px;
  top: calc(100% + 8px);
  max-width: 480px;
  margin: 0 auto;
  flex-direction: column;
  padding: 8px;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(235, 234, 241, 0.9);
  border-radius: var(--r-md);
  box-shadow: 0 16px 40px rgba(13, 71, 161, 0.14);
}

.egrn-header__menu a {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

.egrn-header__menu a:hover {
  background: var(--bg-secondary);
  text-decoration: none;
}

.egrn-header__menu a.is-active {
  color: var(--blue-dark);
}

@media (max-width: 539px) {
  .egrn-header__nav { display: none; }
  .egrn-header__burger { display: inline-flex; }
  .egrn-header.is-open .egrn-header__menu { display: flex; }
}

/* ---------- Подвал: призыв к заказу и строки со ссылками ---------- */

.egrn-footer {
  margin-top: 16px;
  text-align: left;
}

.egrn-footer__cta {
  background: var(--text-primary);
  color: #fff;
  padding: 56px 20px;
}

.egrn-footer__cta-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.egrn-footer__cta h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #fff;
  text-align: left;
}

.egrn-footer__cta p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
}

.egrn-footer__cta-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--r-full);
  background: #fff;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.egrn-footer__cta-btn:hover {
  background: var(--blue);
  color: #fff;
  text-decoration: none;
}

.egrn-footer__body {
  background: var(--surface);
  padding: 8px 20px 32px;
}

.egrn-footer__inner {
  max-width: 480px;
  margin: 0 auto;
}

.egrn-footer__row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}

.egrn-footer__label {
  padding-top: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-caption);
}

.egrn-footer__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.egrn-footer__pill {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-input);
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.egrn-footer__pill:hover {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: #fff;
  text-decoration: none;
}

.egrn-footer__value {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
}

.egrn-footer__value a {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--blue-border);
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.egrn-footer__value a:hover {
  color: var(--blue-dark);
  text-decoration-color: var(--blue-dark);
}

.egrn-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 20px 0 0;
  font-size: 13px;
  color: var(--text-caption);
}

@media (max-width: 479px) {
  .egrn-footer__row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .egrn-footer__label { padding-top: 0; }
  .egrn-footer__cta h2 { font-size: 24px; }
}
