
/* Reset universale */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: #23262d;
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* Navbar & Logo Styling */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 2rem;
  background: rgba(22, 24, 29, 0.95);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  border-bottom: 2px solid #dc2626;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
}

.logo-link {
  display: inline-block;
  text-decoration: none;
}

.logo-img {
  height: 60px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  mix-blend-mode: screen;
  filter: contrast(1.1) brightness(1.05);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-links a i {
  color: #dc2626;
  font-size: 0.85rem;
}

.nav-links a:hover {
  color: #ffffff;
  background-color: rgba(220, 38, 38, 0.15);
}

/* Hero Section Stilizzata */
.hero {
  text-align: center;
  padding: 2.5rem 1rem;
  background: linear-gradient(135deg, #16181d 0%, #23262d 50%, #1a1c22 100%);
  border-bottom: 1px solid #363a45;
}

.hero-content {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.hero-title {
  font-size: clamp(1.6rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: 0.6rem;
  color: #ffffff;
}

.hero-title .brand-highlight {
  background: linear-gradient(90deg, #ffffff 30%, #dc2626 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: #94a3b8;
  font-size: clamp(0.9rem, 2.5vw, 1.16rem);
  margin-bottom: 1.5rem;
}

/* Griglia Servizi */
.services-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 1rem;
}

.service-badge {
  background: rgba(30, 33, 39, 0.8);
  color: #f1f5f9;
  padding: 0.6rem 1.1rem;
  border-radius: 50px;
  font-size: clamp(0.8rem, 2vw, 0.92rem);
  font-weight: 500;
  border: 1px solid #363a45;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.service-badge i {
  color: #dc2626;
}

/* Sezione iFrame AutoScout24 */
.autoscout-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-header h2 {
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-header h2 i {
  color: #dc2626;
}

.btn-external {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background-color: #dc2626;
  color: #ffffff;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-external:hover {
  background-color: #b91c1c;
}

.iframe-wrapper {
  width: 100%;
  height: 75vh;
  min-height: 450px;
  max-height: 950px;
  background-color: #16181d;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #363a45;
  -webkit-overflow-scrolling: touch;
}

.iframe-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Pulsanti Flottanti (Email a sinistra, WhatsApp a destra) */
.float-btn {
  position: fixed;
  bottom: 20px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  z-index: 9990;
  transition: transform 0.2s ease;
}

.email-float {
  left: 20px;
  background-color: #ffffff;
}

.whatsapp-float {
  right: 20px;
}

.float-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.float-btn:hover {
  transform: scale(1.1);
}

/* Footer & Contatti */
.footer {
  background-color: #14161a;
  color: #cbd5e1;
  padding: 3rem 1rem 5.5rem;
  border-top: 3px solid #dc2626;
  margin-top: 2rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.footer-brand h2 {
  font-size: 1.8rem;
  color: #ffffff;
}

.map-link {
  color: #94a3b8;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
}

.map-link i {
  color: #dc2626;
}

.map-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.map-hint {
  font-size: 0.85rem;
  color: #e2e8f0;
  background-color: rgba(226, 232, 240, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 5px;
}

.footer-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.info-card {
  background-color: #1e2127;
  padding: 1.5rem;
  border-radius: 10px;
  border: 1px solid #2e333e;
}

.info-card h3 {
  color: #dc2626;
  font-size: 1.15rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-card p {
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}

.info-card a {
  color: #e2e8f0;
  text-decoration: none;
}

.info-card a:hover {
  text-decoration: underline;
}

.hours-list {
  list-style: none;
}

.hours-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.7rem;
  font-size: 0.92rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.4rem;
}

.hours-list li strong {
  color: #ffffff;
  text-align: right;
}

.hours-list li strong.closed {
  color: #ef4444;
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid #242831;
  font-size: 0.85rem;
  color: #94a3b8;
}

.footer-bottom strong {
  color: #ffffff;
}

.footer-bottom .copy {
  margin-top: 0.4rem;
}

.legal-links {
  margin: 0.6rem 0;
}

.legal-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.legal-links a:hover {
  color: #dc2626;
  text-decoration: underline;
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #16181d;
  color: #f1f5f9;
  padding: 1rem 1.5rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
  border-top: 3px solid #dc2626;
  z-index: 9999;
}

.cookie-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cookie-content p {
  font-size: 0.85rem;
  color: #cbd5e1;
  flex: 1;
  line-height: 1.4;
}

.cookie-content a {
  color: #e2e8f0;
}

.btn-cookie-accept {
  background-color: #dc2626;
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.3rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-cookie-accept:hover {
  background-color: #b91c1c;
}

/* Stili Pagina Privacy & Cookie Policy */
.legal-container {
  max-width: 960px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1rem;
  flex: 1;
}

.legal-box {
  background-color: #1e2127;
  border: 1px solid #363a45;
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.legal-box h1 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: #ffffff;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.legal-box h1 i {
  color: #dc2626;
}

.last-update {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #363a45;
}

.legal-section {
  margin-bottom: 2rem;
}

.legal-section h2 {
  color: #dc2626;
  font-size: 1.25rem;
  margin-bottom: 0.8rem;
}

.legal-section h3 {
  color: #ffffff;
  font-size: 1.05rem;
  margin: 1.2rem 0 0.6rem;
}

.legal-section p {
  color: #cbd5e1;
  line-height: 1.65;
  margin-bottom: 0.8rem;
  font-size: 0.96rem;
}

.legal-section a {
  color: #e2e8f0;
  text-decoration: none;
}

.legal-section a:hover {
  text-decoration: underline;
}

/* ==================================================
   LINK NEI CONTENUTI LEGALI (Privacy, Cookie, Note
   Legali, Termini, Contatti)
   Il blu predefinito del browser era illeggibile sullo
   sfondo scuro: qui tutti i link usano un colore chiaro
   ad alto contrasto, sempre sottolineati per distinguerli
   dal testo normale.
   ================================================== */

.legal-content a,
.legal-box .entry-content a,
.legal-box .legal-list a,
.legal-box .highlight-card a,
.legal-box p a,
.legal-box li a {
  color: #fca5a5;
  text-decoration: underline;
  text-decoration-color: rgba(252, 165, 165, 0.55);
  text-underline-offset: 2px;
  font-weight: 500;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
  word-break: break-word;
}

.legal-content a:hover,
.legal-content a:focus-visible,
.legal-box .entry-content a:hover,
.legal-box .entry-content a:focus-visible,
.legal-box .legal-list a:hover,
.legal-box .legal-list a:focus-visible,
.legal-box .highlight-card a:hover,
.legal-box .highlight-card a:focus-visible,
.legal-box p a:hover,
.legal-box p a:focus-visible,
.legal-box li a:hover,
.legal-box li a:focus-visible {
  color: #ffffff;
  text-decoration-color: #dc2626;
}

/* I pulsanti-link (btn-external / btn-secondary) mantengono il
   proprio stile: non devono ereditare la sottolineatura del testo. */
.legal-content a.btn-external,
.legal-content a.btn-secondary,
.legal-box a.btn-external,
.legal-box a.btn-secondary {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
}

.legal-content a.btn-external:hover,
.legal-content a.btn-external:focus-visible,
.legal-box a.btn-external:hover,
.legal-box a.btn-external:focus-visible {
  color: #ffffff;
  text-decoration: none;
}

.legal-content a.btn-secondary,
.legal-box a.btn-secondary {
  color: #f1f5f9;
}

/* Titoli e paragrafi del contenuto legale predefinito */
.legal-content h2 {
  color: #dc2626;
  font-size: 1.25rem;
  margin: 2rem 0 0.8rem;
}

.legal-content h3 {
  color: #ffffff;
  font-size: 1.05rem;
  margin: 1.2rem 0 0.6rem;
}

.legal-content p {
  color: #cbd5e1;
  line-height: 1.65;
  margin-bottom: 0.8rem;
  font-size: 0.96rem;
}

.legal-content strong {
  color: #ffffff;
}

.legal-content ul,
.legal-content ol {
  list-style: disc;
  padding-left: 1.5rem;
  color: #cbd5e1;
  margin-bottom: 1rem;
}

.legal-content li {
  margin-bottom: 0.6rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

.legal-content code {
  background-color: #14161a;
  padding: 2px 6px;
  border-radius: 4px;
  color: #f87171;
  font-size: 0.88rem;
}

.highlight-card {
  background-color: #16181d;
  border-left: 4px solid #dc2626;
  padding: 1.2rem;
  border-radius: 6px;
  margin: 1rem 0;
}

.highlight-card p {
  margin-bottom: 0.3rem;
}

.legal-list {
  list-style: disc;
  padding-left: 1.5rem;
  color: #cbd5e1;
}

.legal-list li {
  margin-bottom: 0.6rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

.legal-list code {
  background-color: #14161a;
  padding: 2px 6px;
  border-radius: 4px;
  color: #f87171;
  font-size: 0.88rem;
}

.legal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #363a45;
}

.btn-secondary {
  background-color: #2e333e;
  color: #f1f5f9;
  border: 1px solid #475569;
  padding: 0.65rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s;
}

.btn-secondary:hover {
  background-color: #3f4654;
}

/* ================================================== */
/* MENU RESPONSIVE: PULSANTE HAMBURGER (tablet/mobile) */
/* ================================================== */

/* Il pulsante e nascosto su desktop: compare solo sotto i 900px. */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  padding: 0;
  background: transparent;
  border: 1px solid #363a45;
  border-radius: 8px;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  background-color: rgba(220, 38, 38, 0.15);
  border-color: #dc2626;
  outline: none;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #f1f5f9;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* Trasforma le tre barre in una "X" quando il menu e aperto. */
.navbar.nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.navbar.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.navbar.nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ================================================== */
/* MEDIA QUERIES RESPONSIVE ADATTIVE                   */
/* ================================================== */

/* Tablet e smartphone: il menu diventa un pannello a tendina. */
@media (max-width: 900px) {
  .navbar {
    flex-wrap: wrap;
    padding: 0.6rem 1rem;
  }

  .logo-wrapper {
    flex: 1 1 auto;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    width: 100%;
    order: 3;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid #363a45;
  }

  .navbar.nav-open .nav-links {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    justify-content: flex-start;
    padding: 0.75rem 0.9rem;
    font-size: 0.95rem;
    border-radius: 8px;
  }

  .nav-links a i {
    width: 1.1rem;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .logo-img {
    height: 48px;
  }

  .iframe-wrapper {
    height: 65vh;
    min-height: 400px;
  }
}

@media (max-width: 580px) {
  .navbar {
    padding: 0.6rem;
  }

  .logo-img {
    height: 40px;
    max-width: 78vw;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .btn-external {
    justify-content: center;
    width: 100%;
  }

  .float-btn {
    width: 44px;
    height: 44px;
    bottom: 15px;
  }

  .email-float {
    left: 12px;
  }

  .whatsapp-float {
    right: 12px;
  }

  .footer {
    padding-bottom: 7.5rem;
  }

  .cookie-content {
    flex-direction: column;
    text-align: center;
  }

  .btn-cookie-accept {
    width: 100%;
  }

  .legal-box {
    padding: 1.4rem;
  }

  .legal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-secondary,
  .legal-actions .btn-external {
    justify-content: center;
    text-align: center;
  }
}
