/* ==========================================================================
   Comparateur de prix — feuille de style
   Motif directeur : l'étiquette de prix de rayon (jaune, chiffres noirs
   très gras, centimes en exposant). Tout le reste reste sobre.
   Aucune police externe : pile système, donc aucun appel tiers (RGPD).
   ========================================================================== */

:root {
    --ink: #101828;
    --ink-soft: #475467;
    --paper: #F3F5F8;
    --surface: #FFFFFF;
    --line: #D9DEE7;
    --tag: #FFDD33;
    --tag-ink: #1A1400;
    --deal: #0B7A4B;
    --deal-bg: #E4F5EC;
    --action: #1F4FE0;
    --action-dark: #1A43C0;
    --warn: #B42318;
    --radius: 6px;
    --font: "Avenir Next", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 16px/1.5 var(--font);
    font-variant-numeric: tabular-nums;
}
img { max-width: 100%; display: block; }
a { color: var(--action); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3.1rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
code { background: var(--paper); padding: .1em .35em; border-radius: 3px; }

.wrap { width: min(1180px, 100% - 2rem); margin-inline: auto; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 0; }
.muted { color: var(--ink-soft); }

/* ---- En-tête ------------------------------------------------------------ */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; flex-wrap: wrap; gap: .9rem 1.5rem; padding: .9rem 0; }

/* Le logo est une étiquette percée d'un trou d'attache. */
.brand {
    display: inline-block;
    padding: .2rem .9rem .25rem 1.7rem;
    color: var(--tag-ink);
    font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em; text-decoration: none;
    border-radius: 4px 14px 14px 4px;
    background: radial-gradient(circle at .8rem 50%, var(--surface) .22rem, transparent .23rem), var(--tag);
}

.search {
    flex: 1 1 320px; max-width: 640px; display: flex;
    background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden;
}
.search input {
    flex: 1; min-width: 0; border: 0; background: transparent; color: inherit;
    padding: .65rem .9rem; font: inherit;
}
.search input:focus-visible { outline: none; }
.search:focus-within { outline: 3px solid var(--action); outline-offset: 2px; }
.search button {
    border: 0; background: var(--ink); color: #fff; font: inherit; font-weight: 700;
    padding: 0 1.2rem; cursor: pointer;
}
.search button:hover { background: #26334d; }
.search-lg { max-width: none; }
.search-lg input { padding: 1rem 1.1rem; font-size: 1.1rem; }

.cats { border-top: 1px solid var(--line); }
.cats ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: .35rem 0; overflow-x: auto; }
.cats a {
    display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
    padding: .4rem .75rem; border-radius: 999px;
    color: var(--ink); font-weight: 600; font-size: .95rem; text-decoration: none;
}
.cats a:hover, .cats a[aria-current] { background: var(--paper); }
.cats a[aria-current] { box-shadow: inset 0 -3px 0 var(--tag); border-radius: 999px; }

/* ---- Étiquette de prix -------------------------------------------------- */
.tag {
    display: inline-flex; align-items: flex-start;
    background: var(--tag); color: var(--tag-ink);
    padding: .3rem .55rem .35rem .5rem;
    border-radius: 3px 9px 9px 3px;
    font-weight: 800; line-height: 1; letter-spacing: -0.03em;
}
.tag-vis { display: inline-flex; align-items: flex-start; }
.tag-int { font-size: 1.5rem; }
.tag-dec, .tag-cur { font-size: .85rem; margin-top: .1rem; }
.tag-cur { margin-left: .12rem; }
.tag-bare { background: none; padding: 0; border-radius: 0; }
.tag-lg .tag-int { font-size: 1.9rem; }
.tag-lg .tag-dec, .tag-lg .tag-cur { font-size: 1rem; margin-top: .15rem; }
.tag-xl .tag-int { font-size: clamp(3rem, 8vw, 4.5rem); }
.tag-xl .tag-dec, .tag-xl .tag-cur { font-size: clamp(1.2rem, 3vw, 1.7rem); margin-top: .4rem; }

/* Grande étiquette de rayon (accueil et fiche produit). */
.shelf {
    display: flex; flex-direction: column; align-items: flex-start; gap: .35rem;
    padding: 1.6rem 1.6rem 1.7rem 2.9rem;
    color: var(--tag-ink); text-decoration: none;
    border-radius: 6px 26px 26px 6px;
    background: radial-gradient(circle at 1.25rem 50%, var(--surface) .45rem, transparent .46rem), var(--tag);
}
a.shelf:hover { text-decoration: none; }
a.shelf:hover .shelf-name { text-decoration: underline; }
.shelf-note { font-weight: 700; }
.shelf-name { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.shelf-was { font-size: .95rem; }
.shelf-foot { font-size: .95rem; }
.shelf .btn { margin-top: .6rem; }
.shelf-static { margin: 1.25rem 0 1rem; }

/* ---- Accueil ------------------------------------------------------------ */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3rem); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.3fr .7fr; } }
.hero h1 { max-width: 16ch; }
.hero .lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 40rem; margin-bottom: 1.5rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 1.25rem 0 0; padding: 0; }
.chips a {
    display: inline-flex; gap: .4rem; padding: .35rem .8rem;
    border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
    color: var(--ink); text-decoration: none; font-size: .95rem;
}
.chips a:hover { border-color: var(--ink); }

