/* ========================================
   HEADER STYLES
   ======================================== */
.main-header {
    position: fixed;
    top: 20px;
    left: 5%;
    right: 5%;
    width: auto;
    z-index: 1000;
    transition: all 0.3s ease;
    background-color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 16px;
}

/* Header at top - always white floating */
.main-header.at-top {
    background-color: white;
}

.main-header.at-top .logo-colored {
    display: block;
}

.main-header.at-top .logo-white {
    display: none;
}

.main-header.at-top .header-nav a:not(.contact-btn-pill) {
    color: #333;
}

.main-header.at-top .contact-btn-pill {
    background-color: #112921;
    color: white;
}

.main-header.at-top .hotline-btn {
    background-color: #f0f0f0;
    color: #333;
    border-color: #f0f0f0;
}

.main-header.at-top .hotline-btn:hover {
    background-color: #ffc107;
    border-color: #ffc107;
}

.main-header.at-top .language-dropdown select {
    color: #333;
    border-color: #333;
}

.main-header.at-top .header-separator {
    opacity: 0;
}

/* Header scrolled (white background with colored logo) */
.main-header.scrolled {
    background-color: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.main-header.scrolled .logo-colored {
    display: block;
}

.main-header.scrolled .logo-white {
    display: none;
}

.main-header.scrolled .header-nav a:not(.contact-btn-pill) {
    color: #333;
}

.main-header.scrolled .contact-btn-pill {
    background-color: #112921;
    color: white;
}

.main-header.scrolled .hotline-btn {
    background-color: #f0f0f0;
    color: #333;
    border-color: #f0f0f0;
}

.main-header.scrolled .hotline-btn:hover {
    background-color: #ffc107;
    border-color: #ffc107;
}

.main-header.scrolled .language-dropdown select {
    color: #333;
    border-color: #333;
}

.main-header.scrolled .header-separator {
    opacity: 0;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 32px;
    max-width: 100%;
}

.header-logo {
    flex: 0 0 auto;
}

.header-logo a {
    display: block;
    position: relative;
}

.header-logo img {
    height: 36px;
    width: auto;
    transition: all 0.3s ease;
}

.logo-white {
    display: none;
}

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

.header-nav a {
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    color: #333;
}

.header-nav a:not(.contact-btn-pill)::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #ffc107;
    transition: width 0.3s ease;
}

.header-nav a:not(.contact-btn-pill):hover::after {
    width: 100%;
}

.contact-btn-pill {
    background-color: #112921;
    color: white;
    padding: 10px 24px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    z-index: 999;
}

.contact-btn-pill:hover {
    background-color: #ffc107;
    color: #112921;
}

/* Mega Menu Navigation */
.nav-item-dropdown {
    position: relative;
}

/* Invisible bridge to prevent hover gap */
.nav-item-dropdown::after {
    content: '';
    position: fixed;
    top: 55px;
    left: 0;
    right: 0;
    height: 25px;
    pointer-events: none;
    z-index: 997;
}

.nav-item-dropdown:hover::after {
    pointer-events: all;
}

.nav-link-dropdown {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
}

.nav-link-dropdown svg {
    transition: transform 0.3s ease;
}

.nav-item-dropdown:hover .nav-link-dropdown {
    color: #ffc107;
}

.nav-item-dropdown:hover .nav-link-dropdown svg {
    transform: rotate(180deg);
}

.nav-link-simple {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
    padding: 8px 0;
}

.nav-link-simple:hover {
    color: #ffc107;
}

.mega-menu {
    position: fixed;
    top: 72px;
    left: 5%;
    right: 5%;
    width: 90%;
    background: white;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 998;
    max-height: 0;
    overflow: hidden;
}

.nav-item-dropdown:hover .mega-menu,
.mega-menu:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    max-height: 500px;
}

/* Remove bottom border radius from header when mega menu is open */
.main-header:has(.nav-item-dropdown:hover),
.main-header:has(.mega-menu:hover) {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.mega-menu-content {
    display: flex;
    gap: 60px;
    padding: 50px;
}

.mega-menu-intro {
    flex: 0 0 280px;
}

.mega-menu-intro h3 {
    font-size: 1.8rem;
    color: #112921;
    margin-bottom: 15px;
    font-weight: 700;
}

.mega-menu-intro p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 25px;
}

