/* ============================================================
   PONTUAL FACAS — CSS Responsivo v2.0 Premium
   Breakpoints: 1200 | 1024 | 900 | 768 | 640 | 480 | 375
   ============================================================ */

/* ------------------------------------------------------------
   DESKTOP GRANDE — 1200px
   ------------------------------------------------------------ */
@media (max-width: 1200px) {
  :root { --container-max: 1000px; }

  .hero-container { grid-template-columns: 1fr 360px; gap: 48px; }
  .footer-grid { grid-template-columns: 2fr 1fr 1.2fr 1.2fr; gap: 32px; }
  .stats-bar-item { padding: 0 24px; }
}

/* ------------------------------------------------------------
   TABLET GRANDE — 1024px
   ------------------------------------------------------------ */
@media (max-width: 1024px) {
  :root { --section-py: 72px; }

  /* Hero: reduzir visual */
  .hero-container { grid-template-columns: 1fr 300px; gap: 40px; }
  .hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); }

  /* Grids */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .why-grid { gap: 48px; }
  .service-layout { grid-template-columns: 1fr 300px; gap: 36px; }
  .blog-post-layout { grid-template-columns: 1fr 260px; gap: 36px; }
  .stats-bar-inner { grid-template-columns: repeat(2, 1fr); }
  .stats-bar-item:nth-child(2) { border-right: none; }
  .stats-bar-item:nth-child(3) { border-top: 1px solid rgba(255,255,255,.08); padding-top: 20px; margin-top: 4px; }
  .stats-bar-item:nth-child(4) { border-right: none; border-top: 1px solid rgba(255,255,255,.08); padding-top: 20px; margin-top: 4px; }
}

/* ------------------------------------------------------------
   TABLET — 900px
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  :root {
    --section-py: 60px;
    --header-height: 72px;
    --topbar-height: 0px;
  }

  /* Esconder top bar no mobile */
  #top-bar { display: none; }
  body { padding-top: var(--header-height); }
  #site-header { top: 0; }
  #mobile-nav { top: var(--header-height); max-height: calc(100vh - var(--header-height)); }

  /* Header */
  .main-nav,
  .header-phone { display: none; }
  .menu-toggle { display: flex; }

  /* Hero: single column */
  .hero-container {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 56px 24px;
  }
  .hero-visual { display: none; }
  .hero h1 { font-size: clamp(1.85rem, 5vw, 2.8rem); }
  .hero-content { max-width: 100%; }
  .hero-stats { gap: 0; }
  .hero-stat { flex: 1; }

  /* Stats bar */
  .stats-bar-inner { grid-template-columns: repeat(2, 1fr); }

  /* Grids: 2 colunas */
  .benefits-grid { grid-template-columns: repeat(2, 1fr); }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .segments-grid { grid-template-columns: repeat(2, 1fr); }
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .related-posts-grid { grid-template-columns: repeat(2, 1fr); }

  /* Grids: 1 coluna */
  .why-grid { grid-template-columns: 1fr; gap: 48px; }
  .why-image { order: -1; }
  .contact-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .mission-grid { grid-template-columns: repeat(2, 1fr); }
  .service-layout { grid-template-columns: 1fr; }
  .service-sidebar { position: static; }
  .service-process { grid-template-columns: repeat(3, 1fr); }
  .blog-post-layout { grid-template-columns: 1fr; }
  .blog-post-sidebar { position: static; }

  /* CTA */
  .cta-inner {
    flex-direction: column;
    text-align: center;
    gap: 32px;
  }
  .cta-actions { width: 100%; }
  .cta-text .cta-address { justify-content: center; }
  .footer-cta-strip-inner { flex-direction: column; text-align: center; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }

  /* About */
  .about-stat-card { right: 0; bottom: -20px; }
  .about-image-stack .main-img img { height: 400px; }

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

  /* Tour */
  .tour-container iframe { height: 360px !important; }
  .tour-features { gap: 20px; }
}

/* ------------------------------------------------------------
   MOBILE — 640px
   ------------------------------------------------------------ */
