/* ============================================================= 
   1. VARIABILI GLOBALI
   ============================================================= */
:root {
  /* Colori Base */
  --asphalt: #0b0c0e;
  --graphite: #101216;
  --panel: #1d212a;
  --bg-dark: #0b0c0e;
  --bg-card: #16181d;
  --border-color: #2a2e37;
  
  /* Linee e Bordi */
  --line: rgba(233, 238, 246, 0.09);
  --line-2: rgba(233, 238, 246, 0.16);
  
  /* Testi */
  --chrome: #eef1f6;
  --silver: #b6bdca;
  --mist: #7d8593;
  --faint: #565d6b;
  --text-light: #eef1f6;
  --text-muted: #a0a5b0;
  
  /* Accenti Racing */
  --accent: #e4002b;
  --accent-hover: #ff2b48;
  --ignition: #e4002b;
  --ignition-2: #ff2b48;
  --signal: #ffb300;   /* Giallo per badge flotte */
  --ember: #ff7a18;    /* Arancione per soccorso */
  
  /* Layout & Font */
  --rad: 3px;
  --maxw: 1280px;
  --display: "Oswald", sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "Inter", ui-monospace, monospace;
}

/* ============================================================= 
   2. RESET & BASE
   ============================================================= */
body {
  font-family: var(--body);
  background-color: var(--bg-dark);
  color: var(--text-muted);
  padding-top: 76px;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
}

.text-accent { color: var(--accent) !important; }
.text-muted-custom { color: var(--text-muted) !important; }
.bg-dark-custom { background-color: var(--bg-card) !important; }
.border-secondary { border-color: var(--border-color) !important; }

/* ============================================================= 
   3. NAVBAR
   ============================================================= */
.navbar.bg-dark-custom {
  background-color: rgba(11, 12, 14, 0.95) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
  font-size: 1.6rem;
  letter-spacing: 1px;
  color: var(--text-light) !important;
}

.navbar-dark .navbar-nav .nav-link {
  color: var(--text-light) !important;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 16px;
  transition: color 0.25s ease;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
  color: var(--accent) !important;
}

/* ============================================================= 
   4. PULSANTI
   ============================================================= */
.btn-accent {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff !important;
  transition: all 0.3s ease;
}

.btn-accent:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(228, 0, 43, 0.4);
}

.btn-submit-custom {
  min-width: 240px;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.btn-submit-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -8px rgba(228, 0, 43, 0.5);
}

.btn-submit-custom i {
  transition: transform 0.3s ease;
}

.btn-submit-custom:hover i {
  transform: translateX(4px);
}

/* ============================================================= 
   5. CAROUSEL
   ============================================================= */
.carousel-item {
  height: 85vh;
  min-height: 500px;
  position: relative;
}

.carousel-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.35);
  z-index: -1;
}

.carousel-caption {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  padding-top: 40px;
  padding-bottom: 40px;
}

.carousel-caption h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
  color: #fff;
}

.carousel-caption p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  max-width: 600px;
  margin: 0 auto 1.5rem;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
  color: #e0e0e0;
}

.carousel-caption.text-start p { margin-left: 0; }
.carousel-caption.text-end p { margin-right: 0; }

/* ============================================================= 
   6. SEZIONI GENERALI & DIVISORI
   ============================================================= */
.marketing-section, .services-detail-section, .featurettes-section, .contact-section {
  padding: 4rem 0;
}

.section-divider, .featurette-divider {
  border-color: var(--border-color);
  margin: 0;
}

.featurette-heading {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}

/* ============================================================= 
   7. ICONE E PLACEHOLDER
   ============================================================= */
