/*
 * MINIFICATION: Ten plik NIE jest zminifikowany, aby ulatwic rozwoj.
 * Przed wdrozeniem na produkcje uzyj narzedzia do minifikacji CSS, np.:
 *   - cssnano (npm): npx cssnano style.css style.min.css
 *   - clean-css-cli: npx cleancss -o style.min.css style.css
 *   - lightningcss: npx lightningcss --minify --bundle style.css -o style.min.css
 * Nastepnie w layouts/app.php zmien odwolanie na style.min.css.
 */

/* ============================================
   ER7.pl — Design System & Styles
   Porównywarka elektronarzędzi akumulatorowych
   ============================================ */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
    /* Colors — Bold industrial palette */
    --color-primary: #0f3460;
    --color-primary-dark: #0a2340;
    --color-primary-light: #1a56db;
    --color-secondary: #e94560;
    --color-secondary-dark: #c73450;
    --color-accent: #f59e0b;

    --color-success: #059669;
    --color-warning: #d97706;
    --color-danger: #dc2626;
    --color-info: #0f3460;

    --color-text: #111827;
    --color-text-light: #4b5563;
    --color-text-muted: #9ca3af;

    --color-bg: #ffffff;
    --color-bg-light: #f8fafc;
    --color-bg-alt: #f1f5f9;
    --color-border: #e2e8f0;
    --color-border-dark: #cbd5e1;

    --color-winner: #dcfce7;
    --color-loser: #fef2f2;

    /* Typography — DM Sans: geometric, modern */
    --font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;

    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;

    /* Spacing (4px base) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

    /* Borders */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);

    /* Layout */
    --container-max: 1280px;
    --sidebar-width: 280px;

    /* Transitions */
    --transition: 150ms ease-in-out;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary-dark); }
table { border-collapse: collapse; width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* --- Layout --- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }

/* --- Header --- */
.site-header {
    background: var(--color-primary);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.site-logo {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: #fff;
    letter-spacing: -0.02em;
}
.site-logo span { color: var(--color-secondary); }

.site-nav { display: flex; gap: var(--space-1); align-items: center; }
.site-nav a {
    color: rgba(255,255,255,0.75);
    font-weight: var(--font-medium);
    font-size: var(--text-sm);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}
.site-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}
.site-nav a.active {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: var(--text-xl);
    cursor: pointer;
    padding: var(--space-2);
}

/* --- Footer --- */
.site-footer {
    background: var(--color-primary-dark);
    color: rgba(255,255,255,0.7);
    padding: var(--space-12) 0 var(--space-6);
    margin-top: var(--space-16);
}
.site-footer a { color: rgba(255,255,255,0.7); }
.site-footer a:hover { color: var(--color-secondary); }
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}
.footer-col h4 {
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-4);
    color: var(--color-bg);
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: var(--space-2); }
.footer-col li a { font-size: var(--text-sm); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: var(--space-6);
    text-align: center;
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    line-height: var(--leading-tight);
    font-weight: var(--font-bold);
    color: var(--color-text);
}
h1 { font-size: var(--text-3xl); margin-bottom: var(--space-4); }
h2 { font-size: var(--text-2xl); margin-bottom: var(--space-3); }
h3 { font-size: var(--text-xl); margin-bottom: var(--space-2); }
p { margin-bottom: var(--space-4); }
.text-muted { color: var(--color-text-light); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-weight: var(--font-medium);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.5;
}
.btn-primary {
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-md);
}
.btn-primary:hover { background: var(--color-primary-light); color: white; }
.btn-secondary {
    background: var(--color-bg-alt);
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn-secondary:hover { background: var(--color-border); }
.btn-success { background: var(--color-success); color: white; }
.btn-success:hover { background: #059669; color: white; }
.btn-danger { background: var(--color-danger); color: white; }
.btn-danger:hover { background: #dc2626; color: white; }
.btn-sm { padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
.btn-lg { padding: var(--space-3) var(--space-6); font-size: var(--text-base); }

/* --- Cards --- */
.card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
}

/* --- Product Card --- */
.product-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 200ms ease, box-shadow 200ms ease;
    display: flex;
    flex-direction: column;
    position: relative;
}
.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-brand-color, var(--color-border-dark));
    transition: height 200ms ease;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -8px rgba(15, 52, 96, 0.15);
}
.product-card:hover::before {
    height: 4px;
}
.product-card-body {
    padding: var(--space-5) var(--space-4) var(--space-3);
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-card-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}
.product-card-brand {
    font-size: 0.6875rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: var(--font-bold);
    background: var(--color-bg-alt);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}
