/* Top Banner */
.bandeau_haut {
    background: linear-gradient(135deg, #4d67e8 0%, #965fc3 100%);
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.bandeau_haut::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(0, 0, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.bandeau_haut .liens {
    display: flex;
    gap: 2rem;
    align-items: center;
    position: relative;
    z-index: 1;
}


.bandeau_haut a {
    color: white;
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    padding: 0.25rem 0;
    position: relative;
}

.bandeau_haut a:hover {
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.bandeau_haut a:hover::after {
    width: 100%;
}

.bandeau_haut a i {
    font-size: 1rem;
}

.droite {
    text-align: right;
    font-size: 0.875rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.stars-product {
    display: flex;
    gap: 0.15rem;
}

.stars-product input {
    display: none;
}

.stars-product label {
    cursor: pointer;
    width: 16px;
    height: 16px;
    background: white;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    transition: transform 0.2s ease;
}

.stars-product label:hover {
    transform: scale(1.1);
}

/* Main Header */
header.header {
    background: #f5f5f5;
    padding: 1rem 2rem;
    display: grid;
    grid-template-columns: 30px 120px 1fr 50px 120px;
    align-items: center;
    justify-items: center;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1001;
    grid-template-areas: "burger logo search user cart";
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

header.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #4d67e8 50%,
        transparent 100%
    );
}

header.header .burger-menu {
    grid-area: burger;
    margin: 0;
    color: #1a1d29;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 8px;
}

header.header .burger-menu:hover {
    color: #4d67e8;
    background: rgba(77, 103, 232, 0.1);
}

header.header a[href="/"] {
    grid-area: logo;
    transition: transform 0.3s ease;
}

header.header a[href="/"] img {
    max-height: 60px;
    width: auto;
}

header.header a[href="/"] img:hover {
    transform: scale(1.05);
}

header.header .search {
    grid-area: search;
    width: 100%;
    max-width: 600px;
    display: flex;
    position: relative;
}

header.header input.search {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px 0 0 12px;
    outline: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

header.header input.search:focus {
    border-color: #4d67e8;
    background: white;
    box-shadow: 0 4px 12px rgba(77, 103, 232, 0.1);
}

header.header button.button_header {
    background: linear-gradient(135deg, #4d67e8 0%, #965fc3 100%);
    color: white;
    border: none;
    cursor: pointer;
    width: 50px;
    border-radius: 0 12px 12px 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

header.header button.button_header::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

header.header button.button_header:hover::before {
    width: 100px;
    height: 100px;
}

header.header button.button_header:hover {
    box-shadow: 0 4px 12px rgba(77, 103, 232, 0.3);
}

header.header a[title="Espace client"] {
    grid-area: user;
    color: #1a1d29;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 8px;
}

header.header a[title="Espace client"]:hover {
    color: #4d67e8;
    background: rgba(77, 103, 232, 0.1);
}


/* ===================================
   AUTOCOMPLETE & SEARCH STYLES
   =================================== */

/* Search Container */
.contentArea {
    width: 100%;
    margin: 0 auto;  
}

/* Search Input */
#inputSearch {
    width: 100%;
    height: 40px;
    border: 2px solid var(--border-light, #e5e7eb);
    border-radius: 12px 0 0 12px;
    padding: 0.875rem 1.25rem;
    color: var(--text-dark, #1a1d29);
    background-color: var(--bg-gray, #f8f9fa);
    text-decoration: none;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

#inputSearch:focus {
    border-color: var(--primary, #4d67e8);
    background-color: white;
    box-shadow: 0 4px 12px rgba(77, 103, 232, 0.1);
}

/* Results Dropdown */
#divResult {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 4px;
    border: 1px solid var(--border-light, #e5e7eb);
    border-top: none;
}

/* Custom Scrollbar for Results */
#divResult::-webkit-scrollbar {
    width: 8px;
}

#divResult::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 0 12px 0;
}

#divResult::-webkit-scrollbar-thumb {
    background: var(--primary, #4d67e8);
    border-radius: 4px;
}

#divResult::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark, #233da8);
}

/* Links in Results */
#divResult > a {
    display: block;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s ease;
}

#divResult > a:last-child {
    border-bottom: none;
}

#divResult > a:hover {
    background: linear-gradient(90deg, 
        rgba(77, 103, 232, 0.1) 0%,
        rgba(77, 103, 232, 0.05) 100%
    );
}

/* Result Item */
.display_box {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 70px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.display_box::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--primary, #4d67e8);
    transition: width 0.3s ease;
}

#divResult > a:hover .display_box {
    padding-left: 1.5rem;
}

#divResult > a:hover .display_box::before {
    width: 4px;
}

/* Image */
.display_box img {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 6px;
}

/* Product Info Container */
.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0; /* Pour permettre le text-overflow */
}

/* Product Name */
.display_box .name {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark, #1a1d29);
    font-size: 0.95rem;
    line-height: 1.4;
    font-weight: 400;
    transition: color 0.2s ease;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#divResult > a:hover .name {
    color: var(--primary, #4d67e8);
    font-weight: 500;
}

/* Price and Stock Info Container */
.price-stock-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Price */
.price-stock-info .product-price {
    font-weight: 600;
    color: var(--primary, #4d67e8);
    font-size: 1rem;
    white-space: nowrap;
    margin: 0;
}

/* Stock Info */
.product-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: #6b7280;
    padding: 2px 10px;
    background: #f3f4f6;
    border-radius: 12px;
    transition: all 0.2s ease;
}

/* Stock Badge avec point vert si "en stock" */
.product-stock::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
}

/* Si rupture de stock, modifier la couleur */
.product-stock.out-of-stock::before {
    background: #ef4444;
}

#divResult > a:hover .product-stock {
    background: #e5e7eb;
}