.feature-icon-custom {
  width: 80px;
  height: 80px;
  background-color: rgba(228, 0, 43, 0.1);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.featurette-image-placeholder {
  height: 300px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.featurette-image-placeholder:hover {
  transform: scale(1.02);
  border-color: var(--accent) !important;
}

.featurette-image-placeholder i {
  font-size: 5rem;
}

/* ============================================================= 
   8. SERVIZI GRID (12 elementi)
   ============================================================= */
.serv-grid-clean {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 20px;
}

.serv-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 28px 24px;
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
}

.serv-item::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.serv-item:hover {
  background: #1a1d24;
  transform: translateY(-6px);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
  border-color: var(--accent);
}

.serv-item:hover::before {
  transform: scaleX(1);
}

.serv-icon {
  width: 48px;
  height: 48px;
  background: rgba(228, 0, 43, 0.1);
  border: 1px solid rgba(228, 0, 43, 0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  transition: all 0.3s ease;
}

.serv-icon i {
  font-size: 1.8rem;
  color: var(--accent);
}

.serv-item:hover .serv-icon {
  background: rgba(228, 0, 43, 0.2);
  transform: scale(1.1) rotate(-5deg);
}

.serv-item h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.serv-item p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* ============================================================= 
   9. FEATURETTE CON IMMAGINI DI SFONDO
   ============================================================= */
/* Overlay unificato per tutte le featurette */
.featurette-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(11, 12, 14, 0.3) 0%, rgba(228, 0, 43, 0.15) 100%);
  transition: all 0.4s ease;
}

.featurette-image-placeholder:hover .featurette-overlay {
  background: linear-gradient(135deg, rgba(11, 12, 14, 0.1) 0%, rgba(228, 0, 43, 0.25) 100%);
}

/* Immagini specifiche */
.featurette-bg-diagnosi {
  background-image: url('img/diagnosi_auto.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.featurette-bg-pneumatici {
  background-image: url('img/pneumatico.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.featurette-bg-soccorso {
  background-image: url('img/carroattrezzi.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Overlay specifico per soccorso (tocco arancione) */
.featurette-bg-soccorso .featurette-overlay {
  background: linear-gradient(135deg, rgba(11, 12, 14, 0.3) 0%, rgba(255, 122, 24, 0.2) 100%);
}
.featurette-bg-soccorso:hover .featurette-overlay {
  background: linear-gradient(135deg, rgba(11, 12, 14, 0.1) 0%, rgba(255, 122, 24, 0.3) 100%);
}

/* ============================================================= 
   10. BRANDS / MARQUEE (Versione Finale Pulita)
   ============================================================= */
.brands {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0 !important;
}

.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  animation: marquee-slide 40s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marquee-slide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Stile dei singoli loghi */
.brand-logo-item {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 40px;
  margin: 0 10px;
  background-color: var(--panel);
  border-radius: 12px;
  border: 1px solid var(--line-2);
  transition: all 0.3s ease;
}

.brand-logo-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(228, 0, 43, 0.3);
  border-color: var(--ignition);
}

.brand-logo-img {
  max-width: 200px;
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: brightness(1) contrast(1); /* Sempre a colori */
  transition: all 0.3s ease;
}

.brand-logo-item:hover .brand-logo-img {
  filter: brightness(1.1) contrast(1.1);
}

/* Nascondi separatori inutili */
.marquee-track .sep { display: none; }

/* ============================================================= 
   11. CERTIFICAZIONI (Centrate)
   ============================================================= */
.brand-note {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 0 50px 0; /* Spazio equilibrato: 40px sopra, 50px sotto */
  text-align: center;
   background: #000;
  opacity: 0.7;
}
/* Responsive */
@media (max-width: 768px) {
  .brand-note {
    padding: 30px 0 40px 0; /* Meno spazio su mobile */
  }
}

.brand-cert-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem) !important;
  color: var(--silver) !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 !important;
  line-height: 1.2;
}

.brand-cert-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.brand-cert-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  filter: grayscale(0%) brightness(1); /* Sempre a colori */
  opacity: 1;
  transition: all 0.3s ease;
}

.brand-cert-logo:hover {
  filter: grayscale(0%) brightness(0.85);
  opacity: 0.9;
  transform: scale(0.98);
}

