/* ==========================================
   COMMON CSS - Partagé entre tous les sites
   Design optimisé conversion & affiliation
   Mode Dark/Light avec détection système
   ========================================== */

/* ==========================================
   THEME VARIABLES
   ========================================== */

:root {
    /* Couleurs de marque (peuvent être overridées par site) */
    --primary: #e63946;
    --primary-dark: #c1121f;
    --accent: #f77f00;
    --success: #2a9d8f;
    --warning: #e9c46a;

    /* Espacements */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-xxl: 3rem;

    /* Rayons */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Transition theme */
    --theme-transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* LIGHT THEME (défaut) */
:root,
[data-theme="light"] {
    --secondary: #1d3557;
    --bg-body: #f8f9fa;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --text-dark: #212529;
    --text-body: #212529;
    --text-muted: #6c757d;
    --border: #dee2e6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-hover: 0 12px 32px rgba(0,0,0,0.15);
    --hero-gradient: linear-gradient(135deg, #1d3557 0%, #457b9d 100%);
    --table-header-bg: #1d3557;
    --table-hover: #f1f5f9;
    --inline-cta-bg: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    --pros-bg: rgba(42, 157, 143, 0.1);
    --cons-bg: rgba(230, 57, 70, 0.1);
    --highlight-bg: rgba(42, 157, 143, 0.1);
}

/* DARK THEME */
[data-theme="dark"] {
    --secondary: #a8dadc;
    --bg-body: #0f172a;
    --bg-light: #1e293b;
    --bg-white: #1e293b;
    --bg-card: #1e293b;
    --text-dark: #f1f5f9;
    --text-body: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    --shadow-hover: 0 12px 32px rgba(0,0,0,0.6);
    --hero-gradient: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --table-header-bg: #334155;
    --table-hover: #334155;
    --inline-cta-bg: linear-gradient(135deg, #292524 0%, #44403c 100%);
    --pros-bg: rgba(42, 157, 143, 0.2);
    --cons-bg: rgba(230, 57, 70, 0.2);
    --highlight-bg: rgba(42, 157, 143, 0.2);
}

/* Détection automatique du thème système */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --secondary: #a8dadc;
        --bg-body: #0f172a;
        --bg-light: #1e293b;
        --bg-white: #1e293b;
        --bg-card: #1e293b;
        --text-dark: #f1f5f9;
        --text-body: #e2e8f0;
        --text-muted: #94a3b8;
        --border: #334155;
        --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
        --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
        --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
        --shadow-hover: 0 12px 32px rgba(0,0,0,0.6);
        --hero-gradient: linear-gradient(135deg, #1e293b 0%, #334155 100%);
        --table-header-bg: #334155;
        --table-hover: #334155;
        --inline-cta-bg: linear-gradient(135deg, #292524 0%, #44403c 100%);
        --pros-bg: rgba(42, 157, 143, 0.2);
        --cons-bg: rgba(230, 57, 70, 0.2);
        --highlight-bg: rgba(42, 157, 143, 0.2);
    }
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-body);
    background: var(--bg-body);
    transition: var(--theme-transition);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================
   LAYOUT
   ========================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-xl);
    padding: var(--space-xl) 0;
}

@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .sidebar {
        order: -1;
    }
}

/* ==========================================
   HEADER
   ========================================== */

.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--theme-transition);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    gap: var(--space-md);
}

/* ==========================================
   THEME TOGGLE
   ========================================== */

.theme-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 4px;
    cursor: pointer;
    transition: var(--theme-transition);
}

.theme-toggle__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.theme-toggle__btn:hover {
    background: var(--border);
}

