/* ==========================================================================
   EspressoVS — Complete CSS Design
   Coffee-inspired comparison site for espresso machines & grinders
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Color Palette & Tokens)
   -------------------------------------------------------------------------- */
:root {
    /* Core coffee palette */
    --color-dark:         #1A0F0A;
    --color-brown:        #2C1810;
    --color-warm-brown:   #6B4423;
    --color-espresso:     #D4A574;
    --color-cream:        #FFF8F0;
    --color-white:        #FFFFFF;

    /* Extended palette */
    --color-latte:        #F5E6D3;
    --color-mocha:        #3E2723;
    --color-caramel:      #C68B59;
    --color-roast:        #4A2C17;
    --color-foam:         #FEFCF8;

    /* Functional colors */
    --color-success:      #2E7D32;
    --color-warning:      #F57F17;
    --color-error:        #C62828;
    --color-info:         #1565C0;
    --color-muted:        #8D7B6E;

    /* Category colors */
    --cat-single-boiler:     #8B6914;
    --cat-heat-exchanger:    #C2571A;
    --cat-dual-boiler:       #1A6B4B;
    --cat-lever:             #6B1A1A;
    --cat-semi-auto:         #3A5BA0;
    --cat-super-auto:        #7B3FA0;
    --cat-pod-capsule:       #A03A6B;
    --cat-manual-portable:   #4A8B3A;
    --cat-moka-pot:          #8B4513;

    /* Grinder category colors */
    --cat-flat-burr:         #5C6BC0;
    --cat-conical-burr:      #00897B;
    --cat-hand-grinder:      #6D4C41;
    --cat-blade:             #78909C;
    --cat-ghost-burr:        #8E24AA;

    /* Typography */
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-heading: Georgia, 'Times New Roman', 'Palatino Linotype', serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', Consolas, monospace;

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

    /* Layout */
    --max-width:  1200px;
    --sidebar-width: 300px;
    --header-height: 64px;

    /* Borders & Shadows */
    --radius-sm:  4px;
    --radius-md:  8px;
    --radius-lg:  12px;
    --radius-full: 9999px;
    --shadow-sm:  0 1px 3px rgba(26, 15, 10, 0.08);
    --shadow-md:  0 4px 12px rgba(26, 15, 10, 0.12);
    --shadow-lg:  0 8px 24px rgba(26, 15, 10, 0.16);
    --shadow-hover: 0 8px 30px rgba(26, 15, 10, 0.20);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}


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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-brown);
    background-color: var(--color-cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

a {
    color: var(--color-warm-brown);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-espresso);
    text-decoration: underline;
}

ul, ol {
    list-style: none;
}

table {
    border-collapse: collapse;
    width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-dark);
    margin-bottom: 0.5em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p {
    margin-bottom: var(--space-md);
}

p:last-child {
    margin-bottom: 0;
}

hr {
    border: none;
    border-top: 1px solid var(--color-latte);
    margin: var(--space-xl) 0;
}

figure {
    margin: 0;
}


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

main.container {
    flex: 1;
    padding-top: var(--space-xl);
    padding-bottom: var(--space-3xl);
}


/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-brown) 100%);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-espresso) !important;
    text-decoration: none !important;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.logo:hover {
    color: var(--color-cream) !important;
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    color: var(--color-latte);
    font-size: 0.95rem;
    font-weight: 500;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    text-decoration: none !important;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--color-white);
    background: rgba(212, 165, 116, 0.2);
}

.main-nav a.active {
    background: rgba(212, 165, 116, 0.3);
    color: var(--color-espresso);
}

/* Navigation dropdowns */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    cursor: pointer;
}

.nav-dropdown-toggle::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 220px;
    background: var(--color-brown);
    border: 1px solid rgba(212, 165, 116, 0.2);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: var(--space-xs) 0;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: var(--space-xs) var(--space-md);
    color: var(--color-latte);
    font-size: 0.9rem;
    white-space: nowrap;
    border-radius: 0;
}

.nav-dropdown-menu a:hover {
    background: rgba(212, 165, 116, 0.15);
    color: var(--color-white);
}