/* ============================================================= 
   12. BADGE FLOTTE / NOLEGGIO
   ============================================================= */
.fleet-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--asphalt);
  background: var(--signal);
  padding: 8px 16px;
  border-radius: var(--rad);
  box-shadow: 0 4px 15px rgba(255, 179, 0, 0.25);
  transition: transform 0.3s ease;
}

.fleet-badge i {
  color: var(--asphalt);
  font-size: 12px;
}

.fleet-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 179, 0, 0.4);
}

/* ============================================================= 
   13. FORM CONTATTI
   ============================================================= */
.form-control.bg-secondary, 
.form-select.bg-secondary {
  background-color: var(--bg-dark) !important;
  border-color: var(--border-color) !important;
  color: var(--text-light) !important;
}

.form-control.bg-secondary:focus, 
.form-select.bg-secondary:focus {
  background-color: #1a1d24 !important;
  border-color: var(--accent) !important;
  color: var(--text-light) !important;
  box-shadow: 0 0 0 0.25rem rgba(228, 0, 43, 0.15) !important;
}

.form-control.bg-secondary::placeholder {
  color: var(--text-muted) !important;
}

.form-check-input {
  background-color: var(--bg-dark);
  border-color: var(--border-color);
}

.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

.uppercase-input { text-transform: uppercase !important; }
.bg-scheda-preview { background-color: rgba(255, 255, 255, 0.05) !important; }

/* ============================================================= 
   14. FOOTER
   ============================================================= */
footer {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding-top: 3rem;
  padding-bottom: 2rem;
}

footer .text-light { color: var(--text-light) !important; }

footer a.text-light {
  color: var(--text-muted) !important;
  transition: color 0.2s;
}

footer a.text-light:hover {
  color: var(--accent) !important;
  opacity: 1 !important;
}

/* ============================================================= 
   15. RESPIRO GLOBALE (MARGINI MINIMI)
   ============================================================= */