.product-card-brushless {
    font-size: 0.625rem;
    font-weight: var(--font-bold);
    font-family: var(--font-mono);
    color: #fff;
    background: var(--color-success);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
}
.product-card-title {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-3);
    line-height: var(--leading-tight);
    min-height: 2.5em;
}
.product-card-title a {
    color: var(--color-text);
    text-decoration: none;
}
.product-card-title a:hover { color: var(--color-primary); }
.product-card-specs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    margin-top: auto;
}
.product-card-spec {
    flex: 1;
    text-align: center;
    padding: var(--space-2) var(--space-1);
    background: var(--color-bg-alt);
    border-radius: var(--radius-md);
    position: relative;
}
.product-card-spec-val {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--color-primary);
    line-height: 1.2;
}
.product-card-spec-unit {
    font-size: 0.625rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: var(--font-medium);
}
.product-card-price {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--color-secondary);
    padding: var(--space-2) 0 0;
}
.product-card-footer {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: var(--space-2);
    background: var(--color-bg-light);
}

/* Brand accent colors */
.product-card[data-brand="makita"] { --card-brand-color: #00a9a5; }
.product-card[data-brand="dewalt"] { --card-brand-color: #febd17; }
.product-card[data-brand="milwaukee"] { --card-brand-color: #db0032; }
.product-card[data-brand="bosch-professional"] { --card-brand-color: #005691; }
.product-card[data-brand="bosch-diy"] { --card-brand-color: #63a615; }
.product-card[data-brand="metabo"] { --card-brand-color: #76b82a; }
.product-card[data-brand="hikoki"] { --card-brand-color: #3fa535; }
.product-card[data-brand="einhell"] { --card-brand-color: #e30613; }
.product-card[data-brand="parkside"] { --card-brand-color: #004f9f; }
.product-card[data-brand="stanley-fatmax"] { --card-brand-color: #ffd100; }

/* --- Tables --- */
.table-responsive { overflow-x: auto; }
table.data-table {
    width: 100%;
    border-collapse: collapse;
}
table.data-table th,
table.data-table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}
table.data-table th {
    background: var(--color-bg-light);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    color: var(--color-text-light);
}
table.data-table tr:hover { background: var(--color-bg-light); }

/* Compare table — main styles in Compare Page section below */

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}
.badge-primary { background: #dbeafe; color: var(--color-primary); }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-affiliate {
    background: #fef3c7;
    color: #92400e;
    font-size: 0.65rem;
    padding: 2px 6px;
}

/* --- Breadcrumbs Enhanced --- */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    font-size: var(--text-sm);
    color: var(--color-text-light);
    margin-bottom: var(--space-4);
    padding: var(--space-3) 0;
    align-items: center;
}
.breadcrumbs a {
    color: var(--color-text-light);
    transition: color var(--transition);
}
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs .separator {
    margin: 0 var(--space-1);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
}
.breadcrumbs .current {
    color: var(--color-primary);
    font-weight: var(--font-medium);
}

/* --- Forms --- */
.form-group { margin-bottom: var(--space-4); }
.form-label {
    display: block;
    font-weight: var(--font-medium);
    font-size: var(--text-sm);
    margin-bottom: var(--space-1);
    color: var(--color-text);
}
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    transition: border-color var(--transition);
    background: var(--color-bg);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}
.form-error { color: var(--color-danger); font-size: var(--text-xs); margin-top: var(--space-1); }
.form-textarea { min-height: 120px; resize: vertical; }

/* --- Filters sidebar --- */
.filters-sidebar {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}
.filter-group { margin-bottom: var(--space-4); }
.filter-group:last-child { margin-bottom: 0; }
.filter-group-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-2);
}

/* --- Pagination --- */
.pagination {
    display: flex;
    gap: var(--space-1);
    justify-content: center;
    margin-top: var(--space-8);
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--color-text);
    transition: all var(--transition);
}
.pagination a:hover { background: var(--color-bg-alt); color: var(--color-primary); }
.pagination .active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}
.pagination .disabled { color: var(--color-text-muted); pointer-events: none; }

/* --- Flash messages --- */
.flash {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
}
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.flash-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* --- Hero --- */
.hero {
    background: var(--color-primary);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(233,69,96,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(245,158,11,0.1) 0%, transparent 50%);
    color: white;
    padding: var(--space-12) 0 var(--space-10);
    text-align: center;
    border-bottom: 3px solid var(--color-secondary);
}
.hero h1 { color: white; font-size: var(--text-3xl); margin-bottom: var(--space-3); letter-spacing: -0.02em; }
.hero p { font-size: var(--text-base); opacity: 0.85; max-width: 520px; margin: 0 auto var(--space-5); }
.hero-search {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}
.hero-search input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    padding-right: 60px;
    border: none;
    border-radius: var(--radius-xl);
    font-size: var(--text-base);
    box-shadow: var(--shadow-lg);
}
.hero-search button {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    padding: 0 var(--space-4);
    background: var(--color-secondary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: var(--font-bold);
    transition: background var(--transition);
}
.hero-search button:hover { background: var(--color-secondary-dark); }

/* --- Section --- */
.section { padding: var(--space-10) 0; }
.section-title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-6);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-light);
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--color-secondary);
    margin: var(--space-2) auto 0;
    border-radius: 2px;
}

