/* =========================================
   Global Header Styles
   ========================================= */

/* Top Bar */
.header-top {
    background-color: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
    padding: 10px 0;
    font-size: 14px;
}

.header-links ul,
.social-links {
    margin: 0;
    padding: 0;
}

.header-links li {
    display: inline-flex;
    align-items: center;
    color: #555;
    font-weight: 500;
}

.header-links li i {
    color: var(--theme-color, #E8092E);
    margin-right: 8px;
}

.header-links a {
    color: #555;
    text-decoration: none;
    transition: color 0.3s;
}

.header-links a:hover {
    color: var(--theme-color, #E8092E);
}

.social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    background: #fff;
    color: #555;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    text-decoration: none;
}

.social-links a:hover {
    background: var(--theme-color, #E8092E);
    color: #fff;
    transform: translateY(-2px);
}

/* Main Header */
.site-header {
    position: relative;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.sticky-wrapper {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: #fff;
    transition: all 0.3s ease;
}

.sticky-wrapper.is-sticky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    animation: slideDown 0.35s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

.header-logo img {
    max-height: 50px;
    width: auto;
    display: block;
}

/* Navigation */
.main-menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-menu>ul>li {
    display: inline-block;
    position: relative;
    padding: 30px 15px;
}

.main-menu>ul>li>a {
    font-size: 16px;
    font-weight: 600;
    color: #171717;
    text-decoration: none;
    position: relative;
    transition: color 0.3s;
}

.main-menu>ul>li:hover>a,
.main-menu>ul>li.active>a {
    color: var(--theme-color, #E8092E);
}

.main-menu>ul>li>a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--theme-color, #E8092E);
    transition: width 0.3s;
}

.main-menu>ul>li:hover>a::after {
    width: 100%;
}

/* Dropdown / Mega Menu */
.menu-item-has-children .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 99;
    border-top: 3px solid var(--theme-color, #E8092E);
    min-width: 220px;
    padding: 20px 0;
    text-align: left;
}

.menu-item-has-children .mega-menu-wrapper {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99;
    border-top: 3px solid var(--theme-color, #E8092E);
    width: 800px;
    /* Fixed wide width for mega menu */
    padding: 30px;
    text-align: left;
}

.menu-item-has-children:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-item-has-children:hover .mega-menu-wrapper {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.main-menu .sub-menu li {
    display: block;
    margin: 0;
    padding: 0;
}

.main-menu .sub-menu li a {
    display: block;
    padding: 8px 25px;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.main-menu .sub-menu li a:hover {
    color: var(--theme-color, #E8092E);
    background: #f9f9f9;
    padding-left: 30px;
}

/* Mega Menu Specifics */
.main-menu .mega-menu {
    position: relative;
    /* Changed from static to relative for consistent centering with left:50% */
}

.mega-menu-wrapper h4 {
    font-size: 18px;
    font-weight: 700;
    color: #171717;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.mega-menu-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.mega-menu-list li {
    margin-bottom: 12px;
}

.mega-menu-list a {
    color: #555;
    font-size: 15px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    white-space: nowrap;
    /* Prevent text wrapping inside menu items */
}

.mega-menu-list a:hover {
    color: var(--theme-color, #E8092E);
    transform: translateX(5px);
}

.mega-menu-list a i {
    font-size: 8px;
    margin-right: 10px;
    color: var(--theme-color, #E8092E);
}

/* CTA Button */
.header-cta .btn {
    padding: 12px 25px;
    font-weight: 600;
    border-radius: 50px;
}

/* Mobile Toggle */
.menu-toggle {
    border: none;
    background: none;
    font-size: 24px;
    color: #171717;
    cursor: pointer;
    padding: 5px;
}

/* Mobile Menu (Offcanvas style logic needed in HTML/JS or strict CSS override) */
@media (max-width: 991px) {
    .header-top {
        display: none;
    }

    .sticky-wrapper {
        padding: 15px 0;
    }

    .mobile-menu-wrapper {
        position: fixed;
        top: 0;
        left: -300px;
        /* Off-screen */
        width: 300px;
        height: 100vh;
        background: #fff;
        z-index: 1050;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
        transition: left 0.3s ease;
        padding: 20px;
        overflow-y: auto;
    }

    .mobile-menu-wrapper.active {
        left: 0;
    }

    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }

    .mobile-menu-overlay.active {
        display: block;
    }

    .mobile-logo {
        margin-bottom: 30px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .mobile-menu ul {
        display: block;
    }

    .mobile-menu li {
        display: block;
        padding: 0;
        border-bottom: 1px solid #eee;
    }

    .mobile-menu li a {
        display: block;
        padding: 12px 0;
        font-size: 16px;
    }

    .mobile-menu .sub-menu,
    .mobile-menu .mega-menu-wrapper {
        position: static;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        /* Hidden by default, toggled via JS */
        padding: 0 0 0 20px;
        border-top: none;
        min-width: unset;
    }

    .mobile-menu .sub-menu.open,
    .mobile-menu .mega-menu-wrapper.open {
        display: block;
    }

    .menu-expand {
        position: absolute;
        right: 0;
        top: 10px;
        width: 30px;
        height: 30px;
        text-align: center;
        line-height: 30px;
        cursor: pointer;
    }
}