/* ==========================================================================
   RESPONSIVE STYLESHEET — Materassi Ad Acqua
   Breakpoints: 1200 | 992 | 768 | 576 | 480
   ========================================================================== */

/* ── Large Desktop (≤1200px) ─────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
  .footer-grid .footer-brand { grid-column: 1 / -1; }
  .footer-grid .footer-col:last-child { display: none; } /* hide 4th col */
}

/* ── Tablet Landscape (≤992px) ───────────────────────────────────────────── */
@media (max-width: 992px) {
  :root { --spacing-xl: 4rem; --spacing-lg: 3rem; }

  /* Header */
  .primary-nav {
    position: fixed;
    top: 0; right: -100%;
    width: min(320px, 85vw);
    height: 100vh;
    background: var(--color-white);
    box-shadow: -4px 0 24px rgba(0,0,0,.12);
    padding: 5rem 2rem 2rem;
    transition: right 0.35s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    z-index: 999;
  }
  .primary-nav.is-open { right: 0; }
  .primary-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }
  .primary-nav ul li a {
    padding: 0.85rem 1rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--color-light-grey);
  }
  .primary-nav ul li a.btn {
    margin-top: 1rem;
    text-align: center;
    justify-content: center;
  }

  /* Overlay for mobile nav */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 998;
  }
  .nav-overlay.is-visible { display: block; }

  .hamburger { display: flex; }

  /* Hero */
  .hero {
    text-align: center;
    padding-top: 110px;
  }
  .hero > .container {
    flex-direction: column;
    gap: 3rem;
  }
  .hero-content { max-width: 100%; }
  .hero-cta     { justify-content: center; }
  .hero-stats   { justify-content: center; }
  .hero-visual  { order: -1; }
  .hero-image-placeholder { max-width: 480px; margin: 0 auto; }

  /* Two-column → single column */
  .about-grid,
  .contact-grid,
  .vantaggi-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-image-wrap { order: -1; }
  .about-accent-box { display: none; }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .footer-grid .footer-brand { grid-column: 1 / -1; }

  /* 3-col products → 2 col */
  .grid-3.products-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Tablet Portrait (≤768px) ────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --spacing-xl: 3.5rem; --spacing-lg: 2.5rem; }

  /* Top bar */
  .top-bar .top-bar-inner { justify-content: center; }
  .top-bar .top-bar-promo { display: none; }

  /* Section header */
  .section-header { margin-bottom: 2rem; }

  /* Grids */
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }

  /* Form */
  .form-row { grid-template-columns: 1fr; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-bottom-links { justify-content: center; }

  /* Trust bar */
  .trust-bar-inner { gap: 1rem; }
  .trust-item { font-size: 0.82rem; }

  /* Products 2-col */
  .grid-3.products-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile (≤576px) ─────────────────────────────────────────────────────── */
@media (max-width: 576px) {
  :root { --spacing-xl: 2.5rem; }

  /* Typography */
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  h3 { font-size: 1.2rem; }

  /* Header */
  .header-inner { padding: 0.75rem 1rem; }
  .site-logo img { height: 38px; }
  .site-logo .logo-text { font-size: 1.1rem; }

  /* Hero */
  .hero { padding-top: 90px; min-height: auto; padding-bottom: 3rem; }
  .hero-stats { gap: 1.25rem; }
  .hero-badge { display: none; }
  .hero-cta .btn { width: 100%; justify-content: center; }

  /* Features – single col */
  .features-grid { grid-template-columns: 1fr; }

  /* Products – single col */
  .grid-3.products-grid { grid-template-columns: 1fr; }

  /* Testimonials – single col */
  .testimonials-grid { grid-template-columns: 1fr; }

  /* CTA */
  .cta-box { padding: 2.5rem 1.5rem; }
  .cta-buttons .btn { width: 100%; justify-content: center; }
  .cta-buttons { flex-direction: column; }

  /* Contact form */
  .contact-form-wrap { padding: 1.75rem 1.25rem; }

  /* Page hero */
  .page-hero { padding: 6rem 0 2.5rem; }

  /* Vantaggi */
  .vantaggi-grid { grid-template-columns: 1fr; }

  /* Footer */
  .footer-grid .footer-col:nth-child(3),
  .footer-grid .footer-col:nth-child(4) { display: none; }

  /* Back-to-top */
  #back-to-top { bottom: 5rem; right: 1rem; }

  /* Misc */
  .container { padding: 0 1rem; }
  .trust-item span { display: none; } /* show only icons on mobile */

  /* 4-col → 2-col */
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Extra Small (≤480px) ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero-stats .hero-stat:nth-child(n+4) { display: none; }
  .breadcrumb .breadcrumb-sep:last-of-type,
  .breadcrumb span:last-child { display: none; }
}

/* ── Print ───────────────────────────────────────────────────────────────── */
@media print {
  #site-header,
  #chat-widget,
  #back-to-top,
  #cookie-notice,
  #page-loader { display: none !important; }
  body { padding-top: 0 !important; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8rem; }
}
