/* ==========================================================================
   Dynamic Header Styles
   Extracted from dynamic_header.html inline <style> blocks (DES-01 fix)
   Dynamic values use CSS custom properties defined inline in the template.
   ========================================================================== */

/* Éliminer les marges par défaut du body */
body {
    margin: 0;
    padding: 0;
}

/* Styles de base pour le header dynamique */
.dynamic-header {
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    font-family: 'Lato', Arial, sans-serif;
}

/* Style pour le conteneur de menu sticky */
#menu-container.sticky-menu-container {
    position: relative;
    z-index: 1000;
    width: 100%;
    margin: 0;
    padding: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* When the menu becomes sticky */
#menu-container.sticky-menu-container.sticky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dynamic-header.with-shadow {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dynamic-header .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Barre supérieure */
.dynamic-header .top-bar {
    padding: 10px 0 0 0;
}

.dynamic-header .top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

/* Icônes de réseaux sociaux */
.dynamic-header .social-icons {
    display: flex;
    gap: 10px;
}

.dynamic-header .social-icons a {
    color: #ffffff;
    font-size: 16px;
    background: #ed2024;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}

.dynamic-header .social-icons a:hover {
    opacity: 0.85;
}

.dynamic-header .top-bar-logos {
    display: flex;
    align-items: center;
    gap: 20px;
}

.dynamic-header .image2 {
    width: 230px;
    height: auto;
}

.dynamic-header .image3 {
    width: 65px;
    height: auto;
}

/* Barre principale avec background blur à gauche */
.dynamic-header .main-bar {
    background-color: #ffffff;
    position: relative;
    overflow: visible;
    padding: 20px 0 0 0;
    height: var(--main-bar-height, 100px);
    display: flex;
    align-items: center;
    z-index: 2000;
}

/* Background image on the right side - no blur on main image */
.dynamic-header .main-bar-bg-left {
    position: absolute;
    top: 0;
    right: 0;
    width: 40%;
    height: 100%;
    background-position: center right;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: 0;
}

/* Gradient overlay from left (white) to right (transparent) + blur effect on the left side */
.dynamic-header .main-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Gradient: Solid white on left, fading to transparent on right. Extended stops to overlap image. */
    background: linear-gradient(90deg, #ffffff 50%, rgba(255, 255, 255, 0.6) 70%, rgba(255, 255, 255, 0) 90%);

    /* Blur effect */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    /* Mask: Keeps the blur on the left/center, removes it on the far right so image is sharp there */
    mask-image: linear-gradient(90deg, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 85%);
    -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 85%);

    z-index: 1;
    pointer-events: none;
    /* Allow clicking through the overlay */
}

.dynamic-header .main-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2001;
    width: 100%;
}

/* Logos */
.dynamic-header .logo img {
    display: block;
    height: auto;
}

.dynamic-header .logo-left {
    padding: 5px 0;
    flex-shrink: 0;
}

/* Centered search bar */
.dynamic-header .search-inline.search-centered {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 20px;
}

/* User Account Area (right side of main bar) */
.dynamic-header .header-user-area {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2005;
}

.dynamic-header .user-dropdown {
    position: relative;
}

.dynamic-header .user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 24px;
    transition: background-color 0.2s;
}

.dynamic-header .user-avatar-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dynamic-header .user-initials {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0e8040;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
    font-family: 'Lato', Arial, sans-serif;
}

.dynamic-header .user-chevron {
    font-size: 10px;
    color: #666;
    transition: transform 0.2s;
}

.dynamic-header .user-dropdown:hover .user-chevron,
.dynamic-header .user-dropdown.open .user-chevron {
    transform: rotate(180deg);
}

.dynamic-header .user-dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    min-width: 220px;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    overflow: hidden;
}

.dynamic-header .user-dropdown:hover .user-dropdown-content,
.dynamic-header .user-dropdown.open .user-dropdown-content {
    display: block;
}

