/* ============================================================
   qualecomprare.net — Sistema di design condiviso
   Stile: pulito, minimale, molto leggibile. Accento blu.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=Spline+Sans+Mono:wght@400;500;600&display=swap');

:root {
  /* ---- Neutrals (cool, low chroma) ---- */
  --bg:        oklch(99% 0.003 240);
  --surface:   #ffffff;
  --surface-2: oklch(97.5% 0.005 240);
  --surface-3: oklch(95% 0.006 240);
  --border:    oklch(91.5% 0.008 240);
  --border-2:  oklch(87% 0.01 240);
  --ink:       oklch(22% 0.02 250);
  --ink-2:     oklch(38% 0.018 250);
  --muted:     oklch(55% 0.015 250);
  --faint:     oklch(70% 0.012 250);

  /* ---- Accent (blue) ---- */
  --accent:      oklch(56% 0.17 255);
  --accent-600:  oklch(50% 0.18 255);
  --accent-700:  oklch(44% 0.17 255);
  --accent-soft: oklch(96% 0.03 255);
  --accent-ink:  oklch(40% 0.16 255);

  /* ---- Semantic ---- */
  --save:      oklch(58% 0.15 152);   /* risparmio / miglior prezzo */
  --save-soft: oklch(95% 0.04 152);
  --warn:      oklch(70% 0.16 70);     /* badge offerta */
  --warn-soft: oklch(95% 0.05 75);
  --star:      oklch(76% 0.15 80);

  /* ---- Type ---- */
  --sans: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --mono: 'Spline Sans Mono', ui-monospace, monospace;

  /* ---- Radius / shadow ---- */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --shadow-sm: 0 1px 2px oklch(40% 0.03 250 / 0.06), 0 1px 3px oklch(40% 0.03 250 / 0.05);
  --shadow:    0 2px 4px oklch(40% 0.03 250 / 0.05), 0 6px 16px oklch(40% 0.03 250 / 0.08);
  --shadow-lg: 0 8px 24px oklch(40% 0.04 250 / 0.10), 0 18px 48px oklch(40% 0.04 250 / 0.10);

  /* ---- Layout ---- */
  --maxw: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; font-weight: 700; color: var(--ink); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }

/* ---- Layout helpers ---- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(40px, 6vw, 72px); }
.section-tight { padding-block: clamp(28px, 4vw, 44px); }
.stack > * + * { margin-top: var(--s, 16px); }

.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--accent-ink);
}
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(22px, 2.6vw, 30px); }
.section-head .lead { color: var(--muted); margin-top: 6px; font-size: 15px; }
.link-more { color: var(--accent-ink); font-weight: 600; font-size: 14px; white-space: nowrap; }
.link-more:hover { text-decoration: underline; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; line-height: 1; white-space: nowrap;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px oklch(50% 0.18 255 / .35); }
.btn-primary:hover { background: var(--accent-600); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--faint); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: oklch(30% 0.02 250); }
.btn-sm { padding: 8px 14px; font-size: 13.5px; }
.btn-lg { padding: 14px 26px; font-size: 16px; }

/* ============================================================
   Image placeholders (striped, mono label) — no real assets yet
   ============================================================ */
.ph {
  position: relative; overflow: hidden; border-radius: var(--r);
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 11px, var(--surface-3) 11px 22px);
  display: grid; place-items: center; color: var(--faint);
}
.ph::after {
  content: attr(data-label);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em;
  text-transform: lowercase; text-align: center; padding: 8px 12px;
  max-width: 90%; line-height: 1.3;
}
.ph.logo {
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.ph.logo::after { font-weight: 600; text-transform: none; font-family: var(--sans); font-size: 14px; letter-spacing: -0.01em; color: var(--ink-2); }

/* ============================================================
   Badges, pills, ratings
   ============================================================ */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; line-height: 1; }
.badge-save { background: var(--save-soft); color: oklch(40% 0.13 152); }
.badge-deal { background: var(--warn-soft); color: oklch(48% 0.14 60); }
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge-neutral { background: var(--surface-3); color: var(--ink-2); }

