:root {
  --navy: #0f2342;
  --navy-light: #1b3664;
  --red: #b81d24;
  --red-dark: #92141a;
  --bg: #f8f9fb;
  --white: #ffffff;
  --text: #1e242b;
  --muted: #5a6573;
  --border: #e1e6ed;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* TOPBAR */
.topbar {
  background: var(--navy);
  color: #dbe4f0;
  font-size: 0.85rem;
  padding: 8px 0;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar a {
  color: #ffffff;
  text-decoration: none;
  margin-left: 16px;
}

/* NAVBAR */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100px;
  gap: 16px;
}

.brand-logo {
  display: inline-flex;
  align-items: flex-end;
  gap: 0px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo img {
  height: 100px;
  width: auto;
  display: block;
}

.logo-italy {
  color: var(--red);
  font-weight: 700;
  font-size: 0.80rem;
  letter-spacing: 0.9px;
  margin-left: -19px;
  margin-bottom: 30px;
}

.nav-menu {
  display: flex;
  gap: 24px;
}

.nav-menu a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

.nav-menu a:hover {
  color: var(--red);
}

/* BOTTONI */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  transition: 0.2s;
  text-align: center;
}

.btn-primary {
  background: var(--red);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--red-dark);
}

.btn-whatsapp {
  background: #1ebe5d;
  color: var(--white);
}

.btn-whatsapp:hover {
  background: #179c4b;
}

.btn-outline {
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--navy);
}

/* HERO */
.hero {
  background: linear-gradient(rgba(15, 35, 66, 0.88), rgba(15, 35, 66, 0.92)),
              url("https://images.unsplash.com/photo-1511919884226-fd3cad34687c?auto=format&fit=crop&w=1600&q=80") center/cover;
  color: var(--white);
  padding: 64px 0 56px;
}

.badge {
  display: inline-block;
  background: rgba(184, 29, 36, 0.9);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: 2.35rem;
  max-width: 720px;
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero p {
  max-width: 680px;
  color: #dce4f0;
  margin-bottom: 28px;
}

/* FILTRI */
.filter-box {
  background: var(--white);
  color: var(--text);
  padding: 20px;
  border-radius: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: end;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.filter-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 5px;
  text-transform: uppercase;
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.92rem;
  background: var(--white);
}

.filter-actions {
  grid-column: span 2;
}

/* SEZIONI & ORDINAMENTO */
.section {
  padding: 64px 0;
}

.section-alt {
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.section-header h2 {
  color: var(--navy);
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.count-badge {
  display: inline-block;
  background: #e6ecf5;
  color: var(--navy);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.sort-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-box label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

.sort-box select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--white);
  color: var(--navy);
  font-weight: 500;
}

/* GRIGLIA AUTO */
.cars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.car-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.car-card:hover .btn-primary {
  background: var(--red-dark);
}

.car-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(15, 35, 66, 0.08);
}

.car-img-wrap {
  position: relative;
  height: 220px;
  background: #e9edf2;
}

.car-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--white);
}

.status-disponibile {
  background: #1b8a4b;
}

.status-venduta {
  background: #5a6573;
}

.race-pill {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(15, 35, 66, 0.9);
  color: var(--white);
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 600;
}

.car-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.car-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.car-body h3 {
  color: var(--navy);
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.car-specs {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.car-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.car-price {
  font-weight: 700;
  color: var(--red);
  font-size: 1rem;
}

/* SERVIZI */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.service-card {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 10px;
}

.service-card h3 {
  color: var(--navy);
  margin-bottom: 10px;
  font-size: 1.1rem;
}

/* CHI SIAMO & CONTATTI */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
}

.about-grid h2 {
  color: var(--navy);
  margin-bottom: 14px;
}

.about-grid p {
  margin-bottom: 14px;
}

.contact-box {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 10px;
  margin-top: 20px;
}

.contact-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* DETTAGLIO SINGOLA AUTO & GALLERIA */
.detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  background: var(--white);
  padding: 28px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.gallery-main-wrap {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #e9edf2;
}

.detail-img {
  width: 100%;
  height: 440px;
  object-fit: cover;
  display: block;
}

.gallery-counter {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 35, 66, 0.85);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  z-index: 2;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 35, 66, 0.78);
  color: var(--white);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 2;
}

.gallery-arrow:hover {
  background: var(--red);
}

.gallery-prev {
  left: 12px;
}

.gallery-next {
  right: 12px;
}

.thumbs-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.thumb-btn {
  border: 2px solid transparent;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  width: 76px;
  height: 56px;
  background: none;
}

.thumb-btn.active {
  border-color: var(--red);
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
}

.specs-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

.specs-table td:first-child {
  font-weight: 600;
  color: var(--muted);
  width: 40%;
}

/* SEZIONE CONTATTI STILE PORTALE */
.contacts-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 28px;
  align-items: start;
}

.contact-card-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
}

.contact-card-box h3 {
  color: var(--navy);
  font-size: 1.3rem;
  margin-bottom: 22px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.contact-item:last-child {
  margin-bottom: 0;
}

.contact-icon {
  font-size: 1.2rem;
  line-height: 1.4;
}

.contact-item strong {
  display: block;
  color: var(--navy);
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.contact-item p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.contact-item a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.contact-item a:hover {
  color: var(--red);
}

.contact-item a.wa-inline {
  color: #1b8a4b;
  font-weight: 600;
}

.contact-form .form-group {
  margin-bottom: 14px;
}

.contact-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 5px;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--white);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 820px) {
  .contacts-layout,
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

/* FOOTER */
.footer {
  background: var(--navy);
  color: #dbe4f0;
  padding: 28px 0;
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer a {
  color: var(--white);
  text-decoration: none;
  margin-left: 16px;
}

@media (max-width: 960px) {
  .filter-box {
    grid-template-columns: repeat(2, 1fr);
  }
  .filter-actions {
    grid-column: span 2;
  }
}

@media (max-width: 820px) {
  .nav-menu {
    display: none;
  }
  .about-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 1.8rem;
  }
}

@media (max-width: 520px) {
  .filter-box {
    grid-template-columns: 1fr;
  }
  .filter-actions {
    grid-column: span 1;
  }
}