/* ==========================================================================
   CHARTE GRAPHIQUE GRÉZAUD DISTRIBUTION B2B (EDITION 2026)
   ========================================================================== */
:root {
    --gold-primary: #D4AF37;
    --gold-hover: #B3922E;
    --dark-slate: #111827;
    --text-muted: #4B5563;
    --bg-main: #F4F6F8;
    --bg-card: #FFFFFF;
    --border-color: #E5E7EB;
    --radius-sm: 6px;
    --radius-md: 12px;
    --shadow-subtle: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 20px rgba(0,0,0,0.04);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);
    --font-b2b: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: all 0.2s ease-in-out;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

/* Structure pour forcer le footer en bas */
body { 
    display: flex; 
    flex-direction: column; 
    background-color: var(--bg-main); 
    color: var(--dark-slate); 
    font-family: var(--font-b2b); 
    -webkit-font-smoothing: antialiased; 
}

main { 
    flex: 1 0 auto; /* Permet au contenu de pousser le footer vers le bas */
}

.site-footer { 
    flex-shrink: 0; /* Empêche le footer de se déformer */
    background: #111827; 
    color: #FFF; 
    text-align: center; 
    padding: 20px; 
    font-size: 0.85rem; 
}

.hidden { display: none !important; }

/* NAVBAR & HEADER */
.main-header { background: #FFFFFF; border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 1000; box-shadow: var(--shadow-subtle); }
.header-container { display: flex; justify-content: space-between; align-items: center; max-width: 1300px; margin: 0 auto; padding: 12px 24px; }
.site-logo { height: 48px; width: auto; object-fit: contain; }
.nav-menu { display: flex; gap: 24px; }
.nav-link { text-decoration: none; color: var(--dark-slate); font-weight: 600; font-size: 0.9rem; transition: var(--transition); }
.nav-link:hover, .nav-link.active { color: var(--gold-primary); }
.header-actions { display: flex; align-items: center; gap: 12px; }

/* BOUTONS */
.cta-gold, .cta-outline { padding: 10px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.85rem; cursor: pointer; text-decoration: none; transition: var(--transition); text-align: center; }
.cta-gold { background: var(--gold-primary); color: #FFFFFF; border: none; }
.cta-gold:hover { background: var(--gold-hover); }
.cta-outline { background: transparent; color: var(--dark-slate); border: 2px solid var(--dark-slate); }
.cta-outline:hover { background: var(--dark-slate); color: #FFFFFF; }
.full-width { width: 100%; display: block; }
.hamburger-menu { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.cart-toggle-btn {
    display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 50px; cursor: pointer;
    background: #f8f9fa; border: 1px solid var(--border-color); font-weight: 600; color: var(--dark-slate); transition: var(--transition);
}
.cart-toggle-btn:hover { background: #fff; border-color: var(--gold-primary); box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15); }
.cart-badge { background: var(--gold-primary); color: #fff; font-size: 0.7rem; padding: 2px 8px; border-radius: 20px; font-weight: 800; }

.cart-icon { font-size: 1.1rem; }

/* Design formulaire panier amélioré */
.cart-footer form { display: flex; flex-direction: column; gap: 12px; padding: 15px; background: #f9fafb; border-radius: 8px; border: 1px solid #e5e7eb; }
.cart-footer label { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; color: #6b7280; letter-spacing: 0.5px; }
.cart-footer input, .cart-footer textarea { width: 100%; padding: 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; font-family: inherit; transition: 0.3s; }
.cart-footer input:focus, .cart-footer textarea:focus { border-color: #D4AF37; outline: none; box-shadow: 0 0 0 3px rgba(212,175,55,0.15); }
.cart-footer textarea { resize: none; }
.cart-footer button[type="submit"] { background: #111827; color: #D4AF37; border: 1px solid #D4AF37; padding: 12px; font-weight: 800; text-transform: uppercase; border-radius: 6px; cursor: pointer; transition: 0.3s; }
.cart-footer button[type="submit"]:hover { background: #D4AF37; color: #111827; box-shadow: 0 4px 12px rgba(212,175,55,0.3); }

/* HERO SECTIONS */
.hero-section { display: grid; grid-template-columns: 1.2fr 0.8fr; max-width: 1300px; margin: 40px auto; padding: 0 24px; gap: 40px; align-items: center; }
.hero-content h1 { font-size: 2.5rem; font-weight: 800; line-height: 1.2; color: var(--dark-slate); margin-bottom: 16px; }
.hero-content p { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 24px; line-height: 1.5; }
.hero-ctas { display: flex; gap: 12px; }
.hero-img { width: 100%; height: 380px; object-fit: cover; border-radius: var(--radius-md); box-shadow: var(--shadow-md); }

.key-metrics { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 1300px; margin: 40px auto; background: #FFF; padding: 24px; border-radius: var(--radius-md); border: 1px solid var(--border-color); text-align: center; gap: 20px; }
.metric-card h3 { font-size: 2rem; color: var(--gold-primary); font-weight: 800; }
.metric-card p { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; margin-top: 4px; }

.services-section, .catalog-section { max-width: 1300px; margin: 60px auto; padding: 0 24px; }
.section-title h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 8px; }
.section-title p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 24px; }
.b2b-alert-banner { background: #FFFBEB; border: 1px solid #FDE68A; color: #78350F; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500; }

.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service-box { background: #FFF; padding: 24px; border-radius: var(--radius-md); border: 1px solid var(--border-color); }
.service-box h3 { font-size: 1.1rem; margin-bottom: 8px; }
.service-box p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.4; }

/* FILTRES DU CATALOGUE */
.filter-navigation { background: #FFFFFF; padding: 24px; border-radius: var(--radius-md); border: 1px solid var(--border-color); margin-bottom: 32px; box-shadow: var(--shadow-subtle); }
.filter-group { display: flex; align-items: center; gap: 8px; padding: 10px 0; flex-wrap: wrap; }
.filter-group:not(:last-child) { border-bottom: 1px dashed var(--border-color); }
.filter-label { font-weight: 700; font-size: 0.85rem; min-width: 150px; color: var(--text-muted); }
.filter-btn { background: #FFFFFF; border: 1px solid var(--border-color); color: var(--dark-slate); padding: 6px 14px; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.8rem; font-weight: 600; transition: var(--transition); }
.filter-btn:hover, .filter-btn.active { background: var(--dark-slate); color: #FFFFFF; border-color: var(--dark-slate); }

/* GRID PRODUITS CORRIGÉ (PLUS DE DIAGONALE) */
.products-grid { width: 100%; display: block; }
.products-view-block, .cards-wrapper { 
    display: grid !important; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important; 
    gap: 24px !important; 
    width: 100% !important;
    clear: both;
}
.products-view-block h3 { grid-column: 1 / -1; margin-bottom: 16px; font-size: 1.3rem; }

.product-card { 
    background: var(--bg-card); 
    border-radius: var(--radius-md); 
    border: 1px solid var(--border-color); 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    box-shadow: var(--shadow-subtle); 
    transition: var(--transition);
    height: 100%;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--gold-primary); }

.product-img-zone { 
    height: 220px; 
    background: #FFFFFF; 
    padding: 20px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    position: relative; 
    cursor: pointer;
    border-bottom: 1px solid #F1F5F9;
}
.product-img-zone img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hover-overlay { position: absolute; inset: 0; background: rgba(17,24,39,0.4); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; opacity: 0; color: #FFF; font-weight: 600; font-size: 0.8rem; transition: var(--transition); }
.product-card:hover .hover-overlay { opacity: 1; }

.product-meta { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.product-meta h4 { font-size: 0.95rem; font-weight: 700; line-height: 1.4; color: var(--dark-slate); min-height: 42px; display: -webkit-box; line-clamp: 2; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px; }
.product-vol-info { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; font-weight: 500; height: 16px; }
.unit-badge { background: #EDF2F7; color: #4A5568; padding: 4px 8px; font-size: 0.7rem; font-weight: 700; border-radius: 4px; align-self: flex-start; text-transform: uppercase; margin-bottom: 16px; }

.price-action-area { margin-top: auto; border-top: 1px solid #F1F5F9; padding-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pro-price-call { font-size: 0.9rem; font-weight: 700; color: var(--gold-primary); }
.locked-price-text { font-size: 0.75rem; font-weight: 700; color: #9B2C2C; background: #FFF5F5; padding: 4px 8px; border-radius: 4px; border: 1px solid #FED7D7; }
.quick-add-btn { background: var(--dark-slate); color: #FFFFFF; border: none; padding: 8px 14px; font-size: 0.75rem; font-weight: 700; border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); }

/* MODALS & PANIER (Inchangés) */
.modal-overlay { position: fixed; inset: 0; background: rgba(11, 17, 26, 0.6); backdrop-filter: blur(4px); display: none; justify-content: center; align-items: center; z-index: 3000; padding: 16px; }
.modal-overlay.active { display: flex !important; }
.modal-card { background: #FFFFFF; border-radius: var(--radius-md); padding: 32px; width: 100%; max-width: 460px; position: relative; box-shadow: var(--shadow-lg); }
.quickview-card { max-width: 680px; }
.close-modal-btn { position: absolute; top: 16px; right: 16px; font-size: 1.4rem; background: none; border: none; cursor: pointer; color: var(--text-muted); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.close-modal-btn:hover { background: #F1F5F9; }
.quickview-layout { display: flex; gap: 24px; margin-top: 8px; }
.qv-image-pane { flex: 1; background: #FFF; border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 16px; display: flex; align-items: center; justify-content: center; min-height: 220px; }
.qv-image-pane img { max-width: 100%; max-height: 100%; object-fit: contain; }
.qv-details-pane { flex: 1.2; display: flex; flex-direction: column; }
.price-main { font-size: 1.4rem; font-weight: 800; color: var(--gold-primary); }

.cart-sidebar { position: fixed; top: 0; right: -420px; width: 400px; height: 100vh; background: #FFFFFF; box-shadow: var(--shadow-lg); transition: right 0.25s ease-in-out; z-index: 2000; padding: 24px; display: flex; flex-direction: column; }
.cart-sidebar.open { right: 0 !important; }
.cart-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 16px; }
.close-cart-btn { background: none; border: none; font-size: 1.6rem; cursor: pointer; color: #FFFFFF; }
.cart-items-wrapper { flex-grow: 1; overflow-y: auto; padding: 12px 0; }
.cart-item-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #F1F5F9; position: relative; align-items: center; }
.cart-item-row img { width: 46px; height: 46px; object-fit: contain; border: 1px solid var(--border-color); border-radius: 4px; }
.delete-item-btn { position: absolute; right: 0; background: none; border: none; color: #EF4444; font-weight: bold; cursor: pointer; }

#category-loading-indicator { font-weight: 600; text-align: center; color: var(--text-muted); padding: 40px 0; width: 100%; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--border-color); border-top-color: var(--gold-primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-control input { width: 100%; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); outline: none; }

@media (max-width: 992px) {
    .hero-section { grid-template-columns: 1fr; text-align: center; gap: 24px; }
    .hero-img { height: 260px; }
    .key-metrics { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .services-grid { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 768px) {
    .hamburger-menu { display: block; }
}
@media (max-width: 480px) {
    .cart-sidebar { width: 100%; right: -100%; }
    .quickview-layout { flex-direction: column; }
}

/* Style des éléments du panier pour correspondre au formulaire */
.cart-items-wrapper {
    padding: 20px;
}

.cart-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.cart-item-row h5 {
    font-size: 0.9rem;
    color: #111827;
    margin: 0;
}

.cart-item-row button {
    background: none;
    border: none;
    color: #9B2C2C;
    cursor: pointer;
    font-weight: bold;
}

.cart-sidebar {
    background: #ffffff;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
}

.cart-header {
    background: #111827;
    color: #ffffff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 992px) {
    .hero-section { grid-template-columns: 1fr; text-align: center; }
    .key-metrics { grid-template-columns: repeat(2, 1fr); }
    .services-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .hamburger-menu { display: block; }
    .nav-menu { 
        display: none; flex-direction: column; position: absolute; top: 72px; left: 0; width: 100%; 
        background: white; padding: 20px; border-bottom: 1px solid var(--border-color); 
    }
    .nav-menu.active { display: flex; }
    .filter-group { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .cart-sidebar { width: 100%; right: -100%; }
    .hero-content h1 { font-size: 1.8rem; }
    .products-view-block { grid-template-columns: 1fr; }
}

#cookie-banner { position: fixed; bottom: 20px; right: 20px; width: 320px; padding: 20px; background: #fff; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); border: 1px solid #e5e7eb; z-index: 9999; }
.cb-buttons { display: flex; gap: 10px; margin-top: 15px; }
.cb-buttons .cta-gold { background: #D4AF37; color: #111827; border: none; padding: 8px 16px; border-radius: 4px; font-weight: 700; cursor: pointer; }

/* --- FOOTER --- */
.site-footer { background: #111827; color: #FFF; text-align: center; padding: 30px; font-size: 0.85rem; margin-top: auto; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--border-color); border-top-color: var(--gold-primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }