/* TrueDealsHub - cartellino da scaffale: giallo per i prezzi, rosso solo per i possibili errori */
@font-face {
  font-family: "Archivo";
  src: url("/static/fonts/archivo-latin.woff2") format("woff2-variations"), url("/static/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --ink: #1b1f2a;
  --ink-2: #4a5160;
  --ink-3: #6b7282;
  --page: #f4f5f2;
  --surface: #ffffff;
  --line: #dfe2dc;
  --tag: #ffd21f;          /* cartellino */
  --tag-ink: #1b1f2a;
  --err: #c8231b;          /* possibile errore */
  --err-soft: #fdecea;
  --link: #1d4ed8;
  --good: #187a43;
  --focus: #1d4ed8;
  --radius: 10px;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eceef2; --ink-2: #b9bfcb; --ink-3: #9098a7;
    --page: #12151c; --surface: #1a1e27; --line: #2c323e;
    --err: #ff6b5e; --err-soft: #2d1715; --link: #7aa2ff; --good: #4cc38a; --focus: #7aa2ff;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 400 16px/1.55 var(--sans); font-stretch: 100%;
  font-feature-settings: "tnum" 1;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
h1, h2, h3 { font-stretch: 78%; font-weight: 750; letter-spacing: -0.01em; line-height: 1.1; }

/* ---------- testata ---------- */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; gap: 20px; align-items: center; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: baseline; gap: 2px; color: var(--ink); text-decoration: none; font-stretch: 72%; font-weight: 800; font-size: 24px; letter-spacing: -0.02em; }
.logo:hover { text-decoration: none; }
.logo-tag { background: var(--tag); color: var(--tag-ink); padding: 0 6px; margin-left: 2px; border-radius: 3px; transform: rotate(-2deg); display: inline-block; }
.top .search { flex: 1; min-width: 260px; }
.nav-how { display: flex; gap: 16px; font-size: 15px; margin-left: auto; }
.nav-how a { color: var(--ink-2); text-decoration: none; }
.nav-how a:hover { color: var(--ink); text-decoration: underline; }

.search { display: flex; }
.search input {
  flex: 1; min-width: 0; padding: 11px 14px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--page); border: 1.5px solid var(--line); border-right: 0; border-radius: var(--radius) 0 0 var(--radius);
}
.search input:focus { outline: none; border-color: var(--ink); background: var(--surface); }
.search button {
  padding: 0 18px; font: inherit; font-weight: 700; font-stretch: 85%; font-size: 16px; cursor: pointer;
  color: var(--surface); background: var(--ink); border: 0; border-radius: 0 var(--radius) var(--radius) 0;
}
.beta { font-size: 13px; color: var(--ink-3); padding: 6px 0; }

