.header {
    position: relative;
    overflow: visible;
    min-height: 110px;
    z-index: 999;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/bg-header.webp') no-repeat center center;
    background-size: 100% 110px;
    pointer-events: none;
}

.header .header-inner {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 71px;
}

.header .header-inner .logo-container {
    position: absolute;
    left: 50%;
    top: 70%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.header .header-inner .logo {
    display: inline-block;
    transition: all 0.3s ease;
    width: 144px;
    height: 78px;
}

.header .header-inner .logo:hover {
    transform: translateY(-2px);
}

.header .header-inner .logo img {
    width: 100%;
    height: auto;
}

.header .header-inner .top-controls {
    position: relative;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 25px;
    padding-right: 95px;
}

.header .header-inner .search-btn,
.header .header-inner .contact-btn,
.header .header-inner .fournisseur-btn,
.header .header-inner .linkedin-btn,
.header .header-inner .lang-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.header .header-inner .search-btn,
.header .header-inner .linkedin-btn,
.header .header-inner .lang-btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    background: #FFF;
    border: 1px solid var(--light-gray);
}

.header .header-inner .search-btn img {
    width: 16px;
    height: 16px
}

.header .header-inner .linkedin-btn img {
    width: 17px;
    height: 16px;
    transition: filter 0.3s ease;
}

.header .header-inner .linkedin-btn:hover img {
    filter: brightness(0) invert(1);
}

.header .header-inner .lang-btn {
    width: 74px;
    border-radius: 30px;
    justify-content: space-between;
    padding: 0 10px;
}

.header .header-inner .lang-dropdown .dropdown-item {
    padding-bottom: 5px;
}

.header .header-inner .lang-dropdown .dropdown-item img {
    margin-left: -5px !important;
}

.header .header-inner .lang-dropdown .dropdown-item:hover {
    background-color: transparent!important;
}

.header .header-inner .lang-btn[aria-expanded="true"] {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.header .header-inner .lang-dropdown {
    width: 74px !important;
    min-width: unset !important;
    border-radius: 0px 0px 30px 30px;
    background-color: white;
    border-top: 0;
}

.header .header-inner .contact-btn,
.header .header-inner .fournisseur-btn {
    background: var(--primary-gold);
    color: white;
    font-weight: 600;
    font-size: 16px;
    line-height: 100%;
    border-radius: 30px;
    width: 114px;
    height: 40px;
}

.header .header-inner .fournisseur-btn {
    width: auto;
    padding: 0 20px;
    white-space: nowrap;
}

.header .header-inner .search-btn:hover,
.header .header-inner .lang-btn:hover {
    box-shadow: 0 8px 25px rgba(184, 149, 106, 0.3);
}

.header .header-inner .linkedin-btn:hover {
    background-color: var(--primary-gold);
    border: 0;
}

.header .header-inner .contact-btn:hover,
.header .header-inner .fournisseur-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(168, 134, 26, 0.5);
    color: white;
}

.header .header-inner .flag-icon {
    width: 30px;
    height: 30px;
}

.header .header-inner .search-bar {
    display: none;
    position: relative;
    transform: none;
    right: auto;
    align-items: center;
    z-index: 20;
    flex: 1 1 0;
    min-width: 0;
    max-width: 783px;
    margin-left: 210px;
    margin-right: 20px;
}

.header .header-inner .search-bar .search-submit {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #FFF;
    border: 1px solid var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: box-shadow 0.3s ease;
}

.header .header-inner .search-bar .search-submit:hover {
    box-shadow: 0 8px 25px rgba(184, 149, 106, 0.3);
}

.header .header-inner .search-bar .search-submit img {
    width: 16px;
    height: 16px;
}

.header .header-inner .search-input {
    padding: 8px 54px 8px 20px;
    border-radius: 30px;
    border: 1px solid var(--light-gray);
    font-size: 1rem;
    background: #F1F2F7;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.header .header-inner .search-input:focus {
    outline: none;
    box-shadow: none;
}

.header .header-inner .search-input::placeholder {
    color: #BBBBBB;
    font-weight: 400;
    font-size: 14px;
}

.header.search-mode {
    min-height: 75px;
}

.header.search-mode .logo-container {
    left: 92px;
    transform: translateY(-50%);
}

.header.search-mode .logo-container .logo {
    padding-top: 0;
}

.header.search-mode .search-bar {
    display: flex;
}

.header.search-mode .top-controls .search-btn {
    display: none;
}

