/* =========================================
   FM Collections Mobile Header
========================================= */

.mobile-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    display: none;
    width: 100%;
    border-bottom: 1px solid #e3eae5;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 7px 22px rgba(31, 41, 55, 0.06);
    backdrop-filter: blur(12px);
}

.mobile-header-container {
    width: 100%;
    height: 66px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
}

/* =========================
   Header Actions
========================= */

.mobile-menu-btn,
.mobile-cart {
    position: relative;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    padding: 0;
    border: 1px solid #dfe7e1;
    border-radius: 12px;
    background: #f5f9f5;
    color: #263142;
    font-size: 17px;
    text-decoration: none;
    cursor: pointer;
    transition:
        color 0.25s ease,
        background 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}

.mobile-menu-btn:hover,
.mobile-cart:hover {
    border-color: rgba(46, 125, 50, 0.35);
    background: #eaf5eb;
    color: #2e7d32;
}

.mobile-cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #2e7d32;
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
}

/* =========================
   Mobile Logo
========================= */

.mobile-logo {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    border-radius: 50%;
    background: linear-gradient(145deg, #2e7d32, #388e3c);
    color: #ffffff;
    font-size: 14px;
    font-weight: 850;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(46, 125, 50, 0.18);
}

/* =========================
   Mobile Search
========================= */

.mobile-search {
    min-width: 0;
    height: 42px;
    display: flex;
    align-items: center;
    flex: 1;
    overflow: hidden;
    border: 1px solid #dfe7e1;
    border-radius: 999px;
    background: #f8faf8;
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background 0.25s ease;
}

.mobile-search:focus-within {
    border-color: rgba(46, 125, 50, 0.5);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.08);
}

.mobile-search input {
    min-width: 0;
    height: 100%;
    flex: 1;
    padding: 0 4px 0 14px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #1f2937;
    font-size: 12px;
}

.mobile-search input::placeholder {
    color: #8b98a6;
}

.mobile-search button {
    width: 41px;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 41px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #2e7d32;
    font-size: 14px;
    cursor: pointer;
}

/* =========================
   Overlay
========================= */

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.48);
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(2px);
    transition:
        opacity 0.28s ease,
        visibility 0.28s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* =========================
   Side Menu
========================= */

.mobile-side-menu {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 10001;
    width: min(88vw, 340px);
    overflow-x: hidden;
    overflow-y: auto;
    background: #ffffff;
    box-shadow: 22px 0 55px rgba(15, 23, 42, 0.18);
    transform: translateX(-105%);
    transition: transform 0.3s ease;
    overscroll-behavior: contain;
}

.mobile-side-menu.active {
    transform: translateX(0);
}

.mobile-side-header {
    position: sticky;
    top: 0;
    z-index: 3;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 14px 18px;
    border-bottom: 1px solid #e6ece7;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
}

.mobile-side-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    color: inherit;
    text-decoration: none;
}

.mobile-side-brand-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    border-radius: 50%;
    background: #2e7d32;
    color: #ffffff;
    font-size: 13px;
    font-weight: 850;
}

.mobile-side-brand > span:last-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.mobile-side-brand strong {
    color: #1f2937;
    font-size: 15px;
    font-weight: 850;
}

.mobile-side-brand small {
    margin-top: 2px;
    color: #718096;
    font-size: 8px;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.mobile-side-close {
    width: 39px;
    height: 39px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 39px;
    padding: 0;
    border: 1px solid #e1e8e3;
    border-radius: 11px;
    background: #f4f7f4;
    color: #263142;
    font-size: 17px;
    cursor: pointer;
}

/* =========================
   Navigation
========================= */

.mobile-side-navigation {
    padding: 12px 16px 24px;
}

.mobile-menu-list {
    display: grid;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mobile-menu-list li {
    min-width: 0;
}

.mobile-menu-list > li > a,
.mobile-submenu-btn,
.mobile-logout-btn {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 13px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #263142;
    font-family: inherit;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.4;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition:
        color 0.22s ease,
        background 0.22s ease;
}

.mobile-menu-list > li > a > i,
.mobile-menu-label > i,
.mobile-logout-btn > i {
    width: 19px;
    flex: 0 0 19px;
    color: #2e7d32;
    font-size: 14px;
    text-align: center;
}

.mobile-menu-list > li > a:hover,
.mobile-submenu-btn:hover {
    background: #f1f7f2;
    color: #2e7d32;
}

.mobile-menu-list > li > a.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.mobile-menu-label {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    flex: 1;
}

.submenu-arrow {
    margin-left: auto;
    color: #718096;
    font-size: 10px;
    transition: transform 0.25s ease;
}

.mobile-has-submenu.open > .mobile-submenu-btn .submenu-arrow {
    transform: rotate(180deg);
}

/* =========================
   Accordion Submenus
========================= */

.mobile-submenu {
    max-height: 0;
    margin: 0;
    padding: 0 0 0 28px;
    overflow: hidden;
    list-style: none;
    opacity: 0;
    transition:
        max-height 0.35s ease,
        opacity 0.25s ease,
        padding 0.25s ease;
}

.mobile-has-submenu.open > .mobile-submenu {
    max-height: 1600px;
    padding-top: 5px;
    padding-bottom: 7px;
    opacity: 1;
}

.mobile-submenu li {
    margin: 2px 0;
}

.mobile-submenu a {
    min-height: 39px;
    display: flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 9px;
    color: #566273;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition:
        color 0.22s ease,
        background 0.22s ease;
}

.mobile-submenu a:hover {
    background: #f1f7f2;
    color: #2e7d32;
}

.mobile-category-group {
    padding-right: 4px;
}

.mobile-submenu-btn--nested {
    min-height: 40px;
    padding-right: 9px;
    padding-left: 11px;
    color: #394557;
    font-size: 12px;
}

.mobile-submenu--nested {
    padding-left: 14px;
    border-left: 1px solid #e2ebe4;
}

.mobile-view-all-link {
    color: #2e7d32 !important;
    font-weight: 800 !important;
}

/* =========================
   Account Menu
========================= */

.mobile-menu-divider {
    height: 1px;
    margin: 15px 4px;
    background: #e5ebe6;
}

.mobile-menu-count {
    min-width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0 6px;
    border-radius: 999px;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 9px;
    font-weight: 850;
}

.mobile-logout-form {
    margin: 0;
}

.mobile-logout-btn {
    color: #b42318;
}

.mobile-logout-btn > i {
    color: #b42318;
}

.mobile-logout-btn:hover {
    background: #fff1f0;
}

/* =========================
   Utilities
========================= */

body.mobile-menu-open {
    overflow: hidden;
}

.mobile-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================
   Responsive Visibility
========================= */

@media (max-width: 992px) {
    .mobile-header {
        display: block;
    }
}

@media (min-width: 993px) {
    .mobile-header,
    .mobile-menu-overlay,
    .mobile-side-menu {
        display: none;
    }
}

@media (max-width: 390px) {
    .mobile-header-container {
        gap: 7px;
        padding: 0 10px;
    }

    .mobile-menu-btn,
    .mobile-cart,
    .mobile-logo {
        width: 39px;
        height: 39px;
        flex-basis: 39px;
    }

    .mobile-search {
        height: 39px;
    }

    .mobile-search input {
        padding-left: 11px;
        font-size: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-menu-overlay,
    .mobile-side-menu,
    .mobile-submenu,
    .submenu-arrow {
        transition: none;
    }
}