/* =====================================================================
   Шапка сайта (pages/components/header.php) — редизайн 2026, DESIGN.md.
   • белая полоса 56px (ПК 72px), без стекла; тень появляется только после прокрутки;
   • меню на телефоне — белый лист на весь экран справа (в RTL — слева);
   • нижняя панель <1024px: 5 пунктов, прижата к низу, без «капсулы».
   Токены — css/site.css, кнопки .btn / .ab-chip — css/ab-base.css.
   ===================================================================== */

.sh { font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; }
.sh *, .sh *::before, .sh *::after { box-sizing: border-box; }
.sh a { text-decoration: none; color: inherit; }
.sh-wrap {
    width: 100%;
    max-width: calc(var(--container) + 2 * var(--margin));
    margin-inline: auto;
    padding-inline: var(--margin);
}
.sh-top { display: none; }

/* ---------- Полоса ---------- */
.sh-bar {
    position: fixed; top: 0; inset-inline: 0; z-index: 1001;
    background: var(--bg);
}
/* Тень «плывущей» шапки: псевдоэлемент, меняется только opacity */
.sh-bar::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    box-shadow: 0 8px 20px -16px rgb(11 35 71 / .45);
    opacity: 0; transition: opacity var(--dur-fast) ease;
}
.sh.is-scrolled .sh-bar::after { opacity: 1; }
.sh-bar__inner {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: var(--s-2);
    height: var(--header-h);
}
.sh-logo { display: inline-flex; align-items: center; flex-shrink: 0; min-height: 44px; }
.sh-logo img { display: block; width: auto; height: 32px; }
@media (min-width: 1024px) { .sh-logo img { height: 40px; } }

/* ---------- Навигация (ПК ≥1200) ---------- */
.sh-nav { display: none; flex: 1; min-width: 0; }
@media (min-width: 1200px) { .sh-nav { display: block; } }
.sh-nav__list { display: flex; align-items: center; justify-content: center; gap: var(--s-4); margin: 0; padding: 0; list-style: none; }
.sh-nav__item { position: relative; display: flex; align-items: center; }
.sh-nav__link {
    display: inline-flex; align-items: center; height: 44px;
    color: var(--ink); font: 500 16px/1 var(--font); white-space: nowrap;
    text-decoration: underline 2px transparent; text-underline-offset: 6px;
    transition: text-decoration-color var(--dur-fast) ease;
}
@media (hover: hover) { .sh-nav__link:hover { text-decoration-color: var(--line); } }
.sh-nav__item.is-active > .sh-nav__link { text-decoration-color: var(--ink); }
.sh-nav__toggle {
    display: grid; place-items: center; width: 28px; height: 44px; padding: 0; border: 0;
    background: transparent; color: var(--muted); cursor: pointer;
}
.sh-nav__toggle svg { transition: transform var(--dur) var(--ease-out); }
.sh-nav__item--drop.is-open .sh-nav__toggle svg { transform: rotate(180deg); }
@media (hover: hover) { .sh-nav__item--drop:hover .sh-nav__toggle svg { transform: rotate(180deg); } }

/* Выпадашка курорта: белая, углы 0, тень (она правда парит) */
.sh-drop {
    position: absolute; top: calc(100% + 14px); inset-inline-start: -16px; min-width: 260px; padding: var(--s-2) 0;
    background: var(--bg); box-shadow: 0 16px 40px -20px rgb(11 35 71 / .4);
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity var(--dur-fast) ease, transform var(--dur) var(--ease-out), visibility 0s linear var(--dur);
}
.sh-drop::before { content: ""; position: absolute; inset-inline: 0; top: -16px; height: 16px; }
.sh-nav__item--drop:focus-within .sh-drop, .sh-nav__item--drop.is-open .sh-drop {
    opacity: 1; visibility: visible; transform: none; transition-delay: 0s;
}
@media (hover: hover) { .sh-nav__item--drop:hover .sh-drop { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; } }
.sh-drop__all, .sh-drop__list a {
    display: flex; align-items: center; min-height: 44px; padding: 0 var(--s-4);
    color: var(--ink); font: 400 16px/1.3 var(--font); white-space: nowrap;
}
.sh-drop__all { font-weight: 500; }
.sh-drop__list { margin: 0; padding: 0; list-style: none; }
@media (hover: hover) { .sh-drop__all:hover, .sh-drop__list a:hover { background: var(--surface); } }