/* Mobile hamburger */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
    color: var(--color-cream);
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    margin: 5px 0;
    transition: transform var(--transition-base), opacity var(--transition-base);
    border-radius: 2px;
}


/* --------------------------------------------------------------------------
   Breadcrumbs
   -------------------------------------------------------------------------- */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.85rem;
    color: var(--color-muted);
    padding: var(--space-md) 0;
    margin-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-latte);
}

.breadcrumbs a {
    color: var(--color-warm-brown);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs span.separator {
    color: var(--color-muted);
    font-size: 0.7rem;
    margin: 0 2px;
}

.breadcrumbs span.separator::after {
    content: "\203A";
}

.breadcrumbs .current {
    color: var(--color-brown);
    font-weight: 500;
}


/* --------------------------------------------------------------------------
   Hero Section (Homepage)
   -------------------------------------------------------------------------- */
.hero {
    text-align: center;
    padding: var(--space-3xl) var(--space-md);
    margin: calc(-1 * var(--space-xl)) calc(-1 * var(--space-md)) var(--space-2xl);
    background: linear-gradient(160deg, var(--color-brown) 0%, var(--color-roast) 40%, var(--color-mocha) 100%);
    color: var(--color-cream);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.hero h1 {
    font-size: 2.5rem;
    color: var(--color-cream);
    margin-bottom: var(--space-md);
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.2rem;
    color: var(--color-espresso);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.5;
}


/* --------------------------------------------------------------------------
   Product Grid & Cards
   -------------------------------------------------------------------------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
    margin: var(--space-lg) 0 var(--space-xl);
}

.product-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(107, 68, 35, 0.08);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    position: relative;
    overflow: hidden;
}

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

.product-card .product-image,
.product-card .image-placeholder {
    margin: calc(-1 * var(--space-lg));
    margin-bottom: var(--space-md);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    overflow: hidden;
    background: var(--color-latte);
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card .image-placeholder {
    color: var(--color-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: var(--space-md);
}

.product-card .image-placeholder span {
    display: block;
    padding: var(--space-md);
    word-break: break-word;
}

.product-card h3 {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    line-height: 1.35;
}

.product-card h3 a {
    color: var(--color-dark);
    text-decoration: none;
}

.product-card h3 a:hover {
    color: var(--color-warm-brown);
    text-decoration: none;
}

.product-card .brand {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.product-card .price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-warm-brown);
    margin-bottom: var(--space-xs);
}

.product-card .category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    background: var(--color-latte);
    color: var(--color-warm-brown);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.product-card .compare-link {
    display: inline-block;
    margin-top: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-white);
    background: var(--color-warm-brown);
    border-radius: var(--radius-sm);
    text-decoration: none !important;
    transition: background var(--transition-fast);
}

.product-card .compare-link:hover {
    background: var(--color-brown);
}


/* --------------------------------------------------------------------------
   Category Badges (Colored by Type)
   -------------------------------------------------------------------------- */
.category-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    color: var(--color-white);
    background: var(--color-warm-brown);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Machine categories */
.category-badge[data-category="Single Boiler"],
.category-single-boiler { background: var(--cat-single-boiler); }
.category-badge[data-category="Heat Exchanger"],
.category-heat-exchanger { background: var(--cat-heat-exchanger); }
.category-badge[data-category="Dual Boiler"],
.category-dual-boiler { background: var(--cat-dual-boiler); }
.category-badge[data-category="Lever"],
.category-lever { background: var(--cat-lever); }
.category-badge[data-category="Semi-Auto"],
.category-semi-auto { background: var(--cat-semi-auto); }
.category-badge[data-category="Super-Auto"],
.category-super-auto { background: var(--cat-super-auto); }
.category-badge[data-category="Pod/Capsule"],
.category-pod-capsule { background: var(--cat-pod-capsule); }
.category-badge[data-category="Manual/Portable"],
.category-manual-portable { background: var(--cat-manual-portable); }
.category-badge[data-category="Moka Pot"],
.category-moka-pot { background: var(--cat-moka-pot); }

/* Grinder categories */
.category-badge[data-category="Flat Burr"],
.category-flat-burr { background: var(--cat-flat-burr); }
.category-badge[data-category="Conical Burr"],
.category-conical-burr { background: var(--cat-conical-burr); }
.category-badge[data-category="Hand Grinder"],
.category-hand-grinder { background: var(--cat-hand-grinder); }
.category-badge[data-category="Blade"],
.category-blade { background: var(--cat-blade); }
.category-badge[data-category="Ghost Burr"],
.category-ghost-burr { background: var(--cat-ghost-burr); }


/* --------------------------------------------------------------------------
   Section Headings & "See All" links
   -------------------------------------------------------------------------- */
.featured-machines,
.featured-grinders,
.brands-list,
.brand-machines,
.brand-grinders,
.related-products {
    margin-bottom: var(--space-2xl);
}

.featured-machines h2,
.featured-grinders h2,
.brands-list h2,
.brand-machines h2,
.brand-grinders h2,
.related-products h2 {
    font-size: 1.75rem;
    position: relative;
    padding-bottom: var(--space-sm);
}

.featured-machines h2::after,
.featured-grinders h2::after,
.brands-list h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--color-espresso);
    margin-top: var(--space-sm);
    border-radius: 2px;
}

