/* ============================================================
   DIENCHANMULTIREFLEX.COM - Stylesheet principal
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #2d2d2d;
    background: #f8f7f5;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: #6b4c8a; text-decoration: none; transition: color .2s; }
a:hover { color: #4a2d6b; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
h1, h2, h3, h4 { line-height: 1.3; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- HEADER --- */
.site-header {
    background: #331d35;
    color: #fff;
    padding: 0 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}
.logo { display: flex; flex-direction: column; color: #fff; }
.logo-text { font-size: 1.2rem; font-weight: 700; letter-spacing: .5px; }
.logo-tagline { font-size: .7rem; opacity: .7; font-weight: 300; }
.main-nav ul { display: flex; gap: 24px; }
.main-nav a { color: rgba(255,255,255,.85); font-size: .9rem; font-weight: 500; transition: color .2s; }
.main-nav a:hover { color: #fff; }
.header-actions { display: flex; align-items: center; gap: 16px; }

/* Sélecteur devise */
.currency-selector select {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: .85rem;
    cursor: pointer;
}
.currency-selector select option { color: #333; background: #fff; }

/* Mini panier header */
.mini-cart-btn {
    background: none; border: none; color: #fff; cursor: pointer;
    position: relative; padding: 8px;
}
.cart-count {
    position: absolute; top: 0; right: 0;
    background: #e74c3c; color: #fff;
    font-size: .65rem; font-weight: 700;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* --- HERO --- */
.hero {
    text-align: center;
    padding: 60px 20px 40px;
}
.hero h1 {
    font-size: 2rem;
    color: #331d35;
    margin-bottom: 12px;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

/* --- FILTRES --- */
.filters-section {
    margin-bottom: 40px;
}
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
    padding: 20px 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.filter-search {
    flex: 1;
    min-width: 220px;
    position: relative;
}
.filter-search input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 2px solid #e0dde3;
    border-radius: 8px;
    font-size: .95rem;
    transition: border-color .2s;
}
.filter-search input:focus {
    outline: none;
    border-color: #6b4c8a;
}
.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: .4;
}
.filter-group label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #888;
    margin-bottom: 6px;
}
.filter-buttons {
    display: flex;
    gap: 6px;
}
.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e0dde3;
    background: #fff;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}
.filter-btn:hover { border-color: #6b4c8a; color: #6b4c8a; }
.filter-btn.active {
    background: #6b4c8a;
    color: #fff;
    border-color: #6b4c8a;
}
.filter-group select {
    padding: 10px 14px;
    border: 2px solid #e0dde3;
    border-radius: 8px;
    font-size: .9rem;
    background: #fff;
    cursor: pointer;
    min-width: 180px;
}
.filter-group select:focus { outline: none; border-color: #6b4c8a; }

/* --- GRILLE TROUBLES --- */
.troubles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}
.trouble-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform .2s, box-shadow .2s;
}
.trouble-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
}
.trouble-card-link { display: block; color: inherit; }
.trouble-card-image {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #eee;
}
.trouble-card-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.trouble-card:hover .trouble-card-image img { transform: scale(1.05); }
.trouble-card-body { padding: 20px; }
.trouble-discipline-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
}
.badge-dc { background: #e8f4fd; color: #2980b9; }
.badge-cb { background: #fde8f0; color: #c0392b; }
.trouble-card-body h2 {
    font-size: 1.15rem;
    margin-bottom: 6px;
    color: #331d35;
}
.trouble-partie {
    display: flex; align-items: center; gap: 4px;
    font-size: .8rem; color: #999; margin-bottom: 8px;
}
.trouble-desc {
    font-size: .9rem;
    color: #666;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.trouble-tools-count {
    font-size: .8rem;
    font-weight: 600;
    color: #6b4c8a;
}
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* --- SEO CONTENT --- */
.seo-content {
    padding: 40px 0 60px;
    max-width: 800px;
}
.seo-content h2 { font-size: 1.5rem; color: #331d35; margin-bottom: 16px; }
.seo-content h3 { font-size: 1.2rem; color: #4a2d6b; margin: 24px 0 12px; }
.seo-content p { color: #555; margin-bottom: 16px; }

/* --- PAGE TROUBLE DETAIL --- */
.trouble-page { padding-top: 20px; }
.breadcrumb {
    font-size: .8rem; color: #999;
    margin-bottom: 24px;
    display: flex; align-items: center; gap: 8px;
}
.breadcrumb a { color: #6b4c8a; }
.breadcrumb .sep { color: #ccc; }
.trouble-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    align-items: start;
}
.trouble-header { margin-bottom: 32px; }
.trouble-header h1 { font-size: 1.8rem; color: #331d35; margin: 8px 0; }
.trouble-partie-corps {
    display: flex; align-items: center; gap: 6px;
    font-size: .9rem; color: #888; margin-bottom: 12px;
}
.trouble-description { font-size: 1.05rem; color: #555; }

/* Outils cards */
.outils-section h2 { font-size: 1.3rem; color: #331d35; margin-bottom: 20px; }
.outil-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    margin-bottom: 16px;
    transition: box-shadow .2s;
}
.outil-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.outil-image {
    flex-shrink: 0;
    width: 120px; height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0eef2;
}
.outil-image img { width: 100%; height: 100%; object-fit: cover; }
.outil-info { flex: 1; }
.outil-info h3 { font-size: 1rem; color: #331d35; margin-bottom: 8px; }
.outil-instruction { font-size: .85rem; color: #666; margin-bottom: 12px; }
.outil-actions { display: flex; align-items: center; gap: 16px; }
.outil-prix { font-size: 1.1rem; font-weight: 700; color: #331d35; }

/* Fascicule, vidéo, article */
.fascicule-section, .video-section, .article-section, .conseils-section, .faq-section {
    margin-top: 32px;
}
.fascicule-section h2, .video-section h2, .article-section h2, .conseils-section h2, .faq-section h2 {
    font-size: 1.2rem; color: #331d35; margin-bottom: 16px;
}
.fascicule-card, .video-card, .article-card {
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.fascicule-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.fascicule-info h3 { font-size: 1rem; margin-bottom: 6px; }
.fascicule-meta { font-size: .8rem; color: #999; margin-top: 6px; }
.fascicule-actions { text-align: right; white-space: nowrap; }
.fascicule-prix { display: block; font-size: 1.1rem; font-weight: 700; color: #331d35; margin-bottom: 8px; }
.fascicule-rabais-info {
    display: inline-block;
    font-size: .75rem;
    color: #e74c3c;
    font-weight: 600;
    margin-bottom: 4px;
}

/* FAQ */
.faq-item {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.faq-item summary {
    padding: 14px 18px;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    color: #331d35;
}
.faq-item p {
    padding: 0 18px 14px;
    font-size: .9rem;
    color: #666;
}

/* --- Boutons --- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
}
.btn-primary {
    background: #6b4c8a;
    color: #fff;
}
.btn-primary:hover { background: #5a3d76; }
.btn-secondary {
    background: #f0eef2;
    color: #6b4c8a;
}
.btn-secondary:hover { background: #e0dce5; }
.btn-add-cart {
    background: #6b4c8a;
    color: #fff;
    padding: 8px 16px;
    font-size: .85rem;
}
.btn-add-cart:hover { background: #5a3d76; }
.btn-add-cart:disabled {
    background: #ccc; cursor: not-allowed;
}
.btn-add-cart.added {
    background: #27ae60;
}

/* --- PANIER LATERAL (sidebar) --- */
.cart-sidebar {
    position: relative;
}
.cart-sticky {
    position: sticky;
    top: 90px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    padding: 24px;
}
.cart-title {
    font-size: 1.1rem;
    color: #331d35;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0eef2;
}

/* Cart items */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f3f7;
    transition: all .3s;
}
.cart-item-inactive {
    opacity: .45;
}
.cart-item-active {
    opacity: 1;
}
.cart-item-info { flex: 1; }
.cart-item-name {
    display: block;
    font-size: .82rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}
.cart-item-prix {
    font-size: .85rem;
    font-weight: 600;
    color: #999;
    transition: color .3s;
}
.cart-item-active .cart-item-prix {
    color: #331d35;
}
.cart-item-rabais-alert {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    width: 18px; height: 18px;
    border-radius: 50%;
    text-align: center;
    font-size: .75rem;
    font-weight: 700;
    line-height: 18px;
    margin-left: 6px;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}
.cart-item-offert {
    display: inline-block;
    font-size: .8rem;
    font-weight: 700;
    color: #27ae60;
    margin-left: 6px;
}
.cart-item-toggle {
    background: none;
    border: 2px solid #e0dde3;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    color: #6b4c8a;
    transition: all .2s;
    flex-shrink: 0;
    margin-left: 10px;
}
.cart-item-toggle:hover { background: #6b4c8a; color: #fff; border-color: #6b4c8a; }
.cart-item-active .cart-item-toggle { background: #e74c3c; color: #fff; border-color: #e74c3c; }

/* Cart total */
.cart-total {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid #f0eef2;
}
.cart-total-line {
    display: flex;
    justify-content: space-between;
    font-size: .9rem;
    padding: 4px 0;
    color: #666;
}
.cart-total-final {
    font-size: 1.1rem;
    font-weight: 700;
    color: #331d35;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid #e0dde3;
}

/* Shipping & Promo sections */
.cart-shipping-section, .cart-promo-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0eef2;
}
.cart-shipping-section h4, .cart-promo-section h4 {
    font-size: .85rem;
    color: #331d35;
    margin-bottom: 10px;
}
.form-group { margin-bottom: 10px; }
.form-group label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: #888;
    margin-bottom: 4px;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e0dde3;
    border-radius: 6px;
    font-size: .85rem;
    font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #6b4c8a;
}
.promo-input-group {
    display: flex;
    gap: 8px;
}
.promo-input-group input { flex: 1; }
.btn-promo-apply {
    padding: 8px 14px;
    background: #6b4c8a;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
}
#promo-message {
    font-size: .8rem;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 6px;
}
#promo-message.success { background: #e8f8e8; color: #27ae60; }
#promo-message.error { background: #fde8e8; color: #e74c3c; }
#promo-active {
    font-size: .8rem;
    color: #27ae60;
    font-weight: 600;
    margin-top: 6px;
}

/* Cart actions */
.cart-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.btn-paypal {
    background: #0070ba;
    color: #fff;
    font-size: 1rem;
    padding: 14px;
}
.btn-paypal:hover { background: #005ea6; }
.btn-devis { font-size: .85rem; padding: 10px; }

.cart-poids-info {
    margin-top: 10px;
    font-size: .75rem;
    color: #999;
    text-align: center;
}

/* --- MODALS --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 520px;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-close {
    position: absolute; top: 12px; right: 16px;
    background: none; border: none;
    font-size: 1.5rem; cursor: pointer; color: #999;
}
.modal-content h2 { font-size: 1.3rem; color: #331d35; margin-bottom: 12px; }
.modal-info { font-size: .9rem; color: #666; margin-bottom: 20px; line-height: 1.5; }
.modal-merci { text-align: center; }
.modal-merci h2 { color: #27ae60; }
.modal-merci p { color: #555; margin-bottom: 16px; }

/* --- FOOTER --- */
.site-footer {
    background: #331d35;
    color: rgba(255,255,255,.8);
    padding: 48px 0 24px;
    margin-top: 60px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}
.footer-col h4 {
    color: #fff;
    font-size: .9rem;
    margin-bottom: 12px;
}
.footer-col p { font-size: .85rem; line-height: 1.6; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col a { color: rgba(255,255,255,.7); font-size: .85rem; }
.footer-col a:hover { color: #fff; }
.footer-small { font-size: .75rem; opacity: .6; margin-top: 8px; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.15);
    padding-top: 16px;
    text-align: center;
    font-size: .8rem;
    opacity: .6;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .trouble-layout {
        grid-template-columns: 1fr;
    }
    .cart-sticky {
        position: relative;
        top: 0;
    }
    .troubles-grid {
        grid-template-columns: 1fr;
    }
    .outil-card {
        flex-direction: column;
    }
    .outil-image {
        width: 100%;
        height: 180px;
    }
    .fascicule-card {
        flex-direction: column;
        text-align: center;
    }
    .filters-bar {
        flex-direction: column;
    }
}
@media (max-width: 600px) {
    .site-header .container { height: 56px; }
    .logo-text { font-size: 1rem; }
    .main-nav { display: none; }
    .hero h1 { font-size: 1.5rem; }
    .hero-subtitle { font-size: .95rem; }
    .hero { padding: 40px 10px 24px; }
}
