/*
Theme Name: FilterReference
Theme URI: https://filterreference.com/
Author: FilterReference
Description: Lightweight cross-reference catalog theme for replacement filters. Part pages, brand cross-reference hubs, part-number search, RFQ with conversion tracking, CSV import.
Version: 1.0.0
Requires at least: 6.3
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: fr
*/

:root {
	--ink: #14202e;
	--ink-2: #4a5868;
	--line: #dfe5ec;
	--bg: #ffffff;
	--bg-2: #f4f7fa;
	--navy: #0f2a44;
	--navy-2: #173b5e;
	--accent: #f0a20b;
	--accent-ink: #1d1400;
	--ok: #1f8a4c;
	--radius: 8px;
	--wrap: 1160px;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--ink); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; color: var(--navy); }
h1 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
h2 { font-size: clamp(1.25rem, 2.2vw, 1.65rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.section { padding: 48px 0; }
.section-alt { background: var(--bg-2); }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: var(--radius); border: 1px solid transparent; font: 600 15px/1.2 var(--font); cursor: pointer; text-decoration: none !important; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(.95); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-wa { background: #1fa855; color: #fff; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* Header */
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; }
.hdr { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.15rem; letter-spacing: .2px; }
.logo:hover { text-decoration: none; }
.logo svg { width: 28px; height: 28px; flex: none; }
.nav { margin-left: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.nav a { color: #d8e3ee; padding: 8px 12px; border-radius: 6px; display: block; }
.nav a:hover, .nav .current-menu-item > a { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 6px; padding: 7px 12px; font: 600 14px var(--font); }
.subbar { background: var(--navy-2); padding: 10px 0; }
@media (max-width: 860px) {
	.nav-toggle { display: block; }
	.hdr-cta { display: none; }
	.nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--navy); padding: 8px 16px 16px; margin: 0; }
	.nav.open { display: block; }
	.nav ul { flex-direction: column; }
}

/* Search */
.pn-search { display: flex; gap: 8px; max-width: 720px; }
.pn-search input { flex: 1; min-width: 0; padding: 13px 16px; border-radius: var(--radius); border: 1px solid var(--line); font: 16px var(--font); }
.pn-search.compact input { padding: 9px 12px; }
.pn-search.compact .btn { padding: 9px 16px; }
.pn-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Hero */
.hero { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: #e8eef5; padding: 56px 0 64px; }
.hero h1 { color: #fff; max-width: 820px; }
.hero p.lead { font-size: 1.1rem; max-width: 720px; color: #c9d6e3; }
.hero .pn-search { margin-top: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips a, .chip { display: inline-block; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.1); color: #fff; font-size: .9rem; }
.chips a:hover { background: rgba(255,255,255,.2); text-decoration: none; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 36px; }
.stat b { display: block; font-size: 1.5rem; color: #fff; }
.stat span { color: #b7c6d6; font-size: .9rem; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* Cards & grids */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; display: block; color: inherit; }
a.card:hover { border-color: var(--navy-2); text-decoration: none; box-shadow: 0 2px 10px rgba(15,42,68,.08); }
.card h3 { margin-bottom: .3em; }
.card .count { color: var(--ink-2); font-size: .875rem; }
.steps { counter-reset: s; }
.step { position: relative; padding-left: 52px; }
.step::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* Breadcrumb */
.crumbs { font-size: .875rem; color: var(--ink-2); margin: 18px 0 10px; }
.crumbs a { color: var(--ink-2); }
.crumbs span.sep { margin: 0 6px; }

/* Part page */
.part-head { display: grid; grid-template-columns: 340px 1fr; gap: 32px; align-items: start; margin-bottom: 32px; }
@media (max-width: 800px) { .part-head { grid-template-columns: 1fr; } }
.part-img { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.part-img img { width: 100%; height: 100%; object-fit: contain; }
.part-img svg { width: 45%; height: auto; opacity: .55; }
.equiv-line { color: var(--ink-2); margin-bottom: 16px; }
.facts { list-style: none; padding: 0; margin: 0 0 20px; border-top: 1px solid var(--line); }
.facts li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.facts li span:first-child { color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.block { margin: 0 0 36px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.t { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.t th, table.t td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t thead th { background: var(--bg-2); color: var(--navy); font-weight: 600; white-space: nowrap; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover { background: #fafcfd; }
table.t td.num { font-family: var(--mono); white-space: nowrap; }

/* Forms */
.rfq { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: #fff; }
.rfq .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .rfq .row { grid-template-columns: 1fr; } }
.rfq label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 4px; }
.rfq .field { margin-bottom: 14px; }
.rfq input[type=text], .rfq input[type=email], .rfq textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; font: 15px var(--font); background: #fff; }
.rfq textarea { min-height: 110px; resize: vertical; }
.rfq textarea.mono { font-family: var(--mono); }
.rfq .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rfq .req { color: #c0392b; }
.notice { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; }
.notice-err { background: #fdecea; color: #8a1f11; }
.notice-ok { background: #e9f7ef; color: #145c32; }

/* Content */
.entry { max-width: 780px; }
.entry h2 { margin-top: 1.6em; }
.entry ul, .entry ol { padding-left: 1.3em; }
.entry img { border-radius: var(--radius); }
.layout-side { display: grid; grid-template-columns: 1fr 300px; gap: 40px; }
@media (max-width: 900px) { .layout-side { grid-template-columns: 1fr; } }
.side-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: sticky; top: 84px; }
.post-list article { padding: 18px 0; border-bottom: 1px solid var(--line); }
.pagination { margin: 28px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; }
.pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Footer */
.site-footer { background: #0b1f33; color: #b8c6d4; padding: 44px 0 24px; margin-top: 56px; font-size: .92rem; }
.site-footer h3 { color: #fff; font-size: 1rem; }
.site-footer a { color: #d6e1ec; }
.ft-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 800px) { .ft-grid { grid-template-columns: 1fr; } }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0 0 6px; }
.ft-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 28px; padding-top: 16px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.disclaimer { font-size: .8rem; color: #8ea2b6; }

/* WhatsApp float */
.wa-float { position: fixed; right: 18px; bottom: 18px; width: 54px; height: 54px; border-radius: 50%; background: #1fa855; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0,0,0,.25); z-index: 60; }
.wa-float svg { width: 30px; height: 30px; fill: #fff; }