.stars { display: inline-flex; gap: 1px; color: var(--star); font-size: 13px; letter-spacing: 1px; }
.rating { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.rating b { color: var(--ink); font-weight: 700; }

.price { font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.price-from { font-size: 12px; color: var(--muted); font-weight: 600; }
.price-strike { color: var(--faint); text-decoration: line-through; font-weight: 600; font-variant-numeric: tabular-nums; }
.offers-count { color: var(--muted); font-size: 13px; }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease;
}
.card:hover { box-shadow: var(--shadow); border-color: var(--border-2); }

/* product card */
.pcard { display: flex; flex-direction: column; height: 100%; }
.pcard .pcard-media { aspect-ratio: 4/3; background: var(--surface); border-bottom: 1px solid var(--border); }
.pcard .pcard-media .ph { border-radius: 0; height: 100%; }
.pcard .pcard-body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pcard .pcard-brand { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }
.pcard .pcard-title { font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.32; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .pcard-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding-top: 6px; flex-wrap: wrap; }
.pcard .pcard-price .price { font-size: 18px; }
/* CTA a destra, allineata al prezzo. È uno <span> (la card è già un link),
   quindi l'hover va agganciato alla card, non al pulsante. */
.pcard .pcard-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pcard .pcard-cta { padding: 8px 13px; font-size: 13px; }
.pcard:hover .pcard-cta { background: var(--accent-600); }

/* category tile */
.cat-tile {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.cat-tile:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.cat-ico { width: 44px; height: 44px; flex: none; border-radius: 11px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; }
.cat-ico svg { width: 22px; height: 22px; }
.cat-tile .cat-name { font-weight: 700; font-size: 15px; color: var(--ink); }
.cat-tile .cat-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

/* brand chip */
.brand-chip {
  display: grid; place-items: center; height: 76px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  font-weight: 700; color: var(--ink-2); font-size: 16px; letter-spacing: -0.01em;
  transition: border-color .15s ease, box-shadow .15s ease, color .15s;
}
.brand-chip:hover { border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }

/* article card */
.acard { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; transition: box-shadow .18s ease, transform .18s ease, border-color .18s; }
.acard:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.acard .acard-media { aspect-ratio: 16/10; }
.acard .acard-media .ph { border-radius: 0; height: 100%; }
.acard .acard-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.acard .acard-cat { font-size: 12px; font-weight: 700; color: var(--accent-ink); text-transform: uppercase; letter-spacing: 0.06em; }
.acard .acard-title { font-size: 17px; font-weight: 700; line-height: 1.25; }
.acard .acard-excerpt { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acard .acard-meta { margin-top: auto; padding-top: 6px; font-size: 12.5px; color: var(--faint); display: flex; gap: 10px; }

/* ============================================================
   Header / search (shared baseline; variants may extend)
   ============================================================ */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--border); }
.hdr-row { display: flex; align-items: center; gap: 18px; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; letter-spacing: -0.03em; color: var(--ink); white-space: nowrap; }
.logo .logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 16px; }
.logo .logo-tld { color: var(--accent-ink); }

.searchbar { flex: 1; display: flex; align-items: center; gap: 0; background: var(--surface); border: 1.5px solid var(--border-2); border-radius: 999px; padding: 4px 4px 4px 16px; transition: border-color .15s, box-shadow .15s; max-width: 640px; }
.searchbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.searchbar svg { width: 19px; height: 19px; color: var(--muted); flex: none; }
.searchbar input { flex: 1; border: 0; outline: 0; background: transparent; font-family: inherit; font-size: 15px; color: var(--ink); padding: 9px 10px; min-width: 0; }
.searchbar input::placeholder { color: var(--faint); }
.searchbar .btn { padding: 9px 18px; }

.hdr-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn { width: 42px; height: 42px; border-radius: 999px; border: 0; background: transparent; color: var(--ink-2); display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-3); }
.icon-btn svg { width: 21px; height: 21px; }

