/* ==========================================================================
   MYMALLBEAUTY - HEADER STYLES
   Only state/animation classes + walker output classes.
   Layout is handled by Tailwind inline classes (matching prototype).
   ========================================================================== */

/* ── STICKY SECTIONS ────────────────────────────────────────────── */
/* Shadow appears when a section is "stuck" (scrolled past its natural position) */
.mmb-sticky-section {
    transition: box-shadow 0.2s ease;
}

/* ── CATEGORIES DROPDOWN (hover + JS toggle) ────────────────────── */
/* Pure CSS hover — reliable on all pages (no Tailwind CDN dependency) */
#mmbCategoriesWrapper:hover #mmbCategoriesDropdown,
#mmbCategoriesDropdown[data-state="open"] {
    opacity: 1;
    visibility: visible;
}

/* ── CATEGORIES WALKER OUTPUT ────────────────────────────────────── */

/* Items must NOT be positioning parents — submenus anchor to the dropdown container */
.mmb-cat-item {
    position: static;
}

.mmb-cat-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    font-size: 0.875rem;
    color: var(--mmb-text, #374151);
    transition: all 0.15s ease;
    border-bottom: 1px solid #f9fafb;
}

.mmb-cat-link:hover,
.mmb-cat-item.mmb-cat-active > .mmb-cat-link {
    background: var(--mmb-primary-50, #eefbfc);
    color: var(--mmb-primary, #23bac5);
    padding-left: 24px;
}

.mmb-cat-link span {
    flex: 1;
}

/* Submenu level 1 — anchored to dropdown top, appears to the right */
.mmb-cat-submenu {
    position: absolute;
    top: 0;
    left: 100%;
    width: 100%;
    min-height: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: none;
    border-radius: 0 0 8px 0;
    box-shadow: 4px 4px 12px rgba(0,0,0,.08);
    list-style: none;
    margin: 0;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 101;
}

/* JS hover-intent drives visibility via .mmb-sub-active class */
.mmb-cat-submenu.mmb-sub-active {
    opacity: 1;
    visibility: visible;
}

.mmb-cat-sub-item {
    position: static;
}

.mmb-cat-sub-link {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    font-size: 0.875rem;
    color: #4b5563;
    transition: all 0.15s ease;
    border-bottom: 1px solid #f9fafb;
}

.mmb-cat-sub-link:hover,
.mmb-cat-sub-item.mmb-cat-active > .mmb-cat-sub-link {
    background: var(--mmb-primary-50, #eefbfc);
    color: var(--mmb-primary, #23bac5);
}

.mmb-cat-sub-link span {
    flex: 1;
}

/* Submenu level 2 — anchored to level-1 submenu top */
.mmb-cat-sub-submenu {
    position: absolute;
    top: 0;
    left: 100%;
    width: 100%;
    min-height: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: none;
    border-radius: 0 0 8px 0;
    box-shadow: 4px 4px 12px rgba(0,0,0,.08);
    list-style: none;
    margin: 0;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 102;
}

.mmb-cat-sub-submenu.mmb-sub-active {
    opacity: 1;
    visibility: visible;
}

.mmb-cat-deep-link {
    display: block;
    padding: 10px 16px;
    font-size: 0.875rem;
    color: #4b5563;
    transition: all 0.15s ease;
    border-bottom: 1px solid #f9fafb;
}

.mmb-cat-deep-link:hover {
    background: var(--mmb-primary-50, #eefbfc);
    color: var(--mmb-primary, #23bac5);
}

/* ── DESKTOP NAV WALKER ──────────────────────────────────────────── */
.mmb-dropdown {
    left: 0;
    top: 100%;
    margin-top: 0;
}

/* ── MOBILE MENU (JS slide toggle) ───────────────────────────────── */
#mmbMobileMenu.active {
    left: 0;
}

/* Prevent body scroll leak when touching mobile menu */
body.mmb-menu-open {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
}

#mmbMobileOverlay.active {
    opacity: 1;
    visibility: visible;
}

/* ── MOBILE WALKER OUTPUT ────────────────────────────────────────── */
.mmb-mobile-item {
    border-bottom: 1px solid #f3f4f6;
}

.mmb-mobile-item a {
    padding-left: 20px;
    padding-right: 20px;
}

.mmb-mobile-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 20px 8px 8px;
}

.mmb-mobile-toggle.active i {
    transform: rotate(180deg);
}

.mmb-mobile-submenu {
    list-style: none;
    margin: 0 0 0 20px;
    padding: 0 0 8px 0;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 1023px) {
    #mmbCategoriesWrapper button span {
        display: none;
    }
}
