.ag-header {
    --ag-header-bg: transparent;
    --ag-header-text-color: #ffffff;
    --ag-header-icon-bg: rgba(144, 145, 156, 0.10);
    --ag-header-font: 'Al-Jazeera-Arabic', sans-serif;

    width: 100%;
    height: 120px;
    background-color: var(--ag-header-bg);
    display: flex;
    align-items: center;
    padding: 0 32px;
    position: relative;
    z-index: 1000;
}

.ag-header__container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    max-width: 100%;
}

.ag-header__side-left,
.ag-header__side-right {
    display: flex;
    align-items: center;
}

.ag-header__side-left {
    justify-content: flex-end;
}

.ag-header__side-right {
    justify-content: flex-start;
}

.ag-header__container[dir="ltr"] .ag-header__side-left {
    justify-content: flex-start;
}

.ag-header__container[dir="ltr"] .ag-header__side-right {
    justify-content: flex-end;
}

.ag-header__actions {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 10px;
    z-index: 5;
}

.ag-header__container[dir="ltr"] .ag-header__actions {
    left: auto;
    right: 0;
}

.ag-header__action-btn {
    width: 56px;
    height: 56px;
    border-radius: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--ag-header-text-color);
    background-color: transparent;
    transition: background-color 0.3s ease;
    text-decoration: none;
}

.ag-header__action-btn:hover {
    background-color: var(--ag-header-icon-bg);
}

/* Language switcher - visible on all sizes */
.ag-header__language-switcher {
    margin-right: 15px;
}

.ag-header__container[dir="ltr"] .ag-header__language-switcher {
    margin-right: 0;
    margin-left: 15px;
}

/* Position language switcher at the edge */
.ag-header__container:not([dir="ltr"]) .ag-header__language-switcher--desktop {
    position: absolute;
    left: 70px;
    top: 50%;
    transform: translateY(-50%);
}

.ag-header__container[dir="ltr"] .ag-header__language-switcher--desktop {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
}

.ag-header__lang-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: var(--ag-header-text-color);
    font-family: var(--ag-header-font);
    font-size: 14px;
    font-weight: 400;
    padding: 8px 12px;
    border-radius: 20px;
    background-color: var(--ag-header-icon-bg);
    transition: background-color 0.3s ease;
}

.ag-header__lang-btn:hover {
    background-color: rgba(144, 145, 156, 0.3);
}

.ag-header__lang-btn i,
.ag-header__lang-btn svg {
    font-size: 16px;
    fill: currentColor;
}

.ag-header__lang-code {
    font-weight: 700;
}

.ag-header__action-btn i,
.ag-header__action-btn svg {
    font-size: 24px;
    fill: currentColor;
}

.ag-header__logo {
    flex: 0 0 auto;
    text-align: center;
    z-index: 2;
    padding: 0 10px;
}

.ag-header__logo img {
    height: 69px;
    width: auto;
    display: block;
}

.ag-header__nav {
    display: flex;
    gap: 25px;
    align-items: center;
}

.ag-header__nav-item {
    display: flex;
    flex-direction: column;
    /* Stack number on top */
    align-items: center;
    /* Center align items */
    gap: 0px;
    /* Gap controlled by margin */
    text-decoration: none;
    color: var(--ag-header-text-color);
    position: relative;
    cursor: pointer;
}

/* Dropdown Menu Styles */
.ag-header__nav-item--dropdown {
    position: relative;
}

.ag-header__nav-item--dropdown .ag-header__nav-label {
    position: relative;
    padding-left: 15px;
}

.ag-header__nav-item--dropdown .ag-header__nav-label::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.8;
}

.ag-header__container[dir="ltr"] .ag-header__nav-item--dropdown .ag-header__nav-label {
    padding-left: 0;
    padding-right: 15px;
}

.ag-header__container[dir="ltr"] .ag-header__nav-item--dropdown .ag-header__nav-label::after {
    left: auto;
    right: 0;
}

.ag-header__nav-item--dropdown:hover .ag-header__nav-label::after {
    transform: translateY(-50%) rotate(180deg);
}

.ag-header__dropdown {
    position: absolute;
    top: 100%;
    right: 50%;
    transform: translateX(50%);
    background: #121932;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 0;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.ag-header__container[dir="ltr"] .ag-header__dropdown {
    right: 50%;
    transform: translateX(50%);
}

.ag-header__nav-item--dropdown:hover .ag-header__dropdown,
.ag-header__dropdown:hover {
    opacity: 1;
    visibility: visible;
}