.theme-toggle__btn.active {
    background: var(--bg-white);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .theme-toggle__btn.active {
    background: var(--secondary);
    color: var(--bg-body);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
    list-style: none;
}

.nav-links a {
    color: var(--text-dark);
    font-weight: 500;
    padding: var(--space-sm) 0;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
}

/* ==========================================
   HERO
   ========================================== */

.hero {
    background: var(--hero-gradient);
    color: white;
    padding: var(--space-xxl) 0;
    text-align: center;
    transition: var(--theme-transition);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.hero .subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: var(--space-lg);
}

.hero .update-date {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* ==========================================
   BADGES
   ========================================== */

.badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-best {
    background: var(--success);
    color: white;
}

.badge-value {
    background: var(--accent);
    color: white;
}

.badge-premium {
    background: var(--secondary);
    color: white;
}

.badge-budget {
    background: var(--warning);
    color: var(--text-dark);
}

/* ==========================================
   PRODUCT CARDS
   ========================================== */

.products-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
}

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

.product-card-inner {
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    gap: var(--space-lg);
    padding: var(--space-lg);
    align-items: center;
}

@media (max-width: 768px) {
    .product-card-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

.product-rank {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}

.product-image {
    position: relative;
    text-align: center;
}

.product-image img {
    max-height: 150px;
    object-fit: contain;
}

.product-info {
    flex: 1;
}

.product-info h2 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
    color: var(--secondary);
}

.product-brand {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--space-sm);
}

.product-summary {
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.stars {
    color: #ffc107;
    font-size: 1.1rem;
}

.rating-score {
    font-weight: 700;
    color: var(--secondary);
}

.product-pros {
    list-style: none;
}

.product-pros li {
    padding: var(--space-xs) 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.9rem;
}

.product-pros li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 700;
}

.product-cta {
    text-align: center;
}

.product-price {
    margin-bottom: var(--space-md);
}

.price-current {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.price-old {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 1rem;
}

.price-discount {
    display: inline-block;
    background: var(--success);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: var(--space-sm);
}

/* ==========================================
   CTA BUTTONS (Affiliation)
   ========================================== */

.btn {
    display: inline-block;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #d62828 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.5);
    color: white;
}

.btn-amazon {
    background: #ff9900;
    color: #111;
}

.btn-amazon:hover {
    background: #e68a00;
    color: #111;
}

.btn-amazon::before {
    content: "🛒 ";
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--secondary);
    border: 2px solid var(--secondary);
}

.btn-secondary:hover {
    background: var(--secondary);
    color: white;
}

.btn-full {
    width: 100%;
}

.cta-small-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

/* ==========================================
   COMPARISON TABLE
   ========================================== */

.comparison-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin: var(--space-xl) 0;
    box-shadow: var(--shadow-md);
    transition: var(--theme-transition);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.comparison-table th,
.comparison-table td {
    padding: var(--space-md);
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.comparison-table th {
    background: var(--table-header-bg);
    color: white;
    font-weight: 600;
}

.comparison-table th:first-child {
    text-align: left;
    border-radius: var(--radius-md) 0 0 0;
}

.comparison-table th:last-child {
    border-radius: 0 var(--radius-md) 0 0;
}

.comparison-table tr:hover {
    background: var(--table-hover);
}

.comparison-table .product-name {
    text-align: left;
    font-weight: 600;
}

.comparison-table .highlight {
    background: var(--highlight-bg);
    font-weight: 600;
}

/* ==========================================
   SIDEBAR
   ========================================== */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.sidebar-widget {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--theme-transition);
}

.sidebar-widget h3 {
    font-size: 1rem;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--primary);
}

/* Ad Placeholders */
.ad-slot {
    background: var(--bg-light);
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}

.ad-slot-header {
    height: 90px;
    margin: var(--space-md) 0;
}

.ad-slot-sidebar {
    height: 250px;
    width: 300px;
}

.ad-slot-inline {
    height: 100px;
    margin: var(--space-xl) 0;
}

.ad-slot-sticky {
    position: sticky;
    top: 80px;
}

/* ==========================================
   ARTICLE / TEST PRODUIT
   ========================================== */

.article-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    transition: var(--theme-transition);
}

.article-content h2 {
    color: var(--secondary);
    margin: var(--space-xl) 0 var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border);
}

