/* New Header Styles */

/* Hide old desktop menu on mobile, show new structure */
@media screen and (max-width: 1024px) {
    .navbar .desktop-menu {
        display: none !important;
    }

    .navbar .mobile-header-right {
        display: flex;
        align-items: center;
        gap: 30px;
        flex: 1;
        justify-content: flex-end;
    }

    .navbar .mobile-cta {
        padding: 6px 18px;
        background-color: var(--main-color);
        color: #fff;
        border: 2px solid #000000;
        text-transform: uppercase;
        font-weight: 400;
        font-size: 13px;
        white-space: nowrap;
    }

    .navbar .mobile-phone {
        display: inline-block !important;
        width: 24px;
        height: 24px;
        overflow: hidden;
        position: relative;
        text-indent: -9999px;
        white-space: nowrap;
        visibility: visible !important;
        padding: 8px;
        margin: -8px;
    }

    .navbar .mobile-phone .phone-icon-svg {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 24px;
        height: 24px;
        text-indent: 0;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: none; /* Allow clicks to pass through to parent link */
    }

    .navbar .mobile-phone svg {
        width: 24px;
        height: 24px;
        fill: var(--dark-font);
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Mobile Menu Overlay */
    .mobile-menu {
        position: fixed;
        top: 60px;
        left: 100%;
        width: 100%;
        height: calc(100vh - 60px);
        background-color: #ffffff;
        transition: left 0.3s cubic-bezier(0.455, 0.03, 0.515, 0.955);
        overflow-y: auto;
        z-index: 999;
    }

    .mobile-menu.active {
        left: 0;
    }

    .mobile-menu-list {
        list-style: none;
        padding: 20px;
    }

    .mobile-menu-item {
        margin-bottom: 5px;
    }

    .mobile-menu-item a,
    .mobile-submenu-toggle {
        display: block;
        padding: 15px 10px;
        color: var(--dark-font);
        text-transform: uppercase;
        font-weight: 400;
        border: none;
        background: none;
        width: 100%;
        text-align: left;
        font-family: 'Poppins', sans-serif;
        font-size: 14px;
        cursor: pointer;
    }

    .mobile-menu-item.language-group a {
        text-transform: none;
    }

    .mobile-menu-item.language-group .flag {
        margin-right: 10px;
        font-size: 20px;
    }

    .mobile-menu-divider {
        height: 1px;
        background-color: #d1d1d1;
        margin: 15px 0;
    }

    .mobile-submenu-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .mobile-submenu-toggle .chevron {
        width: 12px;
        height: 12px;
        fill: var(--dark-font);
        transition: transform 0.3s ease;
    }

    .mobile-submenu-toggle.active .chevron {
        transform: rotate(180deg);
    }

    .mobile-submenu {
        list-style: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        padding-left: 20px;
    }

    .mobile-submenu.active {
        max-height: 200px;
    }

    .mobile-submenu li a {
        padding: 10px;
        font-size: 13px;
    }
}

/* Desktop Menu Styles */
@media screen and (min-width: 1025px) {
    .navbar .mobile-header-right {
        display: none;
    }

    .navbar .mobile-menu {
        display: none;
    }

    .navbar .desktop-menu {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 20px;
        list-style: none;
        flex: 4;
        width: 100%;
    }

    .navbar .desktop-menu .menu-item a {
        color: var(--dark-font);
        text-transform: uppercase;
        font-weight: 400;
        white-space: nowrap;
        transition: all .3s cubic-bezier(0.455, 0.03, 0.515, 0.955);
    }

    .navbar .desktop-menu .menu-item:not(.cta) a:hover {
        color: var(--main-color);
    }

    /* Social Icons */
    .navbar .desktop-menu .social-icon a {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .navbar .desktop-menu .social-icon svg {
        width: 16px;
        height: 16px;
        fill: var(--dark-font);
        transition: all .3s cubic-bezier(0.455, 0.03, 0.515, 0.955);
    }

    .navbar .desktop-menu .social-icon:hover svg {
        fill: var(--main-color);
    }

    /* Phone Icon */
    .navbar .desktop-menu .phone-icon .phone-icon-link {
        display: inline-block !important;
        width: 16px;
        height: 16px;
        overflow: hidden;
        position: relative;
        text-indent: -9999px;
        white-space: nowrap;
    }

    .navbar .desktop-menu .phone-icon .phone-icon-svg {
        position: absolute;
        top: 0;
        left: 0;
        width: 16px;
        height: 16px;
        text-indent: 0;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: none; /* Allow clicks to pass through to parent link */
    }

    .navbar .desktop-menu .phone-icon svg {
        width: 16px;
        height: 16px;
        fill: var(--dark-font);
        transition: all .3s cubic-bezier(0.455, 0.03, 0.515, 0.955);
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .navbar .desktop-menu .phone-icon:hover svg {
        fill: var(--main-color);
    }

    /* Ensure phone icon stays visible after call tracking script loads */
    .navbar .desktop-menu .phone-icon .zphone {
        display: inline-block !important;
        visibility: visible !important;
    }

    /* Dropdown Menus */
    .navbar .desktop-menu .has-dropdown {
        position: relative;
    }

    .navbar .desktop-menu .has-dropdown > a::after {
        content: '▾';
        margin-left: 5px;
        font-size: 10px;
    }

    .navbar .desktop-menu .dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #ffffff;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        list-style: none;
        min-width: 180px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s cubic-bezier(0.455, 0.03, 0.515, 0.955);
        z-index: 1000;
        padding: 10px 0;
    }

    .navbar .desktop-menu .has-dropdown:hover .dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .navbar .desktop-menu .dropdown li {
        margin: 0;
    }

    .navbar .desktop-menu .dropdown li a {
        display: block;
        padding: 12px 20px;
        color: var(--dark-font);
        text-transform: uppercase;
        font-size: 13px;
    }

    .navbar .desktop-menu .dropdown li a:hover {
        background-color: #f7f7f7;
        color: var(--main-color);
    }

    /* Language Switcher */
    .navbar .desktop-menu .language-switcher .flag {
        font-size: 20px;
    }

    .navbar .desktop-menu .language-switcher .dropdown {
        right: 0;
        left: auto;
    }

    .navbar .desktop-menu .language-switcher .dropdown .flag {
        margin-right: 8px;
    }

    /* CTA Button */
    .navbar .desktop-menu .cta a {
        padding: 8px 20px;
        border: 2px solid #000000;
        background-color: var(--main-color);
        color: #fff;
        text-transform: uppercase;
        font-weight: 400;
    }

    .navbar .desktop-menu .cta a:hover {
        filter: brightness(.8);
        color: var(--bright-font);
    }
}
