/* ============================================================
   Shymbulak Resort Hotel — Mobile Design Layer (≤768px)
   Mobile-first: bottom sheet, safe areas, 44px targets,
   основной текст ≥16px, active:scale(0.98), без бордеров.
   Десктоп (≥769px) не затрагивается, кроме display menu-btn.
   ============================================================ */

/* ===== Хедер: одна строка — [домик] [лого] … [язык] [бургер] ===== */
@media (max-width: 768px) {
    .site-header__row {
        flex-wrap: nowrap; height: 60px; row-gap: 0;
        padding: 0 12px;
    }
    /* старая двухстрочная навигация уходит в bottom sheet */
    .site-nav { display: none; }
    .site-header__row .lang-dropdown { position: static; margin-inline-start: auto; }
    .home-btn { width: 44px; height: 44px; }
    .brand-mark { height: 32px; }
}

/* Очень узкие (≤360px, iPhone SE 1/2): логотип и гэпы чуть меньше —
   ряд [домик][лого][язык][бургер] должен влезать в 320px */
@media (max-width: 360px) {
    .site-header__row { gap: 0 10px; }
    .brand-mark { height: 28px; }
}

/* Бургер — ионная круглая кнопка, 44x44 */
.menu-btn {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    color: var(--navy, #27304c); border: 1px solid rgba(39, 48, 76, 0.08);
    box-shadow: 0 3px 12px rgba(39, 48, 76, 0.05); cursor: pointer;
    transition: transform 0.3s var(--ease-refined, cubic-bezier(0.16, 1, 0.3, 1)),
                background-color 0.3s;
}
@media (min-width: 769px) { .menu-btn { display: none; } }
.menu-btn svg { width: 20px; height: 20px; }
.menu-btn:active { transform: scale(0.98); }
.menu-btn--solo { margin-inline-start: auto; }
.menu-btn:focus-visible { outline: 2px solid var(--sunset-deep, #c53f0a); outline-offset: 2px; }

/* ===== Bottom Sheet ===== */
.sheet-backdrop {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(20, 26, 40, 0.32);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden;
    transition: opacity 0.4s var(--ease-refined, cubic-bezier(0.16, 1, 0.3, 1)),
                visibility 0s linear 0.4s;
}
body.sheet-open .sheet-backdrop {
    opacity: 1; visibility: visible;
    transition: opacity 0.4s var(--ease-refined, cubic-bezier(0.16, 1, 0.3, 1));
}
body.sheet-open { overflow: hidden; }

.mobile-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
    background: #fff;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -12px 48px rgba(20, 26, 40, 0.18);
    transform: translateY(105%);
    transition: transform 0.5s var(--ease-refined, cubic-bezier(0.16, 1, 0.3, 1));
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    /* safe area: нижний inset — жестовая полоса iOS */
    padding: 0 20px calc(24px + env(safe-area-inset-bottom, 0px));
    visibility: hidden;
}
body.sheet-open .mobile-sheet { transform: translateY(0); visibility: visible; }

.mobile-sheet__handle {
    width: 36px; height: 4px; border-radius: 2px;
    background: rgba(39, 48, 76, 0.18);
    margin: 12px auto 16px;
}
.mobile-sheet__section {
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; color: rgba(39, 48, 76, 0.5);
    margin: 16px 6px 6px;
}
.mobile-sheet a {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 52px; padding: 12px 16px; border-radius: 14px;
    font-size: 1.05rem; font-weight: 500; letter-spacing: 0.01em;
    color: var(--navy, #27304c); text-decoration: none;
    transition: background-color 0.25s, transform 0.15s var(--ease-refined, cubic-bezier(0.16, 1, 0.3, 1));
}
.mobile-sheet a::after {
    content: ''; flex-shrink: 0; width: 7px; height: 7px;
    border-inline-end: 1.5px solid rgba(39, 48, 76, 0.3);
    border-block-end: 1.5px solid rgba(39, 48, 76, 0.3);
    transform: rotate(45deg);
}
[dir="rtl"] .mobile-sheet a::after { transform: rotate(-45deg); }
.mobile-sheet a:active { background: var(--water, #f0f7fc); transform: scale(0.98); }
.mobile-sheet a:focus-visible { outline: 2px solid var(--sunset-deep, #c53f0a); outline-offset: -2px; }
.mobile-sheet a.is-active { color: var(--sunset-deep, #c53f0a); }

/* ===== Типографика: читаемость ≥16px, leading 1.65, tracking-tight ===== */
@media (max-width: 768px) {
    .content-panel { padding-top: 120px; }
    h1 { margin-top: 24px; }

    .seo-about-text p, .resort-info-block p,
    .seo-about-text ul li, .resort-info-block ul li {
        font-size: 1rem; line-height: 1.65;
    }
    .seo-about-text { padding: 28px 22px; }
    .location-city { font-size: 1.1rem; }
    .location-park { font-size: 0.95rem; }
    .location-card { padding: 18px 20px; }
    .map-title { font-size: 0.9rem; }
    .info-table { font-size: 0.95rem; }
    .contact-label { font-size: 0.9rem; }
    .contact-value { font-size: 1rem; }
    .cta-caption { font-size: 0.95rem; }
    .status-badge { font-size: 0.9rem; margin-bottom: 28px; }

    .rooms-cats__title { font-size: 1.5rem; letter-spacing: -0.02em; }
    .rooms-cats__inc { font-size: 0.95rem; }
    .room-cat__name { font-size: 1.1rem; letter-spacing: -0.01em; }
    .room-cat__meta { font-size: 0.85rem; }

    .legal-title { letter-spacing: -0.02em; }
    .legal-doc h3 { font-size: 1.25rem; }
    .brand-sub { font-size: 0.8rem; letter-spacing: 0.12em; }
}

/* ===== Visual noise: бордеры карточек убираем — отделяем фоном и whitespace ===== */
@media (max-width: 768px) {
    .contact-line { border: none; }
    .map-section-container { border: none; }
    .room-cat { border: none; }
    .secondary-image-container { margin-bottom: 32px; box-shadow: none; border-radius: 16px; }
}

/* ===== Тактильность: активный стейт scale(0.98) на всех контролах ===== */
@media (max-width: 768px) {
    .home-btn:active,
    .lang-btn:active,
    .social-btn:active,
    .pill-link:active,
    .dropbtn:active,
    .mobile-sheet a:active {
        transform: translateY(0) scale(0.98);
    }
    .cta-btn:active { transform: translateY(0) scale(0.98); }
    .lang-menu button:active { transform: scale(0.98); }
    .site-footer__legal a:active { transform: scale(0.98); }

    /* карточки-ссылки: фото «сминается» при нажатии (быстрый отклик) */
    .room-cat__photo img { transition: transform 0.2s var(--ease-refined, cubic-bezier(0.16, 1, 0.3, 1)); }
    .room-cat__photo:active img { transform: scale(0.98); }
    .contact-line:active { transform: scale(0.98); background: var(--surface, #fff); }
}

/* ===== Таблицы (legal-документы: фиксированная ширина из Word ~700px;
   info-table на ski: min-content 4 колонок ~390px).
   На ≤1024px — горизонтальный скролл ВНУТРИ карточки. Важно: display:block
   разрывает flex min-width:auto — иначе таблица расширяет весь документ ===== */
@media (max-width: 1024px) {
    .legal-doc table, .info-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        border: 1px solid rgba(39, 48, 76, 0.15);
        border-radius: 12px;
        padding: 6px 10px;
        margin: 12px 0 16px;
    }
    .legal-doc table td, .legal-doc table th, .info-table td, .info-table th { white-space: nowrap; }
    /* flex-элементы контент-панели: align-items:center → ширина = fit-content,
       и min-content таблицы расширяет их (и всю страницу). min-width:0 +
       max-width:100% обрывает цепочку, скролл идёт внутри таблицы */
    .content-panel > * { min-width: 0; max-width: 100%; }
}

/* ===== Safe areas ===== */
@media (max-width: 768px) {
    /* мобильный override в site.css терял bottom inset — возвращаем */
    .site-footer { padding: 26px 16px calc(22px + env(safe-area-inset-bottom, 0px)); }
    .scroll-cue { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
    .skip-link { font-size: 1rem; }
    #main { scroll-margin-top: 70px; }
}

/* ===== CTA-система (мобильный слой) ===== */
@media (max-width: 768px) {
    /* Кнопка в шапке — скрыта на мобилке: ряд [домик][лого][язык][бургер] + CTA
       не помещается в 360px (463px мин-контента). Мобильный CTA — шторка
       (CTA-строка — первый элемент) и FAB после первого экрана. */
    .header-cta { display: none; }
    /* scroll-cue уступаем место FAB — два элемента внизу не должны конкурировать */
    .scroll-cue { display: none !important; }
    .hero-cta { margin-bottom: 24px; }
    .booking-embed { min-height: 420px; height: calc(100dvh - 200px); }
}

/* FAB: плавающая CTA на ≤768px; появляется после первого экрана (.is-visible — JS),
   скрывается под открытой шторкой меню */
@media (max-width: 768px) {
    .fab-cta {
        display: inline-flex; align-items: center; gap: 8px;
        position: fixed; z-index: 60;
        left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        transform: translateX(-50%) translateY(16px);
        background: var(--cta, #f15623); color: #ffffff;
        padding: 14px 22px; border-radius: 50px;
        font-size: 0.85rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
        text-decoration: none; box-shadow: 0 10px 28px rgba(241, 86, 35, 0.35);
        opacity: 0; visibility: hidden; pointer-events: none;
        transition: opacity 0.4s var(--ease-refined, cubic-bezier(0.16, 1, 0.3, 1)),
                    transform 0.4s var(--ease-refined, cubic-bezier(0.16, 1, 0.3, 1)),
                    visibility 0s linear 0.4s;
    }
    .fab-cta.is-visible {
        opacity: 1; visibility: visible; pointer-events: auto;
        transform: translateX(-50%) translateY(0);
        transition: opacity 0.4s var(--ease-refined, cubic-bezier(0.16, 1, 0.3, 1)),
                    transform 0.4s var(--ease-refined, cubic-bezier(0.16, 1, 0.3, 1));
    }
    body.sheet-open .fab-cta { opacity: 0; visibility: hidden; pointer-events: none; }
    .fab-cta:active { transform: translateX(-50%) scale(0.98); }
    .fab-cta:focus-visible { outline: 2px solid var(--navy, #27304c); outline-offset: 3px; }
}

/* CTA-строка в мобильной шторке — основной путь выше навигации */
.mobile-sheet__cta {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 52px; margin: 4px 0 10px; border-radius: 14px;
    background: var(--sunset, #f15623); color: #ffffff;
    font-size: 1rem; font-weight: 600; letter-spacing: 0.02em;
    box-shadow: 0 6px 18px rgba(241, 86, 35, 0.25);
}
.mobile-sheet__cta::after { display: none; }
.mobile-sheet__cta svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mobile-sheet__cta:active { transform: scale(0.98); background: var(--sunset-deep, #c53f0a); }