/* ---------- apertura home ---------- */
.intro { padding: 40px 0 8px; max-width: 820px; }
.intro h1 { font-size: clamp(34px, 6vw, 60px); margin: 0 0 14px; }
.intro p { color: var(--ink-2); font-size: 18px; margin: 0 0 22px; max-width: 62ch; }
.intro .search input { padding: 15px 16px; font-size: 18px; background: var(--surface); }
.intro .search button { font-size: 18px; padding: 0 24px; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.examples a { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 14px; text-decoration: none; }
.examples a:hover { border-color: var(--ink); color: var(--ink); }
.facts { margin: 18px 0 0; color: var(--ink-3); font-size: 14px; }

/* ---------- sezioni ---------- */
.block { margin: 44px 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.block h2 { font-size: 30px; margin: 0; }
.block-err h2 { color: var(--err); }
.block > p { color: var(--ink-2); margin: 0 0 18px; max-width: 70ch; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }

/* ---------- offerta ---------- */
.deal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.deal-err { border-color: var(--err); box-shadow: inset 0 3px 0 var(--err); }
.deal-img { display: grid; place-items: center; height: 168px; padding: 14px; background: #fff; border-bottom: 1px solid var(--line); }
.deal-img img { max-height: 140px; width: auto; object-fit: contain; }
.noimg { color: #8a93a3; font-size: 13px; }
.deal-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.deal-body .btn { margin-top: auto; }
.deal-body .err-note + .btn, .deal-body .store + .btn { margin-top: 8px; }
.deal-title { font-size: 15px; font-weight: 500; font-stretch: 100%; line-height: 1.35; margin: 0; letter-spacing: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.deal-title a, .row-body > a { color: var(--ink); text-decoration: none; }
.deal-title a:hover, .row-body > a:hover { text-decoration: underline; }
.deal-body p { line-height: 1.35; }

/* cartellino: il prezzo e' l'elemento forte della pagina */
.pricetag { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.pricetag .now {
  background: var(--tag); color: var(--tag-ink); font-weight: 800; font-stretch: 70%; font-size: 30px; line-height: 1;
  padding: 6px 9px 5px; border-radius: 4px; letter-spacing: -0.01em;
}
.deal-err .pricetag .now { background: var(--err); color: #fff; }
.pricetag .was { color: var(--ink-3); font-size: 14px; line-height: 1.2; }
.pricetag .was s { color: var(--ink-2); }

/* barra del prezzo: dove sta il prezzo rispetto al riferimento */
.bar { position: relative; height: 8px; background: var(--page); border-radius: 999px; margin-top: 2px; overflow: hidden; }
.bar span { position: absolute; inset: 0 auto 0 0; background: var(--good); border-radius: 999px; }
.deal-err .bar span { background: var(--err); }
.bar-label { font-size: 13px; color: var(--ink-2); margin: 0; }
.bar-label strong { color: var(--good); font-weight: 700; }
.deal-err .bar-label strong { color: var(--err); }
.store { font-size: 13px; color: var(--ink-3); margin: 0; }
.err-note { font-size: 12.5px; color: var(--err); margin: 0; }

.btn {
  display: inline-block; text-align: center; margin-top: auto; padding: 10px 14px; border-radius: 8px;
  background: var(--ink); color: var(--surface); font-weight: 700; font-stretch: 88%; text-decoration: none;
}
.btn:hover { text-decoration: none; background: #000; }
@media (prefers-color-scheme: dark) { .btn:hover { background: #fff; } }
.btn-sm { padding: 6px 12px; font-size: 14px; }

/* ---------- ricerca ---------- */
.page-title { font-size: clamp(26px, 4vw, 40px); margin: 28px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; margin: 0 0 8px; color: var(--ink-2); }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--ink); }
.list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 8px; }
.row { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.row-img { width: 76px; height: 76px; flex: none; display: grid; place-items: center; background: #fff; border-radius: 6px; }
.row-img img { max-height: 68px; width: auto; object-fit: contain; }
.row-body { min-width: 0; flex: 1; }
.row-body > a { color: var(--ink); font-weight: 500; }
.row-price { flex: none; text-align: right; }
.row-price .now { background: var(--tag); color: var(--tag-ink); font-weight: 800; font-stretch: 72%; font-size: 22px; padding: 3px 7px; border-radius: 4px; display: inline-block; }
.meta { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); }
.save { color: var(--good); font-weight: 700; }

/* ---------- prodotto ---------- */
.prod { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; margin-top: 20px; }
.prod-img { background: #fff; border-radius: var(--radius); padding: 18px; display: grid; place-items: center; border: 1px solid var(--line); }
.prod-img img { max-height: 280px; width: auto; object-fit: contain; }
.prod .pricetag .now { font-size: 42px; }
.prod-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.check-links { font-size: 14px; color: var(--ink-3); }
@media (max-width: 720px) { .prod { grid-template-columns: 1fr; } }

h2 { font-size: 24px; margin: 34px 0 12px; }
.chart { width: 100%; max-width: 720px; height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.chart .ln { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.chart .pt { fill: var(--tag); stroke: var(--ink); stroke-width: 2; }
.chart .ax { fill: var(--ink-3); font-size: 12px; font-family: var(--sans); }

.offers { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 15px; }
.offers th, .offers td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.offers th { font-size: 13px; color: var(--ink-3); font-weight: 600; background: var(--page); }
.offers tr:first-child td { background: color-mix(in srgb, var(--tag) 14%, var(--surface)); }
.offers .amount { font-weight: 800; font-stretch: 75%; font-size: 19px; }
.tag { background: var(--good); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 7px; font-weight: 600; }
@media (max-width: 680px) {
  .offers thead { display: none; }
  .offers tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px; border-bottom: 1px solid var(--line); }
  .offers td { border: 0; padding: 0; }
}

/* ---------- testi ---------- */
.prose { max-width: 72ch; }
.prose h1 { font-size: clamp(28px, 4vw, 40px); margin: 28px 0 12px; }
.prose h2 { font-size: 22px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }

/* ---------- piede ---------- */
.foot { margin-top: 64px; padding: 28px 0 36px; background: var(--surface); border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.foot p { max-width: 80ch; }
.foot-nav { display: flex; gap: 18px; flex-wrap: wrap; margin: 14px 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* categorie in home */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 24px; margin: 22px 0 6px; }
.cat p { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.cat p a { color: var(--ink-2); text-decoration: none; }
.cat p a:hover { color: var(--ink); text-decoration: underline; }
.cat-name { font-weight: 700; color: var(--ink); text-decoration: none; }
.cat-name:hover { text-decoration: underline; }

/* barra filtri della ricerca */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 10px 0 12px; font-size: 14px; }
.f-field { display: flex; flex-direction: column; gap: 4px; color: var(--ink-2); }
.f-field select, .f-field input { font: inherit; color: var(--ink); background: var(--page); border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; min-width: 0; }
.f-field select { max-width: 240px; }
.f-price input { width: 84px; }
.f-check { display: flex; align-items: center; gap: 6px; padding-bottom: 8px; }
.f-check input { width: 16px; height: 16px; accent-color: var(--ink); }
.filters button { font: inherit; font-weight: 600; background: var(--ink); color: var(--page); border: 0; border-radius: 6px; padding: 9px 16px; cursor: pointer; }
.filters :focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.chip-link { text-decoration: none; }
.chip-link:hover { border-color: var(--ink); }
@media (max-width: 560px) { .filters { gap: 8px 10px; } .f-field select { max-width: 100%; } .filters button { width: 100%; } }

/* voli */
.lead { color: var(--ink-2); max-width: 70ch; margin: 0 0 6px; }
.flight .route { margin: 0; font-size: 17px; }
.flight .row-price { display: flex; align-items: center; gap: 10px; }
@media (max-width: 560px) { .flight { flex-wrap: wrap; } .flight .row-price { width: 100%; justify-content: space-between; } }

/* barra delle sezioni */
.sections { border-top: 1px solid var(--line); }
.sections-in { display: flex; gap: 4px; align-items: center; overflow-x: auto; scrollbar-width: none; padding-top: 4px; padding-bottom: 4px; }
.sections-in::-webkit-scrollbar { display: none; }
.sections a { white-space: nowrap; padding: 6px 10px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500; }
.sections a:hover { color: var(--ink); background: var(--page); }
.sections a[aria-current="page"] { color: var(--ink); background: var(--tag); }
.sections .sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; flex: none; }
.sections a.travel { color: var(--link); }
.sections a.travel[aria-current="page"] { color: var(--tag-ink); }
/* hub viaggi */
.hubs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 16px 0; }
.hub { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--ink); text-decoration: none; }
.hub:hover { border-color: var(--ink); }
.hub h2 { margin: 0 0 6px; font-size: 20px; }
.hub p { margin: 0; color: var(--ink-2); font-size: 15px; }
.hub .soon { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.mini { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; font-size: 14px; }
.mini li { display: flex; justify-content: space-between; gap: 8px; }
.mini b { white-space: nowrap; }

.hub-title { font-size: 20px; margin: 26px 0 4px; }
