/* =========================================
   1. VARIABLES ET RÉGLAGES GLOBAUX
   ========================================= */
:root {
    --bleu-ciel: #87CEEB;
    --orange: #FF8C00;
    --dark: #2c3e50;
    --bg-light: #f8f9fa;
    --white: #ffffff;
}

* {
    box-sizing: border-box; /* Force le calcul de la largeur incluant padding et bordure */
}

body, html { 
    margin: 0; 
    padding: 0; 
    height: 100%; 
    font-family: 'Segoe UI', sans-serif; 
    background: var(--bg-light); 
    color: #333;
}

/* =========================================
   2. HEADER (BLANC - RECHERCHE CENTRÉE)
   ========================================= */
.main-header {
    background: var(--white);
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    border-bottom: 2px solid var(--bleu-ciel);
    position: relative;
}

.header-left { 
    display: flex; 
    align-items: center; 
    gap: 30px; 
}

.logo-area h1 { 
    margin: 0; 
    font-size: 22px; 
    color: var(--bleu-ciel); 
    white-space: nowrap; 
    font-weight: bold;
}

.logo-area span { color: var(--orange); }

/* Centrage absolu de la recherche */
.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    z-index: 10;
}

.search-container { display: flex; width: 100%; }

.search-container input {
    width: 100%;
    padding: 10px 20px;
    border: 2px solid var(--bleu-ciel);
    border-radius: 25px 0 0 25px;
    outline: none;
    font-size: 14px;
}

.search-container button {
    background: var(--orange);
    border: none;
    padding: 0 20px;
    color: var(--white);
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    transition: 0.3s;
}

.search-container button:hover { background: #e67e00; }

/* =========================================
   3. BARRE DE NAVIGATION ET AUTHENTIFICATION
   ========================================= */
.navbar {
    background-color: var(--bleu-ciel);
    height: 55px;
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    z-index: 999;
}

.nav-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: center; /* Centre le menu principal */
    align-items: center;
    padding: 0 20px;
}

.nav-list-center {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-list-center li a {
    color: var(--white);
    text-decoration: none;
    padding: 18px 20px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 13px;
    transition: 0.3s;
}

.nav-list-center li a:hover {
    background: var(--orange);
}

/* Bloc Profil / Quitter à l'extrême droite */
.nav-auth-right {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 20px; /* Espace fixe entre les deux boutons */
}

.nav-btn-auth {
    background: transparent !important;
    color: var(--white) !important;
    text-decoration: none !important;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
    border: none !important;
    cursor: pointer;
    white-space: nowrap; /* Empêche les boutons de se coller/empiler */
}

.nav-btn-auth:hover {
    color: var(--orange) !important;
    background: transparent !important;
}

/* =========================================
   4. CAROUSEL CATÉGORIES (80% LARGEUR)
   ========================================= */
.category-nav-container {
    width: 80%;
    margin: 20px auto;
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    padding: 10px 20px;
    border: 1px solid var(--bleu-ciel);
}

.category-strip {
    display: flex;
    overflow-x: auto; /* Active le défilement horizontal */
    scroll-behavior: smooth;
    gap: 35px;
    padding: 10px 0;
    align-items: center;
}

/* Cache la barre de défilement */
.category-strip::-webkit-scrollbar { display: none; }
.category-strip { -ms-overflow-style: none; scrollbar-width: none; }

.category-item {
    flex: 0 0 auto;
    text-align: center;
    text-decoration: none;
    color: #555;
    transition: 0.3s;
    border-bottom: 3px solid transparent;
    width: 100px;
}

.category-item img {
    width: 80px; /* Taille augmentée */
    height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto 10px;
}

.category-item span {
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.category-item:hover, .category-item.active {
    color: var(--orange);
    border-bottom-color: var(--orange);
    transform: translateY(-2px);
}

/* =========================================
   5. LAYOUT PRINCIPAL (CARTE / SIDEBAR)
   ========================================= */
.main-container { 
    display: flex; 
    height: calc(100vh - 135px); /* Ajusté pour Header + Nav */
}

#map { 
    flex-grow: 1; 
    height: 100%; 
    z-index: 1; 
}

.sidebar-promo { 
    width: 250px; 
    background: var(--white); 
    border-right: 1px solid #ddd; 
    padding: 20px; 
    overflow-y: auto;
}

/* =========================================
   6. CATALOGUE & FILTRES
   ========================================= */
.catalog-container {
    display: flex;
    max-width: 1400px;
    margin: 20px auto;
    gap: 25px;
    min-height: 600px;
}

.filter-sidebar {
    flex: 0 0 280px;
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    height: fit-content;
    position: sticky;
    top: 20px;
    border: 1px solid #eee;
}

.filter-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bleu-ciel);
}