.header.search-mode::before {
    background: url('../images/bg-header-search.webp') no-repeat center center;
    background-size: 100% 100px;
}

.header.search-mode .logo-img {
    width: 102px !important;
    height: 55px !important;
    transition: width 0.3s ease, transform 0.3s ease;
}

.main-nav {
    background: rgba(255, 255, 255, 0.60);
    backdrop-filter: blur(20px);
    box-shadow: 0px 40px 70px 0px #1C261E14;
    border-radius: 0 0 30px 30px;
    border-bottom: 1px solid #FFF;
    padding: 0;
    position: absolute;
    top: 75px;
    left: 0;
    width: 100%;
    z-index: 900;
}

.nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 35px 0 15px;
    position: relative;
}

.nav-container.shifted {
    padding: 15px 0;
}

.nav-item {
    margin: 0 15px;
    position: relative;
}

.nav-link {
    color: var(--dark-brown);
    text-decoration: none;
    display: block;
    position: relative;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 16px;
    line-height: 0px;
    letter-spacing: 0px;
    text-align: center;
}

.nav-link:hover {
    color: var(--dark-brown) !important;
    transform: translateY(-2px);
}

.nav-link:focus {
    color: var(--dark-brown) !important;
}

.nav-link:hover::before {
    width: 100%;
}

.nav-separator {
    color: #898A8E;
    font-size: 1.2rem;
    margin: 0 35px;
    user-select: none;
}

.dropdown-toggle::after {
    margin-left: 10px;
    content: url("../images/icons/chevron-down.svg");
    border: 0
}

.nav-item.dropdown {
    position: relative;
}

.dropdown-arrow {
    margin-left: 8px;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
    .nav-item.dropdown:hover .dropdown-arrow {
        transform: rotate(180deg);
    }
}

.dropdown-menu-custom {
    position: absolute;
    top: 39px;
    left: -40px;
    background: rgba(255, 255, 255, 1);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid white;
    border-radius: 0 0 30px 30px;
    box-shadow: 0px 40px 70px 0px #1C261E14;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 15px 0;
    z-index: 1001;
    min-width: 290px;
}

