/* ==========================================================================
   LEFO Search — foglio di stile unico (IT + EN + pagine editoriali)
   ========================================================================== */

:root {
  --bg-1: #0b1220;
  --bg-2: #111827;
  --bg-3: #0e223d;

  --panel: rgba(255, 255, 255, .06);
  --panel-strong: rgba(255, 255, 255, .10);
  --panel-border: rgba(255, 255, 255, .14);

  --on-dark: #f8fafc;
  --on-dark-soft: rgba(248, 250, 252, .72);
  --on-dark-mute: rgba(248, 250, 252, .55);

  --card: #ffffff;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --line: #e2e8f0;

  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --accent: #f97316;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --danger: #dc2626;

  --r-xl: 20px;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 9px;

  --sh-sm: 0 2px 8px rgba(2, 6, 23, .10);
  --sh-md: 0 10px 28px rgba(2, 6, 23, .18);
  --sh-lg: 0 20px 50px rgba(2, 6, 23, .28);

  --maxw: 1240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--on-dark);
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(37, 99, 235, .28), transparent 60%),
    radial-gradient(900px 500px at 95% 0%, rgba(249, 115, 22, .18), transparent 55%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
  background-attachment: fixed;
  line-height: 1.55;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  background: #fff;
  color: var(--text);
  padding: 10px 16px;
  border-radius: 0 0 var(--r-md) 0;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------- Header --------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(9, 14, 26, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.site-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -.02em;
  font-size: 19px;
}
.brand svg { width: 34px; height: 34px; flex: 0 0 auto; }
.brand span small {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--on-dark-mute);
}

.site-nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
  align-items: center;
}
.site-nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--on-dark-soft);
  padding: 7px 11px;
  border-radius: 999px;
}
.site-nav a:hover { color: #fff; background: var(--panel); }
.site-nav a[aria-current="page"] { color: #fff; background: var(--panel-strong); }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  overflow: hidden;
}
.lang-switch a {
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  text-decoration: none;
  color: var(--on-dark-soft);
}
.lang-switch a[aria-current="true"] { background: var(--primary); color: #fff; }

/* ------------------------------- Layout --------------------------------- */

.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 18px 60px;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 74px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--r-lg);
  padding: 16px;
  backdrop-filter: blur(10px);
}

.sidebar h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .11em;
  color: var(--on-dark-mute);
  margin-bottom: 12px;
}

.sidebar__toggle { display: none; }

.field { margin-bottom: 13px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--on-dark-soft);
  margin-bottom: 5px;
}
.field input,
.field select {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  border: 1px solid var(--panel-border);
  background: rgba(9, 14, 26, .55);
  color: var(--on-dark);
  font: inherit;
  font-size: 14px;
}
.field input::placeholder { color: var(--on-dark-mute); }
.field select option { background: #111827; color: #fff; }
.field .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: var(--r-sm);
  padding: 11px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, background .18s ease, box-shadow .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: var(--sh-sm); }
.btn--primary:hover { box-shadow: 0 8px 22px rgba(37, 99, 235, .45); }
.btn--ghost { background: var(--panel-strong); color: var(--on-dark); border: 1px solid var(--panel-border); }
.btn--ghost:hover { background: rgba(255, 255, 255, .16); }
.btn--block { width: 100%; }
.btn--sm { padding: 8px 12px; font-size: 13px; }

.sidebar .btn + .btn { margin-top: 8px; }

.sidebar hr {
  border: 0;
  border-top: 1px solid var(--panel-border);
  margin: 18px 0;
}

.cat-list { display: flex; flex-direction: column; gap: 3px; }
.cat-list a {
  display: block;
  padding: 8px 11px;
  border-radius: var(--r-sm);
  text-decoration: none;
  font-size: 14px;
  color: var(--on-dark-soft);
}
.cat-list a:hover { background: var(--panel-strong); color: #fff; }
.cat-list a.is-active { background: var(--primary); color: #fff; font-weight: 700; }

/* --------------------------------- Hero --------------------------------- */

.hero { text-align: center; padding: 26px 0 8px; }

.hero h1 {
  font-size: clamp(26px, 4.4vw, 42px);
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -.025em;
  margin-bottom: 12px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, #60a5fa, #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lede {
  max-width: 640px;
  margin: 0 auto 20px;
  color: var(--on-dark-soft);
  font-size: clamp(15px, 1.9vw, 17px);
}

.searchbar {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, .96);
  padding: 8px;
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  max-width: 720px;
  margin: 0 auto;
}
.searchbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
}
.searchbar input:focus { outline: none; }
.searchbar .btn { padding-inline: 22px; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 16px auto 4px;
  max-width: 760px;
}
.chip {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--on-dark-soft);
  cursor: pointer;
  text-decoration: none;
}
.chip:hover { background: var(--panel-strong); color: #fff; }
.chip[aria-pressed="true"] { background: var(--primary); border-color: transparent; color: #fff; }

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: center;
  list-style: none;
  margin: 20px 0 4px;
  font-size: 13px;
  color: var(--on-dark-mute);
}
.trust-row li { display: inline-flex; align-items: center; gap: 6px; }

/* ------------------------------- Risultati ------------------------------- */

.sort-bar {
  display: none;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 26px 0 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--panel-border);
}
.sort-bar.is-visible { display: flex; }
.sort-bar .count { font-size: 14px; font-weight: 600; color: var(--on-dark-soft); }
.sort-bar .spacer { margin-left: auto; }
.sort-bar label { font-size: 13px; color: var(--on-dark-mute); }
.sort-bar select {
  font: inherit;
  font-size: 13.5px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--panel-border);
  background: rgba(9, 14, 26, .6);
  color: var(--on-dark);
}
.sort-bar select option { background: #111827; }

.results { display: flex; flex-direction: column; gap: 12px; }

.card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  background: var(--card);
  color: var(--text);
  border-radius: var(--r-lg);
  padding: 14px;
  box-shadow: var(--sh-sm);
  text-decoration: none;
  transition: transform .14s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }

.card__img {
  width: 104px;
  height: 104px;
  object-fit: contain;
  background: #f8fafc;
  border-radius: var(--r-md);
  padding: 6px;
}

.card__title {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__store {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.card__meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.card__delivery { font-size: 12.5px; color: var(--ok); margin-top: 6px; font-weight: 600; }

.card__buy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  min-width: 132px;
}

.price { font-size: 22px; font-weight: 900; color: var(--text); letter-spacing: -.02em; }
.price-old { font-size: 13px; color: var(--muted); text-decoration: line-through; }

.tag {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: .01em;
}
.tag--discount { background: #fee2e2; color: #b91c1c; }
.tag--new { background: var(--ok-soft); color: var(--ok); }
.tag--refurb { background: #dbeafe; color: #1d4ed8; }
.tag--used { background: #fef3c7; color: var(--warn); }
.tag--deal { background: #ede9fe; color: #6d28d9; }
.tag--deal-top { background: linear-gradient(135deg, #f97316, #ef4444); color: #fff; }
.tag--trust { background: #f1f5f9; color: var(--text-2); }
.tag--rating { background: #fffbeb; color: #a16207; }
.tag--partner { background: #0f172a; color: #fff; }

/* Barra "cerca anche su" sopra i risultati: i link marketplace pagano sempre */
.quick-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  font-size: 13px;
  color: var(--on-dark-mute);
}
.quick-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  color: var(--on-dark);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}
.quick-links a:hover { background: rgba(255, 255, 255, .18); }
.quick-links[hidden] { display: none; }

.cta {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
  padding: 9px 16px;
  border-radius: var(--r-sm);
  white-space: nowrap;
}
.card:hover .cta { box-shadow: 0 6px 18px rgba(37, 99, 235, .4); }

/* Skeleton di caricamento */
.skeleton {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--r-lg);
  padding: 14px;
}
.skeleton div { background: rgba(255, 255, 255, .10); border-radius: 8px; animation: pulse 1.3s ease-in-out infinite; }
.skeleton .s-img { width: 104px; height: 104px; }
.skeleton .s-lines { display: flex; flex-direction: column; gap: 9px; justify-content: center; }
.skeleton .s-lines i { display: block; height: 12px; background: rgba(255, 255, 255, .10); border-radius: 6px; animation: pulse 1.3s ease-in-out infinite; }
.skeleton .s-lines i:nth-child(1) { width: 72%; }
.skeleton .s-lines i:nth-child(2) { width: 46%; }
.skeleton .s-lines i:nth-child(3) { width: 30%; height: 18px; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

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

.notice {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--r-lg);
  padding: 26px 22px;
  text-align: center;
}
.notice h3 { font-size: 17px; margin-bottom: 8px; }
.notice p { color: var(--on-dark-soft); font-size: 14.5px; }
.notice .btn { margin-top: 14px; }
.notice--error { border-color: rgba(248, 113, 113, .45); }

.more-links {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  text-align: center;
}
.more-links p { font-size: 13px; color: var(--on-dark-mute); margin-bottom: 10px; }
.more-links a {
  display: inline-block;
  margin: 4px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--on-dark);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
}
.more-links a:hover { background: rgba(255, 255, 255, .18); }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}
.pagination span { font-weight: 700; font-size: 14px; }
.pagination button[disabled] { opacity: .45; cursor: not-allowed; }

/* ------------------------- Contenuti editoriali -------------------------- */

.section { margin-top: 52px; }
.section > h2 {
  font-size: clamp(21px, 3vw, 27px);
  font-weight: 900;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}
.section > p.lede { color: var(--on-dark-soft); max-width: 720px; margin-bottom: 20px; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.tile {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--r-lg);
  padding: 20px;
}
.tile h3 { font-size: 16.5px; margin-bottom: 7px; }
.tile p { color: var(--on-dark-soft); font-size: 14.5px; }
.tile .num {
  display: inline-flex;
  width: 30px; height: 30px;
  align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--primary);
  font-weight: 900;
  margin-bottom: 12px;
}

.link-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.link-cloud a {
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--on-dark-soft);
  text-decoration: none;
  font-size: 13.5px;
}
.link-cloud a:hover { background: var(--panel-strong); color: #fff; }

details.faq-item {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin-bottom: 10px;
}
details.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15.5px;
  list-style: none;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after { content: ' +'; color: var(--on-dark-mute); float: right; }
details.faq-item[open] summary::after { content: ' –'; }
details.faq-item p { margin-top: 10px; color: var(--on-dark-soft); font-size: 14.5px; }
details.faq-item a { color: #93c5fd; }

.prose { max-width: 760px; }
.prose h2 { font-size: 24px; margin: 32px 0 10px; font-weight: 800; }
.prose h3 { font-size: 18px; margin: 22px 0 8px; font-weight: 700; }
.prose p, .prose li { color: var(--on-dark-soft); font-size: 15.5px; }
.prose p { margin-bottom: 12px; }
.prose ul, .prose ol { margin: 0 0 14px 20px; }
.prose li { margin-bottom: 6px; }
.prose a { color: #93c5fd; }

.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--panel-border); }
table.pricing { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 520px; }
table.pricing th, table.pricing td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--panel-border); }
table.pricing th { background: var(--panel-strong); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
table.pricing tr:last-child td { border-bottom: 0; }
table.pricing td a { color: #93c5fd; font-weight: 700; }

/* ------------------------------ Sponsor --------------------------------- */

.sponsor {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--panel-border);
  text-align: center;
}
.sponsor__label {
  display: block;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--on-dark-mute);
  margin-bottom: 8px;
}
.sponsor a { display: inline-block; border-radius: var(--r-md); overflow: hidden; line-height: 0; }
.sponsor img { border-radius: var(--r-md); height: auto; }
.sponsor__note { font-size: 11.5px; color: var(--on-dark-mute); margin-top: 8px; line-height: 1.45; }

.sponsor-strip { margin: 46px 0 0; text-align: center; }
.sponsor-strip img { margin: 0 auto; }
.sponsor-strip .hide-narrow { display: none; }

@media (min-width: 800px) {
  .sponsor-strip .hide-narrow { display: inline-block; }
  .sponsor-strip .hide-wide { display: none; }
}

/* ------------------------------- Footer --------------------------------- */

.site-footer {
  border-top: 1px solid var(--panel-border);
  background: rgba(9, 14, 26, .55);
  margin-top: 40px;
}
.site-footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 34px 18px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 26px;
}
.site-footer h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .11em;
  color: var(--on-dark-mute);
  margin-bottom: 10px;
}
.site-footer ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.site-footer a { color: var(--on-dark-soft); text-decoration: none; font-size: 14px; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer p { font-size: 13px; color: var(--on-dark-mute); }
.site-footer__bottom {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 18px 28px;
  border-top: 1px solid var(--panel-border);
  font-size: 12.5px;
  color: var(--on-dark-mute);
}
.site-footer__bottom strong { color: var(--on-dark-soft); }

.linklike {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--on-dark-soft);
  text-decoration: underline;
  cursor: pointer;
}
.linklike:hover { color: #fff; }

/* ------------------------------- Consenso ------------------------------- */

.consent {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 24px));
  background: #0f172a;
  border: 1px solid var(--panel-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  padding: 18px;
  z-index: 1500;
  display: none;
}
.consent.is-open { display: block; }
.consent p { font-size: 13.5px; color: var(--on-dark-soft); margin-bottom: 12px; }
.consent a { color: #93c5fd; }
.consent__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------ Responsive ------------------------------ */

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .sidebar__toggle {
    display: flex;
    width: 100%;
    justify-content: space-between;
  }
  .sidebar__body { display: none; margin-top: 14px; }
  .sidebar.is-open .sidebar__body { display: block; }
}

@media (max-width: 620px) {
  .layout { padding: 16px 12px 48px; }
  .site-nav a { padding: 6px 8px; font-size: 13px; }
  .searchbar { flex-direction: column; border-radius: var(--r-lg); }
  .searchbar .btn { width: 100%; }
  .card { grid-template-columns: 84px minmax(0, 1fr); }
  .card__img { width: 84px; height: 84px; }
  .card__buy {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }
  .sort-bar .spacer { margin-left: 0; }
}
