/* =========================================
   1. VARIABLES & THÈMES (Focus Bleu)
   ========================================= */
:root {
    /* Palette Mode Clair - Déclinaisons de Bleus */
    --primary-blue: #0044cc;    /* Bleu électrique pour les actions */
    --deep-blue: #002366;       /* Bleu nuit pour la navigation */
    --light-blue: #e6f0ff;      /* Bleu très clair pour les fonds */
    --accent-green: #2ecc71;    /* Vert discret pour les petits accents */
    --whatsapp-green: #25D366;
    
    --bg-main: #f0f4f8;
    --bg-card: #ffffff;
    --text-main: #1a202c;
    --text-light: #4a5568;
    
    --nav-bg: linear-gradient(135deg, #002366 0%, #0044cc 100%);
    --card-shadow: 0 10px 25px rgba(0, 68, 204, 0.1);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode {
    /* Palette Mode Sombre - Bleus profonds */
    --bg-main: #0a192f;         /* Bleu Navy très sombre */
    --bg-card: #112240;         /* Bleu de profondeur */
    --text-main: #e6f1ff;
    --text-light: #8892b0;
    
    --nav-bg: #020c1b;
    --primary-blue: #64ffda;    /* On peut utiliser un bleu-cyan en dark mode pour le contraste */
    --card-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

/* =========================================
   2. BASE & NAVIGATION
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: var(--transition);
}

header {
    background: var(--nav-bg);
    padding: 1.2rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    gap: 20px;
}

/* LOGO ANIMÉ (Bleu & Blanc) */
.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: 1px;
}

.logo span.electronics {
    color: #fff; /* Texte blanc sur fond bleu */
    opacity: 0.9;
    font-weight: 400;
}

.logo:hover .letter {
    color: #64ffda; /* Une touche de cyan au survol */
    transform: scale(1.1);
}

/* BARRE DE RECHERCHE (Bleu) */
.search-bar {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.search-bar input {
    width: 100%;
    padding: 10px 20px;
    border-radius: 8px; /* Style plus carré/moderne */
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: var(--transition);
}

.search-bar input:focus {
    background: #fff;
    color: var(--deep-blue);
    outline: none;
}

.search-bar button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.1rem;
}

.search-bar input:focus + button {
    color: var(--primary-blue);
}

/* =========================================
   3. CARTES PRODUITS (L'Élégance du Bleu)
   ========================================= */
.container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.section-title {
    color: var(--deep-blue);
    margin-bottom: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dark-mode .section-title {
    color: var(--primary-blue);
}

/* --- Style des Cartes (Cards) --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.card {
    background: var(--bg-card);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid rgba(0, 68, 204, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 68, 204, 0.15);
    border-color: var(--primary-blue);
}

/* Badge "Nouveau" ou "Promo" */
.badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-blue);
    color: white;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.img-container {
    height: 250px;
    overflow: hidden;
    background: #fdfdfd;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-container img {
    max-width: 80%;
    transition: transform 0.5s ease;
}

.card:hover .img-container img {
    transform: scale(1.1);
}

.info {
    padding: 25px;
}

.category {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info h3 {
    margin: 10px 0;
    font-size: 1.25rem;
    color: var(--text-main);
}

.price {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 20px;
}

.btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--primary-blue);
    color: white;
    text-decoration: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: 600;
    transition: 0.3s;
}

.btn-whatsapp:hover {
    background: var(--whatsapp-green);
    transform: scale(1.02);
}

/* --- Style du Footer --- */
.main-footer {
    background: var(--deep-blue);
    color: white;
    padding: 70px 0 20px 0;
    margin-top: 100px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 50px;
    padding: 0 20px;
}

.footer-section h4 {
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background: var(--primary-blue);
}

.footer-section p {
    color: #cbd5e0;
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul li a {
    color: #cbd5e0;
    text-decoration: none;
    transition: 0.3s;
}

.footer-section ul li a:hover {
    color: white;
    padding-left: 10px;
}

.socials {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

.socials a {
    color: white;
    background: rgba(255,255,255,0.1);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: 0.3s;
}

.socials a:hover {
    background: var(--primary-blue);
    transform: translateY(-5px);
}

.footer-bottom {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
    color: #a0aec0;
}

.info {
    padding: 1.5rem;
    border-top: 3px solid var(--primary-blue); /* Ligne de rappel bleue */
}

.price {
    font-size: 1.5rem;
    color: var(--primary-blue);
    font-weight: 700;
    margin: 10px 0;
}

/* BOUTON WHATSAPP (L'unique touche de vert) */
.btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary-blue); /* Bouton bleu par défaut */
    color: white;
    text-decoration: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-whatsapp:hover {
    background: var(--whatsapp-green); /* Devient vert au survol pour rappeler WhatsApp */
}

/* =========================================
   4. BOUTON THÈME
   ========================================= */
.theme-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.theme-btn:hover {
    background: #fff;
    color: var(--primary-blue);
}

/* --- STYLE DE LA MODALE --- */
.modal {
    display: none; 
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 35, 102, 0.8); /* Fond bleu transparent */
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--bg-card);
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 80%;
    max-width: 900px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.close-modal {
    position: absolute;
    right: 25px;
    top: 15px;
    font-size: 35px;
    cursor: pointer;
    color: var(--text-light);
    transition: 0.3s;
}

.close-modal:hover { color: var(--primary-blue); }

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.modal-img img {
    width: 100%;
    border-radius: 15px;
    object-fit: contain;
}

.modal-info h2 {
    font-size: 2rem;
    margin: 10px 0;
    color: var(--primary-blue);
}

#modal-description {
    margin: 20px 0;
    color: var(--text-light);
    line-height: 1.6;
}