.nav-item.dropdown:hover .dropdown-menu-custom {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item-custom {
    display: block;
    padding: 4px 25px;
    color: var(--dark-brown);
    opacity: 0.7;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    font-weight: 600;
    font-size: 16px;
}

.dropdown-item-custom:hover {
    background: rgba(184, 149, 106, 0.1);
    opacity: 1;
    border-left-color: var(--primary-gold);
    padding-left: 30px;
}

@media (min-width: 1280px) and (max-width: 1500px) {
    .header .header-inner .search-bar {
        margin-right: 20px;
        max-width: 643px;
    }
    .header .header-inner .top-controls {
        padding-right: 30px;
    }
    .header.search-mode .logo-container {
        left: 30px;
    }
    .nav-item {
        margin: 0;
    }
    .dropdown-menu-custom {
        min-width: 230px;
    }
    .nav-separator {
        margin: 0 25px;
    }
}

@media (min-width: 1025px) and (max-width: 1279px) {
    .header .header-inner .top-controls {
        padding-right: 15px;
        gap: 20px;
    }
    .header .header-inner .search-bar {
        margin-right: 15px;
        max-width: 475px;
    }
    .header.search-mode .logo-container {
        left: 20px;
    }
    .nav-link {
        font-size: 15px;
    }
    .nav-item {
        margin: 0;
    }
    .dropdown-arrow {
        margin-left: 0px;
    }
    .nav-separator {
        margin: 0 10px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .header .header-inner .top-controls {
        padding-right: 15px;
        gap: 10px;
    }
    .header .logo-container img {
        transform: scale(.8);
    }
    .header .header-inner .linkedin-btn {
        display: none;
    }
    .header .header-inner .search-bar {
        margin-right: 12px;
        max-width: 375px;
        margin-left: 120px;
    }
    .header.search-mode .logo-container {
        left: 0px;
    }
    .nav-link {
        font-size: 14px;
    }
    .nav-item {
        margin: 0;
    }
    .dropdown-arrow {
        margin-left: 0px;
    }
    .nav-separator {
        margin: 0 15px;
    }
    .nav-container {
        overflow: hidden;
    }
}

@media (max-width: 767px) {
    .header {
        min-height: 137px;
    }
    .header::before {
        background: url(../images/bg-header-mobile.svg) no-repeat center center;
        background-size: cover;
        min-height: 115px;
    }
    .header .header-inner {
        height: 90px;
    }
    .header .header-inner .search-btn,
    .header .header-inner .linkedin-btn,
    .header .header-inner .contact-btn,
    .header .header-inner .fournisseur-btn {
        display: none;
    }
    .header .header-inner .top-controls {
        padding-right: 15px;
    }
    .header .header-inner .lang-btn {
        width: 49px;
        height: 31px;
        padding: 0 5px;
    }
    .dropdown-toggle::after {
        content: url(../images/icons/chevron-down-mobile.svg);
    }
    .header .header-inner .lang-btn[aria-expanded="true"] {
        border-radius: 16px 16px 0 0!important;
    }
    .header .header-inner .lang-dropdown {
        width: 49px !important;
        border-radius: 0px 0px 16px 16px;
    }
    .header .header-inner .flag-icon {
        width: 19px;
        height: 19px;
    }
    .header .header-inner .lang-dropdown img {
        width: 23px;
        height: 23px;
    }
    .header .header-inner .logo {
        width: unset;
    }
    .header .header-inner .logo img {
        width: 138px;
        height: 74px;
    }
    #mobileNav {
        position: fixed;
        top: 0;
        left: 0;
        width: 322px;
        height: 100vh;
        background-color: #fff;
        z-index: 1050;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding: 1.5rem;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
        border-radius: 0;
    }
    #mobileNav.show {
        transform: translateX(0);
    }
    .main-nav .nav-container {
        flex-direction: column;
        padding: 0;
        align-items: start;
    }
    .main-nav .nav-item {
        margin: 0;
    }
    .main-nav .nav-separator {
        transform: rotate(90deg);
        margin: 0 0px 0 10px;
        color: #898A8E;
        font-size: 20px;
        padding: 5px 0;
    }
    .main-nav .nav-link,
    .main-nav .dropdown-item-custom {
        text-align: start;
    }
    .main-nav .dropdown-menu-custom {
        display: none;
    }
    .main-nav .nav-item.dropdown.open .dropdown-menu-custom {
        display: flex !important;
        flex-direction: column;
    }
    .nav-item.dropdown.open .dropdown-arrow {
        transform: rotate(180deg);
    }
    .dropdown-arrow {
        transition: transform 0.3s ease;
    }
    .main-nav .dropdown-item-custom {
        opacity: 1;
    }
    .main-nav .dropdown-arrow {
        display: inline-block !important;
        transition: transform 0.3s ease;
    }
    .main-nav .mobile-menu-close {
        position: absolute;
        right: 20px;
        top: 15px
    }
    .main-nav .search-bar {
        display: flex;
        margin: 40px 0 55px;
    }
    .main-nav .search-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        border-radius: 50%;
        width: 45px;
        height: 45px;
        background: #FFF;
        border: 1px solid var(--light-gray);
    }
    .main-nav .search-btn img {
        width: 18px;
        height: 18px
    }
    .main-nav .search-input {
        padding: 0 20px;
        border-radius: 30px;
        border: 1px solid var(--light-gray);
        font-size: 1rem;
        background: #F1F2F7;
        width: 100%;
        height: 45px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
        transition: all 0.3s ease;
        margin-right: -44px;
    }
    .main-nav .search-input:focus {
        outline: none;
        box-shadow: none;
    }
    .main-nav .search-input::placeholder {
        color: #BBBBBB;
        font-weight: 400;
        font-size: 14px;
    }
    .main-nav .contact-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        background: var(--primary-gold);
        color: white;
        font-weight: 600;
        font-size: 16px;
        line-height: 100%;
        letter-spacing: 0%;
        border-radius: 30px;
        width: 114px;
        height: 56px;
        margin: 35px 0;
    }
    .main-nav .linkedin-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        background: #FFF;
        border: 1px solid var(--light-gray);
    }
    .main-nav .linkedin-btn img {
        width: 21px;
        height: 20px
    }
    .main-nav .lang-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        width: 79px;
        height: 50px;
        background: #FFF;
        border: 1px solid var(--light-gray);
        border-radius: 30px;
        justify-content: space-between;
        padding: 0 10px;
    }
    .main-nav .flag-icon {
        width: 34px;
        height: 34px;
    }
    .main-nav .lang-dropdown .dropdown-item {
        padding-bottom: 5px;
    }
    .main-nav .lang-dropdown .dropdown-item img {
        margin-left: -5px !important;
    }
    .main-nav .lang-dropdown .dropdown-item:hover {
        background-color: transparent!important;
    }
    .main-nav .lang-btn[aria-expanded="true"] {
        border: 0 !important;
    }
    .main-nav .lang-btn[aria-expanded="true"]::after {
        transform: rotate(180deg);
    }
    .main-nav .lang-dropdown {
        width: 79px !important;
        min-width: unset !important;
        border-radius: 0px 0px 30px 30px;
        background-color: white;
        border: 0;
    }
    #mobileNavOverlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: var(--dark-brown);
        opacity: 0;
        pointer-events: none;
        backdrop-filter: blur(11px);
        z-index: 999;
        display: none;
        transition: opacity 0.3s ease;
    }
    #mobileNav.show~#mobileNavOverlay {
        opacity: 0.9;
        pointer-events: auto;
    }
    .dropdown-menu-custom {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0;
        margin-top: 10px;
    }
    .dropdown-item-custom {
        padding: 8px 15px;
        border-left: none;
        text-align: center;
    }
}