.see-all {
    text-align: center;
    margin-top: var(--space-lg);
}

.see-all a {
    display: inline-block;
    padding: var(--space-sm) var(--space-xl);
    font-weight: 600;
    color: var(--color-warm-brown);
    border: 2px solid var(--color-warm-brown);
    border-radius: var(--radius-full);
    text-decoration: none !important;
    transition: all var(--transition-fast);
}

.see-all a:hover {
    background: var(--color-warm-brown);
    color: var(--color-white);
}


/* --------------------------------------------------------------------------
   Brand Links (Homepage)
   -------------------------------------------------------------------------- */
.brand-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.brand-links a {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-warm-brown);
    background: var(--color-white);
    border: 1px solid var(--color-latte);
    border-radius: var(--radius-full);
    text-decoration: none !important;
    transition: all var(--transition-fast);
}

.brand-links a:hover {
    background: var(--color-warm-brown);
    color: var(--color-white);
    border-color: var(--color-warm-brown);
}


/* --------------------------------------------------------------------------
   Product Detail Page
   -------------------------------------------------------------------------- */
.product-detail {
    max-width: 900px;
}

.product-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
    align-items: start;
}

.product-image-col .product-image,
.product-image-col .image-placeholder {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-white);
    box-shadow: var(--shadow-md);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-col .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: var(--space-md);
}

.product-image-col .image-placeholder {
    color: var(--color-muted);
    font-size: 0.9rem;
    padding: var(--space-xl);
}

.image-attribution {
    font-size: 0.7rem;
    color: var(--color-muted);
    padding: var(--space-xs) var(--space-sm);
    text-align: right;
}

.product-info-col h1 {
    font-size: 2.25rem;
    margin-bottom: var(--space-xs);
}

.brand-name {
    font-size: 1rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: var(--space-sm) !important;
}

.price-tag {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-warm-brown);
    margin-bottom: var(--space-sm) !important;
}

/* Price value variants */
.price-good {
    color: var(--color-success);
}

/* Status badge */
.status-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: var(--space-xs);
}

.status-badge.discontinued {
    background: var(--color-error);
    color: var(--color-white);
}


/* --------------------------------------------------------------------------
   Product Description
   -------------------------------------------------------------------------- */
.product-description {
    margin-bottom: var(--space-2xl);
    padding: var(--space-xl);
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--color-espresso);
}

.product-description h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
}

.product-description p {
    color: var(--color-brown);
    line-height: 1.8;
}


/* --------------------------------------------------------------------------
   Specs Table
   -------------------------------------------------------------------------- */
.specs-table {
    margin-bottom: var(--space-2xl);
}

.specs-table h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
}

.specs-table table {
    background: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.specs-table tr {
    border-bottom: 1px solid var(--color-latte);
}

.specs-table tr:last-child {
    border-bottom: none;
}

.specs-table tr:nth-child(even) {
    background: var(--color-foam);
}

.specs-table th,
.specs-table td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    vertical-align: top;
}

.specs-table th {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-warm-brown);
    width: 40%;
    background: transparent;
}