.modal-price {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 30px;
    color: var(--text-main);
}

/* Responsive Modale */
@media (max-width: 768px) {
    .modal-body { grid-template-columns: 1fr; }
    .modal-content { width: 95%; margin: 10% auto; }
}

@keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} }

/* ==========================================================
   SYSTÈME RESPONSIVE UNIVERSEL (ACCUEIL + BOUTIQUE)
   ========================================================== */

/* 1. Grilles Intelligentes (S'adaptent toutes seules) */
.stats-grid, 
.service-grid, 
.product-grid, 
.partners-static-grid {
    display: grid;
    /* Crée autant de colonnes que possible sans descendre sous 280px */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    width: 100%;
}

/* 2. Ajustements pour Tablettes (Moins de 1024px) */
@media (max-width: 1024px) {
    .container { padding: 40px 5%; }
    .hero h1 { font-size: 2.8rem; }
    .contact-wrapper { grid-template-columns: 1fr 1fr; }
}

/* 3. Ajustements pour Smartphones (Moins de 768px) */
@media (max-width: 768px) {
    /* Header */
    .nav-links { display: none; } /* Cache le menu texte pour mobile */
    .header { padding: 10px 5%; }

    /* Hero Section */
    .hero { height: auto; padding: 80px 20px; text-align: center; }
    .hero h1 { font-size: 2rem; }
    .hero-btns { 
        display: flex; 
        flex-direction: column; 
        gap: 15px; 
        width: 100%;
    }
    .btn-primary, .btn-outline { 
        width: 100%; 
        justify-content: center; 
        margin-left: 0 !important; 
    }

    /* Sections de Contenu */
    .section-title { font-size: 1.8rem; margin-bottom: 30px; }
    
    /* Formulaire de Contact (Empilement vertical) */
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
    .contact-info, .contact-form-box {
        padding: 30px 20px;
    }

    /* Boutique (On force 1 seule colonne sur mobile très étroit) */
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    .social-icons { justify-content: center; }
}

/* 4. Optimisation pour très petits écrans (iPhone SE, etc.) */
@media (max-width: 400px) {
    .logo { font-size: 1.1rem; }
    .hero h1 { font-size: 1.6rem; }
    .price { font-size: 1.2rem; }
}

/* --- CONFIGURATION DU HEADER --- */
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- LA BARRE DE RECHERCHE (PC) --- */
.search-wrapper {
    flex-grow: 1; /* Elle prend tout l'espace central */
    display: flex;
    max-width: 600px;
    background: #f5f5f5;
    border-radius: 50px;
    padding: 5px 10px;
    border: 1px solid rgba(0,0,0,0.1);
}

.search-box {
    display: flex;
    align-items: center;
    flex: 1;
    padding-left: 15px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    padding: 10px;
}

.btn-search-main {
    background: #0044cc;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap; /* Empêche le texte du bouton de se couper */
}

/* --- LE FIX MOBILE (QUAND C'EST EN LIGNE) --- */
@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap; /* Autorise le passage à la ligne */
        padding: 10px;
    }

    .logo {
        order: 1; /* Reste en haut à gauche */
    }

    .theme-btn {
        order: 2; /* Reste en haut à droite */
    }

    .search-wrapper {
        order: 3; /* PASSE À LA LIGNE en dessous du logo */
        flex-basis: 100%; /* Prend toute la largeur de la nouvelle ligne */
        margin-top: 15px;
        max-width: none;
    }
    
    .btn-search-main {
        padding: 10px 15px; /* Plus compact sur mobile */
    }
}
/* --- MODAL PRODUIT (POPUP) --- */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Fond sombre transparent */
    backdrop-filter: blur(8px); /* Effet flou premium */
    display: none; /* Caché par défaut */
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

/* Le contenu de la fenêtre modal */
.modal-content {
    background: var(--white);
    width: 100%;
    max-width: 800px;
    max-height: 90vh; /* Empêche de dépasser de l'écran */
    border-radius: 25px;
    position: relative;
    overflow-y: auto; /* Permet de scroller si le texte est long */
    display: grid;
    grid-template-columns: 1fr 1fr; /* Image à gauche, texte à droite sur PC */
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- ADAPTATION MOBILE DU MODAL --- */
@media (max-width: 768px) {
    .modal-content {
        grid-template-columns: 1fr; /* Tout en une seule colonne sur mobile */
        max-height: 95vh;
        width: 95%;
    }

    .modal-image {
        height: 250px; /* Image moins haute sur mobile */
    }

    .modal-details {
        padding: 20px;
    }

    .modal-details h2 {
        font-size: 1.5rem;
    }
    
    .close-modal {
        top: 10px;
        right: 10px;
        background: var(--primary); /* Plus visible sur mobile */
        color: white;
        width: 40px;
        height: 40px;
        border-radius: 50%;
    }
}