/**
 * Header Navigation Styles
 * Includes dropdown menus and chevron arrows based on Figma design
 */

/* ==========================================================================
   Desktop Navigation - Dropdown Menu Styles
   ========================================================================== */

/* Nav item wrapper for items with dropdowns */
.custom-header__nav-item-wrapper {
    display: flex;
    align-items: center;
    gap: 4px; /* 4px spacing between text and arrow as per Figma */
    position: relative;
}

/* Dropdown toggle button (chevron arrow) */
.custom-header__dropdown-toggle {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: #1e1e1e; /* Match Figma text color */
    transition: transform 0.2s ease, color 0.2s ease;
    vertical-align: middle;
}

.custom-header__dropdown-toggle:hover {
    color: #000000;
    background: none;
}

/* Arrow rotation when dropdown is open */
.custom-header__nav-list .has-dropdown.dropdown-open .custom-header__dropdown-toggle {
    transform: rotate(180deg);
}

/* Dropdown menu container */
.custom-header__dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #ffffff;
    border: 1px solid #D9D9D9;
    border-radius: 8px;
    padding: 8px 0;
    margin: 8px 0 0 0; /* Added top margin to move dropdown down */
    list-style: none;
    z-index: 1000;
    display: none; /* Initially hidden, shown by JavaScript */
}

/* Dropdown menu items */
.custom-header__dropdown-menu li {
    margin: 0;
    padding: 0;
}

.custom-header__dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: #1e1e1e;
    text-decoration: none;
    font-family: var(--proxima-nova-font), 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.43;
    transition: color 0.2s ease;
}

.custom-header__dropdown-menu a:hover,
.custom-header__dropdown-menu a:focus {
    color: #000000;
}

/* ==========================================================================
   Mobile Navigation - Dropdown Menu Styles
   ========================================================================== */

/* Mobile nav item wrapper for items with dropdowns */
.custom-header__mobile-nav-item-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Mobile dropdown toggle button */
.custom-header__mobile-dropdown-toggle {
    background: none;
    border: none;
    padding: 8px;
    margin: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #1e1e1e;
    transition: transform 0.2s ease, color 0.2s ease;
    border-radius: 4px;
}

.custom-header__mobile-dropdown-toggle:hover {
    background: none;
}

/* Arrow rotation when dropdown is open */
.custom-header__mobile-dropdown-toggle.active {
    transform: rotate(180deg);
}

/* Mobile dropdown menu container */
.custom-header__mobile-dropdown-menu {
    list-style: none;
    margin: 8px 0 0 0;
    padding: 0 0 0 20px;
    border-left: 2px solid #f0f0f0;
}

.custom-header__mobile-dropdown-menu li {
    margin: 0;
    padding: 0;
}

.custom-header__mobile-dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: #666666;
    text-decoration: none;
    font-family: var(--proxima-nova-font), 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    transition: color 0.2s ease;
}

.custom-header__mobile-dropdown-menu a:hover,
.custom-header__mobile-dropdown-menu a:focus {
    color: #1e1e1e;
}

/* ==========================================================================
   Navigation List Base Styles
   ========================================================================== */

/* Ensure proper positioning for dropdown menus */
.custom-header__nav-list > li {
    position: relative;
}

.custom-header__nav-list .has-dropdown > a {
    /* Remove any potential right margin that might interfere with arrow positioning */
    margin-right: 0;
}

/* ==========================================================================
   Responsive Behavior
   ========================================================================== */

/* Hide desktop dropdowns on mobile */
@media (max-width: 1023px) {
    .custom-header__dropdown-menu {
        display: none !important;
    }
    
    .custom-header__dropdown-toggle {
        display: none;
    }
    
    .custom-header__nav-item-wrapper {
        display: contents;
    }
}

/* Hide mobile dropdowns on desktop */
@media (min-width: 1024px) {
    .custom-header__mobile-dropdown-toggle {
        display: none;
    }
    
    .custom-header__mobile-nav-item-wrapper {
        display: contents;
    }
    
    .custom-header__mobile-dropdown-menu {
        display: none !important;
    }
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

/* Focus styles for dropdown toggles */
.custom-header__dropdown-toggle:focus,
.custom-header__mobile-dropdown-toggle:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .custom-header__dropdown-menu {
        border: 2px solid #000000;
    }
    
    .custom-header__dropdown-menu a:hover,
    .custom-header__dropdown-menu a:focus {
        color: #000000;
        text-decoration: underline;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .custom-header__dropdown-toggle,
    .custom-header__mobile-dropdown-toggle {
        transition: none;
    }
    
    .custom-header__dropdown-menu a {
        transition: none;
    }
}

/* ==========================================================================
   Language Selector Arrow (already styled in header.php)
   ========================================================================== */

/* The language selector already has proper chevron styling in header.php
   This section ensures consistency with the navigation dropdown arrows */

.custom-header__language-chevron {
    width: 16px;
    height: 16px;
    color: #1e1e1e;
    transition: transform 0.2s ease;
}

.custom-header__language-button[aria-expanded="true"] .custom-header__language-chevron {
    transform: rotate(180deg);
}