.wrap,
.marketing-section,
.services-detail-section,
.featurettes-section,
.contact-section,
.brands {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ============================================================= 
   16. RESPONSIVE
   ============================================================= */
@media (min-width: 768px) {
  .wrap,
  .marketing-section,
  .services-detail-section,
  .featurettes-section,
  .contact-section,
  .brands {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (max-width: 992px) {
  .serv-grid-clean { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  body { padding-top: 70px; }
  
  .carousel-item { height: 70vh; }
  .carousel-caption { top: 50%; padding-top: 20px; }
  .featurette-image-placeholder { height: 250px !important; margin-top: 2rem; }
  
  .brand-logo-img { max-width: 150px; max-height: 80px; }
  .brand-logo-item { padding: 16px 30px; margin: 0 6px; }
  
  .brand-cert-title { font-size: 1.1rem !important; }
  .brand-cert-logo { height: 32px; }
  .brand-cert-logos { gap: 16px; }
  
  .fleet-badge {
    font-size: 10px;
    padding: 6px 12px;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 576px) {
  .serv-grid-clean { grid-template-columns: 1fr; }
  
  .brand-logo-item { padding: 12px 20px; margin: 0 4px; background-color: var(--graphite); }
  .brand-logo-img { max-width: 120px; max-height: 65px; }
  
  .brand-cert-title { font-size: 1rem !important; }
  .brand-cert-logo { height: 28px; }
  .brand-cert-logos { flex-direction: row; gap: 12px; }
}
/* ============================================================= SERVIZI SPECIALI CON IMMAGINI */
.special-card {
  height: 280px;
  position: relative;
  overflow: hidden;
  border-radius: 0.375rem;
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease;
}

.special-card:hover {
  transform: translateY(-5px);
}

.special-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 20px;
  z-index: 2;
  background: linear-gradient(to top, rgba(11, 12, 14, 0.95) 0%, rgba(11, 12, 14, 0.6) 70%, transparent 100%);
}

.special-card-content h3 {
  font-size: 1.15rem;
  letter-spacing: 0.5px;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
}

.special-card-content p {
  font-size: 0.9rem;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

/* Immagini di sfondo specifiche */
.featurette-bg-gpl {
  background-image: url('img/gpl.jpg');
  background-size: cover;
  background-position: center;
}

.featurette-bg-gancio {
  background-image: url('img/gancio.jpg');
  background-size: cover;
  background-position: center;
}

.featurette-bg-revisione {
  background-image: url('img/revisione.jpg');
  background-size: cover;
  background-position: center;
}

/* Responsive */
@media (max-width: 768px) {
  .special-card {
    height: 240px;
  }
  .special-card-content {
    padding: 18px 16px;
  }
  .special-card-content h3 {
    font-size: 1rem;
  }
}
/* ============================================================= IMMAGINI FEATURETTES SERVIZI SPECIALI */
/* 
 .featurette-bg-gpl {
  background-image: url('img/gpl.jpg');
  background-size: cover;
  background-position: center;
}
*/
.featurette-bg-gancio {
  background-image: url('img/ganciotraino.jpg');
  background-size: cover;
  background-position: center;
}

.featurette-bg-revisione {
  background-image: url('img/revisioni.jpg');
  background-size: cover;
  background-position: center;
}


/* ============================================================= IMMAGINI FEATURETTES SERVIZI SPECIALI */
.featurette-bg-gpl {
  background-image: url('img/gpl.jpg');
  background-size: cover;
  background-position: center;
}
/* ============================================================= SFONDO SEZIONE CONTATTI */
.contact-section {
  position: relative;
}

.contact-bg-gara {
  background-image: url('img/gara.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed; /* Effetto parallasse opzionale */
  background-repeat: no-repeat;
}

.contact-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(11, 12, 14, 0.85) 0%, rgba(228, 0, 43, 0.15) 100%);
  z-index: 0;
}

/* Assicurati che il contenuto sia sopra l'overlay */
.contact-section .container {
  position: relative;
  z-index: 1;
}

/* Responsive: su mobile togli l'attachment fixed per performance */
@media (max-width: 768px) {
  .contact-bg-gara {
    background-attachment: scroll;
  }
}
/* ============================================================= SFONDO SEZIONE SERVIZI */
.marketing-section {
  position: relative;
}

.marketing-bg-officina {
  background-image: url('img/officina.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed; /* Effetto parallasse */
  background-repeat: no-repeat;
}

.marketing-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5); /* Nero al 70% */
  z-index: 0;
}

/* Assicurati che il contenuto sia sopra l'overlay */
.marketing-section .container {
  position: relative;
  z-index: 1;
}

/* Responsive: su mobile togli l'attachment fixed */
@media (max-width: 768px) {
  .marketing-bg-officina {
    background-attachment: scroll;
  }
}
/* ============================================================= LINK TORNA SU */
.back-to-top {
  transition: all 0.3s ease;
}

.back-to-top:hover {
  opacity: 1 !important;
  color: var(--accent) !important;
  transform: translateY(-3px);
}

.back-to-top i {
  transition: transform 0.3s ease;
}

.back-to-top:hover i {
  transform: translateY(-3px);
}
/* ============================================================= BOTTONE TORNA SU */
.back-to-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #ff7a18; /* Arancione racing */
  color: #000 !important;
  padding: 12px;
  border-radius: 25px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(255, 122, 24, 0.3);
  transition: all 0.3s ease;
  margin-top:10px;
}

.back-to-top-btn:hover {
  background-color: #ff9500; /* Arancione più chiaro in hover */
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 122, 24, 0.5);
  color: #000 !important;
}

.back-to-top-btn i {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.back-to-top-btn:hover i {
  transform: translateY(-3px);
}

/* Responsive: su mobile bottone più compatto */
@media (max-width: 576px) {
  .back-to-top-btn {
    padding: 10px 18px;
    font-size: 0.85rem;
  }
}
.text-gold {color: #daa520;}