/* --- Cookie Consent --- */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-text);
    color: white;
    padding: var(--space-4);
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
}
.cookie-consent .container {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}
.cookie-consent p { margin: 0; font-size: var(--text-sm); flex: 1; }
.cookie-consent .btn { white-space: nowrap; }

/* --- Update timestamp --- */
.last-updated {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-4);
}

/* --- Affiliate button --- */
.affiliate-link { position: relative; }
.affiliate-link .badge-affiliate {
    position: absolute;
    top: -8px;
    right: -8px;
}

/* --- FAQ --- */
.faq-list { margin: var(--space-6) 0; }
.faq-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
}
.faq-question {
    padding: var(--space-3) var(--space-4);
    font-weight: var(--font-semibold);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-question::after { content: '+'; font-size: var(--text-xl); color: var(--color-text-light); }
.faq-item.open .faq-question::after { content: '−'; }
.faq-answer {
    padding: 0 var(--space-4) var(--space-4);
    color: var(--color-text-light);
    display: none;
}
.faq-item.open .faq-answer { display: block; }

/* --- Article Content --- */
.article-content {
    max-width: 100%;
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--color-text);
}

.article-content h2 {
    margin-top: 3rem;
    margin-bottom: 1rem;
    font-size: var(--text-2xl);
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(26, 86, 219, 0.2);
    position: relative;
}

.article-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: var(--text-xl);
    color: var(--color-text);
    padding-left: 0.75rem;
    border-left: 3px solid var(--color-primary);
}

.article-content p {
    margin-bottom: 1.25rem;
    color: var(--color-text);
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
    position: relative;
}

.article-content ul li::marker {
    color: var(--color-primary);
}

.article-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

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

.article-content strong {
    font-weight: 600;
    color: var(--color-text);
}

