/* --- 1. VARIABLES & CONFIGURATION (Premium Palette) --- */
:root {
    --primary: #0033A0; 
    --primary-light: #4772e6;
    --primary-dark: #002266;
    --accent: #FFC107;
    --accent-hover: #ffca2c;
    --bg-body: #F4F6F9;
    --bg-card: #FFFFFF;
    --text-main: #2C3E50;
    --text-light: #64748B;
    --border: #E2E8F0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 16px rgba(0,0,0,0.08);
    --shadow-hover: 0 15px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --header-height: 80px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="dark"] {
    --bg-body: #0F172A;
    --bg-card: #1E293B;
    --text-main: #F1F5F9;
    --text-light: #94A3B8;
    --border: #334155;
    --primary: #3B82F6;
    --shadow-md: 0 8px 16px rgba(0,0,0,0.4);
}

/* --- 2. RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; outline: none; }

body {
    background: var(--bg-body);
    color: var(--text-main);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; display: block; }
section { padding: 100px 8%; position: relative; }

/* --- 3. HEADER --- */
header {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

[data-theme="dark"] header {
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.logo img { height: 45px; transition: transform 0.3s; }
.logo:hover img { transform: scale(1.05); }

nav ul { display: flex; gap: 35px; }

nav ul li a {
    font-weight: 600; font-size: 0.9rem; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-main); position: relative; padding-bottom: 5px;
}

nav ul li a::after {
    content: ''; position: absolute; width: 0; height: 2px;
    bottom: 0; left: 0; background: var(--primary); transition: var(--transition);
}

nav ul li a:hover::after, nav ul li a.active::after { width: 100%; }
nav ul li a:hover, nav ul li a.active { color: var(--primary); }

.controls { display: flex; gap: 15px; align-items: center; }
.hamburger { display: none; }

.btn-icon {
    background: transparent; border: 2px solid var(--border);
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-main); transition: var(--transition);
}

.btn-icon:hover { border-color: var(--primary); color: var(--primary); transform: rotate(15deg); }

/* --- 4. HERO SECTION --- */
.hero-small {
    height: 50vh;
    background-size: cover; background-position: center; background-attachment: fixed;
    display: flex; align-items: center; justify-content: center;
    text-align: center; position: relative; margin-top: var(--header-height);
}

.hero-small::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(0, 34, 102, 0.85), rgba(0, 51, 160, 0.7));
}

.hero-small .reveal { position: relative; z-index: 2; color: white; max-width: 800px; padding: 0 20px; }
.hero-small h1 { font-size: 3rem; font-weight: 800; margin-bottom: 20px; text-shadow: 0 4px 10px rgba(0,0,0,0.3); }

/* --- 5. UI ELEMENTS --- */
.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-size: 2.5rem; color: var(--primary); margin-bottom: 15px; position: relative; display: inline-block; }
.section-header h2::after { content: ''; display: block; width: 60px; height: 4px; background: var(--accent); margin: 10px auto 0; border-radius: 2px; }

.btn {
    padding: 12px 30px; background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white; border-radius: 50px; font-weight: 700; text-transform: uppercase;
    font-size: 0.85rem; letter-spacing: 0.5px; border: none; cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 51, 160, 0.3); transition: var(--transition); display: inline-block;
}
.btn:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0, 51, 160, 0.5); }
.btn-outline { background: transparent; border: 2px solid white; box-shadow: none; }
.btn-outline:hover { background: white; color: var(--primary); }

/* --- 6. GRIDS --- */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; }

.card {
    background: var(--bg-card); border-radius: var(--radius); padding: 30px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    transition: var(--transition); position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-10px); box-shadow: var(--shadow-hover); border-color: transparent; }
.card i { font-size: 2.5rem; color: var(--primary); margin-bottom: 20px; }
.card h3 { font-size: 1.4rem; margin-bottom: 15px; color: var(--text-main); }
.card p { color: var(--text-light); font-size: 0.95rem; }

/* --- 7. CATALOGUE STYLES --- */
.catalog-layout { display: flex; gap: 40px; align-items: flex-start; }

.filter-sidebar {
    width: 280px; flex-shrink: 0; background: var(--bg-card); padding: 30px;
    border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    position: sticky; top: 100px;
}

