.top-nav-wrapper *,
.top-nav-wrapper *::before,
.top-nav-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.top-nav-wrapper {
    position: relative;
    width: 100%;
    z-index: 1100;
    font-family: 'Gotham', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-style: normal;
}

.top-nav-wrapper.has-open-dropdown,
.top-nav-wrapper:has(.lang-switch.open) {
    z-index: 99999;
}

/* ═══════════════════════════════════════
   SECONDARY NAV
═══════════════════════════════════════ */
.top-nav-wrapper .sec-nav {
    background: #212121;
    padding: 0 clamp(16px, 3.5vw, 60px);
    overflow: visible;
    position: relative;
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Flex container for left, center and right elements */
.top-nav-wrapper .sec-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px;
    position: relative;
}

/* ── LEFT: audience tabs ── */
.top-nav-wrapper .sec-left {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
    min-width: 0;
    padding: 2px 0;
}

.top-nav-wrapper .sec-link,
.top-nav-wrapper .lang-btn {
    position: relative;
    color: rgba(255, 255, 255, 0.72);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 6px 11px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-style: normal;
    flex-shrink: 0;
    border-radius: 6px;
    background: transparent;
    border: none;
    line-height: 1.2;
}

.top-nav-wrapper .sec-link:hover,
.top-nav-wrapper .lang-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

/* Active audience tab: Frosted Capsule + 2px Bottom Accent */
.top-nav-wrapper .sec-link.active,
.top-nav-wrapper .lang-btn.active {
    font-weight: 700;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    position: relative;
}

.top-nav-wrapper .sec-link.active::after {
    content: '';
    position: absolute;
    bottom: 1px;
    left: 8px;
    right: 8px;
    height: 2px;
    background: #e1251b;
    border-radius: 2px;
    width: auto;
    border: none;
    transform: none;
}

.top-nav-wrapper .sec-item-icon {
    width: 13px;
    height: 13px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    margin-right: 6px;
    opacity: 0.9;
    flex-shrink: 0;
}

/* ── CENTRE: optional pill or items ── */
.top-nav-wrapper .sec-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.top-nav-wrapper .pill {
    background: #c22320;
    border-radius: 999px;
    padding: 4px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.top-nav-wrapper .pill a {
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* ── RIGHT: support links + lang ── */
.top-nav-wrapper .sec-right {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    margin-left: auto;
    flex-shrink: 0;
    position: relative;
}

[dir="rtl"] .top-nav-wrapper .sec-right {
    margin-left: 0;
    margin-right: auto;
}

.top-nav-wrapper .sec-link-icon {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ═══════════════════════════════════════
   LANGUAGE SWITCHER / DROPDOWNS
═══════════════════════════════════════ */
.top-nav-wrapper .lang-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.top-nav-wrapper .lang-btn-switch {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-weight: 600;
    padding: 4px 10px;
    gap: 5px;
}

.top-nav-wrapper .lang-btn-switch:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.28);
}

.top-nav-wrapper .lang-chevron {
    width: 8px;
    height: 8px;
    transition: transform 0.25s ease;
    flex-shrink: 0;
    opacity: 0.8;
}

.top-nav-wrapper .lang-switch.open {
    z-index: 100000;
}

.top-nav-wrapper .lang-switch.open .lang-chevron {
    transform: rotate(180deg);
}

.top-nav-wrapper .lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.08);
    list-style: none;
    min-width: 140px;
    max-width: calc(100vw - 20px);
    padding: 4px;
    z-index: 100001;
    overflow: hidden;
}

.top-nav-wrapper .sec-left .lang-menu {
    left: 0;
    right: auto;
}

.top-nav-wrapper .sec-right .lang-menu {
    right: 0;
    left: auto;
}

.top-nav-wrapper .sec-center .lang-menu {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

[dir="rtl"] .top-nav-wrapper .sec-left .lang-menu {
    right: 0;
    left: auto;
}

[dir="rtl"] .top-nav-wrapper .sec-right .lang-menu {
    left: 0;
    right: auto;
}

.top-nav-wrapper .lang-switch.open .lang-menu {
    display: block;
    visibility: visible;
    opacity: 1;
}

.top-nav-wrapper .lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    font-size: 11.5px;
    font-weight: 600;
    color: #212121;
    text-decoration: none;
    text-align: left;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
    box-sizing: border-box;
    white-space: nowrap;
}

[dir="rtl"] .top-nav-wrapper .lang-option {
    text-align: right;
}

.top-nav-wrapper .lang-option:hover,
.top-nav-wrapper .lang-option.active {
    background: #fff0f0;
    color: #e1251b;
    font-weight: 700;
}

.top-nav-wrapper .lang-option-icon {
    margin-right: 6px;
    height: 14px;
    object-fit: contain;
    max-width: 100%;
}

[dir="rtl"] .top-nav-wrapper .lang-option-icon {
    margin-right: 0;
    margin-left: 6px;
}

.top-nav-wrapper .lang-label-short {
    display: none;
}

/* ═══════════════════════════════════════
   RESPONSIVE DESIGN (UI / UX ENHANCED)
═══════════════════════════════════════ */

/* Tablet & Mobile (≤ 991px) */
@media (max-width: 991px) {
    .top-nav-wrapper .sec-nav {
        display: flex !important;
        padding: 0 10px !important;
        min-height: 36px !important;
        height: 36px !important;
        overflow-x: visible;
    }

    .top-nav-wrapper .sec-inner {
        gap: 6px !important;
        flex-wrap: nowrap !important;
    }

    .top-nav-wrapper .sec-left {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        white-space: nowrap !important;
        gap: 4px !important;
    }

    .top-nav-wrapper .sec-left:has(.open),
    .top-nav-wrapper .sec-left.has-open-dropdown,
    .top-nav-wrapper.has-open-dropdown .sec-left {
        overflow: visible !important;
    }

    .top-nav-wrapper .sec-left::-webkit-scrollbar {
        display: none !important;
    }

    .top-nav-wrapper .sec-right {
        display: flex !important;
        flex: 0 0 auto !important;
        gap: 4px !important;
        margin-left: auto !important;
    }

    [dir="rtl"] .top-nav-wrapper .sec-right {
        margin-left: 0 !important;
        margin-right: auto !important;
    }

    .top-nav-wrapper .sec-link,
    .top-nav-wrapper .lang-btn {
        padding: 4px 8px !important;
        font-size: 11px !important;
    }
}

/* Compact Mobile (≤ 540px) */
@media (max-width: 540px) {
    .top-nav-wrapper .sec-nav {
        padding: 0 6px !important;
    }

    .top-nav-wrapper .sec-inner {
        gap: 4px !important;
    }

    .top-nav-wrapper .sec-left {
        gap: 3px !important;
    }

    .top-nav-wrapper .sec-left .sec-link,
    .top-nav-wrapper .sec-left .lang-btn {
        padding: 4px 7px !important;
        font-size: 10.5px !important;
    }

    /* In right side: hide text labels on narrow mobile so utility icons and language fit without clipping */
    .top-nav-wrapper .sec-right .sec-link-text {
        display: none !important;
    }

    .top-nav-wrapper .sec-right .sec-link {
        width: 28px !important;
        height: 28px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 6px !important;
        background: rgba(255, 255, 255, 0.07) !important;
    }

    .top-nav-wrapper .sec-right .sec-item-icon {
        margin: 0 !important;
        width: 13px !important;
        height: 13px !important;
    }

    /* Short language badge: "FR" instead of "Français" */
    .top-nav-wrapper .lang-label-full {
        display: none !important;
    }

    .top-nav-wrapper .lang-label-short {
        display: inline !important;
    }

    .top-nav-wrapper .lang-btn-switch {
        padding: 3px 6px !important;
        font-size: 10.5px !important;
    }
}