.specs-table td {
    font-size: 0.95rem;
    color: var(--color-brown);
}


/* --------------------------------------------------------------------------
   Comparison Page
   -------------------------------------------------------------------------- */
.comparison {
    max-width: 960px;
}

.comparison h1 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: var(--space-xs);
}

.comparison-subtitle {
    text-align: center;
    color: var(--color-muted);
    font-size: 1.05rem;
    margin-bottom: var(--space-xl) !important;
}

/* VS divider */
.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin: var(--space-xl) 0;
}

.vs-divider::before,
.vs-divider::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-latte), transparent);
}

.vs-divider span {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-espresso);
    background: var(--color-cream);
    padding: var(--space-xs) var(--space-md);
    border: 2px solid var(--color-espresso);
    border-radius: var(--radius-full);
    line-height: 1;
}

/* Comparison table */
.comparison-table-wrapper {
    overflow-x: auto;
    margin: var(--space-lg) 0 var(--space-2xl);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    -webkit-overflow-scrolling: touch;
}

.comparison-table {
    background: var(--color-white);
    min-width: 600px;
}

.comparison-table thead th {
    background: var(--color-brown);
    color: var(--color-cream);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    padding: var(--space-md) var(--space-lg);
    text-align: center;
    position: sticky;
    top: 0;
}

.comparison-table thead th:first-child {
    text-align: left;
    color: var(--color-espresso);
    background: var(--color-dark);
}

.comparison-table tbody td {
    padding: var(--space-sm) var(--space-md);
    text-align: center;
    border-bottom: 1px solid var(--color-latte);
    font-size: 0.9rem;
    vertical-align: middle;
}

.comparison-table tbody td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--color-warm-brown);
    background: var(--color-foam);
    white-space: nowrap;
}

.comparison-table tbody tr:nth-child(even) td {
    background: var(--color-foam);
}

.comparison-table tbody tr:nth-child(even) td:first-child {
    background: rgba(245, 230, 211, 0.7);
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

/* Highlighted differences */
.comparison-table .diff td:not(:first-child) {
    background: rgba(212, 165, 116, 0.12);
    font-weight: 600;
}

/* Winner indicators */
.comparison-table .winner {
    color: var(--color-success);
    font-weight: 700;
}

.comparison-table .winner::before {
    content: "\2713 ";
    font-weight: 700;
}

.comparison-table .loser {
    color: var(--color-muted);
}

/* Comparison summary */
.comparison-summary {
    margin: var(--space-2xl) 0;
    padding: var(--space-xl);
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--color-espresso);
}

.comparison-summary h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
}

.comparison-summary .summary-text {
    line-height: 1.8;
    color: var(--color-brown);
}

/* Comparison actions */
.comparison-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
    margin: var(--space-xl) 0;
}


/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: var(--space-sm) var(--space-xl);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-white);
    background: var(--color-warm-brown);
    border: 2px solid var(--color-warm-brown);
    border-radius: var(--radius-sm);
    text-decoration: none !important;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

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

.btn-outline {
    background: transparent;
    color: var(--color-warm-brown);
}

.btn-outline:hover {
    background: var(--color-warm-brown);
    color: var(--color-white);
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.85rem;
}


/* --------------------------------------------------------------------------
   Browse / Filter Layout
   -------------------------------------------------------------------------- */
.browse-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: var(--space-2xl);
    align-items: start;
}

.browse-sidebar {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: calc(var(--header-height) + var(--space-md));
}

.browse-sidebar h3 {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-warm-brown);
    margin-bottom: var(--space-sm);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-latte);
}

.browse-sidebar h3:first-child {
    padding-top: 0;
    border-top: none;
}

.browse-sidebar ul {
    margin-bottom: var(--space-md);
}

.browse-sidebar li {
    margin-bottom: 2px;
}

.browse-sidebar li a {
    display: block;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.9rem;
    color: var(--color-brown);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background var(--transition-fast);
}

.browse-sidebar li a:hover,
.browse-sidebar li a.active {
    background: var(--color-latte);
    color: var(--color-dark);
}

.browse-sidebar li a.active {
    font-weight: 600;
    color: var(--color-warm-brown);
}

