/* ============================================================
   Catalogo Equal Quality — foglio di stile
   Colore guida: verde marchio #005221 (usato con forza).
   ============================================================ */
:root {
  --eq-green: #005221;
  --eq-green-d: #003c17;
  --eq-green-l: #e7f0ea;
  --eq-green-l2: #f2f7f3;
  --eq-ink: #17201b;
  --eq-muted: #5c6b62;
  --eq-line: #dde5df;
  --eq-bg: #f3f6f3;
  --eq-card: #ffffff;
  --eq-amber: #b8860b;
  --radius: 12px;
  --radius-sm: 8px;
  --wrap: 1200px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px -14px rgba(0,40,18,.25);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--eq-ink);
  background: var(--eq-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--eq-green); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
/* S.4 — niente trascinamento né menu "salva" tenendo premuto su telefono */
img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: .1em 0 .5em; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; margin: 1.6em 0 .7em; letter-spacing: -.01em; }
h3 { font-size: 1rem; margin: 0 0 .3em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 10px; z-index: 20; border-radius: 6px; }
.link-strong { font-weight: 600; }

/* ---------- header (verde) ---------- */
.site-header { background: var(--eq-green); color: #fff; }
.site-header__row {
  display: flex; align-items: center; gap: 22px;
  padding: 12px 20px; flex-wrap: wrap;
}
/* logo bianco su fondo trasparente, direttamente sul verde (niente riquadro bianco) */
.brand {
  padding: 4px 0;
  display: flex; align-items: center; flex: 0 0 auto;
}
.brand:hover { text-decoration: none; }
.brand__logo { width: 118px; height: auto; display: block; }

.quicksearch { display: flex; flex: 1 1 340px; min-width: 220px; }
.quicksearch input {
  flex: 1; border: 2px solid transparent; border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm); padding: 11px 14px; font-size: .95rem;
  background: #fff; color: var(--eq-ink); min-width: 0;
}
.quicksearch input:focus { outline: none; border-color: var(--eq-amber); }
.quicksearch button {
  border: 0; background: var(--eq-green-d); color: #fff; padding: 0 20px; font-weight: 600;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; cursor: pointer; white-space: nowrap;
}
.quicksearch button:hover { background: #06300f; }

.site-nav { display: flex; gap: 6px; align-items: center; font-size: .92rem; }
.site-nav a { color: #fff; padding: 7px 12px; border-radius: 999px; opacity: .92; }
.site-nav a:hover { background: rgba(255,255,255,.14); text-decoration: none; opacity: 1; }
.site-nav a.is-active { background: rgba(255,255,255,.18); opacity: 1; }
.site-nav .lang { border: 1px solid rgba(255,255,255,.4); font-weight: 600; }

/* ---------- catbar ---------- */
.catbar { background: var(--eq-green-d); border-bottom: 3px solid var(--eq-amber); }
.catbar__row { display: flex; align-items: stretch; }
.catbar__toggle {
  display: none; background: transparent; color: #fff; border: 0; font: inherit; font-weight: 600;
  padding: 12px 0; cursor: pointer;
}
/* una sola riga (S.3): voci distribuite su tutta la larghezza; se lo schermo è stretto si scorre, non si va a capo */
.catbar__list {
  list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: nowrap; justify-content: space-between;
  flex: 1; gap: 2px; overflow-x: auto; scrollbar-width: none;
}
.catbar__list::-webkit-scrollbar { display: none; }
.catbar__item {
  display: block; color: #fff; opacity: .85; padding: 11px 8px; font-size: .84rem; font-weight: 500;
  white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -3px;
}
.catbar__item:hover { opacity: 1; text-decoration: none; background: rgba(255,255,255,.08); }
.catbar__item.is-active { opacity: 1; border-bottom-color: var(--eq-amber); font-weight: 700; }

main.wrap { padding-top: 24px; padding-bottom: 40px; }

/* ---------- contesto: backbar / breadcrumb / riepilogo / filtri ---------- */
.backbar {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px;
  background: var(--eq-green-l); color: var(--eq-green-d); padding: 8px 14px; border-radius: 999px;
  font-size: .88rem; font-weight: 600;
}
.backbar:hover { background: #dbe9e0; text-decoration: none; }
.backbar__arrow { font-size: 1.1em; line-height: 1; }

.crumbs { font-size: .84rem; color: var(--eq-muted); margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--eq-muted); }
.crumbs a:hover { color: var(--eq-green); }
.crumbs__sep { opacity: .5; }
.crumbs [aria-current="page"] { color: var(--eq-ink); font-weight: 600; }

.ctx-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 6px 0 18px; }
.ctx-summary__text { margin: 0; font-size: 1rem; color: var(--eq-ink); font-weight: 600; }
.ctx-filters { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ctx-filter {
  display: inline-flex; align-items: center; background: var(--eq-green); color: #fff;
  border-radius: 999px; padding: 4px 12px; font-size: .82rem; font-weight: 600;
}
.ctx-filter:hover { background: var(--eq-green-d); text-decoration: none; }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--eq-green), #0a6b30);
  color: #fff; border-radius: var(--radius); padding: 34px 28px; margin: 0 0 28px;
}
.hero__inner { max-width: 820px; }
.hero h1 { margin: 0 0 18px; color: #fff; }
.vehicle-picker { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.vehicle-picker .field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 240px; }
.vehicle-picker label { font-size: .8rem; font-weight: 600; color: rgba(255,255,255,.9); }
.vehicle-picker select {
  padding: 11px 13px; border: 0; border-radius: var(--radius-sm);
  font-size: .95rem; background: #fff; min-height: 44px; color: var(--eq-ink);
}
.vehicle-picker button {
  border: 0; background: var(--eq-amber); color: #fff; font-weight: 700; cursor: pointer;
  padding: 12px 26px; border-radius: var(--radius-sm); min-height: 44px;
}
.vehicle-picker button:hover { background: #9c7009; }
.hero__alt { margin: 16px 0 0; }
.hero__alt a { color: #fff; font-weight: 600; opacity: .95; }

/* ---------- home blocks ---------- */
.home-block { margin: 30px 0; }
.home-block__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--eq-green); padding-bottom: 6px; margin-bottom: 16px; }
.home-block__head h2 { margin: 0; color: var(--eq-green-d); }
.home-block__all { font-size: .88rem; font-weight: 600; white-space: nowrap; }

.brand-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.brand-strip a { display: flex; align-items: center; justify-content: center; background: var(--eq-card); border: 1px solid var(--eq-line); border-radius: var(--radius-sm); height: 72px; padding: 10px; }
.brand-strip a:hover { border-color: var(--eq-green); }
.brand-strip img { max-height: 46px; width: auto; object-fit: contain; }

/* griglia categorie con icona (S.5) */
.cat-grid { list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.cat-grid a {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; height: 100%;
  background: var(--eq-card); border: 1px solid var(--eq-line); border-bottom: 4px solid var(--eq-green);
  border-radius: var(--radius-sm); padding: 18px 12px 14px; color: var(--eq-ink); font-weight: 700;
}
.cat-grid a:hover { border-color: var(--eq-green); text-decoration: none; box-shadow: var(--shadow); }
.cat-grid a:hover .cat-grid__icon img { transform: scale(1.06); }
.cat-grid__icon { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin-bottom: 4px; }
.cat-grid__icon img { width: 64px; height: 64px; transition: transform .15s ease; }
.cat-grid__sigla {
  display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%;
  border: 2px solid var(--eq-green); color: var(--eq-green); font-weight: 800; font-size: .85rem; letter-spacing: .03em;
}
.cat-grid__count { color: var(--eq-muted); font-weight: 500; font-size: .8rem; }
.cat-grid--lg { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.cat-grid--lg .cat-grid__icon, .cat-grid--lg .cat-grid__icon img { width: 76px; height: 76px; }

/* ---------- pagina marche ---------- */
.brand-grid { list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.brand-tile { display: flex; flex-direction: column; background: var(--eq-card); border: 1px solid var(--eq-line);
  border-radius: var(--radius); overflow: hidden; color: var(--eq-ink); height: 100%; }
.brand-tile:hover { border-color: var(--eq-green); text-decoration: none; box-shadow: var(--shadow); }
.brand-tile__logo { display: flex; align-items: center; justify-content: center; height: 96px; padding: 14px; background: #fff; }
.brand-tile__logo img { max-height: 66px; width: auto; object-fit: contain; }
.brand-tile--text .brand-tile__logo { background: var(--eq-green-l2); }
.brand-tile__name { font-weight: 800; font-size: 1.05rem; color: var(--eq-green-d); text-align: center; }
.brand-tile__meta { border-top: 1px solid var(--eq-line); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.brand-tile__label { font-weight: 700; font-size: .9rem; }
.brand-tile__count { color: var(--eq-muted); font-size: .78rem; }

.brand-head { display: flex; align-items: center; gap: 22px; margin: 6px 0 20px; padding-bottom: 18px; border-bottom: 2px solid var(--eq-green); }
.brand-head__logo { width: 130px; height: auto; max-height: 84px; object-fit: contain; background: #fff; border: 1px solid var(--eq-line); border-radius: var(--radius-sm); padding: 8px; }
.brand-head h1 { margin: 0; }
.brand-head__meta { margin: 4px 0 0; color: var(--eq-muted); font-size: .9rem; }

/* ---------- griglia modelli ---------- */
.model-grid { list-style: none; margin: 0 0 10px; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.model-card { display: flex; flex-direction: column; background: var(--eq-card); border: 1px solid var(--eq-line);
  border-radius: var(--radius); overflow: hidden; color: var(--eq-ink); height: 100%; }
.model-card:hover { border-color: var(--eq-green); text-decoration: none; box-shadow: var(--shadow); }
.model-card__media { aspect-ratio: 16/10; background: var(--eq-green-l2); display: flex; align-items: center; justify-content: center; }
.model-card__media img { width: 100%; height: 100%; object-fit: contain; }
.model-card__noimg { color: var(--eq-muted); font-size: .78rem; }
.model-card__body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.model-card__name { font-weight: 700; font-size: .95rem; }
.model-card__years { color: var(--eq-muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.model-code { color: var(--eq-muted); font-weight: 400; font-size: .82em; white-space: nowrap; }
h1 .model-code { font-size: .6em; }
.app-list .model-code { font-size: .85em; }
.badge--count { align-self: flex-start; margin-top: 4px; background: var(--eq-green-l); color: var(--eq-green-d);
  font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }

/* ---------- facets / chip ---------- */
.facets { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--eq-card);
  border: 1px solid var(--eq-line); border-radius: 999px; padding: 7px 13px;
  font-size: .85rem; color: var(--eq-ink);
}
.chip:hover { border-color: var(--eq-green); text-decoration: none; }
.chip.is-active { background: var(--eq-green); color: #fff; border-color: var(--eq-green); }
.chip__n { opacity: .65; font-size: .82em; font-variant-numeric: tabular-nums; }
.chip.is-active .chip__n { opacity: .85; }

/* scelta della tipologia dopo la categoria (S.3) */
.tipologia { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 22px; }
.tipologia__label { font-weight: 700; font-size: .9rem; color: var(--eq-green-d); }
.tipologia__select {
  min-width: 280px; max-width: 100%; padding: 9px 12px; font: inherit; font-size: .9rem;
  border: 1px solid var(--eq-line); border-radius: var(--radius-sm); background: var(--eq-card); color: var(--eq-ink);
}
.tipologia__select:focus { outline: 2px solid var(--eq-green); outline-offset: 1px; }
.tipologia__vai { padding: 9px 14px; border: 0; border-radius: var(--radius-sm); background: var(--eq-green); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }

/* ---------- grid risultati ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); gap: 16px; }
.card { background: var(--eq-card); border: 1px solid var(--eq-line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .12s, border-color .12s; }
.card:hover { border-color: var(--eq-green); box-shadow: var(--shadow); }
.card__link { color: inherit; display: block; }
.card__link:hover { text-decoration: none; }
.card__media { position: relative; aspect-ratio: 4/3; background: var(--eq-green-l2); display: flex; align-items: center; justify-content: center; }
.card__media img { width: 100%; height: 100%; object-fit: contain; }
.card__noimg { color: var(--eq-muted); font-size: .8rem; text-align: center; padding: 10px; }
/* il conteggio "N ricambi" sta nel corpo della scheda, non sopra la foto */
.badge.badge--count { position: static; }
.badge { position: absolute; top: 8px; left: 8px; background: var(--eq-green); color: #fff;
  font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.card__body { padding: 12px 14px 14px; }
.card__code { font-size: .78rem; color: var(--eq-green-d); font-weight: 700; margin: 0 0 4px; font-variant-numeric: tabular-nums; }
.card__title { font-size: .92rem; margin: 0 0 8px; line-height: 1.35; font-weight: 600; }
.card__meta { font-size: .77rem; color: var(--eq-muted); margin: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.card__apps::before { content: "· "; }
.card__oe { font-size: .78rem; margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--eq-line); }

.empty { color: var(--eq-muted); padding: 34px 0; }

/* ---------- pager ---------- */
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 26px 0 4px; }
.pager__item { border: 1px solid var(--eq-line); background: #fff; border-radius: var(--radius-sm); padding: 8px 13px;
  color: var(--eq-ink); min-width: 42px; text-align: center; font-variant-numeric: tabular-nums; }
.pager__item:hover { border-color: var(--eq-green); text-decoration: none; }
.pager__item.is-current { background: var(--eq-green); color: #fff; border-color: var(--eq-green); }
.pager__item.is-disabled { opacity: .4; }
.pager__gap { padding: 8px 4px; color: var(--eq-muted); }

/* ---------- scheda articolo ---------- */
.article { display: grid; grid-template-columns: minmax(0, 480px) 1fr; gap: 34px; margin: 10px 0 8px; }
.article__media { background: var(--eq-card); border: 1px solid var(--eq-line); border-radius: var(--radius);
  padding: 18px; display: flex; align-items: center; justify-content: center; }
.article__media img { object-fit: contain; max-height: 440px; }
.article__noimg { color: var(--eq-muted); padding: 90px 20px; text-align: center; }
.article__code { color: var(--eq-green-d); font-size: .95rem; font-weight: 700; margin: 0 0 2px; letter-spacing: .02em; }
.article__info h1 { margin-top: .1em; }
.specs { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 18px 0 0; font-size: .93rem; }
.specs dt { color: var(--eq-muted); }
.specs dd { margin: 0; }
.article__more { margin: 20px 0 0; font-weight: 600; }

.block { margin: 34px 0; }
.block h2 { border-bottom: 2px solid var(--eq-green); padding-bottom: 6px; color: var(--eq-green-d); }
.block .count { background: var(--eq-green-l); border-radius: 999px; padding: 1px 10px; font-size: .8rem; color: var(--eq-green-d); font-weight: 700; vertical-align: middle; margin-left: 4px; }

.oe-table { width: 100%; border-collapse: collapse; background: var(--eq-card); border: 1px solid var(--eq-line); border-radius: var(--radius); overflow: hidden; }
.oe-table td { padding: 10px 15px; border-top: 1px solid var(--eq-line); font-size: .9rem; }
.oe-table tr:first-child td { border-top: 0; }
.oe-table__num { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.oe-table__flags { text-align: right; }
.tag { display: inline-block; font-size: .74rem; padding: 2px 9px; border-radius: 999px; background: var(--eq-line); color: var(--eq-muted); }
.tag--ok { background: var(--eq-green-l); color: var(--eq-green-d); font-weight: 600; }

.app-list { columns: 2; column-gap: 34px; }
.app-list__make { break-inside: avoid; margin-bottom: 18px; }
.app-list__make h3 { font-size: .95rem; margin: 0 0 4px; color: var(--eq-green-d); }
.app-list ul { list-style: none; margin: 0; padding: 0; }
.app-list li { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; padding: 4px 0; border-bottom: 1px dotted var(--eq-line); }
.app-list__years { color: var(--eq-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- head veicolo (risultati) ---------- */
.vehicle-head { display: flex; gap: 22px; align-items: center; margin: 8px 0 6px; }
.vehicle-head__media { flex: 0 0 auto; width: 240px; aspect-ratio: 16/10; background: var(--eq-green-l2);
  border: 1px solid var(--eq-line); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.vehicle-head__media img { width: 100%; height: 100%; object-fit: contain; }
.vehicle-head__noimg { color: var(--eq-muted); font-size: .8rem; }
.vehicle-head__make { color: var(--eq-green-d); text-transform: uppercase; letter-spacing: .06em; font-size: .82rem; font-weight: 700; margin: 0; }
.vehicle-head h1 { margin: .1em 0; }
.vehicle-head__meta { color: var(--eq-muted); margin: 0; font-size: .9rem; }

/* ---------- ricerca ---------- */
.search-full { display: flex; gap: 10px; margin: 14px 0; }
.search-full input { flex: 1; border: 1px solid var(--eq-line); border-radius: var(--radius-sm); padding: 13px 15px; font-size: 1rem; }
.search-full input:focus { outline: none; border-color: var(--eq-green); }
.search-full button { border: 0; background: var(--eq-green); color: #fff; font-weight: 700; padding: 0 26px; border-radius: var(--radius-sm); cursor: pointer; }
.hint { color: var(--eq-muted); font-size: .9rem; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 64px 0; }
.btn { display: inline-block; background: var(--eq-green); color: #fff; padding: 11px 22px; border-radius: var(--radius-sm); font-weight: 600; }
.btn:hover { background: var(--eq-green-d); text-decoration: none; }

/* ---------- footer ---------- */
.site-footer { background: var(--eq-green); color: rgba(255,255,255,.85); margin-top: 48px; padding: 26px 0; font-size: .85rem; }
.site-footer__row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.site-footer__brand { flex: 0 0 auto; }
.site-footer__brand img { width: 108px; height: auto; }
.site-footer__text p { margin: 2px 0; }
.site-footer a { color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .article { grid-template-columns: 1fr; gap: 20px; }
  .app-list { columns: 1; }
}
@media (max-width: 760px) {
  .site-header__row { gap: 12px; }
  .quicksearch { order: 3; flex-basis: 100%; }
  .vehicle-head { flex-direction: column; align-items: flex-start; }
  .vehicle-head__media { width: 100%; max-width: 320px; }

  .catbar__row { flex-direction: column; align-items: stretch; }
  .catbar__toggle { display: block; text-align: left; }
  .catbar__list { display: none; flex-direction: column; padding-bottom: 8px; overflow-x: visible; }
  .catbar.is-open .catbar__list { display: flex; }
  .catbar__item { border-bottom: 0; margin-bottom: 0; padding: 10px 4px; }
  .catbar__item.is-active { background: rgba(255,255,255,.1); border-radius: 6px; }
}
@media (max-width: 560px) {
  h1 { font-size: 1.4rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .hero { padding: 24px 18px; }
}