/* =========================================================
   RTL (arabe) — miroir du header + barre de recherche
   Ne touche pas la version FR/LTR : tout est scopé [dir="rtl"]
   ========================================================= */
[dir="rtl"] .header .header-inner .top-controls {
    padding-right: 0;
    padding-left: 95px;
}

[dir="rtl"] .header .header-inner .search-bar {
    margin-left: 20px;
    margin-right: 210px;
}

/* Loupe intégrée : au bord gauche de l'input en RTL */
[dir="rtl"] .header .header-inner .search-bar .search-submit {
    right: auto;
    left: 6px;
}

[dir="rtl"] .header .header-inner .search-input {
    padding: 8px 20px 8px 54px;
    text-align: right;
}

/* Logo en mode recherche : ancré à droite */
[dir="rtl"] .header.search-mode .logo-container {
    left: auto;
    right: 92px;
}

/* Menu déroulant / chevrons */
[dir="rtl"] .header .header-inner .lang-dropdown .dropdown-item img {
    margin-left: 0 !important;
    margin-right: -5px !important;
}

[dir="rtl"] .dropdown-toggle::after {
    margin-left: 0;
    margin-right: 10px;
}

[dir="rtl"] .dropdown-arrow {
    margin-left: 0;
    margin-right: 8px;
}

[dir="rtl"] .dropdown-menu-custom {
    left: auto;
    right: -40px;
}

[dir="rtl"] .dropdown-item-custom {
    border-left: 0;
    border-right: 3px solid transparent;
}

[dir="rtl"] .dropdown-item-custom:hover {
    border-left-color: transparent;
    border-right-color: var(--primary-gold);
    padding-left: 25px;
    padding-right: 30px;
}

@media (min-width: 1280px) and (max-width: 1500px) {
    [dir="rtl"] .header .header-inner .search-bar {
        margin-left: 20px;
        margin-right: 210px;
    }
    [dir="rtl"] .header .header-inner .top-controls {
        padding-right: 0;
        padding-left: 30px;
    }
    [dir="rtl"] .header.search-mode .logo-container {
        left: auto;
        right: 30px;
    }
}

@media (min-width: 1025px) and (max-width: 1279px) {
    [dir="rtl"] .header .header-inner .top-controls {
        padding-right: 0;
        padding-left: 15px;
    }
    [dir="rtl"] .header .header-inner .search-bar {
        margin-left: 15px;
        margin-right: 210px;
    }
    [dir="rtl"] .header.search-mode .logo-container {
        left: auto;
        right: 20px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    [dir="rtl"] .header .header-inner .top-controls {
        padding-right: 0;
        padding-left: 15px;
    }
    [dir="rtl"] .header .header-inner .search-bar {
        margin-left: 12px;
        margin-right: 120px;
    }
    [dir="rtl"] .header.search-mode .logo-container {
        left: auto;
        right: 0;
    }
}

@media (max-width: 767px) {
    /* Panneau menu mobile : glisse depuis la droite en RTL */
    [dir="rtl"] #mobileNav {
        left: auto;
        right: 0;
        transform: translateX(100%);
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.15);
    }
    [dir="rtl"] #mobileNav.show {
        transform: translateX(0);
    }
    [dir="rtl"] .header .header-inner .top-controls {
        padding-right: 0;
        padding-left: 15px;
    }
    [dir="rtl"] .main-nav .mobile-menu-close {
        right: auto;
        left: 20px;
    }
    [dir="rtl"] .main-nav .search-input {
        margin-right: 0;
        margin-left: -44px;
    }
    [dir="rtl"] .main-nav .nav-separator {
        margin: 0 10px 0 0;
    }
}