.browse-main > p {
    font-size: 0.9rem;
    color: var(--color-muted);
    margin-bottom: var(--space-md);
}

/* Active filter badges */
.filter-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 3px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-warm-brown);
    background: var(--color-latte);
    border-radius: var(--radius-full);
}

.filter-badge .remove {
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.filter-badge .remove:hover {
    opacity: 1;
}


/* --------------------------------------------------------------------------
   Brand Page
   -------------------------------------------------------------------------- */
.brand-header {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    padding: var(--space-xl);
    margin-bottom: var(--space-2xl);
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.brand-logo-area {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-foam);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.brand-logo-area img {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
}


/* --------------------------------------------------------------------------
   Affiliate Links & Ad Blocks
   -------------------------------------------------------------------------- */
.affiliate-links {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-latte);
    margin: var(--space-lg) 0;
}

.affiliate-links h4 {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-md);
}

.affiliate-links ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.affiliate-link {
    display: block;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none !important;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.affiliate-link.amazon {
    background: #FF9900;
    color: var(--color-dark) !important;
}

.affiliate-link.amazon:hover {
    background: #E8890A;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.affiliate-link.wll {
    background: var(--color-warm-brown);
    color: var(--color-white) !important;
}

.affiliate-link.wll:hover {
    background: var(--color-brown);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.affiliate-link.scg {
    background: var(--color-mocha);
    color: var(--color-cream) !important;
}

.affiliate-link.scg:hover {
    background: var(--color-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.affiliate-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin: var(--space-xl) 0;
}

/* Ad blocks */
.ad-block {
    margin: var(--space-xl) 0;
    padding: var(--space-sm);
    background: var(--color-foam);
    border: 1px dashed rgba(107, 68, 35, 0.15);
    border-radius: var(--radius-sm);
    text-align: center;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-block ins {
    margin: 0 auto;
}

.ad-sidebar {
    margin: var(--space-md) 0;
}


/* --------------------------------------------------------------------------
   Best / Guide Pages (Article Layout)
   -------------------------------------------------------------------------- */
.article-content {
    max-width: 800px;
}

.article-content h1 {
    font-size: 2.25rem;
    margin-bottom: var(--space-lg);
}

.article-content h2 {
    font-size: 1.65rem;
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--color-latte);
}

.article-content h3 {
    font-size: 1.35rem;
    margin-top: var(--space-xl);
    margin-bottom: var(--space-sm);
}

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

/* Numbered recommendations */
.recommendation {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.recommendation-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--color-warm-brown);
    color: var(--color-white);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.recommendation-content h3 {
    margin-top: 0;
    margin-bottom: var(--space-xs);
}

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

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

.pros {
    background: rgba(46, 125, 50, 0.06);
    border: 1px solid rgba(46, 125, 50, 0.2);
}

.cons {
    background: rgba(198, 40, 40, 0.06);
    border: 1px solid rgba(198, 40, 40, 0.2);
}

.pros h4 {
    color: var(--color-success);
    margin-bottom: var(--space-sm);
}

.cons h4 {
    color: var(--color-error);
    margin-bottom: var(--space-sm);
}

.pros li, .cons li {
    padding: var(--space-xs) 0;
    padding-left: 1.4em;
    position: relative;
    font-size: 0.9rem;
    line-height: 1.5;
}

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

.cons li::before {
    content: "\2717";
    position: absolute;
    left: 0;
    color: var(--color-error);
    font-weight: 700;
}


/* --------------------------------------------------------------------------
   Star Ratings (Placeholder)
   -------------------------------------------------------------------------- */
.star-rating {
    display: inline-flex;
    gap: 2px;
    color: var(--color-espresso);
    font-size: 1.1rem;
}

.star-rating .star-filled::before { content: "\2605"; }
.star-rating .star-empty::before { content: "\2606"; color: var(--color-latte); }


/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    background: var(--color-dark);
    color: rgba(255, 248, 240, 0.6);
    padding: var(--space-2xl) 0;
    margin-top: auto;
    font-size: 0.9rem;
}

.site-footer .container {
    text-align: center;
}

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

.site-footer a {
    color: var(--color-espresso);
}

.site-footer a:hover {
    color: var(--color-cream);
}

.site-footer .disclaimer {
    font-size: 0.75rem;
    color: rgba(255, 248, 240, 0.4);
    max-width: 600px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 0.85rem;
    color: rgba(255, 248, 240, 0.7);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--color-espresso);
}


/* --------------------------------------------------------------------------
   Visually Hidden (Schema/SEO)
   -------------------------------------------------------------------------- */
.sr-only,
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.text-center { text-align: center; }
.text-muted { color: var(--color-muted); }
.text-small { font-size: 0.85rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-md); }
.mt-2 { margin-top: var(--space-xl); }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--space-md); }
.mb-2 { margin-bottom: var(--space-xl); }


