/* ==========================================================================
   ACF COMPUTER - DESIGN GÉNÉRAL & CATALOGUE DYNAMIQUE (SUPABASE)
   ========================================================================== */

/* --- SYSTEM DESIGN & VARIABLES --- */
:root {
    --primary-dark: #030f1e;   /* Ton bleu nuit/noir signature */
    --accent-gold: #ffb300;   /* Le doré emblématique ACF */
    --text-main: #0f172a;     /* Gris très foncé pour une lecture nette */
    --text-muted: #64748b;    /* Gris secondaire pour les sous-titres */
    --bg-light: #f8fafc;      /* Fond de page ultra-clair */
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --radius-lg: 12px;
    --radius-md: 8px;
    --shadow-sm: 0 2px 8px rgba(3, 15, 30, 0.04);
    --shadow-md: 0 10px 25px rgba(3, 15, 30, 0.08);
    --font-sans: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.5;
    scroll-behavior: smooth;
}

/* --- 1. BARRE DE NAVIGATION (NAVBAR) --- */
.main-header {
    background-color: rgba(3, 15, 30, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 22px;
}

.logo-acf { color: var(--accent-gold); }
.logo-text { color: var(--bg-white); }

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-gold);
}

.cart-icon-wrapper {
    position: relative;
    color: var(--bg-white);
    font-size: 22px;
    text-decoration: none;
    transition: color 0.2s;
}

.cart-icon-wrapper:hover { color: var(--accent-gold); }

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   BADGE COMPTE CONNECTÉ (photo de profil + déconnexion) — data-account-slot
   Rendu par auth.js sur toutes les pages ; identique à la version de style.css.
   ========================================================================== */
.acf-acc-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 4px 6px 4px 4px;
}

.acf-acc-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding-right: 2px;
}

.acf-acc-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gold);
    flex-shrink: 0;
}

.acf-acc-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.acf-acc-avatar-fallback {
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 12px;
}

.acf-acc-name {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.acf-acc-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    background: transparent;
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.acf-acc-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.acf-acc-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fecaca;
}

.acf-acc-login {
    color: #ffffff;
    font-size: 1.2rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.acf-acc-login:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* --- 2. HERO SECTION (BANNIÈRE) --- */
.hero-section {
    background: linear-gradient(135deg, #03152a 0%, #020914 100%);
    color: var(--bg-white);
    padding: 100px 20px;
    text-align: center;
    position: relative;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-tag {
    display: inline-block;
    background: rgba(255, 179, 0, 0.15);
    color: var(--accent-gold);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.hero-content h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-content p {
    color: #94a3b8;
    font-size: 17px;
    margin-bottom: 35px;
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--accent-gold);
    color: var(--primary-dark);
    text-decoration: none;
    padding: 14px 30px;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: transform 0.2s, background-color 0.2s;
}

.btn-hero:hover {
    transform: translateY(-2px);
    background-color: #e6a100;
}

/* --- 3. BLOC DE FILTRES ET RECHERCHE (CRUCIAL POUR 60+ APPAREILS) --- */
.filter-section {
    max-width: 1200px;
    margin: -40px auto 30px auto;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.filter-container {
    background-color: var(--bg-white);
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 35px rgba(3, 15, 30, 0.06);
    border: 1px solid var(--border-color);
}

/* Barre de recherche principale */
.search-box-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

#search-input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--text-main);
    background-color: #f8fafc;
    transition: all 0.2s;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-dark);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(3, 15, 30, 0.05);
}

/* Ligne secondaire : Catégories et Tris */
.filter-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.category-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab-btn {
    background-color: #f1f5f9;
    border: none;
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background-color: #e2e8f0;
    color: var(--text-main);
}

.tab-btn.active {
    background-color: var(--primary-dark);
    color: var(--bg-white);
}

.sort-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 14px;
}

#sort-select {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #fff;
    color: var(--text-main);
    font-weight: 500;
    cursor: pointer;
    outline: none;
}

