/**
 * MVOL Custom Header Styles - COMPLETE & FIXED
 * Version: 1.7 - All fixes included
 * - Sticky header
 * - Mobile menu
 * - Dropdown menus with scroll
 * - Section titles
 * - Active parent highlighting
 * - Fixed: Double carets (Astra conflict)
 * - Fixed: Underline hover effect
 * - Fixed: No login button
 */

/* ============================================
   CRITICAL FIX: Hide Astra's Default Carets
   ============================================ */

/* Hide ALL Astra dropdown indicators */
.main-navigation .menu-item-has-children > a::after,
.ast-header-navigation .menu-item-has-children > a::after,
.site-header .menu-item-has-children > a::after,
#site-navigation .menu-item-has-children > a::after,
nav .menu-item-has-children > a::after,
.mvol-nav .menu-item-has-children > a::after {
    display: none !important;
    content: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Hide Astra SVG icons */
.main-navigation .menu-item-has-children > a svg,
.ast-header-navigation .menu-item-has-children > a svg {
    display: none !important;
}

/* Only show OUR custom dropdown icon */
.mvol-dropdown-icon {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ============================================
   HEADER CONTAINER
   ============================================ */

.mvol-header {
    background: #ffffff;
    padding: 1rem 0;
    position: relative;
    z-index: 9999;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.mvol-header.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 0.5rem 0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mvol-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ============================================
   LOGO STYLES
   ============================================ */

.mvol-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.mvol-logo:hover {
    opacity: 0.9;
}

/* Logo Image */
.mvol-logo-image-wrapper {
    display: flex;
    align-items: center;
}

.mvol-logo-image {
    height: 60px;
    width: auto;
    max-width: 280px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.mvol-header.sticky .mvol-logo-image {
    height: 60px;
}

.mvol-logo:hover .mvol-logo-image {
    transform: scale(1.05);
}

/* Logo Icon (Default SVG) */
.mvol-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #a4228d, #c5a028);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.mvol-header.sticky .mvol-logo-icon {
    width: 35px;
    height: 35px;
}

.mvol-logo:hover .mvol-logo-icon {
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.5);
}

.mvol-logo-icon svg {
    width: 24px;
    height: 24px;
}

/* Logo Text */
.mvol-logo-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.mvol-logo-text .logo-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.mvol-logo-text .logo-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    color: #a4228d;
    line-height: 1;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.mvol-header.sticky .mvol-logo-text .logo-title {
    font-size: 1.3rem;
}

.mvol-header.sticky .mvol-logo-text .logo-subtitle {
    font-size: 0.7rem;
}

/* ============================================
   MOBILE MENU TOGGLE
   ============================================ */

.mvol-mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
    transition: transform 0.3s ease;
}

.mvol-mobile-toggle:hover {
    transform: scale(1.1);
    background:transparent!important;
    border-color:transparent!important;
}
.mvol-header-inner button:hover{
     background:transparent!important;
    border-color:transparent!important;
}

.mvol-mobile-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mvol-mobile-toggle.active span:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.mvol-mobile-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.mvol-mobile-toggle.active span:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

/* ============================================
   NAVIGATION
   ============================================ */

.mvol-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.mvol-nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mvol-nav-menu > li {
    position: relative;
}

.mvol-nav-menu > li > a {
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 0;
    display: block;
    position: relative;
    transition: color 0.3s ease;
}

/* ============================================
   UNDERLINE HOVER EFFECT (RESTORED)
   ============================================ */

.mvol-nav-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #a4228d;
    transition: width 0.3s ease;
}

.mvol-nav-menu > li > a:hover,
.mvol-nav-menu > li.active-menu-item > a {
    color: #a4228d;
}

.mvol-nav-menu > li > a:hover::after,
.mvol-nav-menu > li.active-menu-item > a::after {
    width: 100%;
}

/* ============================================
   ACTIVE PARENT MENU HIGHLIGHTING
   ============================================ */

/* Current menu item (direct page match) */
.mvol-nav-menu > li.current-menu-item > a {
    color: #a4228d;
}

.mvol-nav-menu > li.current-menu-item > a::after {
    width: 100%;
}

/* Current menu ancestor (parent of active dropdown item) */
.mvol-nav-menu > li.current-menu-ancestor > a {
    color: #a4228d;
}

.mvol-nav-menu > li.current-menu-ancestor > a::after {
    width: 100%;
}

/* ============================================
   DROPDOWN MENU
   ============================================ */

