/* ═══════════════════════════════════════════
   НОВОЕ МЕНЮ: мега-панели как на apple.com
   Разметка: chunks/layout/mega-menu.tpl, mega-panels.tpl, header.tpl
═══════════════════════════════════════════ */

.has-mm {
    --mm-bg: #fff;
    --mm-text: #1d1d1f;
    --mm-muted: #6e6e73;
    --mm-ease: cubic-bezier(.4, 0, .6, 1);
}

/* Верхний ряд */
.has-mm .navbar-nav .nav-link {
    font-size: 14px;
    padding: 8px 16px !important;
    transition: color .2s;
}
.has-mm .navbar-nav .nav-link.is-hover { color: var(--color-success); }

/* Шапка, когда панель открыта: сплошной фон, тёмный текст даже у header-white */
.header.mm-open { background: var(--mm-bg); }
.header.mm-open::before { background-color: var(--mm-bg); }
.header-white.mm-open,
.header-white.mm-open a,
.header-white.mm-open button { color: var(--mm-text); }
.header-white.mm-open .navbar-nav { --bs-nav-link-color: var(--mm-text); }
.header-white.mm-open .navbar-brand img { filter: invert(1); }

/* Выпадающая область */
.mm-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 0;
    overflow: hidden;
    background: var(--mm-bg);
    transition: height .32s var(--mm-ease);
}
.mm-open .mm-dropdown { box-shadow: 0 24px 32px -24px rgba(0, 0, 0, .12); }

.mm-dropdown .mm-panel {
    display: none;
    padding: 36px 0 56px;
}
.mm-dropdown .mm-panel.is-active { display: block; }

/* Колонки появляются с лёгким сдвигом и задержкой — как у Apple */
.mm-dropdown .mm-col {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .24s var(--mm-ease), transform .24s var(--mm-ease);
}
.mm-dropdown .mm-panel.is-shown .mm-col {
    opacity: 1;
    transform: none;
}
.mm-dropdown .mm-panel.is-shown .mm-col:nth-child(2) { transition-delay: .03s; }
.mm-dropdown .mm-panel.is-shown .mm-col:nth-child(3) { transition-delay: .06s; }
.mm-dropdown .mm-panel.is-shown .mm-col:nth-child(4) { transition-delay: .09s; }

.mm-cols {
    display: grid;
    gap: 28px 48px;
    max-width: 1040px;
    margin: 0 auto;
}
.mm-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* Туры: две колонки стран стоят плотно, дальше направления и типы */
.mm-cols-tours { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mm-cols-3 { grid-template-columns: 1.3fr 1fr 1fr; }
.mm-contacts { grid-template-columns: 1fr 1fr 1.1fr; }

/* Содержимое колонок */
.mm-label {
    font-size: 12px;
    color: var(--mm-muted);
    margin-bottom: 12px;
}
.mm-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.mm-col li a,
.mm-disabled {
    display: inline-block;
    padding: 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--mm-text);
    text-decoration: none;
    transition: color .2s;
}
.mm-col li a:hover,
.mm-col li a.active { color: var(--color-success); }

.mm-big li a,
.mm-big .mm-disabled {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.01em;
    padding: 3px 0;
}
.mm-disabled {
    color: #b8b8bd;
    cursor: default;
}
.mm-disabled em {
    font-style: normal;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--mm-muted);
    background: #f0f0f2;
    border-radius: 20px;
    padding: 2px 8px;
    margin-left: 6px;
    vertical-align: middle;
}

.mm-more {
    display: inline-block;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-success);
    text-decoration: none;
}
.mm-more:hover { text-decoration: underline; }

/* Флаги стран (flag-icons, флаг выбирается в админке у страны) */
.mm-flags li a {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}
/* высота флага = высоте заглавной буквы (14px Montserrat ≈ 10px) */
.mm-flags .fi {
    width: 13px;
    height: 10px;
    line-height: 10px;
    border-radius: 2px;
    background-size: cover;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}

/* Подарочный сертификат — кнопка */
.mm-gift {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border: 2px solid var(--color-success);
    border-radius: 14px;
    background: transparent;
    color: var(--color-success) !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s, color .2s;
}
.mm-gift:hover { background: var(--color-success); color: #fff !important; }
/* «Хочу стать партнёром» начинается ровно под иконкой подарка */
.mm-gift + div .mm-more { padding-left: 20px; }

/* Календарь: месяцы по сезонам */
.mm-months small { font-size: 12px; font-weight: 500; color: var(--mm-muted); margin-left: 2px; }
.mm-months em {
    font-style: normal;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-success);
    background: #e8f8f3;
    border-radius: 10px;
    padding: 1px 7px;
    margin-left: 8px;
    vertical-align: 1px;
}
.mm-months .mm-disabled small { color: #c7c7cc; }
.mm-panel > .mm-cols + .mm-cols { margin-top: 8px; }

/* Соцсети со строкой-подписью */
.mm-social li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}
.mm-social small {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--mm-muted);
}