.filter-group { margin-bottom: 25px; }
.filter-group h4 { font-size: 1.1rem; color: var(--primary); margin-bottom: 15px; border-bottom: 2px solid var(--border); padding-bottom: 5px; }
.filter-option { display: block; margin-bottom: 10px; color: var(--text-main); cursor: pointer; font-size: 0.95rem; }
.filter-option input { margin-right: 10px; accent-color: var(--primary); }

.catalog-grid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 30px; }

.product-card {
    background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border);
    transition: var(--transition); display: flex; flex-direction: column; position: relative;
    /* Important pour le filtre JS: display: none géré par script */
}
.product-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-5px); border-color: var(--primary); }

.product-badge {
    position: absolute; top: 15px; left: 15px; background: var(--accent); color: #000;
    padding: 5px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: bold; z-index: 2;
}

.product-img-wrapper {
    height: 220px; padding: 20px; background: #fff; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border);
}
.product-card img { max-height: 100%; width: auto; object-fit: contain; }

.product-details { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.product-brand { font-size: 0.8rem; text-transform: uppercase; color: var(--text-light); font-weight: 600; }
.product-card h3 { font-size: 1.1rem; margin: 5px 0 15px; color: var(--text-main); }

.specs-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.spec-tag { background: var(--bg-body); padding: 3px 8px; border-radius: 4px; font-size: 0.75rem; color: var(--text-light); border: 1px solid var(--border); }

.btn-product {
    width: 100%; padding: 10px; background: transparent; border: 2px solid var(--primary);
    color: var(--primary); text-align: center; border-radius: 8px; font-weight: bold;
    cursor: pointer; transition: 0.3s; margin-top: auto;
}
.btn-product:hover { background: var(--primary); color: white; }

/* --- 8. BLOG DESIGN --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); /* Responsive auto-fill */
    gap: 40px;
}

.blog-card {
    background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border); transition: var(--transition);
    display: flex; flex-direction: column; height: 100%;
}

.blog-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); }

.blog-img {
    height: 220px; width: 100%; object-fit: cover;
}

.blog-content { padding: 25px; flex: 1; display: flex; flex-direction: column; }

.blog-cat { color: var(--accent); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; margin-bottom: 10px; display: block; }
.blog-card h3 { font-size: 1.3rem; margin-bottom: 15px; line-height: 1.3; color: var(--text-main); }
.blog-card p { color: var(--text-light); font-size: 0.95rem; margin-bottom: 20px; line-height: 1.6; }

.read-more-btn {
    margin-top: auto; color: var(--primary); font-weight: 700; display: inline-flex; align-items: center; gap: 8px;
}
.read-more-btn:hover { gap: 12px; } /* Petite animation flèche */

/* --- 9. FOOTER --- */
footer { background: #0b1120; color: #cbd5e1; padding: 60px 8% 30px; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; }
.footer-col h3 { color: white; margin-bottom: 20px; border-left: 3px solid var(--accent); padding-left: 15px; }
.copyright { text-align: center; border-top: 1px solid rgba(255,255,255,0.1); margin-top: 50px; padding-top: 20px; font-size: 0.85rem; }

/* --- 10. MODAL --- */
.modal-overlay {
    background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(5px);
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 2000;
    display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s;
}
.modal-overlay.open { display: flex; opacity: 1; }
.modal-content {
    background: var(--bg-card); width: 90%; max-width: 700px; padding: 40px;
    border-radius: 20px; position: relative; max-height: 85vh; overflow-y: auto;
}
.close-modal { position: absolute; top: 20px; right: 25px; font-size: 1.8rem; cursor: pointer; }

/* --- 11. RESPONSIVE --- */
@media (max-width: 900px) {
    .catalog-layout { flex-direction: column; }
    .filter-sidebar { width: 100%; position: static; margin-bottom: 30px; }
}

@media (max-width: 768px) {
    nav ul {
        position: fixed; top: 80px; left: 0; width: 100%; height: 0; overflow: hidden;
        background: var(--bg-card); flex-direction: column; padding-top: 0;
        transition: height 0.4s ease; box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }
    nav ul.show { height: calc(100vh - 80px); padding-top: 40px; align-items: center; }
    .hamburger { display: block; font-size: 1.8rem; cursor: pointer; color: var(--text-main); }
    section { padding: 60px 5%; }
    .hero-small { height: 40vh; }
    .hero-small h1 { font-size: 2rem; }
}