html, body {
    margin: 0;
    padding: 0;
    text-decoration: none;
}

/* Style de base pour la navbar */
.navbar {
    display: flex;
    flex-direction: column;
    background: var(--surface-ink);
    padding: 0;
    box-shadow: 0 6px 24px -10px rgba(0, 0, 0, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000; /* Assure que la navbar est au-dessus des autres éléments */
    width: 100%;
    height: 145px; /* Hauteur totale avec main-links */
    transition: height 0.3s ease;
    overflow: visible; /* Permet aux dropdowns de s'afficher correctement */
}

/* Fil dégradé îles en bas de la navbar (signature DA) */
.navbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--gradient-sunset);
    opacity: 0.85;
}

.navbar.nav-compact {
    height: 90px; /* Hauteur réduite = navbar-top seulement */
}

/* Surcharge des styles Bootstrap pour nos liens de navigation */
.navbar .nav-link {
    text-decoration: none;
    color: white;
    font-size: 1.1rem; /* Réduit de 1.2rem à 1.1rem */
    padding: 6px 12px; /* Réduit de 8px 15px à 6px 12px */
    transition: color 0.3s ease;
}

.navbar .nav-link:hover {
    color: var(--color-accent);
}

.container-nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

/* Première ligne : Admin menu + logo + searchbar + liens utilisateur */
.navbar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
    padding: 0px 30px; /* Ajout padding vertical pour espacement fin */
}

/* Style du bouton admin réduit */
.admin-menu {
    display: flex;
    align-items: center;
    margin-left: 10px;
    z-index: 1001;
}

/* Ajuster la navbar-top pour inclure le logo et le bouton admin ensemble */
.navbar-brand-container {
    display: flex;
    align-items: center;
    gap: 30px; /* Espacement entre le logo et le bouton admin */
    flex-shrink: 0; /* Ne pas rétrécir : évite que le bouton Studio déborde sur la recherche */
}

.admin-trigger {
    background: none;
    border: 2px solid white;
    color: white;
    padding: 8px;  /* Réduire le padding pour une icône */
    border-radius: var(--radius-full);  /* Forme ronde pour l'icône */
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.admin-trigger:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg); /* Petit effet de rotation au survol */
}

.admin-trigger .bi {
    font-size: 1.5rem;
}

.admin-title {
    font-weight: bold;
    text-transform: uppercase;
    margin: 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0; /* Override Bootstrap */
    height: auto; /* Override Bootstrap */
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 90px; /* Réduit de 120px à 90px pour navbar plus fine */
    vertical-align: middle;
}

/* Sidebar Admin */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: -290px; /* Cachée par défaut */
    width: 290px;
    height: 100vh;
    background: linear-gradient(to bottom, black, black, var(--text-primary));
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.admin-sidebar.active {
    left: 0; /* Affichage de la sidebar */
}

.admin-sidebar .admin-sidebar-content {
    padding: 30px 20px;
}

.admin-sidebar .admin-title {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 50px;
    color: white;
    text-align: center;
    padding-bottom: 10px;
}

.admin-sidebar a {
    display: block;
    padding: 10px 0px;
    color: white;
    text-decoration: none;
    transition: var(--transition-normal);
    margin-left: 30px;
    margin-top: 8px;
    border-radius: var(--radius-sm);
}

.admin-section h4 {
    color: #1a97b6
}

.admin-sidebar a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #02e2bd;
    transform: translateX(5px);
}

/* Searchbar */
.navbar-search {
    display: flex;
    align-items: center;
    margin: 0 20px;
    flex-grow: 1;
    position: relative;
    max-width: 600px; /* Réduire la largeur maximale */
}

.navbar-search input {
    padding: 10px 45px 10px 18px; /* Réduit de 13px à 10px vertical */
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    margin: 0 auto;
    width: 100%;
    background-color: white;
    line-height: normal; /* Override Bootstrap */
    font-size: 0.95rem; /* Taille de police légèrement réduite */
}

.navbar-search button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-medium);
    padding: 0;
}

.navbar-search button i {
    font-size: 18px;
}

.navbar-search input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--ring);
}

.navbar-search input::placeholder {
    color: #5f5f5f;
    opacity: 1; /* Firefox */
}

/* Liens utilisateur */
.navbar-nav.auth-links {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-left: 0; /* Override Bootstrap */
    margin-bottom: 0; /* Override Bootstrap */
    list-style: none;
    flex-direction: row;
}

.navbar-nav.main-links {
    display: flex;
    flex-direction: row;
    justify-content: center;
    margin-top: -15px; /* Réduit de -25px à -15px */
    margin-bottom: 8px; /* Réduit de 10px à 8px */
    position: relative;
    padding-left: 0; /* Override Bootstrap */
    list-style: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(0);
    opacity: 1;
}

/* Classe pour masquer la barre lors du défilement vers le bas */
.navbar-nav.main-links.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

/* Dropdown styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background-color: transparent;
    color: white;
    font-size: 1.1rem; /* Réduit de 1.2rem à 1.1rem */
    border: none;
    cursor: pointer;
    padding: 6px 12px; /* Réduit de 8px 15px à 6px 12px */
    font-family: 'Signika', sans-serif;
    transition: color 0.3s ease;
}

.dropbtn:hover {
    color: var(--color-accent);
}

.dropdown-content {
    display: none;
    position: absolute;
    background: var(--surface-ink);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-ink);
    min-width: 260px;
    z-index: 1001;
    overflow: hidden;
    padding: 8px 0;
    margin-top: 10px;
    backdrop-filter: blur(10px);
    animation: dropdownSlideIn 0.3s ease;
    left: 50%;
    transform: translateX(-50%);
    top: 100%;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.dropdown-content a {
    color: white;
    padding: 14px 24px;
    text-decoration: none;
    display: block;
    text-align: center;
    transition: all 0.25s ease;
    font-size: 1rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.dropdown-content a::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(6, 214, 160, 0.18) 0%, transparent 100%);
    transition: width 0.3s ease;
    z-index: -1;
}

.dropdown-content a:hover {
    background-color: rgba(6, 214, 160, 0.12);
    border-left-color: var(--color-accent);
    padding-left: 28px;
    color: #4fe3c0;
}

.dropdown-content a:hover::after {
    width: 100%;
}

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

/* Effet sur le bouton quand le dropdown est ouvert */
.dropdown:hover .dropbtn {
    color: var(--color-accent);
}

.cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.cart-count {
    position: relative;
    top: 0;
    margin-left: 5px;
    font-size: 0.9rem;
}

/* Cacher les éléments vides */
.navbar-nav.main-links:empty,
.navbar-search:empty {
    display: none !important;
}


/* Ajuster les media queries pour éviter le rognage des auth-links */
@media (max-width: 1535px) and (min-width: 1201px) {
    .navbar-search {
        max-width: 500px;
    }

    .auth-links {
        min-width: 230px;
        margin-right: 20px;
    }
}

/* Nouvelle media query pour gérer la transition */
@media (max-width: 1200px) and (min-width: 768px) {
    .navbar-top {
        padding: 0 20px;
    }

    .navbar-search {
        max-width: 400px;
    }

    .auth-links {
        min-width: 230px;
        margin-right: 20px;
    }
}

@media (max-width: 1023px) and (min-width: 768px) {
    .navbar-search {
        max-width: 400px;
    }

    .logo img {
        height: 80px; /* Réduit pour tablette */
    }
}

