/* ── Mobile Menu — fullscreen overlay ──────────────────────────────────────── */

#mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    /* Скрываем overflow чтобы тень панели не просачивалась */
    overflow: hidden;
}

#mobile-menu.is-open {
    pointer-events: all;
}

/* ── Backdrop ── */
.mm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu.is-open .mm-backdrop {
    opacity: 1;
}

/* ── Panel ──
   Гамбургер показывается вплоть до 860px (см. .mobile-btn), поэтому
   панель всегда full-screen — узкая боковая версия раньше включалась
   уже с 480px, что ломало вид на планшетах между 480 и 860px. */
.mm-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100vw;
    height: 100dvh;
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition:
        transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    overflow: hidden;
}

#mobile-menu.is-open .mm-panel {
    transform: translateX(0);
    box-shadow: -24px 0 80px rgba(15, 23, 42, 0.18);
}

/* ── Header ── */
.mm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid #F0F2F6;
    flex-shrink: 0;
}

.mm-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.mm-close-btn:hover {
    background: #0F172A;
    color: #fff;
    border-color: #0F172A;
}

/* ── Nav links ── */
.mm-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 8px 20px;
    overflow-y: auto;
}

.mm-link {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 12px;
    font-size: 20px;
    font-weight: 600;
    color: #0F172A;
    text-decoration: none;
    letter-spacing: -0.02em;
    border-bottom: 1px solid #F1F5F9;
    border-radius: 12px;
    -webkit-tap-highlight-color: transparent;

    opacity: 0;
    transform: translateX(24px);
    transition:
        opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.2s;
}

.mm-link:last-child {
    border-bottom: none;
}

.mm-link::before {
    display: none;
}

/* Стрелка справа */
.mm-link::after {
    content: '';
    position: relative;
    z-index: 1;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
    background: transparent url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 7h10M8 3l4 4-4 4' stroke='%23CBD5E1' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
    transition: background-image 0.2s, transform 0.2s;
}

.mm-link:hover {
    color: #4F46E5;
}

.mm-link:hover::after {
    background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 7h10M8 3l4 4-4 4' stroke='%234F46E5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    transform: translateX(3px);
}

#mobile-menu.is-open .mm-link {
    opacity: 1;
    transform: translateX(0);
}

#mobile-menu.is-open .mm-link[data-index="1"] { transition-delay: 0.08s; }
#mobile-menu.is-open .mm-link[data-index="2"] { transition-delay: 0.12s; }
#mobile-menu.is-open .mm-link[data-index="3"] { transition-delay: 0.16s; }
#mobile-menu.is-open .mm-link[data-index="4"] { transition-delay: 0.20s; }
#mobile-menu.is-open .mm-link[data-index="5"] { transition-delay: 0.24s; }
#mobile-menu.is-open .mm-link[data-index="6"] { transition-delay: 0.28s; }
#mobile-menu.is-open .mm-link[data-index="7"] { transition-delay: 0.32s; }

/* ── Нумерация пунктов (01, 02...) + fill-эффект при hover/tap ──
   Общая база для простых ссылок и summary — используется на обоих. */
.mm-link__row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.mm-link__num {
    flex: none;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #CBD5E1;
    transition: color 0.25s ease;
    font-variant-numeric: tabular-nums;
}

.mm-link:hover .mm-link__num,
.mm-link__summary:hover .mm-link__num,
.mm-link--group:focus-within .mm-link__num {
    color: #4F46E5;
}

.mm-link__title {
    position: relative;
}

/* Заливка-подсветка всей строки — выезжает слева при наведении/тапе */
.mm-link::before,
.mm-link__summary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(79, 70, 229, .07), rgba(6, 182, 212, .05));
    border-radius: 12px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    pointer-events: none;
}

.mm-link:hover::before,
.mm-link:active::before,
.mm-link__summary:hover::before,
.mm-link__summary:active::before {
    transform: scaleX(1);
}

/* ── Nav links: пункты с вложенным меню (details/summary) ── */

.mm-link.mm-link--group {
    display: block;
    padding: 0;
    overflow: visible;
}

.mm-link.mm-link--group::after {
    display: none;
}

.mm-link__summary {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 18px 12px;
    font-size: 20px;
    font-weight: 600;
    color: #0F172A;
    letter-spacing: -0.02em;
    border-radius: 12px;
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s;
}
.mm-link__summary::-webkit-details-marker {
    display: none;
}
.mm-link__summary::marker {
    content: '';
}

.mm-link--group:hover .mm-link__summary {
    color: #4F46E5;
}

.mm-link__chevron {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    color: #CBD5E1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s;
}
.mm-link--group:hover .mm-link__chevron {
    color: #4F46E5;
}
.mm-link--group[open] .mm-link__chevron {
    transform: rotate(180deg);
}

.mm-sublist {
    display: flex;
    flex-direction: column;
    padding: 2px 12px 14px;
}

.mm-sublink {
    padding: 11px 0 11px 20px;
    font-size: 16px;
    font-weight: 500;
    color: #64748B;
    text-decoration: none;
    letter-spacing: -0.01em;
    border-left: 2px solid #F1F5F9;
    transition: color 0.2s, border-color 0.2s, padding-left 0.2s;
}
.mm-sublink:hover,
.mm-sublink:focus-visible {
    color: #4F46E5;
    border-left-color: #4F46E5;
    padding-left: 24px;
}

/* ── Footer ── */
.mm-footer {
    padding: 20px 20px 40px;
    border-top: 1px solid #F0F2F6;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;

    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0.36s,
        transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) 0.36s;
}

#mobile-menu.is-open .mm-footer {
    opacity: 1;
    transform: translateY(0);
}

/* ── CTA кнопка ── */
.mm-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    border-radius: 14px;
    background: linear-gradient(135deg, #4F46E5 0%, #6366F1 52%, #06B6D4 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;

    box-shadow: 0 4px 16px -4px rgba(79, 70, 229, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.mm-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px -6px rgba(79, 70, 229, 0.5);
    color: #fff;
}

.mm-phone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 24px;
    border-radius: 14px;
    border: 1.5px solid #E2E8F0;
    background: transparent;
    color: #475569;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: border-color 0.2s, color 0.2s;
}

.mm-phone:hover {
    border-color: #4F46E5;
    color: #4F46E5;
}

.mm-phone-icon {
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.mm-phone:hover .mm-phone-icon {
    color: #4F46E5;
}

/* ── Гамбургер → крестик ── */
.menu-toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 18px;
}

.menu-toggle-icon span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: #0F172A;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
    transform-origin: center;
}

body.menu-is-open .menu-toggle-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
body.menu-is-open .menu-toggle-icon span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
body.menu-is-open .menu-toggle-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Scroll lock ── */
body.menu-is-open {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .mm-link,
    .mm-link::before,
    .mm-link__summary::before,
    .mm-link__chevron,
    .mm-sublink {
        transition: none;
    }
}