/* Иконки — маски, цвет берут от текста */
.mm-ico {
    display: inline-block;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--mm-text);
    -webkit-mask: var(--mm-icon) center / 60% no-repeat;
            mask: var(--mm-icon) center / 60% no-repeat;
}
.mm-ico-tg   { --mm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.665 3.717l-17.73 6.837c-1.21.486-1.203 1.161-.222 1.462l4.552 1.42 10.532-6.645c.498-.303.953-.14.579.192l-8.533 7.701-.314 4.693c.46 0 .663-.211.921-.46l2.211-2.15 4.599 3.397c.848.467 1.457.227 1.668-.785l3.019-14.228c.309-1.239-.473-1.8-1.282-1.434z'/%3E%3C/svg%3E"); }
.mm-ico-wa   { --mm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.05 2.5a9.45 9.45 0 0 0-8.2 14.16L2.5 21.5l4.97-1.3A9.45 9.45 0 1 0 12.05 2.5zm5.53 13.37c-.23.66-1.35 1.26-1.86 1.3-.48.05-.92.22-3.1-.65-2.62-1.03-4.27-3.72-4.4-3.89-.13-.17-1.05-1.4-1.05-2.67s.67-1.9.9-2.16c.24-.26.52-.32.69-.32h.5c.16 0 .38-.06.6.46.23.53.77 1.83.84 1.96.07.13.11.29.02.46-.09.17-.13.28-.26.43l-.39.46c-.13.13-.27.27-.12.53.15.26.68 1.12 1.46 1.81 1 .89 1.85 1.17 2.11 1.3.26.13.41.11.57-.07.15-.17.65-.76.83-1.02.17-.26.35-.22.58-.13.24.09 1.51.71 1.77.84.26.13.43.2.5.3.06.11.06.62-.17 1.26z'/%3E%3C/svg%3E"); }
.mm-ico-vk   { --mm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.9 18.2C6.3 18.2 2.5 13.7 2.3 6.2h3.3c.1 5.5 2.6 7.8 4.5 8.3V6.2h3.1v4.7c1.9-.2 3.9-2.4 4.6-4.7h3.1c-.5 2.9-2.7 5.1-4.2 6 1.5.7 4 2.6 4.9 6h-3.4c-.7-2.3-2.6-4.1-5-4.3v4.3h-.3z'/%3E%3C/svg%3E"); }
.mm-ico-ig   { --mm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2'%3E%3Crect x='3' y='3' width='18' height='18' rx='5'/%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Ccircle cx='17.5' cy='6.5' r='.6' fill='%23000'/%3E%3C/svg%3E"); }
.mm-ico-yt   { --mm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21.6 7.2a2.5 2.5 0 0 0-1.8-1.8C18.2 5 12 5 12 5s-6.2 0-7.8.4A2.5 2.5 0 0 0 2.4 7.2C2 8.8 2 12 2 12s0 3.2.4 4.8a2.5 2.5 0 0 0 1.8 1.8C5.8 19 12 19 12 19s6.2 0 7.8-.4a2.5 2.5 0 0 0 1.8-1.8c.4-1.6.4-4.8.4-4.8s0-3.2-.4-4.8zM10 15V9l5.2 3L10 15z'/%3E%3C/svg%3E"); }
.mm-ico-mail { --mm-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E"); }

/* Контакты (по макету) */
.mm-phone {
    display: inline-block;
    font-size: 30px;
    font-weight: 700;
    color: var(--mm-text);
    text-decoration: none;
    margin-bottom: 28px;
    white-space: nowrap;
}
.mm-messengers li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    font-size: 20px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
}
.mm-messengers .mm-ico { background-color: #9a9aa0; }
.mm-social-row {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
}
.mm-social-row .mm-ico {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: #3a3a3c;
}
.mm-social-row a:hover .mm-ico { background-color: var(--color-success); }
.mm-note {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 8px;
    color: var(--mm-text);
}
.mm-note a { font-weight: 700; color: var(--mm-text); text-decoration: underline; text-underline-offset: 3px; }
.mm-note a:hover { color: var(--color-success); }
.mm-lead {
    font-size: 15px;
    line-height: 1.4;
    color: #555;
    margin-bottom: 14px;
}
.mm-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 85%;
}
.mm-form .form-control {
    height: 44px;
    border: 2px solid #3a3a3c;
    border-radius: 9px;
    font-size: 14px;
}
.mm-form .mm-contact { padding-right: 100px; }
.mm-ctype {
    position: absolute;
    top: 50%;
    right: 10px;
    display: flex;
    gap: 4px;
    transform: translateY(-50%);
}
.mm-ctype input { position: absolute; opacity: 0; pointer-events: none; }
.mm-ctype label { cursor: pointer; padding: 2px; }
.mm-ctype .mm-ico { width: 26px; height: 26px; background-color: #b8b8bd; }
.mm-ctype input:checked + .mm-ico { background-color: #3a3a3c; }
.mm-submit {
    align-self: flex-start;
    border: 0;
    background: none;
    padding: 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-success);
}
.mm-submit:hover { text-decoration: underline; }

/* Размытие страницы под панелью */
.mm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(232, 232, 237, .4);
    opacity: 0;
    visibility: hidden;
    transition: opacity .32s var(--mm-ease), visibility .32s;
}
.mm-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 1199.98px) {
    .has-mm .navbar-nav .nav-link { padding: 8px 10px !important; }
    .mm-cols { gap: 24px 32px; }
    .mm-big li a, .mm-big .mm-disabled { font-size: 21px; }
    .mm-phone { font-size: 26px; }
}


/* ═══════════════════════════════════════════
   МОБИЛЬНОЕ МЕНЮ: уровни с кнопкой «Назад»
═══════════════════════════════════════════ */

.mm-m {
    position: relative;
    overflow: hidden;
    --mm-text: #1d1d1f;
    --mm-muted: #6e6e73;
}
.mm-m-level {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding: 20px 24px 40px;
    visibility: hidden;
    opacity: 0;
    transform: translateX(40px);
    transition: transform .3s cubic-bezier(.4, 0, .6, 1), opacity .3s, visibility .3s;
}
.mm-m-level[data-level="root"] { transform: translateX(-40px); }
.mm-m-level.is-active {
    visibility: visible;
    opacity: 1;
    transform: none;
}

.mm-m-root {
    list-style: none;
    margin: 0;
    padding: 0;
}
.mm-m-root a,
.mm-m-root button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 0;
    border: 0;
    background: none;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--mm-text);
    text-align: left;
    text-decoration: none;
}
.mm-m-root i { font-size: 18px; color: var(--mm-muted); }

.mm-m-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0;
    background: none;
    padding: 0;
    margin-bottom: 20px;
    font-size: 15px;
    color: var(--mm-muted);
}

.mm-m .mm-panel { display: none; }
.mm-m .mm-panel.is-active { display: block; }
.mm-m .mm-cols { display: block; }
.mm-m .mm-col + .mm-col { margin-top: 28px; }
.mm-m .mm-col li a,
.mm-m .mm-disabled { font-size: 18px; padding: 5px 0; }
.mm-m .mm-big li a,
.mm-m .mm-big .mm-disabled { font-size: min(24px, 5.9vw); }
.mm-m .mm-big .mm-disabled { white-space: nowrap; }
/* приветствие Jivo не перекрывает открытое мобильное меню */
body:has(#mobileMenu.show) jdiv { display: none !important; }
.mm-m .mm-phone { font-size: 26px; margin-bottom: 16px; }
.mm-m .mm-messengers li a { font-size: 18px; }
.mm-m .mm-lead { font-size: 15px; }
.mm-m .mm-form { max-width: none; }
.mm-m .mm-cols-tours > .mm-col:nth-child(2),
.mm-m .mm-cols-tours > .mm-col:nth-child(3) { margin-top: 4px; }
.mm-m .mm-flags .fi { width: 16px; height: 12px; }
.mm-m .mm-gift { margin-bottom: 8px; }

/* Страница тура: кнопка «Меню» и вкладки разделов внутри панели (header.tpl, mm-tour) */
.mm-menu-btn svg { flex-shrink: 0; }
.mm-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 28px;
    max-width: 1040px;
    margin: 0 auto;
    padding: 22px 0 14px;
    border-bottom: 1px solid #e8e8ed;
}
.mm-tab {
    position: relative;
    padding: 6px 0;
    border: 0;
    background: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--mm-muted) !important;
    text-decoration: none;
    cursor: pointer;
    transition: color .2s;
}
.mm-tab:hover,
.mm-tab.is-active { color: var(--mm-text) !important; }
.mm-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -15px;
    height: 2px;
    border-radius: 2px;
    background: var(--color-success);
}
.mm-tour .mm-dropdown .mm-panel { padding-top: 28px; }