.dynamic-header .user-dropdown-header {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dynamic-header .user-dropdown-header strong {
    font-size: 14px;
    color: #333;
}

.dynamic-header .user-dropdown-header span {
    font-size: 12px;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dynamic-header .user-dropdown-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 0;
}

.dynamic-header .user-dropdown-content a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: #444;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.15s;
}

.dynamic-header .user-dropdown-content a i {
    width: 18px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

.dynamic-header .user-dropdown-content a:hover {
    background: #f5f5f5;
    color: #0e8040;
}

.dynamic-header .user-dropdown-content a:hover i {
    color: #0e8040;
}

.dynamic-header .user-dropdown-logout {
    color: #c0392b !important;
}

.dynamic-header .user-dropdown-logout i {
    color: #c0392b !important;
}

.dynamic-header .user-dropdown-logout:hover {
    background: #fdf0ef !important;
    color: #a93226 !important;
}

/* Login button for anonymous users */
.dynamic-header .header-login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: #0e8040;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Lato', Arial, sans-serif;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.dynamic-header .header-login-btn:hover {
    background: #0a6030;
    color: #fff;
}

.dynamic-header .search-inline {
    display: inline-flex;
    align-items: center;
}

.dynamic-header .search-form-inline {
    display: flex;
    align-items: center;
    height: 50px;
}

.dynamic-header .search-input-inline {
    border: 2px solid #66bb3f;
    border-right: none;
    border-radius: 10px 0 0 10px;
    padding: 0 19px;
    width: 440px;
    min-width: 340px;
    height: 50px;
    font-size: 16px;
    color: #333;
    box-sizing: border-box;
}

.dynamic-header .search-submit-inline {
    border: 2px solid #66bb3f;
    border-radius: 0 10px 10px 0;
    background: #66bb3f;
    color: #fff;
    height: 50px;
    width: 70px;
    padding: 15px 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-sizing: border-box;
}