.article-content .table-responsive {
    margin: 2rem 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.article-content table {
    margin: 0;
    border-collapse: collapse;
    width: 100%;
    min-width: 500px;
}

.article-content table th {
    background: var(--color-primary);
    color: #fff;
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    font-size: var(--text-xs);
    letter-spacing: 0.05em;
    white-space: nowrap;
    padding: var(--space-3) var(--space-4);
    border-bottom: none;
}

.article-content table td {
    font-size: var(--text-sm);
    vertical-align: middle;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.article-content table tbody tr:nth-child(even) {
    background: var(--color-bg-light);
}

.article-content table tbody tr:hover {
    background: #eef2ff;
}

.article-content table td:first-child {
    font-weight: var(--font-bold);
    color: var(--color-primary);
    text-align: center;
    width: 2.5rem;
}

.article-content table td:nth-child(2) {
    font-weight: var(--font-semibold);
}

/* Ranking counter — only active with .article-ranking wrapper */
.article-ranking { counter-reset: ranking; }
.article-ranking .article-content h3 { counter-increment: ranking; }
.article-ranking .article-content h3::before {
    content: counter(ranking) ". ";
    color: var(--color-primary);
    font-weight: 700;
}

/* Table of Contents */
.article-toc {
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.article-toc h4 {
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    color: var(--color-text-light);
}

.article-toc ol {
    list-style-type: decimal;
    padding-left: 1.25rem;
}

.article-toc li {
    margin-bottom: 0.5rem;
    font-size: var(--text-sm);
}

.article-toc a {
    color: var(--color-text);
    text-decoration: none;
}

.article-toc a:hover {
    color: var(--color-primary);
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    z-index: 1000;
    transition: width 100ms ease;
}

/* Article Meta */
.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    font-size: var(--text-sm);
    color: var(--color-text-light);
}

.article-meta .reading-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* --- Category Cards --- */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-6) var(--space-4);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-text);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-secondary);
    transform: scaleX(0);
    transition: transform 250ms ease;
}
.category-card:hover::before { transform: scaleX(1); }
.category-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: var(--color-text);
}
.category-card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-3);
    color: var(--color-primary);
}
.category-card h3 {
    font-size: var(--text-base);
    margin-bottom: var(--space-1);
}
.category-card .count {
    font-size: var(--text-sm);
    color: var(--color-text-light);
}

/* --- Why ER7 Feature Cards --- */
.feature-card {
    padding: var(--space-5);
    border-left: 3px solid var(--color-secondary);
    background: var(--color-bg-light);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}
.feature-card-icon {
    width: 32px;
    height: 32px;
    color: var(--color-primary);
    margin-bottom: var(--space-2);
}
.feature-card h3 {
    font-size: var(--text-base);
    margin-bottom: var(--space-1);
}
.feature-card p {
    font-size: var(--text-sm);
    color: var(--color-text-light);
    margin-bottom: 0;
}

/* --- Brand Cards --- */
.brand-card {
    text-align: center;
    padding: var(--space-4);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-text);
    transition: all var(--transition);
}
.brand-card:hover {
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-sm);
    color: var(--color-text);
}
.brand-card strong { font-size: var(--text-base); }
.brand-card .count { font-size: var(--text-xs); color: var(--color-text-muted); }

/* --- Comparison Preview Card --- */
.comparison-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-text);
    transition: all var(--transition);
}
.comparison-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    color: var(--color-text);
}
.comparison-card .vs-badge {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    font-size: var(--text-xs);
    color: var(--color-text-light);
}
.comparison-card .comparison-title {
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
}

/* --- Hero Enhancement --- */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-8);
    margin-top: var(--space-6);
}
.hero-stat {
    text-align: center;
}
.hero-stat-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
}
.hero-stat-label {
    font-size: var(--text-sm);
    opacity: 0.8;
}

/* --- Product Card Enhancement --- */
.product-card-category-bar { display: none; }