/* --------------------------------------------------------------------------
   Guide Pages (best.php)
   -------------------------------------------------------------------------- */
.guide-page,
.setup-page {
    max-width: 900px;
    margin: 0 auto;
}

.guide-header,
.setup-header {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 2px solid var(--color-latte);
}

.guide-header h1,
.setup-header h1 {
    margin-bottom: var(--space-sm);
}

.guide-meta,
.setup-meta {
    color: var(--color-muted);
    font-size: 0.9rem;
}

.setup-total-estimate {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-warm-brown);
    margin-top: var(--space-sm);
}

.guide-intro,
.setup-intro {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: var(--space-xl);
}

.guide-intro p,
.setup-intro p {
    margin-bottom: var(--space-md);
}

/* Top picks grid */
.picks-grid,
.setup-picks-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.pick-card,
.setup-pick-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background: var(--color-foam);
    border: 1px solid var(--color-latte);
    border-radius: var(--radius-md);
    position: relative;
}

.pick-rank {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    background: var(--color-warm-brown);
    color: var(--color-white);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    z-index: 1;
}

.pick-image {
    width: 180px;
    flex-shrink: 0;
}

.pick-image .image-placeholder,
.pick-image .product-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.pick-details h3 {
    margin: 0 0 var(--space-xs);
    font-size: 1.25rem;
}

.pick-details h3 a {
    color: var(--color-brown);
    text-decoration: none;
}

.pick-details h3 a:hover {
    color: var(--color-warm-brown);
}

.pick-brand {
    color: var(--color-muted);
    font-size: 0.9rem;
    margin: 0 0 var(--space-xs);
}

.pick-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-warm-brown);
    margin: 0 0 var(--space-sm);
}

.pick-specs table {
    font-size: 0.85rem;
    margin-bottom: var(--space-sm);
    width: 100%;
    max-width: 400px;
}

.pick-specs table th,
.pick-specs-mini th {
    text-align: left;
    color: var(--color-muted);
    padding: 2px 12px 2px 0;
    font-weight: 500;
    white-space: nowrap;
}

.pick-specs table td,
.pick-specs-mini td {
    padding: 2px 0;
}

.pick-specs-mini {
    font-size: 0.85rem;
    margin-bottom: var(--space-sm);
    width: 100%;
    max-width: 400px;
}

.pick-description {
    font-size: 0.9rem;
    color: var(--color-mocha);
    line-height: 1.6;
    margin-bottom: var(--space-sm);
}

.pick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: flex-start;
    margin-bottom: var(--space-sm);
}

.btn-detail {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: var(--color-warm-brown);
    color: var(--color-white) !important;
    border-radius: var(--radius-sm);
    text-decoration: none !important;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background var(--transition-fast);
}

.btn-detail:hover {
    background: var(--color-roast);
}

/* Comparison links grid */
.comparison-links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.comparison-link {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-latte);
    color: var(--color-brown) !important;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    text-decoration: none !important;
    transition: background var(--transition-fast);
}

.comparison-link:hover {
    background: var(--color-espresso);
    color: var(--color-white) !important;
}

/* Buyers guide section */
.buyers-guide-section,
.setup-advice {
    margin: var(--space-xl) 0;
    padding: var(--space-lg);
    background: var(--color-foam);
    border: 1px solid var(--color-latte);
    border-radius: var(--radius-md);
}

.buyers-guide-section h2,
.setup-advice h2 {
    color: var(--color-brown);
    margin-top: 0;
}

