/* =========================================================
   SM · Rappresentanze Alimentari — biglietto da visita NFC
   ========================================================= */

/* Font self-hosted (nessuna richiesta a Google: privacy/GDPR + CSP) — OFL, vedi assets/fonts/OFL-LICENSE.txt */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  --red: #a2262d;
  --red-dark: #861d23;
  --ink: #231f20;
  --text: #3a3536;
  --muted: #6b6668;
  --line: #d4d4d6;
  --soft: #f6f5f5;
  --pink: #f6d3d1;
  --footer-text: #e9e7e7;
  --white: #fff;

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --container: 1104px;
  --gutter: 24px;
  --header-h: 72px;
  --section-pad: 64px;
}

@media (min-width: 768px) {
  :root { --gutter: 40px; --header-h: 88px; --section-pad: 88px; }
}
@media (min-width: 1200px) {
  :root { --header-h: 92px; --section-pad: 88px; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.container {
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.placeholder { color: var(--red); }

/* ---------- Tipografia condivisa ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow img { flex: none; }

.h-title {
  margin-top: 14px;
  font-size: clamp(34px, 4.4vw, 50px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.h-title--md { font-size: clamp(32px, 3.6vw, 42px); }

/* ---------- Bottone "Salva contatto" (forma inclinata del Figma) ---------- */
.btn {
  --btn-h: 58px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: var(--btn-h);
  padding: 0 52px 0 20px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
  transition: transform .2s ease, background-color .2s ease, color .2s ease;
}
.btn span { flex: 1; white-space: nowrap; }
.btn__icon { flex: none; width: 22px; height: 22px; }
.btn__end { flex: none; width: 20px; height: 20px; margin-left: 12px; transition: transform .2s ease; }
.btn:hover .btn__end { transform: translateY(2px); }
.btn:active { transform: scale(.98); }

.btn--light { background: var(--white); color: var(--red); width: min(320px, 100%); --btn-h: 64px; }
.btn--light:hover { background: var(--pink); }
.btn--red { background: var(--red); color: var(--white); width: min(360px, 100%); }
.btn--red:hover { background: var(--red-dark); }

/* ---------- Header ---------- */
.site-header {
  position: relative;
  z-index: 2;
  height: var(--header-h);
  background: var(--white);
  border-bottom: 2px solid var(--ink);
}
.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header__logo img { width: 84px; height: auto; }
.site-header__tag {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: right;
  color: var(--muted);
}
@media (min-width: 768px) {
  .site-header__logo img { width: 96px; }
  .site-header__tag { font-size: 12px; }
}
@media (min-width: 1200px) {
  .site-header__logo img { width: 104px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--red);
  color: var(--white);
}
.hero__rete {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}
.hero__inner {
  position: relative;
  container-type: inline-size;
  padding-block: 96px 48px;
  /* mobile: header (72) + hero + azioni rapide (131) = esattamente uno schermo */
  min-height: max(420px, calc(100vh - 203px));
  min-height: max(420px, calc(100svh - 203px));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.hero__eyebrow {
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pink);
}
.hero__title {
  position: relative;
  z-index: 1;
  margin: 6px 0 40px;
  font-size: clamp(60px, 17vw, 120px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.045em;
}
.hero .btn { position: relative; z-index: 1; }

.hero__art { display: none; }

@media (min-width: 768px) {
  .hero__inner { min-height: 500px; padding-block: 96px 96px; justify-content: center; }
  .hero__title { font-size: clamp(88px, 13vw, 120px); margin-bottom: 44px; }
}

/* logo grande ruotato (solo desktop, come da Figma) */
@media (min-width: 1024px) {
  .hero__inner { min-height: 600px; padding-block: 112px; }
  .hero__title { font-size: min(10.9cqw, 120px); }
  .hero__art {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 43.1cqw;
    top: 87px;
    width: 77.4cqw;
    height: 54.9cqw;
    pointer-events: none;
  }
  .hero__art img {
    width: 69.96cqw;
    height: auto;
    max-width: none;
    transform: rotate(-17.44deg);
    animation: art-in 1.1s cubic-bezier(.2, .7, .2, 1) both;
  }
}
@keyframes art-in {
  from { opacity: 0; transform: translate(60px, 40px) rotate(-10deg); }
  to   { opacity: 1; transform: rotate(-17.44deg); }
}

/* ---------- Azioni rapide ---------- */
.quick { border-bottom: 1px solid var(--line); padding-block: 24px 28px; }
.quick__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.quick__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 78px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  transition: border-color .2s ease, background-color .2s ease;
}
.quick__item svg { color: var(--red); width: 22px; height: 22px; }
.quick__item:hover { border-color: var(--red); background: #fdf6f6; }
@media (min-width: 768px) {
  .quick { padding-block: 28px 36px; }
  .quick__grid { gap: 8px; }
  .quick__item { height: 76px; font-size: 13px; }
}
@media (min-width: 1024px) {
  .quick { padding-block: 31px 32px; }
  .quick__grid { gap: 12px; }
  .quick__item { flex-direction: row; gap: 10px; height: 72px; }
}

/* ---------- Sezioni ---------- */
.section { padding-block: var(--section-pad); }
.section + .section { border-top: 1px solid var(--line); }

/* Presentazione + contatti */
.about__grid { display: grid; gap: 56px; }
.about__lead {
  margin-top: 16px;
  font-size: clamp(21px, 2.3vw, 28px);
  font-weight: 500;
  line-height: 1.38;
  letter-spacing: -0.01em;
  color: var(--ink);
}
@media (min-width: 1024px) {
  .about__grid { grid-template-columns: minmax(0, 512px) minmax(0, 512px); justify-content: space-between; gap: 40px; }
  .about__lead { margin-top: 14px; }
}

.contact-list { margin-top: 22px; border-top: 2px solid var(--ink); }
.contact-list li { border-bottom: 1px solid var(--line); }
.contact-list a {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "label arrow" "value arrow";
  align-items: center;
  row-gap: 4px;
  padding: 20px 0;
  transition: padding .2s ease;
}
.contact-list__label {
  grid-area: label;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-list__value {
  grid-area: value;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.contact-list__arrow { grid-area: arrow; color: var(--red); margin-left: 16px; transition: transform .2s ease; }
.contact-list a:hover .contact-list__value { color: var(--red); }
.contact-list a:hover .contact-list__arrow { transform: translate(2px, -2px); }
@media (min-width: 768px) { .contact-list__value { font-size: 17px; } }

/* ---------- Marchi ---------- */
.brands { padding-bottom: calc(var(--section-pad) - 8px); }
.brands__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.brands__count {
  font-size: clamp(52px, 7vw, 92px);
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.05em;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}
.brands__hint {
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
}
.brands__grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
@media (min-width: 768px)  { .brands__grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .brands__grid { grid-template-columns: repeat(6, 1fr); margin-top: 30px; } }

.brand {
  position: relative;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.brand__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 112px;
  padding: 22px 18px 16px;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: center;
}
@media (min-width: 768px)  { .brand__inner { height: 116px; padding: 24px 28px 18px; } }
@media (min-width: 768px)  { .brand__logo { max-width: 160px; max-height: 66px; } }
@media (min-width: 1024px) { .brand__inner { height: 130px; padding: 26px 26px 20px; } .brand__logo { max-width: 124px; max-height: 78px; } }

.brand__num {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.brand__logo {
  width: 100%;
  height: 100%;
  max-width: 114px;
  max-height: 58px;
  object-fit: contain;
  transition: transform .3s ease;
}
.brand__name {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--ink);
}
.brand__cta {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  color: var(--red);
  transition: transform .2s ease;
}
.brand__badge {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--red);
}

.brand--link .brand__inner { cursor: pointer; }
.brand--link .brand__inner:hover { background: #fcfafa; }
.brand--link .brand__inner:hover .brand__logo { transform: scale(1.05); }
.brand--link .brand__inner:hover .brand__cta { transform: translate(2px, -2px); }

/* ---------- Zona ---------- */
.zone { background: var(--soft); }
.section.zone { border-top-color: var(--line); }
.zone__grid { display: grid; gap: 28px; }
.zone__desc { margin-top: 18px; font-size: 16px; line-height: 1.6; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chips li {
  padding: 7px 12px;
  border: 1px solid var(--ink);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--white);
}
#map {
  width: 100%;
  height: 360px;
  background: #e9e7e7;
  z-index: 0;
}
@media (min-width: 768px) { #map { height: 340px; } }
@media (min-width: 1024px) {
  .zone__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 578px); gap: 40px; align-items: start; }
  #map { height: 392px; }
}

/* Leaflet con i colori del brand */
.zone .leaflet-container { font-family: var(--font); }
.zone .leaflet-tile-pane { filter: grayscale(1) contrast(1.02) brightness(1.04); }
.zone .leaflet-control-zoom a { color: var(--ink); border-radius: 0 !important; }
.zone .leaflet-bar { border-radius: 0; border: 1px solid var(--line); box-shadow: none; }
.zone .leaflet-control-attribution { font-size: 10px; }
.sm-pin { color: var(--red); }

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: var(--white);
  padding-top: 48px;
  overflow: hidden;
}
.footer__top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 48px;
}
.footer__title {
  font-size: clamp(50px, 8vw, 68px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
}
.footer__text {
  margin: 22px 0;
  max-width: 300px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--footer-text);
}
.footer__logo { width: 141px; height: auto; flex: none; }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, .2);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--footer-text);
}
.footer__bottom .placeholder { color: #e98c91; }

@media (max-width: 767px) {
  .footer__top { flex-direction: column; align-items: stretch; }
  .footer .btn--red { width: 100%; }
  .footer__logo { display: none; }
  .footer__bottom { flex-direction: column; gap: 6px; }
}
@media (min-width: 1024px) {
  .footer { padding-top: 58px; }
  .footer__top { padding-bottom: 56px; }
  .footer__bottom { font-size: 12px; }
}

/* ---------- Dialog cataloghi ---------- */
.catalog-dialog {
  width: min(480px, 100% - 32px);
  padding: 0;
  border: 0;
  border-top: 4px solid var(--red);
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 24px 60px rgba(35, 31, 32, .3);
}
.catalog-dialog::backdrop { background: rgba(35, 31, 32, .6); }
.catalog-dialog[open] { animation: dlg-in .22s ease both; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(12px); } }
.catalog-dialog__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 24px 8px;
}
.catalog-dialog__title {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.catalog-dialog__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.catalog-dialog__close:hover { border-color: var(--ink); }
.catalog-dialog__list { padding: 8px 24px 24px; }
.catalog-dialog__list li { border-bottom: 1px solid var(--line); }
.catalog-dialog__list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  font-size: 16px;
  font-weight: 600;
}
.catalog-dialog__list a small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.catalog-dialog__list a svg { color: var(--red); flex: none; }
.catalog-dialog__list a:hover { color: var(--red); }

/* ---------- Animazioni di comparsa ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .hero__art img { animation: none; }
}

/* ---------- Pagina 404 ---------- */
.page-404 main { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 20px; padding-block: 48px; }
.page-404 main > img { width: 104px; height: auto; margin-bottom: 24px; }
.page-404 main p:not(.eyebrow) { color: var(--text); font-size: 17px; }
.page-404 .btn { padding-right: 40px; }