/* --- Article Cards --- */
.article-card {
    display: block;
    padding: var(--space-5);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-text);
    transition: all var(--transition);
    border-left: 4px solid var(--color-primary);
}
.article-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: var(--color-text);
}
.article-card.type-ranking { border-left-color: var(--color-warning); }
.article-card.type-guide { border-left-color: var(--color-primary); }
.article-card.type-ecosystem { border-left-color: var(--color-success); }
.article-card.type-comparison { border-left-color: var(--color-danger); }
.article-card-featured {
    grid-column: 1 / -1;
    padding: var(--space-6);
    background: var(--color-bg-light);
    border-left-width: 5px;
}
.article-card-featured h2 { font-size: var(--text-xl); }
.article-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    font-size: var(--text-xs);
}
.article-card-reading-time {
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Compare Page --- */
.compare-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
    padding: var(--space-8) 0 var(--space-4);
}
.compare-product-name {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    text-align: center;
    flex: 1;
    color: var(--color-primary);
}
.compare-product-name[data-brand="makita"] { color: #00857a; }
.compare-product-name[data-brand="dewalt"] { color: #b8860b; }
.compare-product-name[data-brand="milwaukee"] { color: #db0032; }
.compare-product-name[data-brand="bosch-professional"] { color: #005691; }
.compare-product-name[data-brand="bosch-diy"] { color: #4a8a10; }
.compare-product-name[data-brand="metabo"] { color: #5a8f1e; }
.compare-product-name[data-brand="hikoki"] { color: #2e8028; }
.compare-product-name[data-brand="einhell"] { color: #c20510; }
.compare-product-name[data-brand="parkside"] { color: #004080; }
.compare-product-name[data-brand="stanley-fatmax"] { color: #b8960b; }
.compare-vs {
    width: 64px;
    height: 64px;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    font-size: var(--text-lg);
    color: #fff;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}
.compare-table {
    width: 100%;
    border-collapse: collapse;
}
.compare-table th,
.compare-table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}
.compare-table thead th {
    background: var(--color-bg-light);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    color: var(--color-text-light);
}
.compare-table thead th:first-child { width: 30%; }
.compare-table .winner {
    background: var(--color-winner);
}
.compare-table .loser {
    background: var(--color-loser);
    color: var(--color-text-light);
}
.param-value {
    display: block;
    font-weight: var(--font-semibold);
    margin-bottom: 4px;
}
.winner .param-value::after {
    content: ' \2713';
    color: #166534;
    font-weight: var(--font-bold);
}
.param-bar {
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--color-border);
    overflow: hidden;
}
.param-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 600ms ease;
}
.winner .param-bar-fill { background: var(--color-success); }
.loser .param-bar-fill { background: var(--color-border-dark); }
td:not(.winner):not(.loser) .param-bar-fill { background: var(--color-text-muted); }
.verdict-scorecard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin: var(--space-6) 0;
}
.scorecard {
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
    position: relative;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.scorecard.scorecard-winner {
    border-color: var(--color-success);
    box-shadow: 0 0 0 1px var(--color-success), var(--shadow-md);
    background: linear-gradient(to bottom, var(--color-winner), var(--color-bg));
}
.scorecard-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-success);
    color: #fff;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}
.scorecard-wins {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    color: var(--color-text);
    line-height: 1;
    margin-bottom: var(--space-2);
}
.scorecard-winner .scorecard-wins {
    color: var(--color-success);
}
.scorecard-name {
    font-size: var(--text-base);
    color: var(--color-text);
    font-weight: var(--font-semibold);
}
.scorecard-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- FAQ Enhanced --- */
.faq-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    transition: border-color var(--transition);
}
.faq-item.open {
    border-color: var(--color-primary-light);
    border-left: 3px solid var(--color-primary);
}
.faq-question {
    padding: var(--space-3) var(--space-4);
    font-weight: var(--font-semibold);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--transition);
}
.faq-question:hover {
    background: var(--color-bg-light);
}
.faq-question::after { content: none; }
.faq-chevron {
    width: 20px;
    height: 20px;
    color: var(--color-text-light);
    transition: transform 300ms ease;
    flex-shrink: 0;
}
.faq-item.open .faq-chevron {
    transform: rotate(180deg);
    color: var(--color-primary);
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms ease, padding 300ms ease;
    padding: 0 var(--space-4);
    color: var(--color-text-light);
    line-height: 1.7;
    display: block;
}
.faq-item.open .faq-answer {
    max-height: 500px;
    padding: 0 var(--space-4) var(--space-4);
    display: block;
}

/* --- Product Detail Page --- */
.product-detail-top {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-8);
    margin-bottom: var(--space-8);
    align-items: start;
}
.product-hero-info {
    display: flex;
    flex-direction: column;
}
.product-breadcrumb-line {
    display: flex;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
}
.product-breadcrumb-line a { color: var(--color-text-light); }
.product-breadcrumb-line a:hover { color: var(--color-primary); }
.product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}
.product-sidebar {
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    position: sticky;
    top: 72px;
}
.product-price-block {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border);
}
.product-price-value {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--color-secondary);
}
.product-price-note {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}
.product-key-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.product-key-spec {
    text-align: center;
    padding: var(--space-3);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}
.product-key-spec-value {
    display: block;
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-primary);
    line-height: 1.2;
}
.product-key-spec-unit {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Specs table enhanced */
.specs-section { margin-top: var(--space-8); }
.specs-section h2 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--color-bg-alt);
}
.specs-table tr:nth-child(even) { background: var(--color-bg-light); }
.specs-table td:first-child {
    font-weight: var(--font-medium);
    color: var(--color-text-light);
    width: 40%;
}
.specs-table td:last-child { font-weight: var(--font-semibold); }

