/* =====================================
   NAVIGATION BAR MODERNE - FROM SCRATCH
   ===================================== */

/* Structure principale */
.navigation-bar-modern {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(96, 165, 250, 0.12);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 9999;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

/* Neutralise le padding Bootstrap du container-fluid dans la nav */
.navigation-bar-modern .container-fluid {
    padding-left: 0;
    padding-right: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.navbar-content {
    display: flex;
    align-items: center;
    padding: 0 30px;
    height: 70px;
    gap: 40px;
    max-width: 100%;
    box-sizing: border-box;
}

/* =====================================
   LOGO - TOUJOURS À GAUCHE
   ===================================== */
.navbar-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    min-width: 200px; /* Largeur minimale pour le logo */
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo-link:hover {
    text-decoration: none;
    transform: scale(1.02);
}

/* Image du logo */
.logo-image {
    height: 52px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.logo-link:hover .logo-image {
    filter: brightness(1.1);
}

/* Texte caché (pour accessibilité) */
.logo-text-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =====================================
   MENU PRINCIPAL - À GAUCHE PRÈS DU LOGO
   ===================================== */
.navbar-menu {
    display: flex;
    align-items: center;
}

.menu-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 20px;
}

.menu-item {
    position: relative;
}

.menu-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    font-size: 13.5px;
    padding: 25px 0;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.menu-link:hover {
    color: #60a5fa;
    text-decoration: none;
}

.menu-link i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.has-dropdown:hover .menu-link i {
    transform: rotate(180deg);
}

/* Menu déroulant */
.dropdown-menu-custom {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(96, 165, 250, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 10px 0;
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    list-style: none;
    margin: 0;
}

.has-dropdown:hover .dropdown-menu-custom {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu-custom li {
    margin: 0;
}

.dropdown-menu-custom a {
    display: block;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.dropdown-menu-custom a:hover {
    background: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
    border-left-color: #60a5fa;
    text-decoration: none;
}

/* =====================================
   ACTIONS - TOUJOURS À DROITE
   ===================================== */
.navbar-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
    justify-content: flex-end;
}

.action-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.action-link:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
    text-decoration: none;
}

.separator {
    color: rgba(255, 255, 255, 0.2);
    font-weight: 300;
}

/* =====================================
   NAVIGATION MOBILE
   ===================================== */
.mobile-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mobile-cart {
    position: relative;
    background: linear-gradient(135deg, #5dafef 0%, #74a9d8 100%);
    color: white;
    padding: 12px;
    border-radius: 50%;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(93, 175, 239, 0.4);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-cart:hover {
    transform: scale(1.1);
    text-decoration: none;
    color: white;
    box-shadow: 0 6px 25px rgba(93, 175, 239, 0.5);
}

.cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
}

.mobile-burger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-burger span {
    width: 25px;
    height: 3px;
    background: rgba(255, 255, 255, 0.85);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-burger.active span:nth-child(2) {
    opacity: 0;
}

.mobile-burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Menu mobile */
.mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(96, 165, 250, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    padding: 20px;
}

.mobile-menu-item {
    display: block;
    padding: 15px 0;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(96, 165, 250, 0.1);
    transition: color 0.3s ease;
}

.mobile-menu-item:hover {
    color: #60a5fa;
    text-decoration: none;
}

.mobile-submenu {
    padding-left: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-submenu.active {
    max-height: 300px;
}

.mobile-submenu-item {
    display: block;
    padding: 10px 0;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: 14px;
}

.mobile-account-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid rgba(96, 165, 250, 0.15);
}

/* Grille 2 colonnes */
.mobile-account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Slot Langue/Devise pleine largeur quand non connecté */
.mob-full-width {
    grid-column: 1 / -1;
}

/* Boutons mobile — icône + texte empilés */
.mobile-account-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 8px;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    width: 100%;
    min-height: 70px;
}

.mobile-account-btn i {
    font-size: 20px;
    line-height: 1;
}

.mobile-account-btn span {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}

.mobile-account-btn:hover {
    opacity: 0.85;
    text-decoration: none;
    color: white;
    transform: translateY(-1px);
}

.dashboard-btn { background: linear-gradient(135deg, #5dafef 0%, #2979b5 100%); }
.cart-btn      { background: linear-gradient(135deg, #28a745 0%, #20c997 100%); }
.logout-btn    { background: linear-gradient(135deg, #dc3545 0%, #c82333 100%); }
.login-btn     { background: linear-gradient(135deg, #5dafef 0%, #2979b5 100%); }
.register-btn  { background: linear-gradient(135deg, #28a745 0%, #20c997 100%); }

/* =====================================
   RESPONSIVE
   ===================================== */

/* Desktop (1281px+) : burger caché, menu complet affiché */
@media (min-width: 1281px) {
    .mobile-toggle {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    .navbar-menu {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .navbar-actions {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .mobile-menu {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }
}

/* Écrans moyens - réduire les espaces */
@media (max-width: 1400px) and (min-width: 1281px) {
    .navbar-content {
        padding: 0 20px;
        gap: 20px;
    }

    .menu-list {
        gap: 18px;
    }

    .menu-link {
        font-size: 13px;
    }

    .navbar-logo {
        min-width: 160px;
    }

    .logo-image {
        height: 44px;
    }
}

/* Passage en burger menu strict à 1280px */
@media (max-width: 1280px) {
    /* Forcer la disparition immédiate des éléments desktop */
    .navbar-menu {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    .navbar-actions {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    .mobile-toggle {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .mobile-menu {
        position: absolute !important;
    }

    /* Ajuster l'espacement pour le mobile */
    .navbar-content {
        justify-content: space-between !important;
        gap: 0 !important;
        padding: 0 15px !important;
        max-width: 100% !important;
    }

    .navbar-logo {
        min-width: auto !important;
        max-width: calc(100% - 110px) !important; /* laisse la place au burger + panier */
    }

    .logo-image {
        max-width: 150px !important;
    }
}

@media (max-width: 768px) {
    .navbar-content {
        padding: 0 15px;
        height: 60px;
    }

    .logo-image {
        height: 38px;
    }
}

@media (max-width: 576px) {
    .navbar-content {
        padding: 0 10px;
    }

    .logo-image {
        height: 35px;
    }
}

/* =====================================
   LOADER STYLES
   ===================================== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(52, 73, 94, 0.9);
    z-index: 999998;
    display: none;
    justify-content: center;
    align-items: center;
}

.page-loader.active {
    display: flex;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.loader-gif {
    width: 180px;
    height: 180px;
    object-fit: contain;
    animation: loader-main 2s ease-in-out infinite;
}

.loader-bar-wrap {
    width: 160px;
    height: 4px;
    background: rgba(35, 220, 236, 0.15);
    border-radius: 99px;
    overflow: hidden;
}

.loader-bar {
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, #23dcec, #186cb3);
    border-radius: 99px;
    animation: loader-bar-slide 1.4s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(35,220,236,0.8);
}

@keyframes loader-main {
    0%   { transform: scale(0.8)  rotate(-4deg); filter: drop-shadow(0 0 10px rgba(35,220,236,0.3)); opacity: 0.7; }
    25%  { transform: scale(1.2)  rotate(2deg);  filter: drop-shadow(0 0 40px rgba(35,220,236,1))   drop-shadow(0 0 80px rgba(24,108,179,0.6)); opacity: 1; }
    50%  { transform: scale(1.05) rotate(-1deg); filter: drop-shadow(0 0 25px rgba(35,220,236,0.7)); opacity: 0.9; }
    75%  { transform: scale(1.18) rotate(3deg);  filter: drop-shadow(0 0 45px rgba(35,220,236,1))   drop-shadow(0 0 70px rgba(24,108,179,0.5)); opacity: 1; }
    100% { transform: scale(0.8)  rotate(-4deg); filter: drop-shadow(0 0 10px rgba(35,220,236,0.3)); opacity: 0.7; }
}

@keyframes loader-bar-slide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(500%); }
}

/* =====================================
   BOUTONS ACTIONS NAVBAR
   ===================================== */

.nav-cart-btn,
.nav-dash-btn,
.nav-login-btn,
.nav-register-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: 50px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.25s ease;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
}

.nav-cart-btn:hover,
.nav-dash-btn:hover,
.nav-login-btn:hover,
.nav-register-btn:hover {
    text-decoration: none;
}

/* Panier — ghost neutre */
.nav-cart-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.11);
    color: rgba(255, 255, 255, 0.78);
}
.nav-cart-btn:hover {
    background: rgba(79, 195, 247, 0.1);
    border-color: rgba(79, 195, 247, 0.28);
    color: #4fc3f7;
}
/* Badge compteur dans le pill */
.nav-cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    border-radius: 10px;
    line-height: 1;
}

/* Dashboard — gradient bleu FastPanel */
.nav-dash-btn {
    background: linear-gradient(135deg, #4fc3f7 0%, #0288d1 100%);
    color: #fff;
    box-shadow: 0 4px 18px rgba(79, 195, 247, 0.28);
}
.nav-dash-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(79, 195, 247, 0.45);
    color: #fff;
}

/* Connexion — ghost */
.nav-login-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.82);
}
.nav-login-btn:hover {
    background: rgba(79, 195, 247, 0.1);
    border-color: rgba(79, 195, 247, 0.3);
    color: #4fc3f7;
}

/* Inscription — gradient bleu FastPanel */
.nav-register-btn {
    background: linear-gradient(135deg, #4fc3f7 0%, #0288d1 100%);
    color: #fff;
    box-shadow: 0 4px 18px rgba(79, 195, 247, 0.28);
}
.nav-register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(79, 195, 247, 0.45);
    color: #fff;
}