.section { padding-top: 2.5rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-head h2 { margin: 0; }

/* ---- Cartes produit ----------------------------------------------------- */
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card:hover { border-color: var(--ink); }
.card-link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.card-media { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; background: #E9EDF3; }
.card-media img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.ph { font-size: 3.5rem; line-height: 1; }
.drop {
    position: absolute; top: .6rem; left: .6rem;
    background: var(--deal); color: #fff; font-weight: 800; font-size: .85rem;
    padding: .15rem .5rem; border-radius: 3px;
}
.card-body { display: flex; flex-direction: column; gap: .25rem; flex: 1; padding: .8rem .9rem 1rem; }
.card-brand { color: var(--ink-soft); font-size: .85rem; }
.card-title {
    margin: 0; font-size: 1rem; font-weight: 700; letter-spacing: -0.01em;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { margin-top: auto; padding-top: .7rem; display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.from { font-size: .85rem; color: var(--ink-soft); }
.card-offers { margin-left: auto; font-size: .85rem; color: var(--ink-soft); }

/* ---- Résultats ---------------------------------------------------------- */
.crumbs { padding-top: 1rem; font-size: .9rem; color: var(--ink-soft); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .25rem .5rem; list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: .5rem; color: var(--line); }
.crumbs a { color: inherit; }

.listing { display: grid; gap: 1.5rem; padding: 1.25rem 0 3rem; }
@media (min-width: 900px) { .listing { grid-template-columns: 260px minmax(0, 1fr); align-items: start; } }

.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 1rem 1rem; }
.filters summary { padding: .9rem 0; font-weight: 800; cursor: pointer; }
.facet { margin-top: 1rem; }
.facet h3 { font-size: .95rem; margin-bottom: .35rem; }
.facet ul { list-style: none; margin: 0; padding: 0; }
.facet li a { display: flex; justify-content: space-between; gap: .5rem; padding: .25rem 0; color: var(--ink); text-decoration: none; }
.facet li a:hover { text-decoration: underline; }
.facet [aria-current] { font-weight: 800; }
.facet [aria-current]::before { content: ""; width: .35rem; margin: .15rem .5rem .15rem 0; background: var(--tag); border-radius: 2px; }
.facet .n { color: var(--ink-soft); font-weight: 400; margin-left: auto; }
.price-range { display: flex; gap: .5rem; }
.price-range .field { margin-bottom: .6rem; flex: 1; }

.toolbar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1rem; }
.results-title { font-size: 1.6rem; margin: 0; }
.results-count { margin: 0; color: var(--ink-soft); }
.sorts { display: flex; flex-wrap: wrap; gap: .3rem; }
.sorts a {
    padding: .3rem .75rem; border: 1px solid var(--line); border-radius: 999px;
    background: var(--surface); color: var(--ink); font-size: .92rem; text-decoration: none;
}
.sorts a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem; margin-top: 2rem; }
.page {
    min-width: 2.4rem; padding: .4rem .7rem; text-align: center;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); color: var(--ink); text-decoration: none;
}
a.page:hover { border-color: var(--ink); }
.page.is-current { background: var(--ink); border-color: var(--ink); color: #fff; }

.empty { background: var(--surface); border: 1px dashed #98A2B3; border-radius: var(--radius); padding: 2rem; text-align: center; }
.empty h1, .empty h2 { font-size: 1.4rem; }

/* ---- Fiche produit ------------------------------------------------------ */
.product-top { display: grid; gap: 2rem; padding-top: 1.25rem; }
@media (min-width: 800px) { .product-top { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); } }
.product-media {
    display: grid; place-items: center; aspect-ratio: 1; overflow: hidden;
    background: #E9EDF3; border: 1px solid var(--line); border-radius: var(--radius);
}
.product-media img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.product-media .ph { font-size: 8rem; }
.product-brand { margin: 0 0 .25rem; color: var(--ink-soft); font-weight: 600; }
.lead-sm { color: var(--ink-soft); max-width: 60ch; }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { margin-bottom: .35rem; }
.fact-good { color: var(--deal); font-weight: 700; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.section-tight { margin-top: 1.5rem; }
.two-col { display: grid; gap: 1.25rem; margin-top: 1.25rem; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1.4fr 1fr; } }
.note { margin: 1rem 0 0; font-size: .9rem; color: var(--ink-soft); }

.table-wrap { overflow-x: auto; }
.offers { width: 100%; border-collapse: collapse; }
.offers th { padding: .5rem .75rem; text-align: left; font-size: .9rem; font-weight: 600; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.offers td { padding: .85rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.offers tr:last-child td { border-bottom: 0; }
.offers .num { text-align: right; }
.offers tr.is-best td { background: var(--deal-bg); }
.offers tr.is-out { color: var(--ink-soft); }
.merchant { font-weight: 700; }
.rating { display: block; font-size: .85rem; color: var(--ink-soft); }
.badge-best { display: inline-block; margin-left: .4rem; padding: .1rem .45rem; border-radius: 3px; background: var(--deal); color: #fff; font-size: .8rem; font-weight: 700; }
.stock-ok { color: var(--deal); font-weight: 600; }
.stock-out { color: var(--warn); }

@media (max-width: 700px) {
    .offers thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .offers, .offers tbody, .offers tr, .offers td { display: block; }
    .offers tr { padding: .6rem 0; border-bottom: 1px solid var(--line); }
    .offers tr:last-child { border-bottom: 0; }
    .offers td { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .25rem .75rem; border: 0; text-align: right; }
    .offers td[data-label]::before { content: attr(data-label); color: var(--ink-soft); text-align: left; }
    .offers td:first-child { display: block; text-align: left; }
    .offers td.action { justify-content: stretch; }
    .offers td.action .btn { width: 100%; }
}

.stats { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: 0 0 1rem; }
.stats dt { font-size: .9rem; color: var(--ink-soft); }
.stats dd { margin: 0; font-size: 1.15rem; font-weight: 800; }
.chart { display: block; width: 100%; height: auto; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-area { fill: var(--tag); opacity: .45; }
.chart-line { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.chart-text { fill: var(--ink-soft); font: 11px var(--font); }
.chart-dot { fill: var(--deal); stroke: #fff; stroke-width: 2; }
.chart-dot-now { fill: var(--ink); stroke: #fff; stroke-width: 2; }

.specs { width: 100%; border-collapse: collapse; }
.specs th, .specs td { padding: .5rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.specs th { width: 42%; padding-right: 1rem; font-weight: 600; color: var(--ink-soft); }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 0; }

/* ---- Boutons et formulaires -------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .6rem 1.1rem; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
    background: var(--surface); color: var(--ink);
    border: 2px solid var(--ink); border-radius: var(--radius);
}
.btn:hover { background: var(--paper); }
.btn-primary { background: var(--action); border-color: var(--action); color: #fff; }
.btn-primary:hover { background: var(--action-dark); border-color: var(--action-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #26334d; }
.btn-danger { border-color: var(--warn); color: var(--warn); }
.btn-danger:hover { background: #FEE4E2; }
.btn-sm { padding: .35rem .75rem; font-size: .9rem; }

.field { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .9rem; }
.field label { font-weight: 600; font-size: .9rem; }
.field-check label { display: flex; align-items: center; gap: .5rem; font-weight: 400; font-size: 1rem; }
.hint { font-size: .85rem; color: var(--ink-soft); font-weight: 400; }
.input, .select, .textarea {
    width: 100%; padding: .55rem .7rem; font: inherit; color: inherit;
    background: var(--surface); border: 1px solid #98A2B3; border-radius: var(--radius);
}
.textarea { min-height: 7rem; resize: vertical; }

/* ---- Pied de page ------------------------------------------------------- */
.site-footer { margin-top: 4rem; padding: 2rem 0; background: var(--ink); color: #D0D5DD; font-size: .92rem; }
.site-footer a { color: #fff; }
.site-footer p { max-width: 70ch; }

/* ---- Installation et administration ------------------------------------ */
.login-box { max-width: 420px; margin: 3rem auto; }
.checks { list-style: none; margin: 0 0 1rem; padding: 0; }
.checks .ok { color: var(--deal); }
.checks .ko { color: var(--warn); font-weight: 700; }

.admin-bar { background: var(--ink); color: #fff; }
.admin-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.25rem; padding: .7rem 0; }
.admin-bar a { color: #fff; font-weight: 600; text-decoration: none; }
.admin-bar a:hover, .admin-bar a[aria-current] { text-decoration: underline; text-decoration-color: var(--tag); text-decoration-thickness: 3px; }
.admin-bar .spacer { margin-left: auto; }
.admin-bar .btn { border-color: #fff; background: transparent; color: #fff; }
.admin-main { padding: 1.5rem 0 3rem; }
.admin-main h1 { font-size: 1.8rem; }
.admin-main h2 { margin-top: 2rem; }
.flash { margin-bottom: 1rem; padding: .7rem 1rem; border-radius: var(--radius); font-weight: 600; }
.flash-ok { background: var(--deal-bg); color: var(--deal); }
.flash-err { background: #FEE4E2; color: var(--warn); }

.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); }
.table th, .table td { padding: .6rem .75rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table th { font-size: .9rem; font-weight: 600; color: var(--ink-soft); }
.table .num { text-align: right; }
.table .row-actions { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; }
.inline-form { display: inline; }
.toolbar-admin { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.form-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid .wide { grid-column: 1 / -1; }
.stat-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 1.5rem; }
.stat { padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat b { display: block; font-size: 1.9rem; letter-spacing: -0.03em; line-height: 1.1; }
.offer-row { display: grid; gap: .5rem 1rem; align-items: end; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); padding: 1rem 0; border-bottom: 1px solid var(--line); }
.offer-row .field { margin: 0; }
.offer-row .grow { grid-column: span 2; }
.offer-row .btns { display: flex; gap: .4rem; }

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; }
}