/* ---------- Справа: язык, WhatsApp, меню ---------- */
.sh-actions { display: flex; align-items: center; gap: var(--s-2); margin-inline-start: auto; }
.sh-lang { position: relative; display: none; }
@media (min-width: 1200px) { .sh-lang { display: block; } }
.sh-lang__btn {
    display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0 var(--s-2); border: 0;
    background: transparent; color: var(--ink); font: 500 16px/1 var(--font); cursor: pointer;
}
.sh-lang__btn svg { color: var(--muted); transition: transform var(--dur) var(--ease-out); }
.sh-lang.is-open .sh-lang__btn svg { transform: rotate(180deg); }
.sh-lang__menu {
    position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 200px; padding: var(--s-2) 0;
    background: var(--bg); box-shadow: 0 16px 40px -20px rgb(11 35 71 / .4);
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity var(--dur-fast) ease, transform var(--dur) var(--ease-out), visibility 0s linear var(--dur);
}
.sh-lang.is-open .sh-lang__menu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.sh-lang__item { display: flex; align-items: center; gap: var(--s-3); min-height: 44px; padding: 0 var(--s-4); color: var(--ink); font-size: 16px; }
.sh-lang__code { width: 2.2em; font-weight: 600; color: var(--muted); }
.sh-lang__item.is-current { text-decoration: underline 2px; text-underline-offset: 6px; }
@media (hover: hover) { .sh-lang__item:hover { background: var(--surface); } }

/* WhatsApp: на телефоне — квадратная «пилюля» 44×44 с зелёной иконкой, на ПК — .btn--wa.btn--sm */
.sh-cta {
    display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
    border-radius: var(--r-press); background: var(--surface); color: var(--wa);
    transition: background-color var(--dur-fast) ease, transform 100ms ease;
}
.sh-cta span { display: none; }
.sh-cta:active { transform: scale(.98); }
@media (min-width: 1200px) {
    .sh-cta {
        display: inline-flex; align-items: center; gap: 8px; width: auto; padding: 0 18px;
        background: var(--wa); color: #fff; font: 600 16px/1 var(--font);
    }
    .sh-cta span { display: inline; }
    .sh-cta svg { width: 20px; height: 20px; }
}
@media (hover: hover) {
    .sh-cta:hover { background: var(--surface-2); color: var(--wa); }
}
@media (hover: hover) and (min-width: 1200px) {
    .sh-cta:hover { background: var(--wa-hover); color: #fff; }
}
.sh-cta:focus-visible { outline: 3px solid var(--wa); outline-offset: 3px; }

.sh-burger {
    display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r-press);
    background: var(--surface); cursor: pointer; transition: transform 100ms ease, background-color var(--dur-fast) ease;
}
.sh-burger span { display: block; width: 18px; height: 2px; background: var(--ink); }
.sh-burger:active { transform: scale(.96); }
@media (hover: hover) { .sh-burger:hover { background: var(--surface-2); } }
@media (min-width: 1200px) { .sh-burger { display: none; } }

/* ---------- Меню-лист ---------- */
.sh-backdrop {
    position: fixed; inset: 0; z-index: 1190; background: var(--backdrop);
    opacity: 0; transition: opacity 200ms ease;
}
.sh-backdrop.is-open { opacity: 1; }
.sh-drawer {
    position: fixed; z-index: 1200; top: 0; bottom: 0; inset-inline-end: 0;
    width: 100%; max-width: 480px;
    display: flex; flex-direction: column;
    background: var(--bg);
    transform: translateX(100%);
    transition: transform var(--dur-ui-max) var(--ease-sheet), visibility 0s linear var(--dur-ui-max);
    visibility: hidden;
}
[dir="rtl"] .sh-drawer { transform: translateX(-100%); }
.sh-drawer.is-open, [dir="rtl"] .sh-drawer.is-open {
    transform: none; visibility: visible;
    transition: transform var(--dur-ui-max) var(--ease-sheet), visibility 0s;
}
.sh-drawer__head {
    display: flex; align-items: center; justify-content: space-between; flex: none;
    height: var(--header-h); padding-inline: var(--margin);
}
.sh-drawer__head .sh-logo img { height: 32px; }
.sh-drawer__close {
    display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r-press);
    background: var(--surface); color: var(--ink); cursor: pointer;
}
.sh-drawer__body {
    flex: 1; overflow-y: auto; overscroll-behavior: contain;
    padding: var(--s-2) var(--margin) calc(var(--s-6) + env(safe-area-inset-bottom));
}
.sh-drawer__label {
    margin: var(--s-5) 0 var(--s-2); font: 500 var(--step-small)/1.4 var(--font); color: var(--muted);
    letter-spacing: 0; text-transform: none;
}
.sh-drawer__label:first-child { margin-top: var(--s-2); }

/* Курорты крупными строками 56px, число экскурсий справа */
.sh-acc { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s-1); }
.sh-acc__row { display: flex; align-items: stretch; background: var(--surface); }
.sh-acc__item.is-active .sh-acc__row { background: var(--surface-2); }
.sh-acc__link {
    flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
    min-height: 56px; padding: 0 var(--s-4);
    color: var(--ink); font: 500 var(--step-lead)/1.15 var(--font); letter-spacing: -.01em;
}
.sh-acc__count { font: 400 var(--step-small)/1 var(--font); color: var(--muted); font-variant-numeric: tabular-nums; }
.sh-acc__toggle {
    display: grid; place-items: center; width: 52px; flex: none; padding: 0; border: 0;
    background: transparent; color: var(--muted); cursor: pointer;
}
.sh-acc__toggle svg { transition: transform var(--dur) var(--ease-out); }
.sh-acc__item.is-open .sh-acc__toggle svg { transform: rotate(180deg); }
.sh-acc__panel { margin: 0; padding: var(--s-1) 0 var(--s-2); list-style: none; }
.sh-acc__panel a {
    display: flex; align-items: center; min-height: 44px; padding-inline: var(--s-6) var(--s-4);
    color: var(--ink); font-size: var(--step-body);
}
@media (hover: hover) { .sh-acc__link:hover, .sh-acc__panel a:hover { background: var(--surface-2); } }

