/* ============================================================
   ProductDB — design system
   A clean, trustworthy product-comparison aesthetic.
   Indigo primary, emerald for prices, slate neutrals, Inter type.
   Served from the static build root for all SEO pages + homepage.
   ============================================================ */

:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-2: #eef0f6;
    --surface-3: #fafbfd;
    --border: #e5e8f0;
    --border-strong: #d3d8e6;
    --text: #10132b;
    --text-2: #5a6078;
    --text-3: #6b7188;
    --primary: #4f46e5;
    --primary-600: #4338ca;
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --accent: #059669;
    --accent-50: #ecfdf5;
    --accent-600: #047857;
    --amber: #d97706;
    --amber-50: #fffbeb;
    --red: #dc2626;
    --red-50: #fef2f2;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(16, 19, 43, .06), 0 1px 3px rgba(16, 19, 43, .06);
    --shadow-md: 0 4px 12px rgba(16, 19, 43, .08), 0 2px 4px rgba(16, 19, 43, .05);
    --shadow-lg: 0 16px 40px rgba(16, 19, 43, .12), 0 4px 12px rgba(16, 19, 43, .06);
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('/fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('/fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; margin: 0 0 .75rem; }
h2 { font-size: 1.5rem; font-weight: 700; margin: 2.25rem 0 1rem; }
h3 { font-size: 1.1rem; font-weight: 650; margin: 0 0 .4rem; }
p { margin: 0 0 1rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

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

/* ---------- Header / navigation ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-wrap { display: flex; align-items: center; gap: 1.5rem; height: 64px; }
.logo { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.logo:hover { text-decoration: none; color: var(--text); }
.logo svg { width: 30px; height: 30px; flex-shrink: 0; }
.logo .brand { letter-spacing: -0.03em; }
.logo .brand em { font-style: normal; color: var(--primary); }
.nav-links { display: flex; gap: .25rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--text-2); font-weight: 500; font-size: .92rem; padding: .45rem .7rem; border-radius: var(--radius-sm); }
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--primary); background: var(--primary-50); }
.nav-links .btn { background: var(--primary); color: #fff; }
.nav-links .btn:hover { background: var(--primary-600); color: #fff; text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    background: var(--primary); color: #fff; font-weight: 600; font-size: .95rem;
    padding: .62rem 1.15rem; border-radius: var(--radius-sm); border: 0; cursor: pointer;
    transition: background .15s, transform .1s, box-shadow .15s; text-decoration: none;
}
.btn:hover { background: var(--primary-600); color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); color: var(--text); }
.btn-lg { padding: .8rem 1.5rem; font-size: 1.02rem; border-radius: 11px; }
.btn .arrow { font-size: 1.1em; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
    display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
    font-size: .85rem; color: var(--text-3); margin: 1.25rem 0 1.5rem;
}
.breadcrumbs a { color: var(--text-2); font-weight: 500; }
.breadcrumbs a:hover { color: var(--primary); text-decoration: none; }
.breadcrumbs .sep { color: var(--border-strong); }

/* ---------- Cards / grids ---------- */
.cards {
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    margin: 1.25rem 0;
}
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.25rem; transition: transform .15s, box-shadow .15s, border-color .15s;
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card h3 { font-size: 1.08rem; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--primary); text-decoration: none; }
.card p { color: var(--text-2); font-size: .92rem; }
.card .price { font-size: 1.25rem; font-weight: 700; color: var(--accent); margin: .5rem 0 .2rem; }
.card .card-meta { margin-top: auto; padding-top: .75rem; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.card-actions { margin-top: auto; padding-top: .9rem; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Pills / badges ---------- */
.pill {
    display: inline-flex; align-items: center; gap: .3rem;
    background: var(--primary-50); color: var(--primary-600);
    padding: .2rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap;
}
.pill.green { background: var(--accent-50); color: var(--accent-600); }
.pill.amber { background: var(--amber-50); color: var(--amber); }
.pill.red { background: var(--red-50); color: var(--red); }
.pill.neutral { background: var(--surface-2); color: var(--text-2); }

/* ---------- Tables ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); margin: 1.25rem 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--border); font-size: .94rem; }
thead th { background: var(--surface-3); font-weight: 600; color: var(--text-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-3); }

/* ---------- Disclosure ---------- */
.disclosure {
    display: flex; gap: .6rem; align-items: flex-start;
    background: var(--amber-50); border: 1px solid #fde68a; color: #92400e;
    padding: .85rem 1rem; border-radius: var(--radius-sm); font-size: .85rem; margin: 1.5rem 0;
}
.disclosure::before { content: "ℹ"; font-weight: 700; }

/* ---------- Error box ---------- */
.error-box {
    background: var(--red-50); border: 1px solid #fecaca; border-left: 4px solid var(--red);
    padding: 1rem 1.1rem; border-radius: var(--radius-sm); margin: 1rem 0; color: #7f1d1d;
}
.card.error-box { background: var(--red-50); border: 1px solid #fecaca; }

/* ---------- Homepage hero + search ---------- */
.hero {
    text-align: center; padding: 4.5rem 0 3rem;
    background:
        radial-gradient(900px 400px at 15% -10%, rgba(79, 70, 229, .10), transparent 60%),
        radial-gradient(800px 400px at 85% -20%, rgba(5, 150, 105, .08), transparent 60%);
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); max-width: 760px; margin: 0 auto .9rem; }
.hero .tagline { font-size: 1.15rem; color: var(--text-2); max-width: 600px; margin: 0 auto 2rem; }
.hero .tagline b { color: var(--text); }

/* Search */
.search-box {
    position: relative; max-width: 620px; margin: 0 auto;
}
.search-input-wrap {
    display: flex; align-items: center; gap: .6rem;
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: 14px; padding: .4rem .5rem .4rem 1rem;
    box-shadow: var(--shadow-lg); transition: border-color .15s, box-shadow .15s;
}
.search-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, .15), var(--shadow-lg); }
.search-input-wrap svg { color: var(--text-3); flex-shrink: 0; }
.search-input-wrap input {
    flex: 1; border: 0; outline: none; font: inherit; font-size: 1.05rem; color: var(--text); background: transparent; padding: .65rem 0;
}
.search-input-wrap input::placeholder { color: var(--text-3); }
.search-input-wrap .btn { flex-shrink: 0; }