/* Dropdown Icon (Caret) */
.mvol-dropdown-icon {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.mvol-nav-menu > li.has-dropdown:hover .mvol-dropdown-icon {
    transform: rotate(180deg);
}

.mvol-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 300px;
    max-width: 320px;
    padding: 0.5rem 0;
    list-style: none;
    margin: 0.5rem 0 0 0;
    border-radius: 8px;
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    
    /* Scrollable dropdown - limits height and adds scroll */
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar styling for dropdown */
.mvol-dropdown::-webkit-scrollbar {
    width: 6px;
}

.mvol-dropdown::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.mvol-dropdown::-webkit-scrollbar-thumb {
    background: #a4228d;
    border-radius: 4px;
}

.mvol-dropdown::-webkit-scrollbar-thumb:hover {
    background: #c5a028;
}

/* Firefox scrollbar styling */
.mvol-dropdown {
    scrollbar-width: thin;
    scrollbar-color: #a4228d #ddd;
}

/* Right-align dropdowns for last 2 menu items to prevent overflow */
.mvol-nav-menu > li.has-dropdown:last-child .mvol-dropdown,
.mvol-nav-menu > li.has-dropdown:nth-last-child(2) .mvol-dropdown {
    left: auto;
    right: 0;
}

.mvol-nav-menu > li.has-dropdown:hover .mvol-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mvol-dropdown li {
    margin: 0;
}

.mvol-dropdown li a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.mvol-dropdown li a:hover {
    background: #f5f5f5;
    color: #a4228d;
    padding-left: 2rem;
}

/* Dropdown Section Titles */
.mvol-dropdown-section-title {
    display: block;
    padding: 1rem 1.5rem 0.5rem;
    color: #a4228d;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-top: 1px solid #3a3a3a;
    margin-top: 0.5rem;
}

.mvol-dropdown-section-title:first-child {
    border-top: none;
    margin-top: 0;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.mvol-mobile-toggle:focus-visible {
    outline: 2px solid #a4228d;
    outline-offset: 4px;
}

.mvol-nav-menu a:focus-visible {
    outline: 2px solid #a4228d;
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #a4228d;
    color: #1a1a1a;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* ============================================
   RESPONSIVE STYLES - TABLET AND MOBILE
   ============================================ */

@media (max-width: 992px) {
    .mvol-header-inner {
        padding: 0 1.5rem;
    }

    .mvol-mobile-toggle {
        display: flex;
    }

    .mvol-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        align-items: flex-start;
        padding: 5rem 2rem 2rem;
        transition: right 0.3s ease;
        overflow-y: auto;
        box-shadow: -5px 0 15px rgba(0,0,0,0.3);
    }

    .mvol-nav.active {
        right: 0;
    }

    .mvol-nav-menu {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0;
        top: 10px;
        position: relative;
    }

    .mvol-nav-menu > li {
        width: 100%;
        border-bottom: 1px solid #ddd;
    }

    .mvol-nav-menu > li > a {
        padding: 1rem 0;
        font-size: 1.1rem;
    }

    .mvol-nav-menu > li > a::after {
        display: none;
    }

    /* Mobile Dropdown */
    .mvol-dropdown {
        position: static;
        background: #ddd;
        margin: 0;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: max-height 0.3s ease;
    }

    .mvol-nav-menu > li.has-dropdown.dropdown-open .mvol-dropdown {
        max-height: 500px;
        padding: 0.5rem 0;
    }

    .mvol-dropdown-icon {
        position: absolute;
        right: 10px;
        margin-left: 0;
    }

    .mvol-nav-menu > li.has-dropdown.dropdown-open .mvol-dropdown-icon {
        transform: rotate(180deg);
    }

    .mvol-dropdown li a {
        padding: 0.75rem 1rem 0.75rem 2rem;
        font-size: 0.95rem;
    }

    .mvol-dropdown li a:hover {
        padding-left: 2.5rem;
    }

    /* Mobile active states */
    .mvol-nav-menu > li.current-menu-item > a,
    .mvol-nav-menu > li.current-menu-ancestor > a {
        color: #a4228d;
        background: #f5f5f5;
        border-left: 3px solid #a4228d;
        padding-left: calc(0rem + 10px);
    }
}

@media (max-width: 768px) {
    .mvol-header-inner {
        padding: 0 1rem;
    }

    .mvol-logo-text .logo-title {
        font-size: 1.3rem;
    }

    .mvol-logo-text .logo-subtitle {
        font-size: 0.7rem;
    }

    .mvol-header.sticky .mvol-logo-text .logo-title {
        font-size: 1.1rem;
    }

    .mvol-logo-image {
        height: 40px;
    }

    .mvol-header.sticky .mvol-logo-image {
        height: 35px;
    }

    .mvol-nav {
        width: 90%;
        padding: 4rem 1.5rem 2rem;
    }
}

@media (max-width: 480px) {
    .mvol-logo-icon {
        width: 35px;
        height: 35px;
    }

    .mvol-logo-icon svg {
        width: 20px;
        height: 20px;
    }

    .mvol-logo-text .logo-title {
        font-size: 1.1rem;
    }

    .mvol-logo-text .logo-subtitle {
        font-size: 0.65rem;
    }

    .mvol-nav {
        width: 100%;
    }
}

/**
 * Mobile Dropdown Toggle Button Styles
 * Add this to the BOTTOM of your custom-header.css file
 * (After the existing mobile styles)
 */

/* ============================================
   MOBILE DROPDOWN TOGGLE BUTTON
   ============================================ */

@media (max-width: 992px) {
    /* Toggle button for mobile dropdowns */
    .mvol-mobile-dropdown-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        margin: 0;
        background: transparent;
        border: 1px solid rgba(164, 34, 141, 0.3);
        border-radius: 4px;
        color: #a4228d;
        cursor: pointer;
        transition: all 0.3s ease;
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .mvol-mobile-dropdown-toggle:hover {
        background: rgba(164, 34, 141, 0.1);
        border-color: rgba(164, 34, 141, 0.5);
    }
    
    .mvol-mobile-dropdown-toggle i {
        font-size: 12px;
        transition: transform 0.3s ease;
    }
    
    /* Ensure parent items have relative positioning */
    .mvol-nav-menu > li.has-dropdown {
        position: relative;
    }
    
    /* Adjust link padding to make room for toggle button */
    .mvol-nav-menu > li.has-dropdown > a {
        padding-right: 60px !important;
    }
    
    /* Hide the old dropdown icon since we have the new button */
    .mvol-nav-menu > li.has-dropdown .mvol-dropdown-icon {
        display: none !important;
    }
}