/* ============================
   HEADER
   ============================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Logo & WhatsApp Icon Toggles */
.site-header .logo-white,
.site-header .wa-icon-white {
    display: none;
}

.site-header .logo-default,
.site-header .wa-icon-default {
    display: block;
}

/* Homepage Transparent Hero Header */
.site-header.header-home {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}

.site-header.header-transparent {
    background: #FFFFFF05;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.site-header.header-transparent .logo-default {
    display: none;
}

.site-header.header-transparent .logo-white {
    display: block;
}

.site-header.header-transparent .wa-icon-default {
    display: none;
}

.site-header.header-transparent .wa-icon-white {
    display: block;
}

.site-header.header-transparent .header-nav > a {
    color: #FFFFFF;
}

.site-header.header-transparent .header-nav > a:hover {
    color: rgba(255, 255, 255, 0.85);
}

.site-header.header-transparent .header-nav > a.active {
    color: #FFFFFF;
    font-weight: 600;
}

.site-header.header-transparent .nav-dropdown-toggle {
    color: #FFFFFF;
}

.site-header.header-transparent .nav-dropdown-toggle:hover,
.site-header.header-transparent .nav-dropdown.open .nav-dropdown-toggle {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.15);
}

.site-header.header-transparent .btn-wa {
    width: 130px;
    height: 40px;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 24px;
    border: 1px solid #FFFFFF;
    background: transparent;
}

.site-header.header-transparent .btn-wa span {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 24px;
    letter-spacing: -0.008em;
    color: #FFFFFF;
}

.site-header.header-transparent .header-toggle span {
    background: #FFFFFF;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1440px;
    margin: 0 auto;
    padding: 16px var(--gutter-desktop);
}

.header-logo a {
    display: flex;
    align-items: center;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.header-nav a {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0%;
    text-align: center;
    text-decoration: none;
    color: #252525;
    transition: color 0.3s ease;
}

.header-nav a.active {
    font-weight: 600;
    font-style: Semi Bold;
    color: #A4271E;
}

.header-nav a:not(.active) {
    font-weight: 400;
    font-style: Regular;
}

.header-nav a:hover {
    color: #A4271E;
}

/* Dropdown Styles - Custom Modern Active & Hover States */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle {
    color: #A4271E;
    background: rgba(164, 39, 30, 0.06);
}

.dropdown-arrow {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(10px) scale(0.97);
    min-width: 310px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 16px 40px -6px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.04);
    border-radius: 14px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* Hover support for desktop — handled in @media (min-width: 1024px) at bottom of file */

.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    margin: 2px 0;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: #333333;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-align: left;
}

.dropdown-item-arrow {
    opacity: 0;
    transform: translateX(-6px);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.nav-dropdown-menu a:hover {
    background: rgba(164, 39, 30, 0.06);
    color: #A4271E;
    transform: translateX(4px);
    padding-left: 16px;
}

.nav-dropdown-menu a:hover .dropdown-item-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Active State in Dropdown Menu */
.nav-dropdown-menu a.active {
    background: #A4271E;
    color: #FFFFFF !important;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(164, 39, 30, 0.28);
    transform: translateX(0);
}

.nav-dropdown-menu a.active .dropdown-item-arrow {
    opacity: 1;
    transform: translateX(0);
    color: #FFFFFF;
}

.header-whatsapp {
    display: flex;
    align-items: center;
}

.btn-wa {
    display: flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    height: 40px;
    padding: 8px 16px;
    border-radius: 24px;
    border: 1px solid #A4271E;
    background: transparent;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.btn-wa img {
    width: 20px;
    height: 20px;
}

.btn-wa span {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-style: Medium;
    font-size: 14px;
    line-height: 24px;
    letter-spacing: -0.8%;
    color: #A4271E;
}

.btn-wa:hover {
    transform: scale(1.05);
}

.header-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.header-toggle span {
    width: 24px;
    height: 2px;
    background: #252525;
    transition: all 0.3s ease;
}

.header-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.header-toggle.open span:nth-child(2) {
    opacity: 0;
}

.header-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1023px) {
    .header-inner {
        padding: 12px var(--gutter-tablet);
    }

    .header-nav {
        position: fixed;
        top: 65px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 20px 24px;
        background: #ffffff;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        max-height: calc(100vh - 65px);
        overflow-y: auto;
    }

    .header-nav.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    /* Force mobile drawer text to be dark readable text on white background even when transparent header is enabled on homepage */
    .site-header.header-transparent .header-nav.show {
        background: #ffffff !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
    }

    .site-header.header-transparent .header-nav.show > a,
    .site-header.header-transparent .header-nav.show .nav-dropdown-toggle {
        color: #252525 !important;
    }

    .header-nav > a,
    .nav-dropdown {
        width: 100%;
        padding: 14px 0;
        border-bottom: 1px solid #f0f0f0;
        text-align: left;
    }

    .header-nav a {
        text-align: left !important;
        color: #252525;
        font-size: 16px;
    }

    .nav-dropdown-toggle {
        display: flex !important;
        width: 100% !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        color: #252525 !important;
    }

    .nav-dropdown-toggle span {
        text-align: left;
    }

    .nav-dropdown-menu {
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        width: 100% !important;
        min-width: 100% !important;
        padding: 8px 12px !important;
        background: #f8fafc !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 10px !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: none;
        margin-top: 8px !important;
        box-sizing: border-box !important;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        display: flex !important;
        flex-direction: column !important;
        gap: 2px !important;
    }

    .nav-dropdown-menu a {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 10px 12px !important;
        font-size: 14px !important;
        line-height: 20px !important;
        border-bottom: 1px solid #e2e8f0 !important;
        white-space: normal !important;
        text-align: left !important;
        color: #333333 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        border-radius: 6px !important;
    }

    .nav-dropdown-menu a:last-child {
        border-bottom: none !important;
    }

    .nav-dropdown-menu a:hover {
        padding-left: 14px !important;
        background: rgba(164, 39, 30, 0.08) !important;
        color: #A4271E !important;
    }

    .header-whatsapp {
        display: none;
    }

    .header-whatsapp-mobile {
        display: flex;
        width: 100%;
        justify-content: flex-start;
        margin-top: 16px;
    }

    .header-whatsapp-mobile .btn-wa {
        width: 100%;
        justify-content: center;
    }

    .header-toggle {
        display: flex;
    }
}

/* Hover-based dropdown only on desktop */
@media (min-width: 1024px) {
    .nav-dropdown:hover .dropdown-arrow {
        transform: rotate(180deg);
    }
    .nav-dropdown:hover .nav-dropdown-toggle {
        color: #A4271E;
        background: rgba(164, 39, 30, 0.06);
    }
    .nav-dropdown:hover .nav-dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@media (max-width: 575px) {
    .header-inner {
        padding: 12px var(--gutter-mobile);
    }
}