.ag-header__dropdown-item {
    display: block;
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    font-family: var(--ag-header-font);
    font-size: 16px;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.ag-header__dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.ag-header__nav-label {
    font-family: var(--ag-header-font);
    font-size: 20px;
    font-weight: 400;
}

.ag-header__nav-number {
    font-family: 'Texturina', serif;
    font-size: 13px;
    opacity: 0.8;
    line-height: 1;
    display: block;
}

.ag-header__toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: var(--ag-header-icon-bg);
    border-radius: 30px;
    display: none;
    /* Hide on desktop */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 1001;
}

.ag-header__container[dir="ltr"] .ag-header__toggle {
    right: auto;
    left: 0;
}

.ag-header__toggle:hover {
    transform: scale(1.05);
}

.ag-header__toggle span {
    display: block;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.75);
    border-radius: 2px;
}

.ag-header__toggle-bar--long {
    width: 22px;
}

.ag-header__toggle-bar--short {
    width: 17px;
}

/* Mobile Menu Drawer */
.ag-mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    /* Hidden by default */
    width: 300px;
    height: 100vh;
    background: #121932;
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    padding: 80px 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    direction: rtl;
    /* Force RTL for the drawer content */
}

[dir="ltr"] .ag-mobile-menu {
    right: auto;
    left: -100%;
    transition: left 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    direction: ltr;
}

.ag-mobile-menu.active {
    right: 0;
}

[dir="ltr"] .ag-mobile-menu.active {
    right: auto;
    left: 0;
}

.ag-mobile-menu__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
}

.ag-mobile-menu__overlay.active {
    opacity: 1;
    visibility: visible;
}

.ag-mobile-menu__close {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 30px;
    color: white;
    cursor: pointer;
}

[dir="ltr"] .ag-mobile-menu__close {
    left: auto;
    right: 20px;
}

.ag-mobile-menu__nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.ag-mobile-menu__item {
    display: flex;
    justify-content: flex-start;
    /* Right in RTL */
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    width: 100%;
    text-align: right;
}

[dir="ltr"] .ag-mobile-menu__item {
    text-align: left;
}

.ag-mobile-menu__label {
    font-family: var(--ag-header-font);
    font-size: 24px;
}

.ag-mobile-menu__number {
    font-family: 'Texturina', serif;
    font-size: 14px;
    color: #ffffff;
}

/* Mobile Dropdown */
.ag-mobile-menu__item--has-dropdown {
    flex-direction: column;
    align-items: flex-start;
}

.ag-mobile-menu__item-header {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.ag-mobile-menu__dropdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
    padding-right: 20px;
    border-right: 2px solid rgba(255, 255, 255, 0.2);
}

[dir="ltr"] .ag-mobile-menu__dropdown {
    padding-right: 0;
    padding-left: 20px;
    border-right: none;
    border-left: 2px solid rgba(255, 255, 255, 0.2);
}

.ag-mobile-menu__dropdown-item {
    font-family: var(--ag-header-font);
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.ag-mobile-menu__dropdown-item:hover {
    color: #FAB93A;
}

/* Responsiveness */
@media (max-width: 1200px) {
    .ag-header__nav {
        display: none;
    }

    .ag-header__toggle {
        display: flex;
        /* Show toggle when nav is hidden */
    }

    /* Show language switcher on tablet/mobile next to hamburger */
    .ag-header__language-switcher--desktop {
        display: flex;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        margin: 0;
    }
    
    .ag-header__container:not([dir="ltr"]) .ag-header__language-switcher--desktop {
        right: 70px;
    }
    
    .ag-header__container[dir="ltr"] .ag-header__language-switcher--desktop {
        left: 70px;
    }
}

@media (max-width: 768px) {
    .ag-header {
        height: 80px;
        padding: 0 15px;
    }

    .ag-header__container {
        justify-content: space-between;
    }

    .ag-header__container[dir="ltr"] {
        justify-content: flex-start;
    }

    .ag-header__container:not([dir="ltr"]) .ag-header__logo {
        order: 1;
        /* Keep at start (left in RTL) */
        padding: 0;
        margin-right: auto;
        margin-left: 0;
    }

    .ag-header__container[dir="ltr"] .ag-header__logo {
        order: 2;
        margin-left: auto;
        margin-right: 0;
    }

    .ag-header__logo img {
        height: 40px;
    }

    .ag-header__actions {
        display: none;
    }

    .ag-header__container:not([dir="ltr"]) .ag-header__toggle {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        order: 2;
        /* Keep at end (right in RTL) */
        margin: 0;
    }

    .ag-header__container[dir="ltr"] .ag-header__toggle {
        position: absolute;
        right: auto;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        order: 1;
        /* Keep at start (left in LTR) */
    }
}