/* Autocomplete dropdown */
.autocomplete {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); overflow: hidden; text-align: left;
}
.autocomplete .ac-item {
    display: flex; gap: .75rem; align-items: center; padding: .8rem 1rem; cursor: pointer;
    border-bottom: 1px solid var(--border);
}
.autocomplete .ac-item:last-child { border-bottom: 0; }
.autocomplete .ac-item:hover, .autocomplete .ac-item.active { background: var(--primary-50); }
.autocomplete .ac-label { font-weight: 600; font-size: .95rem; color: var(--text); }
.autocomplete .ac-sub { font-size: .8rem; color: var(--text-3); }
.autocomplete .ac-icon { color: var(--primary); flex-shrink: 0; }
.autocomplete .ac-empty { padding: 1rem; color: var(--text-3); text-align: center; font-size: .9rem; }

/* Example queries */
.examples { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1.25rem; }
.example-tag {
    background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
    padding: .45rem .9rem; border-radius: 999px; font-size: .88rem; cursor: pointer;
    transition: all .15s;
}
.example-tag:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); text-decoration: none; }

/* Hero stat strip */
.stats { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: center; margin-top: 2.5rem; }
.stat { text-align: center; }
.stat .num { font-size: 1.6rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
.stat .lbl { font-size: .85rem; color: var(--text-2); }

/* ---------- Homepage sections ---------- */
.section { padding: 2.5rem 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head .link { font-weight: 600; font-size: .92rem; }

/* Browse categories */
.browse-grid {
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.browse-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.4rem; transition: all .15s; position: relative; overflow: hidden;
}
.browse-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); text-decoration: none; }
.browse-card .bc-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-50); color: var(--primary); display: flex; align-items: center; justify-content: center; margin-bottom: .9rem; }
.browse-card h3 { font-size: 1.05rem; }
.browse-card .bc-count { font-size: .85rem; color: var(--text-3); }
.browse-card .bc-arrow { position: absolute; top: 1.4rem; right: 1.4rem; color: var(--border-strong); font-size: 1.1rem; }