.buyers-guide-section h3,
.setup-advice h3 {
    color: var(--color-warm-brown);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
}

.buyers-guide-section p,
.setup-advice p {
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

/* FAQ section */
.guide-faq,
.setup-faq {
    margin: var(--space-xl) 0;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.faq-item {
    border: 1px solid var(--color-latte);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.faq-item summary {
    padding: var(--space-md);
    cursor: pointer;
    background: var(--color-foam);
    transition: background var(--transition-fast);
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::before {
    content: '+';
    display: inline-block;
    width: 1.5em;
    font-weight: 700;
    color: var(--color-warm-brown);
}

.faq-item[open] summary::before {
    content: '\2212';
}

.faq-item summary:hover {
    background: var(--color-latte);
}

.faq-item p {
    padding: var(--space-md);
    margin: 0;
    line-height: 1.7;
    border-top: 1px solid var(--color-latte);
}

/* Related guides */
.guide-related,
.setup-related {
    margin: var(--space-xl) 0;
}

.related-guides-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    margin-bottom: var(--space-lg);
}

.related-guide-link {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: var(--color-latte);
    color: var(--color-brown) !important;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    text-decoration: none !important;
    font-weight: 500;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.related-guide-link:hover {
    background: var(--color-warm-brown);
    color: var(--color-white) !important;
}

/* Setup page sections */
.setup-section {
    margin: var(--space-xl) 0;
}

.setup-section h2 {
    margin-bottom: var(--space-lg);
    color: var(--color-brown);
}

.setup-comparisons {
    margin: var(--space-lg) 0;
}


/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tablet (max-width: 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.45rem; }

    .hero h1 { font-size: 2rem; }
    .hero { padding: var(--space-2xl) var(--space-md); }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    .browse-layout {
        grid-template-columns: 240px 1fr;
        gap: var(--space-lg);
    }

    .product-header {
        gap: var(--space-lg);
    }

    .affiliate-row {
        grid-template-columns: 1fr;
    }

    .pros-cons {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Mobile (max-width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    :root {
        --header-height: 56px;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.15rem; }

    .hero {
        padding: var(--space-xl) var(--space-md);
        margin-bottom: var(--space-lg);
    }

    .hero h1 { font-size: 1.65rem; }
    .hero p { font-size: 1rem; }

    /* Mobile nav */
    .nav-toggle {
        display: block;
    }

    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--color-dark);
        flex-direction: column;
        padding: var(--space-md);
        gap: 0;
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform var(--transition-base), opacity var(--transition-base), visibility var(--transition-base);
        z-index: 999;
    }

    .main-nav.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .main-nav a {
        width: 100%;
        padding: var(--space-md);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 0;
        font-size: 1rem;
    }

    /* Mobile dropdowns: show inline */
    .nav-dropdown-menu {
        position: static;
        display: none;
        background: rgba(0, 0, 0, 0.15);
        box-shadow: none;
        border: none;
        padding: 0;
        min-width: auto;
    }

    .nav-dropdown:hover .nav-dropdown-menu,
    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown-menu a {
        padding-left: var(--space-xl);
        font-size: 0.9rem;
    }

    .nav-dropdown-toggle::after {
        border-top-width: 3px;
        border-left-width: 3px;
        border-right-width: 3px;
    }

    /* Guide pick cards: stacked on mobile */
    .pick-card,
    .setup-pick-card {
        grid-template-columns: 1fr;
    }

    .pick-image {
        width: 100%;
        max-width: 250px;
        margin: 0 auto;
    }

    /* Product grid: 1 column */
    .product-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    /* Browse: stacked layout */
    .browse-layout {
        grid-template-columns: 1fr;
    }

    .browse-sidebar {
        position: static;
        order: -1;
    }

    /* Product detail: stacked */
    .product-header {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .product-info-col h1 {
        font-size: 1.75rem;
    }

    .price-tag {
        font-size: 1.4rem;
    }

    /* Comparison table: scroll */
    .comparison-table-wrapper {
        margin-left: calc(-1 * var(--space-md));
        margin-right: calc(-1 * var(--space-md));
        border-radius: 0;
    }

    .comparison-actions {
        flex-direction: column;
    }

    .comparison-actions .btn {
        width: 100%;
    }

    .affiliate-row {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    /* Brand links: scroll */
    .brand-links {
        gap: var(--space-xs);
    }

    .brand-links a {
        font-size: 0.8rem;
        padding: 3px 10px;
    }

    /* Recommendation */
    .recommendation {
        grid-template-columns: 1fr;
    }

    .recommendation-number {
        width: 36px;
        height: 36px;
        font-size: 1.15rem;
    }

    /* Brand header */
    .brand-header {
        flex-direction: column;
        text-align: center;
    }
}

/* --------------------------------------------------------------------------
   Small Mobile (max-width: 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .container {
        padding-left: var(--space-sm);
        padding-right: var(--space-sm);
    }

    .hero h1 {
        font-size: 1.4rem;
    }

    .product-card {
        padding: var(--space-md);
    }

    .product-card .product-image,
    .product-card .image-placeholder {
        margin: calc(-1 * var(--space-md));
        margin-bottom: var(--space-sm);
    }

    .specs-table th,
    .specs-table td {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.85rem;
    }

    .specs-table th {
        width: 45%;
    }

    .comparison-table thead th {
        padding: var(--space-sm);
        font-size: 0.8rem;
    }

    .comparison-table tbody td {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.8rem;
    }
}


/* ==========================================================================
   Desktop Enhancements (min-width: 1024px)
   ========================================================================== */
@media (min-width: 1024px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }

    .hero h1 {
        font-size: 3rem;
    }

    .hero p {
        font-size: 1.25rem;
    }

    /* Two-column layout for detail pages */
    .product-detail {
        display: grid;
        grid-template-columns: 1fr var(--sidebar-width);
        gap: var(--space-2xl);
        max-width: none;
    }

    .product-detail > .product-header,
    .product-detail > .product-description,
    .product-detail > .specs-table,
    .product-detail > .related-products,
    .product-detail > .ad-block,
    .product-detail > script {
        grid-column: 1;
    }

    .product-detail > .affiliate-links {
        grid-column: 2;
        grid-row: 1 / span 3;
        position: sticky;
        top: calc(var(--header-height) + var(--space-md));
        align-self: start;
    }
}


/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    .site-header,
    .site-footer,
    .nav-toggle,
    .main-nav,
    .ad-block,
    .affiliate-links,
    .affiliate-row,
    .browse-sidebar,
    .compare-link,
    .comparison-actions,
    .see-all {
        display: none !important;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    main.container {
        padding-top: 0;
    }

    .product-header {
        grid-template-columns: 200px 1fr;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .comparison-table-wrapper {
        overflow: visible;
        box-shadow: none;
    }

    .comparison-table {
        min-width: auto;
    }

    .comparison-table thead th {
        background: #e0e0e0 !important;
        color: #000 !important;
    }

    .specs-table table,
    .comparison-table {
        border: 1px solid #ccc;
    }

    .specs-table th,
    .specs-table td,
    .comparison-table th,
    .comparison-table td {
        border: 1px solid #ccc;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    a[href^="#"]::after,
    a[href^="javascript"]::after {
        content: "";
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    .product-card,
    .recommendation {
        page-break-inside: avoid;
    }
}

/* --------------------------------------------------------------------------
   Footer Grid
   -------------------------------------------------------------------------- */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 2rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1.5rem;
}

.footer-col h4 {
    color: var(--color-espresso);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 0.4rem;
}

.footer-col ul li a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: var(--color-espresso);
}

.footer-bottom {
    text-align: center;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Homepage Guides Grid
   -------------------------------------------------------------------------- */
.home-guides {
    margin: 3rem 0;
}

.guides-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.guide-card {
    display: block;
    padding: 1.5rem;
    background: var(--color-white);
    border: 2px solid var(--color-latte);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--color-dark);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.guide-card:hover {
    border-color: var(--color-caramel);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.guide-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: var(--color-warm-brown);
}

.guide-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-muted);
}

@media (max-width: 768px) {
    .guides-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .guides-grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Popular Comparisons on Homepage
   -------------------------------------------------------------------------- */
.popular-comparisons {
    margin: 2.5rem 0;
}