.filter-input {
    width: 100% !important;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background-color: #f9f9f9;
    outline: none;
    transition: 0.3s;
}

.filter-input:focus {
    border-color: var(--bleu-ciel);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(135, 206, 235, 0.2);
}

/* Radios personnalisés */
.radio-label {
    display: block;
    text-align: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.radio-item input:checked + .radio-label {
    background: var(--bleu-ciel);
    color: var(--white);
    border-color: var(--bleu-ciel);
}

/* =========================================
   7. ÉTIQUETTES PRODUITS (CARDS)
   ========================================= */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    flex-grow: 1;
}

.product-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    transition: 0.3s;
}

.product-card:hover { transform: translateY(-5px); }

.product-info { padding: 20px; } /* Texte ne colle pas aux bords */

.product-card .price { 
    font-size: 20px; 
    color: var(--orange); 
    font-weight: bold; 
}

.quick-actions {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: 0.3s;
}

.product-card:hover .quick-actions { opacity: 1; }

.action-btn {
    width: 35px; height: 35px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--white);
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.action-btn.call { background: #27ae60; }
.action-btn.msg { background: var(--bleu-ciel); }

/* =========================================
   8. SECTION AVIS (ARTICLE.PHP)
   ========================================= */
.reviews-section {
    background: var(--white);
    border-radius: 15px;
    padding: 30px;
    margin-top: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.rating-picker label {
    font-size: 35px;
    color: #ddd;
    cursor: pointer;
    transition: 0.3s;
}

.rating-picker label:hover,
.rating-picker label:hover ~ label,
.rating-picker input:checked ~ label {
    color: var(--orange);
}

/* =========================================
   9. FOOTER
   ========================================= */
footer {
    clear: both;
    width: 100%;
    margin-top: 50px;
    background: #1a1a1a;
    padding: 40px 0;
    color: #bdc3c7;
}

/* =========================================
   10. RESPONSIVE
   ========================================= */
@media (max-width: 992px) {
    .header-center { width: 30%; }
    .category-nav-container { width: 95%; }
}

@media (max-width: 768px) {
    .nav-btn-auth span { display: none; } /* On ne garde que les icônes sur mobile */
    .main-container { flex-direction: column; }
    .sidebar-promo { width: 100%; height: auto; }
}
/* --- CAROUSEL DE CATÉGORIES AVEC BOUTONS --- */
.category-nav-wrapper {
    position: relative;
    width: 80%; /* Limite à 80% */
    margin: 20px auto;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #87CEEB;
}

.category-strip {
    display: flex;
    overflow-x: auto; /* Défilement tactile pour mobile */
    scroll-behavior: smooth;
    gap: 30px;
    padding: 15px 10px;
    scrollbar-width: none; /* Cache barre Firefox */
    width: 100%;
}

.category-strip::-webkit-scrollbar { display: none; } /* Cache barre Chrome/Safari */

/* Boutons Flèches */
.scroll-btn {
    background: white;
    border: none;
    color: #87CEEB;
    font-size: 24px;
    cursor: pointer;
    padding: 0 15px;
    height: 100%;
    z-index: 10;
    transition: 0.3s;
    border-radius: 15px;
}

.scroll-btn:hover { color: #FF8C00; background: #f9f9f9; }

/* Items */
.category-item {
    flex: 0 0 auto;
    width: 100px;
    text-align: center;
    text-decoration: none;
    color: #555;
    transition: 0.3s;
}

.category-item img {
    width: 80px; 
    height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto 8px;
}

.category-item span { font-size: 11px; font-weight: bold; white-space: nowrap; }
.category-item.active, .category-item:hover { color: #FF8C00; }