.article-content h3 {
    color: var(--secondary);
    margin: var(--space-lg) 0 var(--space-md);
}

.article-content p {
    margin-bottom: var(--space-md);
    color: var(--text-dark);
}

.article-content ul,
.article-content ol {
    margin-bottom: var(--space-md);
    padding-left: var(--space-lg);
}

.article-content li {
    margin-bottom: var(--space-sm);
}

/* Verdict Box */
.verdict-box {
    background: linear-gradient(135deg, var(--secondary) 0%, #457b9d 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin: var(--space-xl) 0;
}

.verdict-box h3 {
    color: white;
    margin-bottom: var(--space-md);
}

.verdict-score {
    font-size: 3rem;
    font-weight: 700;
}

/* Pros/Cons */
.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
}

@media (max-width: 600px) {
    .pros-cons {
        grid-template-columns: 1fr;
    }
}

.pros, .cons {
    padding: var(--space-lg);
    border-radius: var(--radius-md);
}

.pros {
    background: var(--pros-bg);
    border-left: 4px solid var(--success);
}

.cons {
    background: var(--cons-bg);
    border-left: 4px solid var(--primary);
}

.pros h4, .cons h4 {
    margin-bottom: var(--space-md);
}

.pros li::marker {
    color: var(--success);
}

.cons li::marker {
    color: var(--primary);
}

/* ==========================================
   INLINE CTA (dans article)
   ========================================== */

.inline-cta {
    background: var(--inline-cta-bg);
    border: 2px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin: var(--space-xl) 0;
    text-align: center;
    transition: var(--theme-transition);
}

.inline-cta h4 {
    color: var(--secondary);
    margin-bottom: var(--space-md);
}

.inline-cta .price-highlight {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-md);
}

/* ==========================================
   FOOTER
   ========================================== */

.footer {
    background: var(--secondary);
    color: white;
    padding: var(--space-xxl) 0 var(--space-lg);
    margin-top: var(--space-xxl);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer h4 {
    margin-bottom: var(--space-md);
    font-size: 1rem;
}

.footer ul {
    list-style: none;
}

.footer li {
    margin-bottom: var(--space-sm);
}

.footer a {
    color: rgba(255,255,255,0.7);
}

.footer a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: var(--space-lg);
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}

.affiliate-disclosure {
    background: rgba(255,255,255,0.05);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-top: var(--space-md);
    font-size: 0.8rem;
}

/* ==========================================
   COOKIE BANNER
   ========================================== */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    padding: var(--space-lg);
    z-index: 1000;
    display: none;
    transition: var(--theme-transition);
}

.cookie-banner.show {
    display: block;
}

.cookie-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    min-width: 300px;
}

.cookie-text h4 {
    margin-bottom: var(--space-sm);
}

.cookie-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cookie-buttons {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.cookie-buttons .btn {
    padding: var(--space-sm) var(--space-lg);
}

/* ==========================================
   LEGAL PAGES
   ========================================== */

.legal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin: var(--space-xl) 0;
    box-shadow: var(--shadow-md);
}

.legal-content h1 {
    color: var(--secondary);
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--primary);
}

.legal-content h2 {
    color: var(--secondary);
    margin: var(--space-xl) 0 var(--space-md);
}

.legal-content p {
    margin-bottom: var(--space-md);
    line-height: 1.8;
}

.legal-content ul {
    margin-bottom: var(--space-md);
    padding-left: var(--space-xl);
}

.legal-content li {
    margin-bottom: var(--space-sm);
}

/* ==========================================
   UTILITIES
   ========================================== */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: var(--space-md); }
.mt-2 { margin-top: var(--space-lg); }
.mb-1 { margin-bottom: var(--space-md); }
.mb-2 { margin-bottom: var(--space-lg); }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Print styles */
@media print {
    .header, .footer, .ad-slot, .cookie-banner, .sidebar {
        display: none !important;
    }
}