.sh-drawer__pages { margin: var(--s-5) 0 0; padding: 0; list-style: none; display: grid; }
.sh-drawer__pages a {
    display: flex; align-items: center; min-height: 48px;
    color: var(--ink); font: 400 var(--step-body)/1.3 var(--font);
}
.sh-drawer__pages a.is-active { text-decoration: underline 2px; text-underline-offset: 6px; }

.sh-contact { display: grid; gap: var(--s-2); margin-top: var(--s-6); }
.sh-contact__phone {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 48px;
    color: var(--ink); font: 500 var(--step-body)/1 var(--font);
    text-decoration: underline 1px !important; text-underline-offset: 4px;
}
.sh-contact__note { margin: 0; text-align: center; font-size: var(--step-small); color: var(--muted); }
.sh-langchips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.sh-langchip.is-current { background: var(--ink); color: #fff; }

/* ---------- Нижняя панель (<1024px) ---------- */
.sh-tabbar { display: none; }
@media (max-width: 1023px) {
    .sh-tabbar {
        position: fixed; z-index: 1000; inset-inline: 0; bottom: 0;
        display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
        height: calc(var(--bar-h) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: var(--bg);
        box-shadow: 0 -8px 24px -18px rgb(11 35 71 / .4);
    }
    body { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); }
    body.ab-no-tabbar:not(.ab-has-bookbar) { padding-bottom: 0; }
}
.sh-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 44px; padding: 6px 2px;
    color: var(--muted); font: 400 var(--step-small)/1.1 var(--font); text-align: center;
    -webkit-tap-highlight-color: transparent;
    transition: color var(--dur-fast) ease;
}
.sh-tab svg { flex: none; transition: transform 100ms ease; }
.sh-tab:active svg { transform: scale(.92); }
.sh-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-tab.is-active { color: var(--accent); font-weight: 600; }
.sh-tab--chat svg { color: var(--wa); }
.sh-tab:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
/* Пока открыто меню или модалка брони — панели не видно */
body.nav-open .sh-tabbar, body:has(#bookingModal.show) .sh-tabbar { visibility: hidden; }
/* Страница экскурсии пока выводит свою панель .td-mbar — общую не показываем (см. ab-bookbar в ab-base.css) */
body.td-page .sh-tabbar { display: none; }
@media (max-width: 1023px) { body.td-page { padding-bottom: 0; } }

@media (prefers-reduced-motion: reduce) {
    .sh *, .sh-drawer, .sh-backdrop, .sh-tab, .sh-bar::after { transition: none !important; }
}

/* Старые страницы: отступы под прежнюю полосу контактов больше не нужны */
body.reviews-page, body.useful-info-page { padding-top: 0 !important; }
body > .prices-container { margin-top: var(--sh-bar-h, 56px); }

/* Защита от общих стилей страниц (button {…}, * {…}): шапка выглядит одинаково везде */
.sh button { margin: 0; box-shadow: none; text-transform: none; letter-spacing: normal; line-height: 1; min-width: 0; touch-action: manipulation; }
.sh .sh-nav__toggle, .sh .sh-lang__btn, .sh .sh-acc__toggle { box-shadow: none; }
.sh .sh-lang__btn { background: transparent; }
.sh .sh-burger, .sh .sh-drawer__close, .sh .sh-acc__toggle, .sh .sh-nav__toggle { padding: 0; }
.sh .sh-burger, .sh .sh-drawer__close { min-height: 44px; }
.sh p { line-height: 1.4; }
.sh ul { margin: 0; }
.sh .btn { text-decoration: none; }
/* Плавающие подсказки страниц — над нижней панелью */
@media (max-width: 1023px) {
    .tl-jump { bottom: calc(var(--bar-h) + 16px + env(safe-area-inset-bottom)) !important; }
}
/* Кнопки внутри шапки/меню: правило `.sh a { color: inherit }` не должно перебивать их цвет */
.sh .btn--wa, .sh .btn--wa:hover { color: #fff; }
.sh .btn--soft { color: var(--ink); }
.sh .btn--primary { color: var(--accent-ink); }
@media (min-width: 1200px) {
    .sh .sh-cta { color: #fff; }
}
@media (hover: hover) and (min-width: 1200px) { .sh .sh-cta:hover { color: #fff; } }
@media (max-width: 1199px) { .sh .sh-cta { color: var(--wa); } }