.mega-menu-btn {
    display: inline-block;
    background-color: #112921 !important;
    color: white !important;
    padding: 12px 28px;
    border-radius: 25px;
    text-decoration: none !important;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.mega-menu-btn::after {
    display: none !important;
}

.mega-menu-btn:hover {
    background-color: #ffc107 !important;
    color: #112921 !important;
}

.mega-menu-links {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.mega-menu-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mega-menu-column a {
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 4px 0;
}

.mega-menu-column a:hover {
    color: #ffc107;
    padding-left: 8px;
}

/* Media Mega Menu - Disabled Links & Featured Post */
.mega-menu-disabled {
    display: block;
    padding: 4px 0;
    color: #9ca3af;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: default;
}

.coming-soon-tag {
    font-size: 0.6rem;
    background: #e5e7eb;
    color: #6b7280;
    padding: 2px 6px;
    border-radius: 8px;
    text-transform: uppercase;
    font-weight: 600;
    margin-left: 6px;
}

/* Featured Post Column */
.mega-menu-featured-post {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    border-radius: 12px;
    min-width: 220px;
    height: 160px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    padding: 14px !important;
    text-decoration: none !important;
}

.mega-menu-featured-post::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.1) 100%);
    border-radius: 12px;
}

.mega-menu-featured-post:hover::before {
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.2) 100%);
}

.mega-menu-featured-post .featured-post-label {
    position: relative;
    z-index: 1;
    display: inline-block;
    width: fit-content;
    font-size: 0.55rem;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: #ffc107;
    color: #112921;
}

.mega-menu-featured-post .featured-post-content {
    position: relative;
    z-index: 1;
}

.mega-menu-featured-post .featured-post-title {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: white !important;
    line-height: 1.35;
    margin-bottom: 6px;
}

.mega-menu-featured-post:hover .featured-post-title {
    color: #ffc107 !important;
}

.mega-menu-featured-post .featured-post-meta {
    display: block;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.8);
}

.header-utilities {
    display: flex;
    align-items: center;
    gap: 20px;
}

.language-dropdown select {
    padding: 8px 16px;
    border: 1px solid;
    border-radius: 4px;
    background-color: transparent;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-dropdown select:focus {
    outline: none;
    border-color: #ffc107;
}

.hotline-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    background-color: white;
    color: #333;
}

.hotline-btn:hover {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #333;
}

.hotline-btn svg {
    width: 16px;
    height: 16px;
}

.header-separator {
    width: 90%;
    margin: 0 5%;
    height: 1px;
    background-color: white;
    transition: opacity 0.3s ease;
}

/* Hamburger Menu Button */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-menu span {
    width: 100%;
    height: 3px;
    background-color: #333;
    transition: all 0.3s ease;
    transform-origin: center;
}

.main-header.scrolled .hamburger-menu span {
    background-color: #333;
}

.main-header.at-top .hamburger-menu span {
    background-color: #333;
}

.hamburger-menu.active span {
    background-color: #333;
}

.hamburger-menu.active span:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background-color: white;
    z-index: 999;
    transition: right 0.4s ease;
    overflow-y: auto;
}

.mobile-menu.active,
.mobile-menu.open {
    right: 0;
}

.mobile-menu-logo {
    padding: 30px 5% 20px;
    text-align: left;
}

.mobile-menu-logo img {
    height: 50px;
    width: auto;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    padding: 20px 5% 40px;
    gap: 0;
}

.mobile-nav-item {
    text-decoration: none;
    font-size: 2.5rem;
    font-weight: 600;
    color: #333;
    padding: 20px 0;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-nav-item:first-child {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Animate nav items when menu is open */
.mobile-menu.active .mobile-nav-item,
.mobile-menu.open .mobile-nav-item {
    opacity: 1;
    transform: translateX(0);
}

.mobile-menu.active .mobile-nav-item:nth-child(1),
.mobile-menu.open .mobile-nav-item:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.active .mobile-nav-item:nth-child(2),
.mobile-menu.open .mobile-nav-item:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.active .mobile-nav-item:nth-child(3),
.mobile-menu.open .mobile-nav-item:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.active .mobile-nav-item:nth-child(4),
.mobile-menu.open .mobile-nav-item:nth-child(4) { transition-delay: 0.25s; }
.mobile-menu.active .mobile-nav-item:nth-child(5),
.mobile-menu.open .mobile-nav-item:nth-child(5) { transition-delay: 0.3s; }
.mobile-menu.active .mobile-nav-item:nth-child(6),
.mobile-menu.open .mobile-nav-item:nth-child(6) { transition-delay: 0.35s; }
.mobile-menu.active .mobile-nav-item:nth-child(7),
.mobile-menu.open .mobile-nav-item:nth-child(7) { transition-delay: 0.4s; }

/* Mobile header styles */
@media (max-width: 1024px) {
    .main-header {
        top: 15px;
        left: 5%;
        right: 5%;
        border-radius: 12px;
    }

    .header-nav {
        display: none;
    }

    .header-utilities {
        display: none;
    }

    .hamburger-menu {
        display: flex;
    }

    .header-container {
        padding: 15px 30px;
    }

    .header-logo img {
        height: 50px;
    }
}

@media (max-width: 768px) {
    .main-header {
        left: 3%;
        right: 3%;
        top: 10px;
        max-width: calc(100vw - 6%);
    }

    .header-container {
        padding: 12px 20px;
    }

    .header-logo img {
        height: 45px;
    }
}
