/* ==========================================================================
   Видео-hero страницы района (дизайн-хендофф «Хуай Яй — видео с дрона»).
   Подключается только на страницах property_area. Шапка/каталог не трогаются.
   Токены — из assets/css/mm-preview.css (:root).
   ========================================================================== */

@keyframes mmAhPulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes mmAhBar   { 0% { width: 8%; } 70% { width: 82%; } 100% { width: 92%; } }

.mm-ah {
    position: relative;
    background: var(--mm-olive, #18231d);
    border-top: 1px solid var(--mm-line, rgba(32, 36, 31, .14));
    border-bottom: 1px solid var(--mm-line, rgba(32, 36, 31, .14));
    font-family: var(--mm-sans, Inter, sans-serif);
}

.mm-ah-frame {
    position: relative;
    --mm-ah-pad: calc(30px + max(0px, (100% - 1500px) / 2));
}

/* ---------- Сцена ---------- */
.mm-ah-stage {
    position: relative;
    overflow: hidden;
    background: var(--mm-olive, #18231d);
    height: 612px;
    transition: height .45s ease;
}

.mm-ah-poster {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
}

.mm-ah-v {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    will-change: transform, opacity;
}

.mm-ah-scrim {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    transition: opacity .45s ease;
}
.mm-ah-scrim-side { background: linear-gradient(90deg, rgba(10, 16, 12, .86) 0%, rgba(10, 16, 12, .6) 46%, rgba(10, 16, 12, .18) 100%); }
.mm-ah-scrim-bot  { background: linear-gradient(180deg, rgba(10, 13, 10, .36) 0%, rgba(10, 13, 10, 0) 26%, rgba(10, 13, 10, .74) 100%); }
.mm-ah.is-hover .mm-ah-scrim-side { opacity: .22; }
.mm-ah.is-hover .mm-ah-scrim-bot  { opacity: .55; }

/* Фото-fallback: боковой градиент плотнее (район без съёмки). */
.mm-ah-photo .mm-ah-scrim-side { background: linear-gradient(90deg, rgba(10, 16, 12, .88) 0%, rgba(10, 16, 12, .6) 50%, rgba(10, 16, 12, .22) 100%); }

/* ---------- Бейдж съёмки ---------- */
.mm-ah-badge {
    position: absolute;
    z-index: 5;
    top: 26px;
    left: var(--mm-ah-pad, 30px);
    display: flex;
    align-items: center;
    gap: 9px;
    background: rgba(15, 22, 18, .72);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(247, 243, 236, .2);
    border-radius: var(--mm-radius-pill, 999px);
    padding: 7px 14px 7px 11px;
}
.mm-ah-badge-ico { display: block; width: 16px; height: 16px; flex: none; }
.mm-ah-badge-t {
    font-weight: 800;
    font-size: 10px;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--mm-paper, #f7f3ec);
}
.mm-ah-badge-sep { width: 1px; height: 13px; background: rgba(247, 243, 236, .28); }
.mm-ah-badge-mute {
    font-weight: 600;
    font-size: 10px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(247, 243, 236, .6);
}

/* ---------- Плашка загрузки ---------- */
.mm-ah-loading {
    position: absolute;
    z-index: 6;
    right: var(--mm-ah-pad, 30px);
    top: 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15, 22, 18, .72);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(247, 243, 236, .18);
    border-radius: var(--mm-radius-lg, 8px);
    padding: 12px 16px;
    transition: opacity .4s ease;
    pointer-events: none;
}
.mm-ah.is-ready .mm-ah-loading { opacity: 0; }
.mm-ah-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--mm-gold, #ad8b51); flex: none; animation: mmAhPulse 1.2s ease-in-out infinite; }
.mm-ah-loading-in { display: flex; flex-direction: column; gap: 7px; }
.mm-ah-loading-t { font-weight: 800; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--mm-paper, #f7f3ec); }
.mm-ah-loading-bar { width: 190px; height: 3px; border-radius: 999px; background: rgba(247, 243, 236, .22); overflow: hidden; }
.mm-ah-loading-bar i { display: block; height: 100%; background: var(--mm-gold, #ad8b51); animation: mmAhBar 2.4s ease-out infinite; }

/* ---------- Центральная кнопка ▶ ---------- */
.mm-ah-bigplay {
    position: absolute;
    z-index: 6;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 74px;
    height: 74px;
    border-radius: 999px;
    border: none;
    background: var(--mm-gold, #ad8b51);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    color: #171911;
    font-size: 15px;
    padding: 0;
}
.mm-ah.is-paused .mm-ah-bigplay { display: flex; }
.mm-ah-bigplay span { margin-left: 3px; }

/* ---------- Текстовый блок ---------- */
.mm-ah-copy {
    position: absolute;
    z-index: 5;
    left: var(--mm-ah-pad, 30px);
    right: var(--mm-ah-pad, 30px);
    top: 86px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 40px;
    align-items: start;
    transition: opacity .45s ease, transform .45s ease;
}
.mm-ah.is-hover .mm-ah-copy { opacity: 0; transform: translateY(-10px); pointer-events: none; }
.mm-ah-copy-main { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.mm-ah-crumbs { font-weight: 500; font-size: 11px; color: rgba(247, 243, 236, .6); margin: 0; }
.mm-ah-crumbs a { color: rgba(247, 243, 236, .6); text-decoration: none; }
.mm-ah-crumbs a:hover { color: var(--mm-gold, #ad8b51); }
.mm-ah-eyebrow { font-weight: 800; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mm-gold, #ad8b51); margin: 0; }
.mm-ah h1 {
    font-family: var(--mm-serif, "Cormorant Garamond", Georgia, serif);
    font-weight: 400;
    font-size: clamp(38px, 4.4vw, 60px);
    line-height: .98;
    color: var(--mm-paper, #f7f3ec);
    margin: 0;
    max-width: 16ch;
}
.mm-ah-lead { font-size: 14.5px; line-height: 1.65; color: rgba(247, 243, 236, .78); margin: 0; max-width: 520px; }
.mm-ah-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.mm-ah-btn {
    font-weight: 800;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-radius: var(--mm-radius-sm, 5px);
    padding: 14px 22px;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.mm-ah-btn-gold { background: var(--mm-gold, #ad8b51); color: #171911; border-color: var(--mm-gold, #ad8b51); }
.mm-ah-btn-gold:hover { background: #c1a06a; color: #171911; }
.mm-ah-btn-ghost { background: transparent; color: var(--mm-paper, #f7f3ec); border-color: rgba(247, 243, 236, .45); }
.mm-ah-btn-ghost:hover { border-color: var(--mm-paper, #f7f3ec); color: var(--mm-paper, #f7f3ec); }

/* ---------- Панель «Район в цифрах» ---------- */
.mm-ah-nums {
    background: rgba(24, 35, 29, .9);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(247, 243, 236, .16);
    border-radius: var(--mm-radius-lg, 8px);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.mm-ah-nums-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: rgba(247, 243, 236, .16);
    border: 1px solid rgba(247, 243, 236, .16);
    border-radius: var(--mm-radius, 6px);
    overflow: hidden;
}
.mm-ah-nums-grid.is-single { grid-template-columns: 1fr; }
.mm-ah-tile { background: var(--mm-olive, #18231d); padding: 12px 14px; }
.mm-ah-tile-v { font-weight: 900; font-size: 17px; color: var(--mm-paper, #f7f3ec); font-variant-numeric: tabular-nums; }
.mm-ah-tile-l { font-size: 11px; color: rgba(247, 243, 236, .6); margin-top: 2px; }
.mm-ah-near { font-size: 12px; line-height: 1.5; color: rgba(247, 243, 236, .66); }
.mm-ah-near a { color: rgba(247, 243, 236, .78); text-decoration: none; border-bottom: 1px solid rgba(247, 243, 236, .22); }
.mm-ah-near a.mm-ah-near-map { color: var(--mm-gold, #ad8b51); border: none; font-weight: 600; }

/* ---------- Нижний блок: чипы + панель ---------- */
.mm-ah-controls {
    position: absolute;
    z-index: 5;
    left: var(--mm-ah-pad, 30px);
    right: var(--mm-ah-pad, 30px);
    bottom: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mm-ah-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.mm-ah-chips::-webkit-scrollbar { display: none; }
.mm-ah-chips-label { flex: none; font-weight: 800; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: rgba(247, 243, 236, .55); margin-right: 4px; }
.mm-ah-chip {
    display: flex;
    flex: none;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
    cursor: pointer;
    border-radius: 999px;
    padding: 5px 15px 5px 5px;
    font-family: inherit;
    font-weight: 600;
    font-size: 11px;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
    background: rgba(15, 22, 18, .55);
    color: rgba(247, 243, 236, .85);
    border: 1px solid rgba(247, 243, 236, .28);
}
.mm-ah-chip.is-active { background: var(--mm-gold, #ad8b51); color: #171911; border-color: var(--mm-gold, #ad8b51); }
.mm-ah-chip-th { width: 30px; height: 22px; border-radius: 999px; flex: none; background-size: cover; background-position: center; }
.mm-ah-chip.is-loading .mm-ah-chip-th { filter: grayscale(1) brightness(.7); }
.mm-ah-chip-dot { display: none; width: 6px; height: 6px; border-radius: 999px; flex: none; background: var(--mm-gold, #ad8b51); animation: mmAhPulse 1.1s ease-in-out infinite; }
.mm-ah-chip.is-loading .mm-ah-chip-dot { display: block; }

.mm-ah-panel {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(15, 22, 18, .72);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(247, 243, 236, .16);
    border-radius: 999px;
    padding: 10px 14px 10px 16px;
}
.mm-ah-play {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 999px;
    border: 1px solid rgba(247, 243, 236, .4);
    background: transparent;
    color: var(--mm-paper, #f7f3ec);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.mm-ah-cur { flex: none; font-weight: 800; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--mm-paper, #f7f3ec); }
.mm-ah-track { flex: 1; height: 3px; border-radius: 999px; background: rgba(247, 243, 236, .22); position: relative; overflow: hidden; min-width: 40px; }
.mm-ah-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--mm-gold, #ad8b51); border-radius: 999px; }
.mm-ah-time { flex: none; font-weight: 500; font-size: 11px; color: rgba(247, 243, 236, .7); font-variant-numeric: tabular-nums; }
.mm-ah-all {
    flex: none;
    border-radius: 999px;
    border: none;
    background: var(--mm-gold, #ad8b51);
    color: #171911;
    font-family: inherit;
    font-weight: 800;
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 10px 18px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

/* ---------- Fallback-плашка (район без съёмки) ---------- */
.mm-ah-nofilm {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border: 1px solid rgba(247, 243, 236, .22);
    border-radius: 999px;
    padding: 10px 18px;
    background: rgba(15, 22, 18, .55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    align-self: flex-start;
}
.mm-ah-nofilm-t { font-size: 12px; color: rgba(247, 243, 236, .75); }
.mm-ah-nofilm a { font-weight: 800; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--mm-gold, #ad8b51); text-decoration: none; white-space: nowrap; }

/* ---------- Мобильная полоса над видео ---------- */
.mm-ah-mbar { display: none; }

/* ---------- Подложка hero: УТП + SEO-интро ---------- */
.mm-catalog-page .mm-catalog-hero-sub {
    display: block;
    max-width: 1500px;
    margin: 0 auto;
    padding: clamp(22px, 3vw, 34px) clamp(18px, 4vw, 64px) clamp(18px, 2vw, 26px);
}
.mm-catalog-page .mm-catalog-hero-sub .mm-usp-strip { border-top: none; padding-top: 0; }
.mm-catalog-page .mm-catalog-hero-sub .mm-listing-intro { margin-top: 18px; }

/* ==========================================================================
   Планшет / мобильный: ролик блоком 16:9 сразу под шапкой,
   чипы горизонтальной прокруткой, контент — на бумаге.
   ========================================================================== */
@media (max-width: 900px) {
    .mm-ah { background: var(--mm-paper, #f7f3ec); }
    .mm-ah-frame { --mm-ah-pad: 16px; }
    .mm-ah-stage { height: auto; aspect-ratio: 16 / 9; transition: none; }
    .mm-ah-scrim-side { display: none; }
    .mm-ah-scrim-bot { background: linear-gradient(180deg, rgba(10, 13, 10, .34) 0%, rgba(10, 13, 10, 0) 42%, rgba(10, 13, 10, .76) 100%); opacity: 1 !important; }
    .mm-ah-badge { top: 12px; left: 12px; padding: 6px 11px; gap: 7px; }
    .mm-ah-badge-ico { width: 12px; height: 12px; }
    .mm-ah-badge-t { font-size: 9px; letter-spacing: .12em; }
    .mm-ah-badge-sep, .mm-ah-badge-mute { display: none; }
    .mm-ah-loading { right: 12px; top: 12px; padding: 9px 12px; }
    .mm-ah-loading-bar { width: 110px; }
    .mm-ah-bigplay { width: 58px; height: 58px; }

    .mm-ah-mbar {
        position: absolute;
        z-index: 5;
        left: 12px;
        right: 12px;
        bottom: 12px;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .mm-ah-mbar-cur { font-weight: 800; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: rgba(247, 243, 236, .9); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mm-ah-mbar-all {
        margin-left: auto;
        flex: none;
        font-weight: 800;
        font-size: 9px;
        letter-spacing: .08em;
        text-transform: uppercase;
        color: #171911;
        background: var(--mm-gold, #ad8b51);
        border-radius: 999px;
        padding: 9px 12px;
        min-height: 34px;
        display: inline-flex;
        align-items: center;
        text-decoration: none;
    }

    .mm-ah-controls {
        position: static;
        padding: 12px 16px;
        border-bottom: 1px solid var(--mm-line, rgba(32, 36, 31, .14));
        background: var(--mm-paper, #f7f3ec);
        gap: 0;
    }
    .mm-ah-panel { display: none; }
    .mm-ah-chips-label { display: none; }
    .mm-ah-chip { background: var(--mm-surface, #fbfaf6); color: var(--mm-ink, #20241f); border: 1px solid rgba(32, 36, 31, .18); padding: 5px 13px 5px 5px; min-height: 34px; }
    .mm-ah-chip.is-active { background: var(--mm-olive, #18231d); color: var(--mm-paper, #f7f3ec); border-color: var(--mm-olive, #18231d); }
    .mm-ah-chip-th { width: 26px; height: 20px; }

    .mm-ah-copy {
        position: static;
        display: flex;
        flex-direction: column;
        gap: 14px;
        padding: 18px 16px 22px;
        background: var(--mm-paper, #f7f3ec);
        opacity: 1 !important;
        transform: none !important;
    }
    .mm-ah-copy-main { gap: 12px; max-width: none; }
    .mm-ah-crumbs, .mm-ah-crumbs a { color: var(--mm-muted, #6d7169); }
    .mm-ah h1 { font-size: clamp(28px, 8vw, 34px); line-height: 1; color: var(--mm-ink, #20241f); max-width: none; }
    .mm-ah-lead { font-size: 13.5px; line-height: 1.6; color: var(--mm-muted, #6d7169); max-width: none; }
    .mm-ah-cta { flex-direction: column; gap: 8px; }
    .mm-ah-btn { min-height: 46px; padding: 14px 18px; width: 100%; }
    .mm-ah-btn-ghost { color: var(--mm-ink, #20241f); border-color: var(--mm-line, rgba(32, 36, 31, .14)); }
    .mm-ah-btn-ghost:hover { border-color: var(--mm-ink, #20241f); color: var(--mm-ink, #20241f); }

    .mm-ah-nums { background: transparent; border: none; padding: 0; -webkit-backdrop-filter: none; backdrop-filter: none; gap: 10px; }
    .mm-ah-nums-grid { background: var(--mm-line, rgba(32, 36, 31, .14)); border-color: var(--mm-line, rgba(32, 36, 31, .14)); }
    .mm-ah-tile { background: var(--mm-surface, #fbfaf6); padding: 11px 13px; }
    .mm-ah-tile-v { font-size: 15px; color: var(--mm-ink, #20241f); }
    .mm-ah-tile-l { color: var(--mm-muted, #6d7169); }
    .mm-ah-near, .mm-ah-near a { color: var(--mm-muted, #6d7169); }
    .mm-ah-near a.mm-ah-near-map { color: var(--mm-gold, #ad8b51); }

    .mm-ah-nofilm { background: var(--mm-surface, #fbfaf6); border-color: var(--mm-line, rgba(32, 36, 31, .14)); border-radius: var(--mm-radius-lg, 8px); padding: 12px 14px; }
    .mm-ah-nofilm-t { color: var(--mm-muted, #6d7169); }
}

@media (max-width: 900px) {
    /* На мобильном hover-эффектов нет вовсе. */
    .mm-ah.is-hover .mm-ah-copy { opacity: 1; transform: none; pointer-events: auto; }
    .mm-ah.is-hover .mm-ah-scrim-bot { opacity: 1; }
}

/* Промежуточная ширина: панель цифр под текстом. */
@media (min-width: 901px) and (max-width: 1180px) {
    .mm-ah-copy { grid-template-columns: minmax(0, 1fr); gap: 20px; top: 64px; }
    .mm-ah-nums { max-width: 340px; }
    .mm-ah h1 { font-size: clamp(34px, 4vw, 46px); }
    .mm-ah-lead { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .mm-ah-stage { transition: none; }
    .mm-ah-v { transition: none !important; }
    .mm-ah-dot, .mm-ah-loading-bar i, .mm-ah-chip-dot { animation: none; }
}

/* ---------- Фото-fallback ---------- */
.mm-ah-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; z-index: 0; }
.mm-ah-photo .mm-ah-stage { height: 470px; }
.mm-ah-photo .mm-ah-controls { bottom: 24px; }
.mm-ah-photo .mm-ah-copy { top: 44px; }
.mm-ah-photo h1 { font-size: clamp(36px, 4vw, 54px); }

/* Якоря hero не должны прятаться под липкую шапку. */
#mm-uf-districts, #mm-area-drone { scroll-margin-top: 92px; }

@media (max-width: 900px) {
    .mm-ah-photo .mm-ah-stage { height: auto; }
    .mm-ah-photo .mm-ah-controls { padding: 14px 16px; }
    .mm-ah-photo .mm-ah-copy { top: auto; }
}

/* ---------- Кнопки-мессенджеры ----------
   Тема подменяет ссылки wa.me на <button data-mm-contact-open/data-mm-msg>,
   поэтому те же стили нужны и для button. */
.mm-ah-btn, .mm-ah-all, .mm-ah-nofilm button, .mm-ah-mbar-all {
    -webkit-appearance: none;
    appearance: none;
}
.mm-ah-nofilm a,
.mm-ah-nofilm button {
    font-family: inherit;
    font-weight: 800;
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mm-gold, #ad8b51);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

/* Фото-fallback: чуть выше сцена, чтобы панель цифр не упиралась в плашку. */
.mm-ah-photo .mm-ah-stage { height: 520px; }
@media (min-width: 901px) and (max-width: 1180px) {
    .mm-ah-photo .mm-ah-copy { top: 40px; }
}
@media (max-width: 900px) {
    .mm-ah-photo .mm-ah-stage { height: auto; }
    .mm-ah-nofilm a, .mm-ah-nofilm button { min-height: 24px; }
}

/* Иконки play/pause — SVG, а не глифы (в Inter нет ❚❚). */
.mm-ah-play svg { display: block; }
.mm-ah-ico-pause { display: none; }
.mm-ah.is-playing .mm-ah-ico-play { display: none; }
.mm-ah.is-playing .mm-ah-ico-pause { display: block; }
.mm-ah-bigplay svg { display: block; margin-left: 2px; }

/* Ghost-кнопка над светлым кадром — лёгкая тень для читаемости. */
.mm-ah-btn-ghost { text-shadow: 0 1px 6px rgba(0, 0, 0, .45); }
.mm-ah-badge { transition: opacity .4s ease; }

@media (max-width: 900px) {
    /* Узкий экран: бейдж и плашка загрузки не помещаются в одну строку —
       сначала показываем загрузку, после готовности проявляется бейдж. */
    .mm-ah-video:not(.is-ready) .mm-ah-badge { opacity: 0; }
    .mm-ah-btn-ghost { text-shadow: none; }
}

/* Ghost-кнопка поверх светлого кадра: полупрозрачная подложка вместо чистой рамки —
   иначе «Обсудить район» пропадает на ярких планах (пляж, бассейн, небо). */
.mm-ah-btn-ghost {
    background: rgba(15, 22, 18, .38);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.mm-ah-btn-ghost:hover { background: rgba(15, 22, 18, .58); }
@media (max-width: 900px) {
    .mm-ah-btn-ghost { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
    .mm-ah-btn-ghost:hover { background: transparent; }
}

/* ---------- Клоакинг мессенджер-ссылок ----------
   Тема превращает ссылки wa.me/t.me в <button data-mm-msg> и сбрасывает им
   font/padding/color/border (mm-preview.css). Возвращаем вид кнопки hero
   селектором с более высокой специфичностью. */
.mm-ah button[data-mm-msg].mm-ah-btn,
.mm-ah button[data-mm-msg].mm-ah-btn:hover,
.mm-ah button[data-mm-msg].mm-ah-btn:focus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mm-sans, Inter, sans-serif);
    font-weight: 800;
    font-size: 11px;
    line-height: 1.2;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-radius: var(--mm-radius-sm, 5px);
    padding: 14px 22px;
    margin: 0;
    cursor: pointer;
}
.mm-ah button[data-mm-msg].mm-ah-btn-ghost,
.mm-ah button[data-mm-msg].mm-ah-btn-ghost:focus {
    color: var(--mm-paper, #f7f3ec);
    border: 1px solid rgba(247, 243, 236, .45);
    background: rgba(15, 22, 18, .38);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    text-shadow: 0 1px 6px rgba(0, 0, 0, .45);
}
.mm-ah button[data-mm-msg].mm-ah-btn-ghost:hover {
    color: var(--mm-paper, #f7f3ec);
    border-color: var(--mm-paper, #f7f3ec);
    background: rgba(15, 22, 18, .58);
}
.mm-ah .mm-ah-nofilm button[data-mm-msg],
.mm-ah .mm-ah-nofilm button[data-mm-msg]:hover,
.mm-ah .mm-ah-nofilm button[data-mm-msg]:focus {
    font-family: var(--mm-sans, Inter, sans-serif);
    font-weight: 800;
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mm-gold, #ad8b51);
    background: none;
    border: 0;
    padding: 0;
    white-space: nowrap;
    cursor: pointer;
}

@media (max-width: 900px) {
    .mm-ah button[data-mm-msg].mm-ah-btn {
        width: 100%;
        min-height: 46px;
        padding: 14px 18px;
    }
    .mm-ah button[data-mm-msg].mm-ah-btn-ghost,
    .mm-ah button[data-mm-msg].mm-ah-btn-ghost:focus,
    .mm-ah button[data-mm-msg].mm-ah-btn-ghost:hover {
        color: var(--mm-ink, #20241f);
        border-color: var(--mm-line, rgba(32, 36, 31, .14));
        background: transparent;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        text-shadow: none;
    }
}

/* ==========================================================================
   CTA-ряд hero: при раскрытии кадра копия и цифры гаснут, а кнопки остаются
   кликабельными и переезжают вниз (top меняет JS, transition — здесь).
   ========================================================================== */
.mm-ah-copy { row-gap: 14px; }
.mm-ah-copy-main { grid-column: 1; grid-row: 1; }
.mm-ah-cta { grid-column: 1; grid-row: 2; margin-top: 0; z-index: 7; }
.mm-ah-nums { grid-column: 2; grid-row: 1; }

.mm-ah-copy-main,
.mm-ah-nums { transition: opacity .45s ease, transform .45s ease; }
.mm-ah.is-hover .mm-ah-copy { opacity: 1; transform: none; pointer-events: none; }
.mm-ah-cta { pointer-events: auto; }
.mm-ah.is-hover .mm-ah-copy-main,
.mm-ah.is-hover .mm-ah-nums { opacity: 0; transform: translateY(-10px); pointer-events: none; }

/* Плавающее состояние включает JS — без скрипта ряд остаётся в потоке. */
/* grid-placement сбрасываем: иначе containing block абсолютного ряда — ячейка сетки. */
.mm-ah-cta.is-float { position: absolute; left: 0; top: 400px; margin: 0; grid-column: auto; grid-row: auto; transition: top .45s ease; }

@media (min-width: 901px) and (max-width: 1180px) {
    .mm-ah-nums { grid-column: 1; grid-row: 3; }
}

@media (max-width: 900px) {
    .mm-ah-cta.is-float { position: static; }
    .mm-ah.is-hover .mm-ah-copy-main,
    .mm-ah.is-hover .mm-ah-nums { opacity: 1; transform: none; pointer-events: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .mm-ah-cta.is-float { transition: none; }
}


/* ==========================================================================
   v7. Мобильная вёрстка hero района — те же правки, что и на странице места:
   компактная плашка загрузки, короткий бейдж, нижняя строка без обрезанной
   подписи, лента чипов с растушёвкой и крупными тапами.
   Только медиазапросы ≤900 / ≤600 — десктоп без изменений.
   ========================================================================== */

.mm-ah-badge-tm,
.mm-ah-loading-tm { display: none; }

@media (max-width: 900px) {

    /* Кадр чуть выше: 16:10 вместо 16:9. */
    .mm-ah-stage { aspect-ratio: 16 / 10; }

    /* 1. Плашка загрузки — компактная пилюля. */
    .mm-ah-loading {
        top: 12px;
        right: 12px;
        gap: 7px;
        padding: 7px 12px 7px 10px;
        border-radius: 999px;
        max-width: calc(100% - 24px);
    }
    .mm-ah-loading-in { flex-direction: row; align-items: center; gap: 0; min-width: 0; }
    .mm-ah-loading-t,
    .mm-ah-loading-bar { display: none; }
    .mm-ah-loading-tm {
        display: block;
        font-weight: 800;
        font-size: 9px;
        letter-spacing: .1em;
        text-transform: uppercase;
        color: rgba(247, 243, 236, .92);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 2. Бейдж — короткая подпись; теперь помещается рядом с плашкой,
          поэтому больше не прячем его до готовности ролика. */
    .mm-ah-badge { padding: 6px 11px; gap: 6px; max-width: calc(100% - 150px); }
    .mm-ah-badge-t { display: none; }
    .mm-ah-badge-tm {
        display: block;
        font-weight: 800;
        font-size: 9px;
        letter-spacing: .11em;
        text-transform: uppercase;
        color: var(--mm-paper, #f7f3ec);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mm-ah-video:not(.is-ready) .mm-ah-badge { opacity: 1; }

    /* 3. Нижняя строка кадра: подпись сюжета убрана (дублируется чипом),
          остаётся кнопка «Все пролёты» слева — не спорит с водяным знаком. */
    .mm-ah-mbar-cur { display: none; }
    .mm-ah-mbar-all { margin-left: 0; min-height: 44px; padding: 12px 16px; font-size: 9.5px; }

    /* 4. Лента чипов. */
    .mm-ah-controls { position: relative; left: auto; right: auto; bottom: auto; padding: 0; }
    .mm-ah-chips {
        padding: 10px 16px 11px;
        gap: 7px;
        scroll-padding-inline: 16px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }
    .mm-ah-controls::after {
        content: "";
        position: absolute;
        right: 0;
        top: 0;
        bottom: 1px;
        width: 34px;
        pointer-events: none;
        background: linear-gradient(90deg, rgba(247, 243, 236, 0) 0%, var(--mm-paper, #f7f3ec) 76%);
    }
    .mm-ah-chip { min-height: 44px; padding: 6px 14px 6px 6px; gap: 8px; font-size: 12px; }
    .mm-ah-chip-th { width: 32px; height: 32px; border-radius: 999px; }
    .mm-ah-chip-n { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* Копия hero — колонка flex; base align-items:start мешал кнопкам
       растянуться на всю ширину. */
    .mm-ah-copy { align-items: stretch; }
}

@media (max-width: 360px) {
    .mm-ah-video:not(.is-ready) .mm-ah-badge { opacity: 0; }
    .mm-ah-chip-n { max-width: 40vw; }
}


/* Режим «только постер» — см. комментарий в mm-place-v8.css. */
.mm-hero-still .mm-ah-loading { display: none; }