.nav-strip { border-top: 1px solid var(--border); background: var(--surface); overflow: hidden; max-height: 53px; transition: max-height .28s ease, opacity .2s ease, border-color .2s ease; }
.site-header.nav-collapsed .nav-strip { max-height: 0; opacity: 0; border-top-color: transparent; }
.nav-strip .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav-strip .wrap::-webkit-scrollbar { display: none; }
.nav-link { padding: 12px 14px; font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; border-bottom: 2px solid transparent; }
.nav-link:hover { color: var(--accent-ink); border-color: var(--border-2); }
.nav-link.active { color: var(--accent-ink); border-color: var(--accent); }

.menu-toggle { display: none; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--ink); color: oklch(80% 0.015 250); margin-top: 40px; }
.site-footer a { color: oklch(80% 0.015 250); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 32px; padding-block: 52px; }
.footer-grid h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px; font-weight: 700; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 14px; }
.footer-brand .logo { color: #fff; margin-bottom: 12px; }
.footer-brand p { font-size: 14px; line-height: 1.6; color: oklch(72% 0.015 250); max-width: 34ch; }
.footer-bottom { border-top: 1px solid oklch(34% 0.02 250); padding-block: 22px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: oklch(65% 0.015 250); }
.footer-bottom .langs { display: flex; gap: 14px; }
.footer-bottom .langs a.active { color: #fff; font-weight: 700; }

/* ============================================================
   Trust / how-it-works
   ============================================================ */
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.trust-item { display: flex; flex-direction: column; gap: 8px; }
.trust-item .trust-ico { width: 46px; height: 46px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; }
.trust-item .trust-ico svg { width: 24px; height: 24px; }
.trust-item h3 { font-size: 16px; }
.trust-item p { font-size: 14px; color: var(--muted); }

/* ============================================================
   Variant switcher (strumento di prototipo — non fa parte del sito)
   ============================================================ */
.variant-switch {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; align-items: center; gap: 4px;
  background: oklch(24% 0.02 250 / 0.96); backdrop-filter: blur(12px);
  border: 1px solid oklch(40% 0.02 250); border-radius: 999px;
  padding: 6px 8px 6px 14px; box-shadow: var(--shadow-lg);
  font-size: 13px; color: oklch(82% 0.01 250);
}
.variant-switch .vs-label { font-weight: 600; margin-right: 6px; white-space: nowrap; }
.variant-switch .vs-label b { color: #fff; }
.variant-switch a { width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; color: oklch(78% 0.01 250); font-weight: 700; font-size: 13px; transition: background .15s, color .15s; }
.variant-switch a:hover { background: oklch(36% 0.02 250); color: #fff; }
.variant-switch a.active { background: var(--accent); color: #fff; }
@media (max-width: 560px) { .variant-switch .vs-name { display: none; } }

/* ============================================================
   Mobile menu drawer
   ============================================================ */
.drawer-backdrop { position: fixed; inset: 0; background: oklch(20% 0.02 250 / 0.45); z-index: 99; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(86vw, 340px); background: var(--surface); z-index: 100; transform: translateX(100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer-body { padding: 12px 10px; overflow-y: auto; }
.drawer-body a { display: block; padding: 13px 14px; border-radius: var(--r-sm); font-weight: 600; color: var(--ink-2); font-size: 15px; }
.drawer-body a:hover { background: var(--surface-2); color: var(--accent-ink); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 15.5px; }
  .hdr-row { height: 60px; gap: 12px; }
  .searchbar { display: none; }       /* spostata sotto l'header su mobile */
  .nav-strip { display: none; }
  .menu-toggle { display: grid; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px 20px; }
  .trust-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 460px) {
  .footer-grid { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr; }
}

/* mobile search shown under header */
.mobile-search { display: none; }
@media (max-width: 760px) {
  .mobile-search { display: block; padding: 10px var(--gutter) 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .mobile-search .searchbar { display: flex; max-width: none; }
}