/* Responsive */
@media (max-width: 640px) {
    .display_box {
        padding: 0.875rem 1rem;
        gap: 10px;
    }
    
    .display_box img {
        width: 40px;
        height: 40px;
    }
    
    .display_box .name {
        font-size: 0.875rem;
    }
    
    .product-price {
        font-size: 0.9375rem;
    }
    
    .product-stock {
        font-size: 0.8125rem;
        padding: 2px 8px;
    }
}

/* General Link Styles (pour compatibilité) */
a {
    font-family: -apple-system, 'Trebuchet MS', 'Segoe UI', sans-serif;
    color: var(--text-dark, #1a1d29);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary, #4d67e8);
}

/* Empty State */
#divResult:empty {
    display: none;
}

/* Loading State */
#divResult.loading::after {
    content: 'Recherche en cours...';
    display: block;
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted, #6b7280);
    font-style: italic;
}

/* No Results State */
#divResult .no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted, #6b7280);
    font-style: italic;
}

/* Result Highlight (pour mettre en valeur le texte recherché) */
.display_box .highlight {
    background: rgba(77, 103, 232, 0.2);
    padding: 0.125rem 0.25rem;
    border-radius: 4px;
    font-weight: 600;
    color: var(--primary-dark, #233da8);
}

/* Product Image in Results (si vous avez des images) */
.display_box img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 1rem;
    border: 1px solid var(--border-light, #e5e7eb);
}

/* Product Info Layout */
.display_box .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.display_box .product-name {
    font-weight: 500;
    color: var(--text-dark, #1a1d29);
}

.display_box .product-ref {
    font-size: 0.875rem;
    color: var(--text-muted, #6b7280);
}

.display_box .product-price {
    font-weight: 600;
    color: var(--primary, #4d67e8);
    font-size: 1rem;
}

/* Animation d'apparition */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#divResult {
    animation: slideDown 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    #divResult {
        max-height: 300px;
        border-radius: 0 0 8px 8px;
    }

    .display_box {
        padding: 0.875rem 1rem;
        min-height: 50px;
        font-size: 0.875rem;
    }

    .display_box img {
        width: 32px;
        height: 32px;
    }
}

/* Focus visible pour l'accessibilité */
.display_box:focus-visible {
    outline: 2px solid var(--primary, #4d67e8);
    outline-offset: -2px;
}

/* Support clavier */
.display_box.keyboard-selected {
    background: linear-gradient(90deg, 
        rgba(77, 103, 232, 0.15) 0%,
        rgba(77, 103, 232, 0.08) 100%
    );
    padding-left: 1.5rem;
}

.display_box.keyboard-selected::before {
    width: 4px;
}

/* Navigation Bar */
nav.navbar {
    background: linear-gradient(to bottom, white 0%, #f8f9fa 100%);
    display: flex;
    justify-content: center;
    padding: 0;
    position: sticky;
    top: 85px;
    z-index: 1000;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

nav.navbar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 0.5rem;
}

nav.navbar ul li {
    display: inline;
}

nav.navbar ul li a {
    color: #1a1d29;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    display: block;
    padding: 1rem 1.25rem;
    transition: all 0.3s ease;
    position: relative;
}

nav.navbar ul li a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: #4d67e8;
    transition: width 0.3s ease;
}

nav.navbar ul li a:hover {
    color: #4d67e8;
}

nav.navbar ul li a:hover::before {
    width: 80%;
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    left: -500px;
    z-index: 1002;
    width: 500px;
    max-width: 100vw;
    height: 100vh;
    background: white;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.side-menu.open {
    left: 0;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1001;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media screen and (max-width: 1300px) {
    .bandeau_haut .respno {
        display: none;
    }
}
@media screen and (max-width: 870px) {

    .bandeau_haut {
        padding: 0.5rem 1rem;
    }

    .bandeau_haut .liens {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    header.header {
        grid-template-columns: 30px 1fr 50px 100px;
        grid-template-areas: 
            "burger logo user cart"
            "search search search search";
        height: auto;
        padding: 1rem;
        gap: 1rem;
    }

    header.header .search {
        max-width: 100%;
    }

    nav.navbar {
        top: auto;
    }

    nav.navbar ul {
        overflow-x: auto;
        justify-content: flex-start;
        padding: 0 1rem;
    }

    nav.navbar ul li a {
        padding: 0.75rem 1rem;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .droite {
        font-size: 0.75rem;
        gap: 0.5rem;
    }

    .stars-product label {
        width: 12px;
        height: 12px;
    }

    .side-menu {
        width: 100%;
        left: -100%;
    }
}