/* Meli Motors — colori dal logo. Rosso logo #f20418; #e0031a regge il testo bianco (5:1) */
:root {
  --bg: #000; --surface: #161616; --ink: #ededed; --muted: #a3a3a3;
  --accent: #e0031a; --accent-ink: #fff;
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --m: 20px;
  --display: "Panchang", "Arial Black", sans-serif;
  --text: "Switzer", system-ui, sans-serif;
}
@media (min-width: 901px) { :root { --m: 32px; } }

* { box-sizing: border-box; margin: 0; }
html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { font: 400 var(--step-body)/1.5 var(--text); }
img { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--surface); }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2 { font: 700 var(--step-head)/1 var(--display); letter-spacing: -0.02em; text-transform: uppercase; }
.price { font: 700 var(--step-lead) var(--display); white-space: nowrap; }
.muted { color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px;
  background: var(--accent); color: var(--accent-ink); font: 500 var(--step-body) var(--text);
  text-decoration: none; border: 0; cursor: pointer; transition: transform .15s, background-color .15s;
}
.btn:hover { background: #b8021a; }
.btn:active { transform: scale(.97); }
.btn.alt { background: var(--ink); color: var(--bg); }
.btn.alt:hover { background: #fff; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* Link che sul telefono non servono (c'è la barra in basso) */
@media (max-width: 900px) { .no-mobile { display: none; } }

/* Ricerca */
.cerca-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; border: 0;
  background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; transition: opacity .15s; }
.cerca-btn:hover { opacity: .6; }
.cerca-btn svg { width: 20px; height: 20px; }
.cerca { display: flex; gap: 8px; padding: 0 var(--m) 16px; }
.cerca[hidden] { display: none; }
.cerca input { flex: 1; min-width: 0; height: 52px; padding: 0 16px; border: 0; border-radius: 0;
  background: var(--surface); color: var(--ink); font: 400 max(16px, var(--step-body)) var(--text); }
.cerca input::placeholder { color: var(--muted); }
.cerca input:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; }
.cerca .btn { flex: 0 0 auto; }
@media (prefers-reduced-motion: no-preference) { .cerca:not([hidden]) { animation: rise .3s cubic-bezier(.2, .7, .2, 1); } }

/* Barra in alto */
.bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px var(--m); font-size: var(--step-small); }
.bar img { width: auto; height: 32px; background: none; }
.bar nav { display: flex; align-items: center; gap: 20px; }
.bar nav a { transition: opacity .15s; }
.bar nav a:hover { opacity: .6; }
@media (min-width: 901px) { .bar { padding-block: 20px; } .bar img { height: 44px; } }

/* Sezioni */
.s { padding: 96px var(--m); }
@media (min-width: 901px) { .s { padding-block: 160px; } }

/* Contatti */
.contatti { display: grid; gap: 24px; }
.contatti .price { font-size: clamp(1.75rem, 3vw, 2.75rem); }
@media (min-width: 901px) {
  .contatti { grid-template-columns: repeat(12, 1fr); align-items: end; }
  .contatti > div:first-child { grid-column: 1 / 7; display: grid; gap: 24px; }
  .contatti > div:last-child { grid-column: 8 / 13; display: grid; gap: 24px; justify-items: start; }
}

/* Chiusura */
footer { padding: 96px var(--m) 32px; display: grid; gap: 32px; font-size: var(--step-small); color: var(--muted); }
footer img { width: min(100%, 560px); height: auto; background: none; }

/* Telefono: pulsanti sempre a portata di pollice */
.dock { position: fixed; inset: auto 0 0; z-index: 5; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 10px var(--m) calc(10px + env(safe-area-inset-bottom)); background: var(--bg); transition: transform .3s; }
.dock.via { transform: translateY(110%); }
.dock .btn { padding: 0; }
body:has(.dock) { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
@media (min-width: 901px) { .dock { display: none; } body:has(.dock) { padding-bottom: 0; } }

/* Entrata delle parti, solo dove il browser la supporta */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .rise { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
    .rise + .rise { animation-range: entry 10% entry 80%; }
    .rise + .rise + .rise { animation-range: entry 20% entry 90%; }
  }
}
@media (prefers-reduced-motion: no-preference) {
  /* Entrata al caricamento per quello che si vede subito */
  .load { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
  .load + .load { animation-delay: .08s; }
  .load + .load + .load { animation-delay: .16s; }
}
@keyframes rise { from { opacity: .4; transform: translateY(28px); } }
