/**
 * Header - Complete Styles (No Hero Section)
 */

/* Header Widget */
.header-widget {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #770D29;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    height: auto;
    min-height: auto;
    max-height: none;
    width: 100%;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.header-widget.scrolled {
    background-color: #770D29;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Header Clearfix - Reserves space for fixed header */
.header-clearfix {
    width: 100%;
    height: 0;
    clear: both;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 !important;
    padding: 0 !important;
    display: block;
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    line-height: 0;
    font-size: 0;
    vertical-align: top;
}

/* Ensure header widget container doesn't add spacing */
.elementor-widget-header .elementor-widget-container {
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure clearfix is positioned at the top with no spacing */
.elementor-widget-header .header-clearfix {
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    top: 0 !important;
    left: 0;
    right: 0;
    line-height: 0;
    font-size: 0;
    vertical-align: top;
}

/* Ensure no spacing between header and clearfix or any elements before it */
.elementor-widget-header header + .header-clearfix,
.elementor-widget-header .header-clearfix {
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Remove any whitespace/spacing from container */
.elementor-widget-header .elementor-widget-container > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Ensure mobile sidebar elements don't take space (they're fixed) */
.elementor-widget-header .sidebar-overlay,
.elementor-widget-header .mobile-sidebar {
    position: fixed;
    margin: 0;
    padding: 0;
}

/* Remove spacing from Elementor container wrapping header widget */
.elementor-element.e-con-boxed.e-con.e-parent .elementor-widget-header,
.elementor-element.e-flex.e-con-boxed.e-con.e-parent .elementor-widget-header,
.elementor-element[data-id="9d6c0fe"] {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Remove spacing from Elementor container inner wrapper */
.elementor-element.e-con-boxed.e-con.e-parent .e-con-inner,
.elementor-element.e-flex.e-con-boxed.e-con.e-parent .e-con-inner,
.elementor-element[data-id="9d6c0fe"] .e-con-inner {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Remove spacing from all Elementor containers with these classes when they contain header */
.e-con-boxed.e-con.e-parent:has(.elementor-widget-header),
.e-flex.e-con-boxed.e-con.e-parent:has(.elementor-widget-header) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Top Bar */
.top-bar {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 10;
    height: auto;
    min-height: auto;
}

.desktop-buttons {
    position: relative;
    z-index: 10;
}

.desktop-buttons > div {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
}

/* Nav Menu */
.nav-menu {
    background-color: #59595C;
    backdrop-filter: blur(10px);
    opacity: 1;
    position: relative;
    height: auto;
    min-height: auto;
}

/* Quick Links Modal */
.quicklinks-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.quicklinks-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.quicklinks-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.quicklinks-content {
    position: relative;
    background: white;
    border-radius: 24px;
    padding: 40px;
    max-width: 1000px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.quicklinks-modal.active .quicklinks-content {
    transform: scale(1) translateY(0);
}

.quicklinks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.quicklinks-title {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
}

.quicklinks-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.quicklinks-close:hover {
    background: #e5e7eb;
    transform: rotate(90deg);
}

.quicklinks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.quicklink-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #FFF3F5;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.quicklink-item:hover {
    background: #FFD2DB;
    border-color: #CF1F45;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(207, 31, 69, 0.2);
}

.quicklink-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quicklink-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.quicklink-text {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hamburger Menu Button */
.hamburger-btn {
    display: none;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: #77102A;
    z-index: 99999;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
}

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

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 99998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.sidebar-content {
    padding: 24px;
}

.sidebar-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sidebar-btn-white {
    background: white;
    color: #1a1a1a;
}

.sidebar-btn-primary {
    background: #CF1F45;
    color: white;
}

.sidebar-btn:hover {
    transform: translateX(5px);
    opacity: 0.9;
}

.sidebar-nav {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
}

.sidebar-nav-title {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.sidebar-nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

/* Desktop Nav Items */
.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.5rem 1rem;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-arrow {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

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

/* Dropdown Submenu */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 280px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    padding: 8px 0;
}

/* Second-level submenu should have higher z-index */
.submenu .submenu {
    z-index: 101;
}

.nav-item:hover > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu-item {
    position: relative;
}

.submenu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.submenu-link:hover {
    background: #FFF3F5;
    color: #CF1F45;
}

.submenu-arrow {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.submenu-item:hover > .submenu-link .submenu-arrow {
    transform: rotate(90deg);
}

.submenu .submenu {
    top: 0;
    left: 100%;
    margin-left: 8px;
}

/* Show second-level submenu on hover */
.submenu-item:hover > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* RTL support for second-level submenu */
[dir="rtl"] .submenu .submenu {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 8px;
}

.sidebar-submenu {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin: 4px 0 4px 16px;
    padding: 4px 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-submenu.active {
    max-height: 1000px;
}

.sidebar-submenu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sidebar-submenu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    padding-left: 20px;
}

.sidebar-nav-item.has-submenu .nav-arrow {
    transition: transform 0.3s ease;
}

.sidebar-nav-item.has-submenu.active .nav-arrow {
    transform: rotate(90deg);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu ul {
        flex-wrap: wrap;
        gap: 8px !important;
    }

    .quicklinks-content {
        padding: 24px;
        width: 95%;
    }

    .quicklinks-title {
        font-size: 22px;
    }

    .quicklinks-grid {
        grid-template-columns: 1fr;
    }

    .nav-menu {
        display: none !important;
    }

    .desktop-buttons {
        display: none !important;
    }

    .hamburger-btn {
        display: flex;
    }
}


/* GC: sticky nav on scroll (desktop) + logo at start */
.nav-inner { position: relative; }
.nav-sticky-logo { display: none; align-items: center; }
.nav-sticky-logo img { height: 26px; width: auto; display: block; }

/* Sticky (scrolled): logo on one side, menu on the other so they don't collide; smaller nav items for more room */
#mainHeader.header-widget.scrolled .nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
#mainHeader.header-widget.scrolled .nav-sticky-logo { display: flex; flex: 0 0 auto; }
#mainHeader.header-widget.scrolled .nav-sticky-logo img { height: 30px; }
#mainHeader.header-widget.scrolled .nav-menu ul { justify-content: flex-end; gap: 0.35rem; flex-wrap: nowrap; margin: 0; }
#mainHeader.header-widget.scrolled .nav-menu .nav-link { padding-left: 7px; padding-right: 7px; }
#mainHeader.header-widget.scrolled .nav-menu .nav-link span { font-size: 18px; }



/* Edge-aware flip: open nested submenu toward the viewport interior so it never goes off-screen (toggled by JS in header-script.js) */
.submenu .submenu.submenu-flip {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 8px;
}
[dir="rtl"] .submenu .submenu.submenu-flip {
    right: auto;
    left: 100%;
    margin-right: 0;
    margin-left: 8px;
}

/* GC: flag-only language switcher at the end of the sticky navbar */
.nav-menu .nav-lang-item { display: none; align-items: center; margin: 0; padding: 0; list-style: none; }
.nav-menu .nav-lang-item .lang-switch-btn { display: inline-flex; align-items: center; justify-content: center; border: none; outline: none; background: transparent; box-shadow: none; font-family: inherit; line-height: 0; padding: 4px; border-radius: 50%; gap: 0; white-space: nowrap; cursor: pointer; }
.nav-menu .nav-lang-item .lang-switch-btn:hover { background: transparent; transform: translateY(-1px); }
.nav-menu .nav-lang-item .lang-text { display: none; }
.nav-menu .nav-lang-item .lang-flag { display: inline-flex; align-items: center; line-height: 0; }
.nav-menu .nav-lang-item .lang-flag svg { display: block; width: 24px; height: 24px; }
#mainHeader.header-widget.scrolled .nav-menu .nav-lang-item { display: flex; margin-left: 8px; }
[dir="rtl"] #mainHeader.header-widget.scrolled .nav-menu .nav-lang-item { margin-left: 0; margin-right: 8px; }

/* GC: base nav-menu font size (matches sticky size) */
.nav-menu .nav-link span { font-size: 18px; }

/* ===== GC: Navbar search (Request 29) ===== */
.nav-menu .nav-search-item { display: flex; align-items: center; margin: 0; padding: 0; list-style: none; }
.nav-menu .search-toggle-btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: #fff; background: transparent; border: none; padding: 4px 6px; line-height: 1; white-space: nowrap; transition: opacity .3s ease; }
.nav-menu .search-toggle-btn:hover { opacity: .8; }
.nav-menu .search-icon { display: inline-flex; align-items: center; line-height: 0; }
.nav-menu .search-icon svg { display: block; width: 20px; height: 20px; }
.nav-menu .search-label { font-size: 18px; }

/* ===== GC: Search overlay ===== */
.search-overlay { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: flex-start; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.search-overlay.active { opacity: 1; pointer-events: auto; }
.search-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(10px); }
.search-content { position: relative; z-index: 1; width: 90%; max-width: 720px; margin-top: 18vh; background: #fff; border-radius: 24px; padding: 40px; box-shadow: 0 20px 60px rgba(0,0,0,.3); transform: scale(.9) translateY(20px); transition: transform .3s ease; }
.search-overlay.active .search-content { transform: scale(1) translateY(0); }
.search-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border: none; border-radius: 50%; background: #f3f4f6; color: #1a1a1a; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .3s ease; }
[dir="rtl"] .search-close { right: auto; left: 16px; }
.search-close:hover { background: #e5e7eb; transform: rotate(90deg); }
.search-overlay-title { font-size: 26px; font-weight: 700; color: #1a1a1a; margin: 0 0 20px; }
.search-form { display: flex; align-items: center; gap: 10px; border: 2px solid #e5e7eb; border-radius: 14px; padding: 6px 6px 6px 16px; transition: border-color .3s ease; }
[dir="rtl"] .search-form { padding: 6px 16px 6px 6px; }
.search-form:focus-within { border-color: #770D29; }
.search-field { flex: 1; border: none; outline: none; background: transparent; font-size: 16px; color: #1a1a1a; padding: 10px 0; min-width: 0; }
.search-field::-webkit-search-cancel-button { display: none; }
.search-submit { display: inline-flex; align-items: center; gap: 8px; background: #770D29; color: #fff; border: none; border-radius: 10px; padding: 12px 22px; font-size: 15px; font-weight: 700; cursor: pointer; transition: background .3s ease; }
.search-submit:hover { background: #CF1F45; }
.search-content a { color: inherit; }
@media (max-width: 768px) { .search-content { padding: 24px; margin-top: 12vh; } .search-overlay-title { font-size: 20px; } }
/* Non-sticky: menu items left, search pushed right */
#mainHeader:not(.scrolled) .nav-menu ul { justify-content: flex-start; }
#mainHeader:not(.scrolled) .nav-menu ul .nav-search-item { margin-left: auto; }
[dir="rtl"] #mainHeader:not(.scrolled) .nav-menu ul .nav-search-item { margin-left: 0; margin-right: auto; }

/* Sticky: icon only */
#mainHeader.header-widget.scrolled .nav-menu ul .nav-search-item { margin-left: 0; margin-right: 0; }
#mainHeader.header-widget.scrolled .nav-menu .search-label { display: none; }
#mainHeader.header-widget.scrolled .nav-menu .search-toggle-btn { gap: 0; }