/* --- 4. GRILLE DE PRODUITS ET ÉTATS DYNAMIQUES --- */
.shop-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 80px 20px;
}

.results-counter {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 500;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Structure unifiée des cartes produits */
.product-card {
    position: relative;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 520px;
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* --- Rupture de stock --- */
.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 5;
    border-radius: 4px;
}

.out-badge {
    background-color: #94a3b8;
    color: #ffffff;
}

.disabled-card {
    opacity: 0.75;
}

.product-card .add-to-cart-btn.disabled {
    background-color: #e2e8f0 !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
}

.product-card .add-to-cart-btn.disabled:hover {
    background-color: #e2e8f0 !important;
    color: #94a3b8 !important;
}

/* Zone d'affichage des textes descriptifs complets */
.product-card h3, 
.product-card .product-title {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    line-height: 1.4;
    height: auto; 
    overflow: visible; 
    text-overflow: clip;
    display: block;
    -webkit-line-clamp: unset;
    margin-bottom: 15px;
    color: var(--text-main);
}

/* Bloc Prix et alignement en bas de carte */
.product-card .product-price-box {
    margin-top: auto; 
    padding-top: 10px;
    margin-bottom: 12px;
}

/* Uniformisation globale des boutons Ajouter au panier actifs */
.product-card .add-to-cart-btn {
    background-color: var(--primary-dark) !important;
    color: var(--bg-white) !important;
    opacity: 1 !important;
    cursor: pointer !important;
    width: 100% !important;
    border: none !important;
    padding: 12px !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.2s ease !important;
}

.product-card .add-to-cart-btn:hover {
    background-color: var(--accent-gold) !important;
    color: var(--primary-dark) !important;
}

/* --- 5. CARROUSEL D'IMAGES DES APPAREILS --- */
.product-img-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 220px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.slides-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.slides-container img.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    box-sizing: border-box;
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    pointer-events: none;
}

.slides-container img.slide.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Boutons flèches du carrousel */
.slide-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(3, 15, 30, 0.7);
    color: var(--bg-white);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    opacity: 0; /* Cachées par défaut */
    transition: all 0.2s ease-in-out;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.product-card:hover .slide-btn {
    opacity: 1; /* Apparaissent au survol de la carte */
}

.slide-btn:hover {
    background: var(--accent-gold);
    color: var(--primary-dark);
    transform: translateY(-50%) scale(1.1);
}

.slide-btn.prev { left: 12px; }
.slide-btn.next { right: 12px; }

/* --- 6. LOADING PLACEHOLDER & NO-RESULTS CODES --- */
.loading-box {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.loading-box i {
    font-size: 40px;
    color: var(--primary-dark);
    margin-bottom: 15px;
}

.empty-results-box {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.empty-results-box i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 15px;
}

.empty-results-box h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

/* --- 6bis. TÉMOIGNAGES / AVIS CLIENTS --- */
.testimonials-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 70px 20px;
}

.testimonials-header {
    text-align: center;
    max-width: 620px;
    margin: 0 auto 40px auto;
}

.testimonials-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    margin: 12px 0 10px 0;
    color: var(--text-main);
}

.testimonials-header p {
    color: var(--text-muted);
    font-size: 14.5px;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

.testimonial-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.testimonial-stars {
    color: var(--accent-gold);
    font-size: 15px;
    margin-bottom: 12px;
}

.testimonial-comment {
    color: var(--text-main);
    font-size: 14.5px;
    line-height: 1.6;
    margin-bottom: 18px;
    min-height: 60px;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.testimonial-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-dark);
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.testimonial-author-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.testimonial-author-date {
    font-size: 12px;
    color: var(--text-muted);
}

/* --- 7. BOUTON WHATSAPP ET FOOTER --- */
.whatsapp-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 99;
    text-decoration: none;
    transition: transform 0.2s;
}

.whatsapp-floating-btn:hover {
    transform: scale(1.1) rotate(10deg);
}

.main-footer {
    background-color: var(--primary-dark);
    color: #94a3b8;
    text-align: center;
    padding: 30px 20px;
    font-size: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}