/* ============================================================
   IMOBILIÁRIA ELEMENTOR CUSTOM - CSS Responsivo
   Mobile-first breakpoints
   ============================================================ */

/* ---- DESKTOP LARGE: ≥ 1201px ---- */
@media (min-width: 1201px) {
  .container { padding: 0 40px; }
  .imoveis-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---- DESKTOP: 993px – 1200px ---- */
@media (max-width: 1200px) {
  :root { --container-max: 100%; }
  .container { padding: 0 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .agentes-grid { grid-template-columns: repeat(2, 1fr); }
  .imoveis-grid-cols-4 { grid-template-columns: repeat(3, 1fr); }
  .como-funciona-grid { grid-template-columns: repeat(2, 1fr); }
  .sobre-imagem img { height: 380px; }
}

/* ---- TABLET: 769px – 992px ---- */
@media (max-width: 992px) {
  /* Layout */
  .section-pad { padding: 56px 0; }

  /* Header */
  .header-topbar { display: none; }
  .header-inner { height: 64px; }
  .site-nav { display: none; }
  .mobile-toggle { display: flex; }
  .mobile-nav { display: block; }
  .header-actions .btn:not(.mobile-toggle) { display: none; }
  .header-actions .mobile-toggle { display: flex; }

  /* Hero */
  .hero-section { min-height: 70vh; }
  .hero-content { padding: 48px 0; }
  .hero-busca .imob-busca-wrapper { padding: 16px; }

  /* Grid Imóveis */
  .imoveis-grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .imoveis-grid-cols-4 { grid-template-columns: repeat(2, 1fr); }

  /* Single Imóvel */
  .single-imovel-layout { grid-template-columns: 1fr; }
  .single-imovel-sidebar { position: static; }
  .gallery-main { max-height: 420px; }

  /* Home */
  .sobre-layout { grid-template-columns: 1fr; gap: 40px; }
  .sobre-imagem { max-width: 100%; }
  .sobre-badge-anos { right: 0; bottom: 0; }
  .agentes-grid { grid-template-columns: repeat(2, 1fr); }
  .depoimentos-grid { grid-template-columns: repeat(2, 1fr); }
  .cta-final-box { padding: 40px; flex-direction: column; text-align: center; }
  .cta-final-img { position: static; font-size: 4rem; margin-top: 24px; opacity: 0.2; }
  .cta-final-buttons { justify-content: center; }

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

/* ---- TABLET PEQUENO / MOBILE GRANDE: 577px – 768px ---- */
@media (max-width: 768px) {
  /* Busca */
  .imob-busca-fields { flex-direction: column; }
  .imob-busca-field { min-width: 100%; }
  .imob-busca-submit { width: 100%; }
  .btn-busca { width: 100%; justify-content: center; }

  /* Archive Filtros */
  .archive-filtros-section { position: static; }
  .filtros-grid { grid-template-columns: 1fr 1fr; }
  .filtro-keyword { grid-column: span 2; }
  .filtro-buttons { grid-column: span 2; }

  /* Grid imóveis */
  .imoveis-grid-cols-3 { grid-template-columns: repeat(2, 1fr); }

  /* Home sections */
  .como-funciona-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
  .depoimentos-grid { grid-template-columns: 1fr; max-width: 500px; margin: 0 auto; }
  .sobre-numeros { gap: 20px; }

  /* Posts grid */
  .posts-grid { grid-template-columns: repeat(2, 1fr); }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }
}

/* ---- MOBILE: ≤ 576px ---- */
@media (max-width: 576px) {
  /* Tipografia */
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.3rem; }

  /* Botões */
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; justify-content: center; }

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

  /* Grid imóveis - 1 coluna no mobile */
  .imoveis-grid-cols-2,
  .imoveis-grid-cols-3,
  .imoveis-grid-cols-4 { grid-template-columns: 1fr; }

  /* Archive filtros */
  .filtros-grid { grid-template-columns: 1fr; }
  .filtro-keyword,
  .filtro-buttons { grid-column: span 1; }
  .filtro-buttons { flex-direction: column; }
  .filtro-buttons .btn { width: 100%; justify-content: center; }

  /* Home */
  .como-funciona-grid { grid-template-columns: 1fr; }
  .agentes-grid { grid-template-columns: 1fr; max-width: 360px; margin: 0 auto; }
  .sobre-numeros { flex-direction: column; gap: 16px; }
  .cta-final-box { padding: 30px 20px; }
  .cta-final-buttons { flex-direction: column; }
  .cta-final-buttons .btn { width: 100%; justify-content: center; }

  /* Single */
  .single-imovel-icones-bar { justify-content: space-around; }
  .icone-item { min-width: 60px; }
  .gallery-thumbs { gap: 6px; }
  .gallery-thumb { flex: 0 0 65px; height: 50px; }

  /* Social share */
  .share-btn { width: 36px; height: 36px; font-size: 0.8rem; }

  /* Sidebar contato */
  .sidebar-contato-box { padding: 20px; }

  /* Posts */
  .posts-grid { grid-template-columns: 1fr; }

  /* Footer */
  .footer-social { justify-content: center; }
  .footer-widgets { padding: 40px 0 32px; }
  .footer-col-1 { text-align: center; }

  /* WhatsApp float */
  .whatsapp-float { width: 50px; height: 50px; font-size: 1.4rem; bottom: 20px; right: 20px; }

  /* Section */
  .section-pad { padding: 44px 0; }

  /* Breadcrumbs */
  .imob-breadcrumbs ol { font-size: 0.75rem; }

  /* Hero stats — empilha no mobile */
  .hero-stats { max-width: 100%; }
  .hero-stat { padding: 12px 10px; }
  .hero-stat-val { font-size: 1.1rem; }

  /* Scroll indicator — ocultar no mobile */
  .hero-scroll { display: none; }

  /* WhatsApp tooltip — ocultar no mobile */
  .whatsapp-float::before,
  .whatsapp-float::after { display: none; }

  /* Section title decoration — tamanho menor */
  .section-title { padding-bottom: 14px; }
  .section-title::after { width: 36px; height: 2px; }

  /* Grid imoveis section */
  .imoveis-grid-section { padding: 44px 0; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .header-topbar,
  .mobile-toggle,
  .mobile-nav,
  .mobile-overlay,
  .whatsapp-float,
  .single-imovel-sidebar,
  .single-imovel-similares,
  .site-footer,
  .archive-filtros-section { display: none !important; }

  .single-imovel-layout { grid-template-columns: 1fr; }
  .gallery-thumbs { display: none; }
  .detalhes-table { break-inside: avoid; }
  body { color: #000; }
  a { color: #000; text-decoration: underline; }
}

/* ============================================================
   ACESSIBILIDADE
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .whatsapp-float { animation: none; }
}

@media (prefers-color-scheme: dark) {
  /* Não implementamos dark mode automaticamente para manter a identidade visual */
}

/* ============================================================
   ELEMENTOR RESPONSIVO - OVERRIDES
   ============================================================ */
@media (max-width: 992px) {
  .elementor-section.elementor-section-boxed > .elementor-container { max-width: 100%; }
}

/* Ajuste para sticky header + filtros */
@media (min-width: 993px) {
  .single-imovel-sidebar { top: 88px; }
}

/* Scroll horizontal para galeria de thumbs no mobile */
.gallery-thumbs { scrollbar-width: thin; scrollbar-color: var(--cor-primaria) var(--cor-fundo-alt); }
.gallery-thumbs::-webkit-scrollbar { height: 4px; }
.gallery-thumbs::-webkit-scrollbar-track { background: var(--cor-fundo-alt); }
.gallery-thumbs::-webkit-scrollbar-thumb { background: var(--cor-primaria); border-radius: 2px; }