/* Adaptation Mobile */
@media (max-width: 767px) {
    .navbar {
        height: 226px; /* Mobile: hauteur totale avec main-links */
    }

    .navbar-top {
        height: auto;
        flex-wrap: wrap;
        justify-content: center;
    }

    .dropdown:hover .dropdown-content {
        left: 110px;
    }

    .navbar-nav.main-links {
        transition: opacity 0.25s ease, transform 0.25s ease;
    }

    .navbar.nav-compact {
        height: 190px; /* Mobile: hauteur réduite sans main-links */
    }

    .admin-menu {
        position: relative;
        order: 0;
        width: auto;
        text-align: center;
        margin-left: 0;
    }

    .studio-menu {
        position: relative;
        order: 0;
        width: auto;
        text-align: center;
        margin-left: 0;
    }

    .studio-link span {
        display: none; /* Cacher le texte sur mobile, garder l'icône */
    }

    .studio-link {
        padding: 8px;
        border-radius: var(--radius-full);
    }

    .admin-trigger {
        margin-bottom: 0;
    }

    .navbar-brand-container {
        order: 2;
        display: flex;
        justify-content: center;
        align-items: center;
        width: auto;
    }

    .logo {
        margin: auto;
    }

    .logo img {
        width: auto;
    }

    .navbar-search {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin-top: -10px;
    }

    .navbar-nav.auth-links {
        order: 4;
        width: 100%;
        justify-content: center;
    }

    .admin-sidebar {
        width: 80%;
        left: -80%;
    }

    .admin-sidebar.active {
        left: 0;
        width: 90%;
    }

    .navbar-search:empty {
        display: none !important;
    }
    
    .navbar-nav.main-links {
        margin-top: -10px;
        text-align: center;
        justify-content: center;
    }


}

@media (min-width: 768px) {
    .admin-menu {
        /* Garder dans le flux normal pour éviter la superposition */
        position: relative;
    }

    .studio-menu {
        position: relative;
    }

    .studio-link span {
        display: inline; /* Afficher le texte sur desktop */
    }

    .navbar-brand {
        margin-left: 0;
    }

    /* Ajustement de l'espacement sur desktop quand la searchbar est absente */
    .navbar-top:has(.navbar-search:empty) {
        justify-content: flex-start;
        gap: 40px;
    }
        
    .navbar-top:has(.navbar-search:empty) .auth-links {
        margin-left: auto;
    }
}

/* Fix pour éviter les conflits avec Bootstrap */
.navbar .navbar-nav .nav-link {
    padding: 8px 15px;
}

.navbar .navbar-brand {
    height: auto;
    padding: 0;
    margin-right: 0;
}

/* Correction du z-index pour les éléments Bootstrap */
.dropdown-menu {
    z-index: 1001;
}

/* Fix pour Safari et iOS */
@supports (-webkit-overflow-scrolling: touch) {
    .admin-sidebar {
        -webkit-overflow-scrolling: touch;
    }

    .logo img {
        max-height: 120px;
    }
}

.admin-link {
    display: flex;
    align-items: center;
    gap: 6px; /* Réduit de 8px à 6px */
    padding: 6px 12px; /* Réduit de 8px 16px à 6px 12px */
    background: black; /* Background noir */
    border: 2px solid white; /* Bordure blanche pour contraste */
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem; /* Réduit de 0.95rem à 0.9rem */
    transition: var(--transition-normal);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}

.admin-link:hover {
    background: #1a1a1a; /* Gris très foncé au survol */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
    color: white;
}

.admin-link i {
    font-size: 1.1rem;
}

/* Style du lien Studio de Création - Rouge/Rouge Pastel */
.studio-menu {
    display: flex;
    align-items: center;
    margin-left: 10px;
    z-index: 1001;
}

.studio-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--gradient-sunset);
    border: none;
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-normal);
    box-shadow: 0 4px 14px -4px rgba(255, 67, 101, 0.5);
}

.studio-link:hover {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary), #d98a3c);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(255, 67, 101, 0.6);
    color: white;
}

.studio-link i {
    font-size: 1.1rem;
}

/* Style spécial pour le lien Nouveautés - Bleu-Turquoise */
.nav-link-highlight {
    background: var(--gradient-ocean);
    padding: 6px 20px !important;
    border-radius: var(--radius-full);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(6, 214, 160, 0.3);
    transition: var(--transition-slow);
    animation: glow 2.4s ease-in-out infinite;
}

.nav-link-highlight:hover {
    background: linear-gradient(135deg, var(--color-teal), var(--color-accent));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 214, 160, 0.5);
    color: white !important;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(6, 214, 160, 0.3);
    }
    50% {
        box-shadow: 0 6px 25px rgba(53, 148, 185, 0.55);
    }
}