/* VARIABLES GLOBALES */
:root { 
    --p: #000000; 
    --red: #e74c3c; 
    --bg: #fdfdfd;
    --card-bg: #ffffff;
}

/* BASE */
body { 
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; 
    margin: 0; 
    background: var(--bg); 
    color: #333; 
    overflow-x: hidden; 
}

/* HEADER & BIO */
header#storeHeader { background: white; padding: 40px 20px; text-align: center; }
header h1 { margin: 0; font-size: 28px; font-weight: 800; white-space: pre-wrap; }
.store-bio { max-width: 600px; margin: 10px auto; color: #666; line-height: 1.6; font-size: 15px; white-space: pre-wrap; word-break: break-word; }

/* BANNIÈRE PROMO */
#promo-banner { background: var(--red); color: white; padding: 25px 20px; text-align: center; margin-bottom: 30px; }
#promo-banner h2 { margin: 0; font-size: 22px; text-transform: uppercase; letter-spacing: 1px; white-space: pre-wrap; }
#promo-banner p { margin: 5px 0 0; opacity: 0.9; font-size: 15px; white-space: pre-wrap; }

/* GRILLE DE PRODUITS & CARTES (DESKTOP) */
.container { max-width: 1100px; margin: auto; padding: 0 20px 40px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-top: 40px; margin-bottom: 15px; }
.section-title { font-size: 1.5rem; font-weight: 700; display: flex; align-items: center; gap: 10px; margin: 0; }

/* Masquer "Balayer" par défaut sur Desktop */
.swipe-guide { display: none; }

/* Grid Desktop : 4 colonnes fixes */
.grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 25px; 
    justify-content: start; 
}

.card { background: var(--card-bg); border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit; transition: 0.3s; border: 1px solid #eee; display: flex; flex-direction: column; height: 100%; }
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); }
.img-box { width: 100%; aspect-ratio: 1/1; background: #fff; overflow: hidden; }
.img-box img { width: 100%; height: 100%; object-fit: cover; }
.info { padding: 15px; flex-grow: 1; }
.info h3 { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.3; height: 2.6em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: pre-wrap; }
.price-row { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.price { font-weight: bold; color: var(--p); font-size: 1.1rem; }
.old-price { color: #999; text-decoration: line-through; font-size: 0.85rem; }

/* VERSION MOBILE (PHONE VERSION) */
@media (max-width: 768px) {
    .container { padding: 0 0 40px 0; } 
    .section-header { padding: 0 15px; margin-top: 20px !important; margin-bottom: 10px !important; }
    
    /* Correction de l'espace sous le formulaire sur product.html */
    #product-form { margin-bottom: 10px !important; }
    .product-details-container { padding-bottom: 10px !important; }

    /* Affiche "Balayer" uniquement si plusieurs produits sur Mobile */
    .swipe-guide { 
        display: flex; 
        font-size: 12px; 
        color: #999; 
        align-items: center; 
        gap: 5px; 
        animation: slideHint 2s infinite; 
    }

    /* Recache "Balayer" si un seul produit est présent sur Mobile */
    .section-header:has(+ .grid .card:only-child) .swipe-guide {
        display: none !important;
    }
    
    .grid { 
        display: flex; 
        overflow-x: auto; 
        scroll-snap-type: x mandatory; 
        gap: 15px; 
        padding: 0 15px 15px 15px;
        scrollbar-width: none; 
        justify-content: flex-start;
    }

    /* Centrage du produit unique sur Mobile */
    .grid:has(.card:only-child) {
        justify-content: center;
    }

    .grid::-webkit-scrollbar { display: none; }
    .card { min-width: 75vw; max-width: 80vw; scroll-snap-align: center; }
    .section-title { font-size: 1.2rem; }
}

@keyframes slideHint { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }

/* --- NOUVEAU LOADER LINÉAIRE AVEC EFFETS --- */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.progress-container {
    width: 200px;
    height: 6px; /* Légèrement plus épais pour mieux voir l'effet */
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--p);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px var(--p); /* Lueur autour de la barre */
    position: relative;
    overflow: hidden;
}

/* Effet de brillance qui traverse la barre en continu */
.progress-bar::after {
    content: "";
    position: absolute;
    top: 0; 
    left: -100%;
    width: 100%; 
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shine 1.5s infinite;
}

@keyframes shine {
    100% { left: 100%; }
}

/* Texte avec animation de pulsation douce */
.loader-text {
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    text-align: center;
    animation: pulseText 1.8s infinite ease-in-out;
}

@keyframes pulseText {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.98); }
}

/* Animation de la bannière mobile dans nav-SaaS.js */
@media (max-width: 768px) {
    #banner-content {
        display: inline-block !important;
        width: auto !important;
        text-align: left !important;
        padding-left: 100% !important;
        animation: navMarquee 12s linear infinite;
    }
}

@keyframes navMarquee {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-100%); }
}