@media (max-width: 992px) {
    .dynamic-header .top-bar-content {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .dynamic-header .top-bar-logos {
        order: 1;
        width: 100%;
        justify-content: center;
    }

    .dynamic-header .social-icons {
        order: 2;
        width: 100%;
        justify-content: center;
    }

    .dynamic-header .main-bar {
        height: auto;
        padding: 15px 0;
    }

    .dynamic-header .main-bar-content {
        flex-wrap: nowrap;
        gap: 12px;
    }

    .dynamic-header .header-user-area {
        margin-left: auto;
    }

    .dynamic-header .mobile-menu-toggle {
        display: inline-flex;
        margin-left: 8px;
        background: #0e8040;
        color: #ffffff;
        border-radius: 10px;
        padding: 10px 14px;
    }

    .dynamic-header .header-login-text {
        display: none;
    }

    .dynamic-header .header-login-btn {
        padding: 8px;
        border-radius: 50%;
    }

    .dynamic-header .user-chevron {
        display: none;
    }

    .dynamic-header .user-initials {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .dynamic-header .main-bar-content {
        flex-wrap: wrap;
    }

    .dynamic-header .logo-left {
        order: 1;
    }

    .dynamic-header .header-user-area {
        order: 2;
    }

    .dynamic-header .mobile-menu-toggle {
        order: 3;
    }

    .dynamic-header .search-inline.search-centered {
        order: 4;
        width: 100%;
        margin: 10px 0 0 0;
        flex: 0 0 100%;
        justify-content: center;
    }

    .dynamic-header .search-form-inline {
        width: 100%;
    }

    .dynamic-header .search-input-inline {
        width: 100%;
        min-width: 0;
        flex: 1;
    }

    .dynamic-header .search-submit-inline {
        width: 60px;
        padding: 0;
    }
}

/* Boutons spéciaux */
.dynamic-header .special-buttons {
    display: flex;
    gap: 10px;
}

.dynamic-header .special-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.dynamic-header .special-button:hover {
    opacity: 0.9;
}

/* Styles pour les effets de survol du menu */
.dynamic-header .nav-item>a {
    text-transform: uppercase;
    font-weight: 700;
    font-size: 16px;
    font-family: 'Lato', Arial, sans-serif;
    line-height: 100%;
    letter-spacing: 0;
}

.dynamic-header .nav-item>a:hover {
    background-color: var(--hover-bg-color, #D4AF37);
    color: var(--hover-text-color, #FFFFFF) !important;
}

/* Styles pour les sous-menus */
.dynamic-header .submenu li>a:hover {
    background-color: #0a6030 !important;
    color: #FFFFFF !important;
    padding-left: 25px;
}

/* Indicateur de sous-menu */
.submenu-indicator {
    margin-left: 5px;
    font-weight: bold;
    transition: transform 0.3s;
}

.nav-item:hover .submenu-indicator {
    transform: rotate(45deg);
}

/* Language Switcher Styles */
.language-switcher-item {
    margin-left: auto;
    /* Push to the right */
}

.lang-dropdown {
    position: relative;
    display: inline-block;
    height: 100%;
}

.lang-dropdown .dropbtn {
    background-color: transparent;
    color: white;
    padding: 0 20px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-family: 'Lato', Arial, sans-serif;
}

.lang-dropdown:hover .dropbtn {
    background-color: rgba(255, 255, 255, 0.1);
}

.lang-dropdown .dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 100px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    right: 0;
    border-radius: 0 0 4px 4px;
}

.lang-dropdown .dropdown-content a {
    color: black !important;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-weight: normal;
    font-size: 14px;
    text-transform: none;
}

.lang-dropdown .dropdown-content a:hover {
    background-color: #f1f1f1;
    color: #0e8040 !important;
}

.lang-dropdown:hover .dropdown-content {
    display: block;
}

.flag-icon {
    font-size: 18px;
}

/* ==========================================================================
   Default Header Styles (fallback when no config is active)
   ========================================================================== */

.default-header {
    width: 100%;
    font-family: 'Roboto', Arial, sans-serif;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.default-header .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Barre supérieure */
.default-header .top-bar {
    padding: 8px 0;
}

.default-header .top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Icônes de réseaux sociaux */
.default-header .social-icons {
    display: flex;
    gap: 15px;
}

.default-header .social-icons a {
    color: inherit;
    font-size: 16px;
    transition: opacity 0.3s;
}

.default-header .social-icons a:hover {
    opacity: 0.8;
}

/* Barre de recherche */
.default-header .search-bar {
    display: flex;
}

.default-header .search-bar form {
    display: flex;
    height: 30px;
}

.default-header .search-bar input {
    border: none;
    padding: 0 10px;
    border-radius: 3px 0 0 3px;
    min-width: 200px;
}

.default-header .search-bar button {
    border: none;
    padding: 0 15px;
    border-radius: 0 3px 3px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Barre principale */
.default-header .main-bar {
    padding: 15px 0 0 0;
}

.default-header .main-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.default-header .logo img {
    display: block;
    height: auto;
}

.default-header .logo-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.default-header .special-buttons {
    display: flex;
    gap: 10px;
}

.default-header .special-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.default-header .special-button:hover {
    opacity: 0.9;
}

/* Menu principal */
.default-header .main-menu {
    padding: 0;
}

.default-header .main-menu ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.default-header .main-menu li {
    position: relative;
}

.default-header .main-menu a {
    display: block;
    color: #FFFFFF;
    text-decoration: none;
    padding: 15px 20px;
    transition: background-color 0.3s;
}

.default-header .main-menu a:hover {
    background-color: #D4AF37;
    color: #FFFFFF;
}

/* Sous-menus */
.default-header .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background-color: #8B6F0F;
    display: none;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.default-header .main-menu li:hover>.submenu {
    display: block;
}

.default-header .submenu a {
    padding: 12px 20px;
}

/* Menu mobile */
.default-header .mobile-menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 992px) {
    .default-header .main-menu {
        display: none;
    }

    .default-header .mobile-menu-toggle {
        display: block;
    }

    .default-header .logo-center {
        position: static;
        transform: none;
        margin: 0 auto;
    }

    .default-header .main-bar-content {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .default-header .top-bar-content {
        flex-direction: column;
        gap: 10px;
    }

    .default-header .search-bar input {
        min-width: 150px;
    }
}