/**
 * Mobile fullscreen menu + bottom dock navigation + mobile gutters.
 * Extracted from equinox-custom.css for focused mobile shell styling.
 */

/* Mobile: fullscreen menu, gutters, bottom nav (shell vars + bar: equinox-header.css; calculator: equinox-homechange.css) */
@media only screen and (max-width: 640px) {
    /* Burger menu must overlay all content on full-screen glass plate */
    body.equinox-shell .main-menu,
    body.equinox-shell .menu-open .main-menu {
        top: var(--eq-admin-offset) !important;
        height: calc(100dvh - var(--eq-admin-offset)) !important;
        z-index: 1300 !important;
        background: var(--eq-surface-menu-scrim) !important;
        -webkit-backdrop-filter: blur(18px) saturate(140%) !important;
        backdrop-filter: blur(18px) saturate(140%) !important;
    }

    /* Mobile rhythm: increase vertical spacing between blocks */
    body.equinox-shell .homepage_wrap > *,
    body.equinox-shell .inner-content > *,
    body.equinox-shell .aside > * {
        margin-bottom: 1.8rem !important;
    }

    body.equinox-shell .section,
    body.equinox-shell .main-form,
    body.equinox-shell .many_news_wrap,
    body.equinox-shell .many_reviews,
    body.equinox-shell .xchange_div,
    body.equinox-shell .cf_div_wrap,
    body.equinox-shell #comments #respond {
        margin-bottom: 2rem !important;
    }

    /* Burger icon -> cross animation in open state */
    body.equinox-shell .main-menu-btn {
        transition: all 0.2s ease !important;
    }

    body.equinox-shell .main-menu-btn span {
        transition: transform 0.25s ease, opacity 0.25s ease !important;
        transform-origin: center;
    }

    body.equinox-shell.menu-open .main-menu-btn span:first-child {
        transform: translateY(0.4rem) rotate(45deg) !important;
    }

    body.equinox-shell.menu-open .main-menu-btn span:nth-child(2) {
        opacity: 0 !important;
    }

    body.equinox-shell.menu-open .main-menu-btn span:last-child {
        transform: translateY(-0.4rem) rotate(-45deg) !important;
    }

    /* --- Fullscreen menu, flags, auth/contacts in drawer, bottom nav, mobile gutters --- */

    /* Fullscreen menu shell */
    body.equinox-shell .main-menu {
        padding: 2rem 1.6rem 1.6rem !important;
        background: rgba(34, 18, 74, 0.9) !important;
        -webkit-backdrop-filter: blur(24px) saturate(130%) !important;
        backdrop-filter: blur(24px) saturate(130%) !important;
        position: fixed !important;
        overflow: hidden !important;
    }

    body.equinox-shell .main-menu__wrapper {
        min-height: calc(100dvh - var(--eq-admin-offset) - 2.4rem);
        display: flex !important;
        flex-direction: column !important;
        position: relative;
        z-index: 1;
    }

    body.equinox-shell .main-menu::before {
        content: "";
        position: absolute;
        inset: 0;
        background: var(--eq-gradient-menu-overlay);
        pointer-events: none;
        z-index: 0;
    }

    /* Remove blue card background behind menu text */
    body.equinox-shell .menu-items-wrapper {
        margin: 7.4rem 0 1.6rem !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    /* Menu items typography = hero style */
    body.equinox-shell .main-menu__list > li > a,
    body.equinox-shell .main-menu li a {
        padding: 1.2rem 0.4rem !important;
        border: 0 !important;
        color: #ffffff !important;
        font-family: Unbounded, sans-serif !important;
        font-size: 2rem !important;
        font-weight: 600 !important;
        line-height: 1.25 !important;
        letter-spacing: -0.01em;
        background: transparent !important;
    }

    body.equinox-shell .main-menu__list > li > a:hover,
    body.equinox-shell .main-menu__list > li > a:active {
        opacity: 0.88;
    }

    /* Beautiful language switcher (flags) */
    body.equinox-shell .flags_wrapper {
        display: inline-flex !important;
        align-items: center;
        gap: 0.8rem !important;
        padding: 0.6rem 0.8rem !important;
        border: 1px solid var(--eq-glass-stroke-strong) !important;
        border-radius: 999px !important;
        background: var(--eq-glass-fill-strong) !important;
        -webkit-backdrop-filter: blur(10px) saturate(130%) !important;
        backdrop-filter: blur(10px) saturate(130%) !important;
        max-width: none !important;
    }

    body.equinox-shell .flags_wrapper a {
        width: 2.8rem !important;
        height: 2rem !important;
        border-radius: 0.4rem !important;
        opacity: 0.55 !important;
        transition: opacity .2s ease, transform .2s ease !important;
    }

    body.equinox-shell .flags_wrapper a.active,
    body.equinox-shell .flags_wrapper a:hover {
        opacity: 1 !important;
        transform: translateY(-1px);
    }

    /* Working hours: white + clock icon */
    body.equinox-shell .header_timetable--mobile {
        margin-top: 0.6rem;
        margin-bottom: 1.2rem;
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 0.8rem;
        color: #fff !important;
        opacity: 1 !important;
    }

    body.equinox-shell .header_timetable--mobile::before {
        content: "";
        width: 1.6rem;
        height: 1.6rem;
        display: inline-block;
        background: url("../images/icons/clock-darc.svg") no-repeat center / contain !important;
        filter: invert(1) brightness(1.4);
    }

    body.equinox-shell .header_timetable--mobile p,
    body.equinox-shell .header_timetable--mobile .header_timetable_ins,
    body.equinox-shell .header_timetable--mobile .header_timetable_ins * {
        color: #fff !important;
        opacity: 1 !important;
    }

    /* Auth row in menu */
    body.equinox-shell .hidden_auth .auth-wrapper {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        margin: 1rem 0 1.2rem;
        width: 100%;
    }

    body.equinox-shell .hidden_auth,
    body.equinox-shell .hidden_contacts {
        width: 100%;
    }

    body.equinox-shell .hidden_auth {
        margin-top: auto !important;
    }

    body.equinox-shell .hidden_auth .auth-wrapper a {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 0.6rem;
        width: 100%;
        min-height: 5.8rem;
        height: 5.8rem;
        padding: 0 1.2rem !important;
        border: 0 !important;
        border-radius: 1.2rem !important;
        background: var(--eq-glass-fill-soft) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        backdrop-filter: blur(8px) !important;
        color: #fff !important;
    }

    body.equinox-shell .hidden_auth .auth-wrapper a span:last-child {
        color: #fff !important;
        font-weight: 600;
    }

    /* Explicit icon for Register button */
    body.equinox-shell .hidden_auth .auth-wrapper .link-register .auth-wrapper__icon {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 1.8rem;
        height: 1.8rem;
        border: 1px solid var(--eq-text-placeholder);
        border-radius: 999px;
        font-size: 1.2rem;
        line-height: 1;
        color: #9bc0ff;
        background: var(--eq-glass-fill-ghost);
    }

    body.equinox-shell .hidden_auth .auth-wrapper .link-register .auth-wrapper__icon::before {
        content: "+";
        font-weight: 700;
    }

    /* Pin TG + Email links to bottom */
    body.equinox-shell .hidden_contacts {
        margin-top: 0 !important;
        padding-top: 1rem;
        gap: 1rem !important;
    }

    body.equinox-shell .hidden_contacts .link_wrapper {
        width: 100%;
    }

    body.equinox-shell .hidden_contacts .link_wrapper a {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 5.8rem;
        height: 5.8rem;
        border: 0 !important;
        border-radius: 1.2rem !important;
        background: var(--eq-glass-fill-soft) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        backdrop-filter: blur(8px) !important;
        color: #fff !important;
    }

    /* Larger burger and morph to X in open state */
    body.equinox-shell .main-menu-btn {
        width: 5.6rem !important;
        height: 5.6rem !important;
        padding: 1.6rem !important;
        border-radius: 1.4rem !important;
        border: 1px solid var(--eq-glass-border-medium) !important;
        background: var(--eq-glass-fill-soft) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        backdrop-filter: blur(10px) !important;
        z-index: 1400 !important;
    }

    body.equinox-shell .main-menu-btn span {
        height: 2px !important;
        background: #8cb5ff !important;
    }

    body.equinox-shell.menu-open .main-menu-btn {
        position: fixed !important;
        top: calc(var(--eq-admin-offset) + 1.6rem) !important;
        right: 1.6rem !important;
    }

    body.equinox-shell.menu-open .main-menu-btn span:first-child {
        transform: translateY(0.55rem) rotate(45deg) !important;
    }

    body.equinox-shell.menu-open .main-menu-btn span:nth-child(2) {
        opacity: 0 !important;
    }

    body.equinox-shell.menu-open .main-menu-btn span:last-child {
        transform: translateY(-0.55rem) rotate(-45deg) !important;
    }

    /* Hide separate close button to keep one animated control */
    body.equinox-shell .menu-close-btn {
        display: none !important;
    }

    /* Mobile homepage spacing tune */
    body.home.equinox-shell .section.hometext,
    body.home.equinox-shell .section.reviews,
    body.home.equinox-shell .section.news-section {
        margin-bottom: 100px !important;
    }

    /* Reviews/News block height */
    body.home.equinox-shell .section.reviews .section__title,
    body.home.equinox-shell .section.news-section .section__title {
        min-height: 75px !important;
        display: flex !important;
        align-items: center !important;
    }

    /* Space between Advantages and Reserve */
    body.home.equinox-shell .section.advantages {
        margin-bottom: 100px !important;
    }

    /* Bottom mobile app-like navigation */
    body.equinox-shell {
        padding-bottom: 8.6rem !important;
    }

    body.equinox-shell .equinox-mobile-bottom-nav {
        position: fixed;
        left: var(--eq-mobile-gutter);
        right: var(--eq-mobile-gutter);
        bottom: max(1rem, env(safe-area-inset-bottom));
        z-index: 1600;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.6rem;
        padding: 0.8rem;
        border-radius: 1.4rem;
        border: 1px solid var(--eq-glass-stroke-muted);
        background: rgba(20, 14, 56, 0.86);
        -webkit-backdrop-filter: blur(16px) saturate(130%);
        backdrop-filter: blur(16px) saturate(130%);
        box-shadow: var(--eq-shadow-dock);
    }

    body.equinox-shell .equinox-mobile-bottom-nav__link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        min-height: 4.8rem;
        border-radius: 1rem;
        color: var(--eq-text-body-soft);
        text-decoration: none;
        font: 500 1.1rem/1.2 Rubik, sans-serif;
        letter-spacing: 0.01em;
    }

    body.equinox-shell .equinox-mobile-bottom-nav__link:active {
        background: var(--eq-glass-hairline);
    }

    body.equinox-shell .equinox-mobile-bottom-nav__icon {
        width: 1.8rem;
        height: 1.8rem;
        border-radius: 0.4rem;
        border: 1px solid rgba(140, 181, 255, 0.7);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        color: #8cb5ff;
        background: var(--eq-glass-fill-trace);
    }
    body.equinox-shell .equinox-mobile-bottom-nav__icon svg {
        width: 1.25rem;
        height: 1.25rem;
        display: block;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.9;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    body.equinox-shell.menu-open .equinox-mobile-bottom-nav {
        display: none !important;
    }

    /* Section headings: same left offset as content text */
    body.equinox-shell .section.reviews .section__title,
    body.equinox-shell .section.news-section .section__title,
    body.equinox-shell .section.home-reserve .section__title,
    body.equinox-shell .section.partners-section .section__title,
    body.equinox-shell .section.advantages .section__title {
        padding-left: 1.6rem !important;
        padding-right: 1.6rem !important;
        box-sizing: border-box;
    }

    /* News/reviews blocks: equal side offsets */
    body.home.equinox-shell .section.reviews .section_ins,
    body.home.equinox-shell .section.news-section .section_ins,
    body.home.equinox-shell .section.reviews .section_content_wrapper,
    body.home.equinox-shell .section.news-section .section_content_wrapper {
        margin-left: 1.6rem !important;
        margin-right: 1.6rem !important;
        width: auto !important;
    }

    /* Partners to footer: no extra gap */
    body.home.equinox-shell .section.partners-section {
        margin-bottom: 0 !important;
    }

    /* Hero to calculator gap: 20px less */
    body.home.equinox-shell .equinox-home-hero,
    body.flarex-homepage-template.equinox-shell .equinox-home-hero {
        margin-bottom: 4px !important;
    }

    /* Unified side gutters: all major blocks use menu-like offsets */
    body.equinox-shell .equinox-home-hero,
    body.equinox-shell .main-form,
    body.equinox-shell .footer,
    body.equinox-shell .footer__grid,
    body.equinox-shell .footer__col-1,
    body.equinox-shell .footer__col-2,
    body.equinox-shell .footer__col-3,
    body.equinox-shell .footer__nav,
    body.equinox-shell .footer__contacts,
    body.equinox-shell .footer__info,
    body.equinox-shell .section .section_ins,
    body.equinox-shell .section .section_content_wrapper,
    body.equinox-shell .homepage-disclaimer .disclaimer,
    body.equinox-shell .hometext-wrapper_ins,
    body.equinox-shell .many_news_wrap .mb-35,
    body.equinox-shell .many_reviews_ins,
    body.equinox-shell .xchange_div,
    body.equinox-shell .cf_div_wrap,
    body.equinox-shell #comments #respond,
    body.equinox-shell .aside .widget,
    body.equinox-shell .widget,
    body.equinox-shell .register_widget,
    body.equinox-shell .login_widget,
    body.equinox-shell .user_widget,
    body.equinox-shell .userverify_widget,
    body.equinox-shell .widget_stats_div,
    body.equinox-shell .checkstatus_widget,
    body.equinox-shell .widget_reserv_div,
    body.equinox-shell .widget_lchange_div,
    body.equinox-shell .widget.widget_news_div,
    body.equinox-shell .widget.widget_reviews_div {
        margin-left: var(--eq-mobile-gutter) !important;
        margin-right: var(--eq-mobile-gutter) !important;
        width: auto !important;
    }
}