/* Metrics cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    margin-top: var(--space-6);
}
.metric-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}
.metric-card.metric-pln-nm::before { background: var(--color-primary); }
.metric-card.metric-g-nm::before { background: var(--color-secondary); }
.metric-value {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    line-height: 1.2;
}
.metric-card.metric-pln-nm .metric-value { color: var(--color-primary); }
.metric-card.metric-g-nm .metric-value { color: var(--color-secondary-dark); }
.metric-label {
    font-size: var(--text-sm);
    color: var(--color-text-light);
    margin-top: var(--space-2);
}

/* Product placeholder (for detail page) */
.product-image-placeholder {
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    text-align: center;
    color: var(--color-text-muted);
}
.product-image-placeholder svg {
    width: 80px;
    height: 80px;
    opacity: 0.3;
    margin: 0 auto var(--space-3);
    display: block;
}
.product-image-placeholder p {
    font-size: var(--text-sm);
    margin: 0;
}

/* Similar products horizontal scroll on mobile */
.similar-products-scroll {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
}

/* --- Category Index Cards --- */
.cat-index-card {
    display: flex;
    flex-direction: column;
    padding: var(--space-5);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--color-text);
    transition: all 200ms ease;
    position: relative;
}
.cat-index-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
    transform: translateY(-2px);
    color: var(--color-text);
}
.cat-index-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}
.cat-index-card-icon {
    color: var(--color-primary);
    display: flex;
}
.cat-index-card-count {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    line-height: 1;
}
.cat-index-card-title {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-2);
}
.cat-index-card-desc {
    font-size: var(--text-sm);
    color: var(--color-text-light);
    margin-bottom: var(--space-3);
    flex: 1;
    line-height: 1.5;
}
.cat-index-card-link {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--color-primary);
    margin-top: auto;
}
.cat-index-card:hover .cat-index-card-link {
    color: var(--color-secondary);
}

/* --- Category Page Enhanced --- */
.filters-sidebar h3 {
    font-size: var(--text-base);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--color-primary);
}
.filter-group {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-bg-alt);
}
.filter-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}
.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    background: #dbeafe;
    color: var(--color-primary);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}
.product-count-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    background: var(--color-bg-alt);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--color-text-light);
    font-weight: var(--font-medium);
}

/* --- Product Layout (sidebar + grid) --- */
.product-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: var(--space-6);
}

/* --- Compare Selector --- */
.compare-selector {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-4);
    align-items: start;
}

/* --- Search Dropdown (compare autocomplete) --- */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    color: var(--color-text);
    text-align: left;
    border: 1px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
}
.search-item {
    display: block;
    padding: var(--space-2) var(--space-3);
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid var(--color-border-light, rgba(0,0,0,0.05));
    text-decoration: none;
    color: var(--color-text);
}
.search-item-name {
    font-weight: var(--font-bold);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}
