/**
 * AVM Header CSS
 *
 * Purpose: Styles that Tailwind utility classes can't handle for the
 * AVM header component (scrollbar hiding, dropdown JS states,
 * mobile nav transitions, badge sizing).
 *
 * JS class convention: theme.js uses .active for all toggles.
 */

/* ========================================
   0. Scroll-aware fixed header
   ----------------------------------------
   Hide on scroll down, show on scroll up.
   JS toggles .header-hidden class.
   Uses fixed positioning (not sticky) so
   transform: translateY works correctly.
======================================== */

.avm-header {
    transition: transform 0.3s ease;
    will-change: transform;
}

.avm-header.header-hidden {
    transform: translateY(-100%);
}

/* ========================================
   0b. Force vertical centering in AVM header
   ----------------------------------------
   Base CSS may override Tailwind's items-center.
   These ensure all header content stays centered.
======================================== */

.avm-header,
.avm-header * {
    box-sizing: border-box;
}

.avm-header .flex {
    display: flex !important;
    align-items: center !important;
}

.avm-header a.flex-shrink-0 {
    display: flex;
    align-items: center;
}

.avm-header a.flex-shrink-0 img {
    display: block;
}

/* ========================================
   1. Application Area Row - Hide Scrollbar
   ----------------------------------------
   Horizontal scroll without visible scrollbar.
======================================== */

.avm-apparea-row {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.avm-apparea-row::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* ========================================
   2. User Dropdown Toggle (hover)
======================================== */

.avm-user-dropdown-menu {
    display: none;
    font-size: 14px !important;
    margin-top: 4px;
}

/* Bridge the gap between button and dropdown so hover doesn't break */
.avm-user-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

.avm-user-dropdown-menu a {
    font-size: 14px !important;
    line-height: 1.5 !important;
    padding: 10px 18px !important;
    display: block !important;
}

.avm-user-dropdown-menu p {
    font-size: 14px !important;
    line-height: 1.5 !important;
}

.avm-user-dropdown:hover .avm-user-dropdown-menu {
    display: block;
}

/* ========================================
   3. Search Overlay Toggle
   ----------------------------------------
   JS toggles .active on #search-overlay.
======================================== */

#search-overlay.active {
    display: block !important;
}

/* ========================================
   4. Mobile Nav Drawer
   ----------------------------------------
   JS adds .active class to slide in.
======================================== */

#mobile-nav.active {
    transform: translateX(0);
}

#mobile-nav-overlay.active {
    display: block !important;
}

/* Mobile submenu expand/collapse (JS toggles .open on parent li) */
.mobile-nav-item.open > .mobile-nav-submenu {
    display: block !important;
}

.mobile-nav-submenu-nested.open {
    display: block !important;
}

/* Rotate chevron when submenu is open */
.mobile-nav-item.open > .mobile-nav-link .toggle-icon {
    transform: rotate(180deg);
}

/* ========================================
   5. Badge Sizing
   ----------------------------------------
   Tailwind doesn't have w-4.5/h-4.5 by default.
======================================== */

.avm-header-icon .absolute,
.avm-header .open-mini-cart .absolute {
    min-width: 18px;
    min-height: 18px;
}

/* ========================================
   6. Mega Menu - full-width hover timing
   ----------------------------------------
   Small delay to prevent accidental close.
======================================== */

.avm-mega-menu {
    transition: opacity 0.15s ease;
}

/* ========================================
   7. Mobile Footer Bar Spacing
   ----------------------------------------
   Add bottom padding to body so content
   isn't hidden behind fixed mobile bar.
======================================== */

@media (max-width: 1023px) {
    body {
        padding-bottom: 56px; /* h-14 = 3.5rem = 56px */
    }
}
