/* =========================================================
   headerMobileEmega.isml (MOBILE HEADER LAYOUT)
========================================================= */

/* ── Hide desktop all-menu on mobile ── */
@media (max-width: 768px) {
    #all-menu-overlay,
    #all-menu-wrapper {
        display: none !important;
    }

    /* ── Sticky header ── */
    /* .header.container-fluid.emega-header-top,
    .emega-header-top.container-fluid {
        position: sticky !important;
        top: 0 !important;
        z-index: 9998 !important;
        background: #f3f3ef !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 12px 16px 16px !important;
        margin: 0 !important;
        max-width: 100% !important;
    } */

    .emega-header-top .emega-header-row {
        display: none !important;
    }

    /* ── Mobile header wrapper ── */
    .emega-header-top .emega-header-mobile {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 12px 16px 16px !important;
        overflow: visible !important;
        position: relative !important;
        z-index: 9998 !important;
    }

    /* ── Logo zone ── */
    .emega-header-zone--logo {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        padding: 4px 0 10px 0 !important;
        margin: 0 !important;
    }

    .emega-mobile-logo-link {
        display: inline-flex !important;
        align-items: center !important;
        text-decoration: none !important;
    }

    .emega-header-zone--logo .emega-mobile-logoImg {
        height: 28px !important;
        max-height: 28px !important;
        width: auto !important;
        max-width: 150px !important;
        display: block !important;
    }

    /* ── Search zone ── */
    .emega-header-mobile .emega-header-zone--search,
    .emega-header-mobile .emega-header-zone--search .search,
    .emega-header-mobile .emega-header-zone--search .emega-header-search {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
        position: relative !important;
        z-index: 9999 !important;
    }

    /* ── Site search shell ── */
    .emega-header-mobile .site-search {
        position: relative !important;
        overflow: visible !important;
        z-index: 9999 !important;
        width: 100% !important;
    }

    /* ── Search form ── */
    .emega-header-mobile .site-search form {
        position: relative !important;
        overflow: visible !important;
        z-index: 9999 !important;
    }

    /* ── Suggestions wrapper ── */
    .emega-header-mobile .site-search .suggestions-wrapper {
        position: absolute !important;
        top: calc(100% + 4px) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 99999 !important;
        overflow: visible !important;
    }

    /* ── Suggestions dropdown ── */
    .emega-header-mobile .site-search .suggestions-wrapper .suggestions {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        max-height: 55vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        background: #fff !important;
        border: 1px solid #d5d9d9 !important;
        border-radius: 8px !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14) !important;
        z-index: 99999 !important;
    }

    /* ── Sticky override — disabled ── */
    /* .emega-header-top .emega-header-mobile.emega-header-mobile--sticky {
        background: rgba(255, 255, 255, 0.95) !important;
        padding: 12px 16px 16px !important;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12) !important;
        border-bottom: 1px solid #ebebeb !important;
    } */

    /* .emega-header-mobile--sticky .emega-header-zone--logo {
        padding-bottom: 10px !important;
    } */

    /* ── Bottom Nav Shell ── */
    .emega-mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        display: flex !important;
        align-items: stretch;
        justify-content: space-between;
        background: #fff;
        border-top: 1px solid #dcdcdc;
        padding-bottom: env(safe-area-inset-bottom);
        transition: transform 0.3s ease;
    }

    .emega-mobile-bottom-nav--hidden {
        transform: translateY(100%);
    }

    /* ── Every nav item ── */
    .emega-mobile-bottom-nav__item,
    .emega-mobile-bottom-nav .minicart {
        flex: 1 1 25%;
        min-height: 60px;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 6px 4px;
        border: 0;
        background: transparent;
        color: #111;
        text-decoration: none !important;
        font-size: 12px;
        line-height: 1.2;
        box-sizing: border-box;
        position: relative;
        overflow: hidden;
    }

    /* ── Active indicator ── */
    .emega-mobile-bottom-nav__item--active::before,
    .emega-mobile-bottom-nav
        .minicart.emega-mobile-bottom-nav__item--active::before {
        content: "";
        position: absolute !important;
        top: 0 !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 32px !important;
        height: 4px !important;
        background: #e00 !important;
        border-radius: 0 0 4px 4px !important;
        z-index: 2 !important;
        pointer-events: none !important;
    }

    /* ── Cart wrapper ── */
    .emega-mobile-bottom-nav
        .minicart.emega-header-minicart.emega-mobile-bottom-nav__item {
        padding: 0 !important;
        align-self: stretch !important;
        overflow: visible !important;
        margin-top: -1px !important;
        vertical-align: top !important;
    }

    /* ── Active state ── */
    .emega-mobile-bottom-nav__item--active {
        color: #111 !important;
    }

    /* ── Icons ── */
    .emega-mobile-bottom-nav__item .fa,
    .emega-mobile-bottom-nav__item i {
        font-size: 18px;
        line-height: 1;
        opacity: 0.75;
    }

    .emega-mobile-bottom-nav__item--active .fa,
    .emega-mobile-bottom-nav__item--active i {
        opacity: 1;
    }

    /* ── Labels ── */
    .emega-mobile-bottom-nav__item span:last-child {
        font-size: 11px;
        color: #555;
    }

    .emega-mobile-bottom-nav__item--active span:last-child {
        color: #111;
        font-weight: 500;
    }

    /* ── Hover / focus ── */
    .emega-mobile-bottom-nav__item:hover,
    .emega-mobile-bottom-nav__item:focus {
        color: #111;
        text-decoration: none !important;
    }

    /* ── Minicart total ── */
    .emega-mobile-bottom-nav
        .minicart.emega-header-minicart
        .minicart-total.hide-link-med {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 100% !important;
        width: 100% !important;
        padding: 6px 4px !important;
        box-sizing: border-box !important;
    }

    .emega-mobile-bottom-nav
        .minicart.emega-header-minicart
        .minicart-total.hide-no-link {
        display: none !important;
    }

    /* ── Cart: minicart-link ── */
    .emega-mobile-bottom-nav .minicart-link {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        color: #111 !important;
        text-decoration: none !important;
        font-size: 12px !important;
        position: relative !important;
        width: 100% !important;
        height: 100% !important;
        box-sizing: border-box !important;
    }

    .emega-mobile-bottom-nav .minicart-link .fa {
        font-size: 18px !important;
        line-height: 1 !important;
        opacity: 0.75 !important;
    }

    /* ── Cart: badge ── */
    .emega-mobile-bottom-nav .minicart-link .minicart-quantity {
        position: absolute !important;
        top: -1px !important;
        left: calc(50% - 14px) !important;
        transform: translateX(100%) !important;
        min-width: 16px !important;
        height: 16px !important;
        padding: 0 4px !important;
        border-radius: 999px !important;
        background: #e00 !important;
        color: #fff !important;
        font-size: 10px !important;
        line-height: 16px !important;
        text-align: center !important;
    }

    /* ── Cart: hide popover ── */
    .emega-mobile-bottom-nav .popover {
        display: none !important;
    }

    /* ── Cart: label ── */
    .emega-mobile-bottom-nav .minicart-link::after {
        content: "Cart" !important;
        font-size: 11px !important;
        color: #555 !important;
        display: block !important;
    }

    /* ── Body ── */
    html,
    body {
        overflow-x: hidden;
        max-width: 100%;
    }

    body {
        padding-bottom: 61px;
    }

    /* ── Scroll lock when mobile menu is open ── */
    html.mobile-menu-open,
    html.mobile-menu-open body {
        overflow: hidden !important;
        height: 100% !important;
    }

    html.mobile-menu-open body {
        position: fixed !important;
        width: 100% !important;
    }
}

/* ── Hide bottom nav on desktop ── */
@media (min-width: 769px) {
    .emega-mobile-bottom-nav {
        display: none !important;
    }
}