.search-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}
.search-item-meta span:last-child:not(:first-child) {
    color: var(--color-primary);
    font-weight: var(--font-medium);
}
.search-item:last-child {
    border-bottom: none;
}
.search-item:hover,
.search-item:focus {
    background: var(--color-primary);
    color: #fff;
}
.search-item:hover .text-muted,
.search-item:focus .text-muted,
.search-item:hover .search-item-meta,
.search-item:focus .search-item-meta {
    color: rgba(255,255,255,0.8);
}
.search-item:hover .search-item-meta span:last-child:not(:first-child),
.search-item:focus .search-item-meta span:last-child:not(:first-child) {
    color: rgba(255,255,255,0.9);
}

/* Parent needs position:relative for dropdown */
.compare-selector > div {
    position: relative;
}

/* --- Filter Toggle (hidden on desktop) --- */
.filter-toggle-btn {
    display: none;
    width: 100%;
    justify-content: center;
    margin-bottom: var(--space-4);
    min-height: 44px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root { font-size: 15px; }
    .container { padding: 0 var(--space-3); }
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }

    .site-nav { display: none; }
    .site-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--color-primary);
        padding: var(--space-4);
        box-shadow: var(--shadow-lg);
    }
    .site-nav.open a { color: rgba(255,255,255,0.85); padding: var(--space-3) var(--space-4); min-height: 44px; display: flex; align-items: center; }
    .mobile-menu-btn { display: block; color: #fff; }

    /* Product layout — single column on mobile */
    .product-layout { grid-template-columns: 1fr; }
    .filter-toggle-btn { display: flex; }
    .filters-sidebar { display: none; }
    .filters-sidebar.open { display: block; }

    /* Compare selector — stack vertically */
    .compare-selector { grid-template-columns: 1fr; }
    .compare-selector > div:nth-child(2) { text-align: center; padding: 0; }

    /* Touch targets */
    .btn-sm { padding: var(--space-2) var(--space-3); min-height: 44px; display: inline-flex; align-items: center; }
    .pagination a, .pagination span { min-width: 44px; height: 44px; }

    .hero { padding: var(--space-10) 0; }
    .hero h1 { font-size: var(--text-2xl); }
    .hero-stats { gap: var(--space-4); }
    .hero-stat-value { font-size: var(--text-lg); }

    .cookie-consent .container { flex-direction: column; text-align: center; }

    h1 { font-size: var(--text-2xl); }
    h2 { font-size: var(--text-xl); }

    .compare-header { flex-direction: column; gap: var(--space-3); }
    .compare-product-name { font-size: var(--text-lg); }
    .compare-vs { width: 48px; height: 48px; font-size: var(--text-base); }
    .compare-table thead { display: none; }
    .compare-table tbody tr {
        display: block;
        margin-bottom: var(--space-3);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        overflow: hidden;
    }
    .compare-table td {
        display: block;
        border-bottom: none;
    }
    .compare-table td:first-child {
        background: var(--color-bg-light);
        font-weight: var(--font-semibold);
        font-size: var(--text-sm);
        color: var(--color-text-light);
        letter-spacing: 0.02em;
        padding: var(--space-2) var(--space-3);
    }
    .compare-table td:not(:first-child)::before {
        content: attr(data-label);
        display: block;
        font-size: var(--text-xs);
        color: var(--color-text-muted);
        margin-bottom: 2px;
    }
    .verdict-scorecard { grid-template-columns: 1fr; }
    .article-card-featured { padding: var(--space-4); }

    .article-content h2 { font-size: var(--text-xl); margin-top: 2rem; }
    .article-content h3 { font-size: var(--text-lg); margin-top: 1.5rem; }
    .article-content { font-size: 1rem; }
    .article-toc { padding: 1rem; }

    .product-detail-top {
        grid-template-columns: 1fr;
    }
    .product-sidebar {
        position: static;
    }
    .similar-products-scroll {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    .similar-products-scroll .product-card { flex: 0 0 260px; scroll-snap-align: start; }
    .metrics-grid { grid-template-columns: 1fr; }
    .product-price-value { font-size: var(--text-2xl); }
}

@media (max-width: 480px) {
    .product-card-footer { flex-direction: column; }
    .pagination { flex-wrap: wrap; }
}