/* Featured product cards (top products) */
.top-products .card { position: relative; }
.top-products .rank {
    position: absolute; top: -.8rem; left: 1rem;
    width: 2rem; height: 2rem; border-radius: 50%;
    background: var(--primary); color: #fff; font-weight: 700; font-size: .9rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md);
}
.product-card .pc-specs { list-style: none; padding: 0; margin: .75rem 0; display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---------- Page hero (subpages) ---------- */
.page-hero { padding: 2.5rem 0 1.5rem; }
.page-hero h1 { max-width: 780px; }
.page-hero .lead { font-size: 1.1rem; color: var(--text-2); max-width: 720px; }

/* Product detail layout */
.product-layout { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .product-layout { grid-template-columns: 1fr 340px; } }
.product-main { min-width: 0; }
.buy-sidebar { position: sticky; top: 84px; align-self: start; }

.buy-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-md); padding: 1.4rem;
}
.buy-card .price-big { font-size: 1.9rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.buy-card .price-big .cur { color: var(--text-3); font-size: 1.2rem; }
.buy-card .in-stock { color: var(--accent); font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: .4rem; }
.buy-card .in-stock::before { content: "●"; font-size: .7rem; }
.buy-card .cta-note { font-size: .8rem; color: var(--text-3); margin-top: .5rem; }
.buy-card .buy-card-list { list-style: none; padding: 0; margin: 1rem 0 0; border-top: 1px solid var(--border); }
.buy-card .buy-card-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.buy-card .buy-card-list li span:first-child { color: var(--text-3); }

.spec-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.spec-item { background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem 1rem; }
.spec-item .si-label { font-size: .78rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.spec-item .si-value { font-weight: 650; margin-top: .15rem; }

/* Quick links / nav tiles */
.quicklinks { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.25rem 0; }
.quicklink {
    display: inline-flex; align-items: center; gap: .5rem;
    background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
    padding: .55rem 1rem; border-radius: 999px; font-size: .9rem; font-weight: 500; transition: all .15s;
}
.quicklink:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); text-decoration: none; }
.quicklink .ql-count { background: var(--primary-50); color: var(--primary); border-radius: 999px; font-size: .74rem; padding: .05rem .45rem; font-weight: 700; }

/* Lists */
.tight-list { list-style: none; padding: 0; margin: .5rem 0; }
.tight-list li { padding: .55rem 0; border-bottom: 1px solid var(--border); }
.tight-list li:last-child { border-bottom: 0; }
.tight-list a { font-weight: 500; }

/* Compare highlight */
.compare-vs { display: flex; align-items: center; gap: 1rem; }
.compare-vs .vs { background: var(--primary-50); color: var(--primary); font-weight: 800; border-radius: 50%; width: 2.4rem; height: 2.4rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.winner { color: var(--accent); font-weight: 700; }

/* ---------- Legal pages ---------- */
.legal h2 { margin-top: 2.5rem; }
.legal h3 { margin-top: 1.5rem; }
.legal ul { padding-left: 1.4rem; }
.legal .updated { color: var(--text-3); font-size: .88rem; font-style: italic; margin-bottom: 1.5rem; }
.legal .toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin: 1rem 0 2rem; }
.legal .toc a { display: block; padding: .25rem 0; font-weight: 500; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 4rem; }
.footer-inner { padding: 2.5rem 20px; display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-inner { grid-template-columns: 1.5fr 1fr 1fr; } }
.footer-brand .logo { margin-bottom: .75rem; }
.footer-brand p { color: var(--text-2); font-size: .9rem; max-width: 300px; }
.footer-col h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: 0 0 .9rem; }
.footer-col a { display: block; color: var(--text-2); padding: .28rem 0; font-size: .92rem; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); padding: 1.2rem 20px; color: var(--text-3); font-size: .82rem; }
.footer-bottom-inner { max-width: 1120px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; align-items: center; }
.footer-bottom a { color: var(--text-3); }
.footer-bottom a:hover { color: var(--primary); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .nav-wrap { height: auto; padding: .8rem 0; flex-wrap: wrap; gap: .6rem; }
    .nav-links { margin-left: 0; width: 100%; justify-content: flex-start; gap: .2rem; }
    .hero { padding: 2.5rem 0 2rem; }
    .search-input-wrap { flex-wrap: wrap; }
    .search-input-wrap input { min-width: 100%; }
    .search-input-wrap .btn { width: 100%; }
}

/* Utilities */
.muted { color: var(--text-2); }
.small { font-size: .88rem; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