@media (max-width: 640px) {
  :root {
    --section-py: 52px;
    --header-height: 64px;
  }

  .container { padding: 0 16px; }

  /* Top bar: oculto */
  #top-bar { display: none; }

  /* Header */
  .site-logo-tagline { display: none; }
  .site-logo img { height: 38px; }
  .site-logo-name { font-size: .95rem; }
  .header-cta .header-phone { display: none; }

  /* Hero */
  .hero-container {
    padding: 48px 16px 40px;
    min-height: auto;
  }
  .hero h1 { font-size: 1.8rem; margin-bottom: 18px; }
  .hero-badge { font-size: .65rem; }
  .hero-desc { font-size: 1rem; margin-bottom: 32px; }
  .hero-actions { flex-direction: column; gap: 10px; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 28px;
    margin-bottom: 0;
  }
  .hero-stat { padding-right: 0; margin-right: 0; border-right: 1px solid rgba(255,255,255,.1); padding: 0 8px; }
  .hero-stat:last-child { border-right: none; }
  .hero-stat strong { font-size: 1.5rem; }
  .hero-stat span { font-size: .6rem; }
  .hero-scroll { display: none; }

  /* Stats bar: 2 colunas */
  .stats-bar-inner { grid-template-columns: 1fr 1fr; gap: 0; }
  .stats-bar-item {
    padding: 16px 16px;
    border-right: 1px solid rgba(255,255,255,.08);
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .stats-bar-item:nth-child(even) { border-right: none; }
  .stats-bar-item:nth-child(3),
  .stats-bar-item:nth-child(4) { border-bottom: none; }
  .stats-bar-text strong { font-size: 1.35rem; }

  /* Section titles */
  .section-title { font-size: 1.5rem; }
  .page-hero h1 { font-size: 1.5rem; }
  .section-subtitle { font-size: .9375rem; }

  /* Grids: 1 coluna */
  .benefits-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: 1fr; }
  .segments-grid { grid-template-columns: 1fr; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .mission-grid { grid-template-columns: 1fr; }
  .related-posts-grid { grid-template-columns: 1fr; }
  .service-process { grid-template-columns: 1fr; }
  .service-gallery { grid-template-columns: 1fr 1fr; }

  /* Cards */
  .product-card-img { height: 190px; }
  .blog-card-img { height: 190px; }
  .benefit-card { padding: 28px 20px; }
  .benefit-card-num { font-size: 2.5rem; }

  /* Segment cards — lista */
  .segment-card { padding: 20px 16px; }
  .segment-icon { width: 44px; height: 44px; }

  /* Why grid */
  .why-grid { gap: 32px; }
  .why-image img { max-height: 320px; }
  .why-badge { bottom: 16px; left: 16px; padding: 14px 18px; }
  .why-badge strong { font-size: 1.5rem; }
  .why-badge-yellow { top: 16px; right: 16px; }

  /* Tour */
  .tour-container iframe { height: 260px !important; }
  .tour-placeholder { padding: 48px 24px; }
  .tour-placeholder-icon { width: 80px; height: 80px; }
  .tour-features { flex-direction: column; align-items: center; gap: 12px; }

  /* Contact form card */
  .contact-form-card { padding: 28px 20px; }
  .contact-whatsapp-block { padding: 24px 20px; }

  /* CTA */
  .cta-inner { gap: 28px; }
  .cta-actions { flex-direction: column; }
  .cta-actions .btn { width: 100%; justify-content: center; }
  .footer-cta-strip { padding: 28px 0; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-bottom-links { flex-wrap: wrap; justify-content: center; }
  #site-footer { padding-top: 56px; }

  /* WhatsApp float */
  #whatsapp-float { bottom: 20px; right: 16px; }
  .whatsapp-float-btn { width: 56px; height: 56px; }
  .whatsapp-float-btn svg { width: 28px; height: 28px; }
  .whatsapp-float-bubble { display: none; }

  /* Page hero */
  .page-hero { padding: 52px 0 44px; }
  .page-hero h1 { font-size: 1.5rem; }

  /* Breadcrumbs: simplificar */
  .breadcrumbs { gap: 5px; }
  .breadcrumbs a:not(:last-of-type) { display: none; }
  .breadcrumbs span:not(.current):not(:last-child) { display: none; }

  /* Service page */
  .service-cta-card { padding: 28px 20px; }
  .service-links-card { padding: 20px 16px; }
  .service-hero-img img { height: 220px; }

  /* Buttons */
  .btn-lg { padding: 16px 36px; }
  .btn-xl { padding: 18px 40px; }

  /* Timeline */
  .timeline::before { left: 14px; }
  .timeline-item { padding-left: 44px; }
  .timeline-dot { left: 5px; }

  /* About */
  .about-image-stack .main-img img { height: 280px; }
  .about-stat-card { position: static; margin-top: 16px; border-radius: var(--radius-md); }

  /* Blog post */
  .blog-post-featured-img img { height: 220px; }
  .blog-post-meta-bar { gap: 12px; }
  .blog-post-cta { padding: 28px 20px; }
}

/* ------------------------------------------------------------
   MOBILE PEQUENO — 480px
   ------------------------------------------------------------ */
@media (max-width: 480px) {
  .hero h1 { font-size: 1.65rem; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .stats-bar-inner { grid-template-columns: 1fr 1fr; }
  .segment-card { flex-direction: column; gap: 12px; }
  .testimonial-card { padding: 24px 20px; }
  .nav-dropdown { min-width: 180px; }
  .service-gallery { grid-template-columns: 1fr; }
  .service-gallery img { height: 200px; }
}

/* ------------------------------------------------------------
   MOBILE EXTRA PEQUENO — 375px
   ------------------------------------------------------------ */
@media (max-width: 375px) {
  :root { --header-height: 60px; }
  .hero h1 { font-size: 1.5rem; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-stats .hero-stat:last-child { grid-column: span 2; text-align: center; }
  .btn { padding: 12px 22px; font-size: .875rem; }
  .btn-lg { padding: 14px 28px; font-size: .9375rem; }
  .benefits-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------
   GARANTIAS — Zero rolagem horizontal
   ------------------------------------------------------------ */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}
*, *::before, *::after {
  max-width: 100%;
}
img, video { max-width: 100%; height: auto; }
iframe, object, embed { max-width: 100%; }
/* iframes de mapa/tour: preservar altura definida, não forçar auto */
.map-embed iframe { height: 240px !important; }
.tour-container iframe { height: 460px !important; }
table { width: 100%; overflow-x: auto; display: block; }
pre { overflow-x: auto; }

/* Garantir que nenhum elemento cause overflow */
.hero-container,
.container,
.footer-grid,
.benefits-grid,
.products-grid,
.segments-grid,
.testimonials-grid,
.blog-grid,
.why-grid,
.contact-grid,
.about-grid,
.mission-grid,
.service-layout,
.stats-bar-inner {
  min-width: 0;
}

/* ------------------------------------------------------------
   IMPRESSÃO
   ------------------------------------------------------------ */
@media print {
  #top-bar,
  #site-header,
  #site-footer,
  #whatsapp-float,
  .cta-banner,
  .footer-cta-strip,
  .hero-scroll,
  .service-sidebar,
  .blog-post-sidebar { display: none !important; }
  body { padding-top: 0 !important; }
  a { color: var(--blue-primary); }
  .page-hero { padding: 24px 0; }
}
