/* ==========================================================================
   RESPONSIVIDADE E ADAPTAÇÃO MOBILE / TABLET / DESKTOP - ALEXSANDRA TOMAZ
   Otimizado para UX superior, eliminação de espaços vazios e fluidez total
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. PREVENÇÃO ABSOLUTA DE ROLAGEM HORIZONTAL E RESET BASE
   -------------------------------------------------------------------------- */
html {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative !important;
  box-sizing: border-box !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

*, *::before, *::after {
  box-sizing: border-box !important;
}

h1, h2, h3, h4, h5, h6, p, span, a, li, label, div {
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
}

/* --------------------------------------------------------------------------
   2. DESKTOP PADRÃO E TELAS LARGAS (A partir de 1024px)
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1.12fr 0.88fr;
    gap: clamp(2rem, 3.5vw, 3.5rem);
    align-items: center;
  }

  .proposals-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
  }

  /* Preenchimento perfeito do grid de 3 colunas: Card 7 ocupa 2 colunas e Card 8 ocupa 1 */
  .proposal-card[data-category="empreendedorismo"] {
    grid-column: span 2;
  }

  .proposal-card-cta {
    grid-column: span 1;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }

  .materials-grid {
    grid-template-columns: 0.95fr 1.05fr;
    gap: 3rem;
    align-items: center;
  }

  .contact-cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
  }

  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 2.5rem;
  }
}

/* --------------------------------------------------------------------------
   3. DESKTOPS COMPACTOS E NOTEBOOKS (1024px até 1199px)
   -------------------------------------------------------------------------- */
@media (max-width: 1199px) and (min-width: 1024px) {
  .hero-title {
    font-size: 3rem;
  }

  .hero-candidate-photo {
    height: 480px;
  }

  .proposals-grid {
    gap: 1.25rem;
  }

  .proposal-card {
    padding: 1.75rem 1.4rem;
  }
}

/* --------------------------------------------------------------------------
   4. TABLETS E TELAS MÉDIAS (768px até 1023px)
   Otimização para eliminação de espaços mortos (Grid 2x4 perfeito de propostas)
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) and (min-width: 768px) {
  section {
    padding: 3.5rem 0 !important;
  }

  .hero-section {
    padding: 3rem 0 2.5rem !important;
    min-height: auto;
  }

  .hero-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 2rem !important;
    align-items: center !important;
  }

  .hero-title {
    font-size: 2.6rem !important;
  }

  .hero-slogan {
    font-size: 1.05rem !important;
    line-height: 1.5 !important;
  }

  .hero-candidate-photo {
    height: 430px !important;
  }

  /* Grid 2x2 na Faixa de Estatísticas */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem !important;
  }

  .stat-box {
    border-right: none !important;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem !important;
  }

  /* Grid 2 Colunas para os 8 Cards de Propostas (4 Linhas Exatas = ZERO Espaço Vazio!) */
  .proposals-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.4rem !important;
  }

  .proposal-card[data-category="empreendedorismo"] {
    grid-column: span 1 !important;
  }

  .proposal-card-cta {
    grid-column: span 1 !important;
  }

  /* Seção Sobre / Biografia */
  .about-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 2.5rem !important;
    align-items: center !important;
  }

  .about-main-image img {
    height: 380px !important;
  }

  /* Central de Materiais */
  .materials-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .flyer-preview-box {
    max-width: 480px;
    margin: 0 auto;
  }

  /* Contato em 2 colunas com o 3º card centralizado */
  .contact-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.4rem !important;
  }

  .contact-cards-grid > .contact-card:nth-child(3) {
    grid-column: span 2;
  }

  /* Galeria de Vídeos Tablet (2 colunas) */
  .videos-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }

  /* Rodapé */
  .footer-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem !important;
  }
}

/* --------------------------------------------------------------------------
   5. MOBILE & SMARTPHONES (Abaixo de 768px)
   UX de aplicativo nativo, navegação facilitada e zero rolagem vertical excessiva
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  /* Regra de Ouro: Nada pode estourar a largura do dispositivo */
  .hero-grid > *,
  .about-grid > *,
  .proposals-grid > *,
  .stats-grid > *,
  .materials-grid > *,
  .footer-grid > *,
  .contact-cards-grid > * {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  section {
    padding: 2.75rem 0 !important;
  }

  .container {
    padding-left: 1.15rem !important;
    padding-right: 1.15rem !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
  }

  /* Ocultar barra superior em telas pequenas */
  .top-bar {
    display: none !important;
  }

  /* Header e Navbar Fixa Mobile */
  .header-navbar {
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
  }

  .nav-wrapper {
    height: 64px;
    width: 100%;
  }

  .brand-badge {
    width: 36px;
    height: 40px;
    border-radius: 9px;
  }

  .brand-name {
    font-size: 1.05rem;
  }

  .brand-tag {
    font-size: 0.65rem;
  }

  .mobile-nav-toggle {
    display: flex;
    z-index: 10001;
  }

  /* Menu Gaveta Mobile */
  .nav-menu {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100vh - 64px);
    background: #030a16 !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1.8rem 1.25rem;
    gap: 0.9rem;
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.35s;
    z-index: 99999;
    overflow-y: auto;
    border-top: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.95);
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    width: 100%;
    text-align: center;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: background-color 0.2s ease, color 0.2s ease;
  }

  .nav-link:hover,
  .nav-link.active {
    background: rgba(245, 158, 11, 0.18);
    color: var(--gold);
    border-color: rgba(245, 158, 11, 0.4);
  }

  .nav-link::after {
    display: none;
  }

  .nav-actions .btn-header {
    display: none;
  }

  .mobile-nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .mobile-nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0.2);
  }

  .mobile-nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Cabeçalhos de Seção */
  .section-header {
    margin-bottom: 2rem !important;
  }

  .section-tag {
    font-size: 0.72rem !important;
    padding: 0.25rem 0.75rem !important;
    margin-bottom: 0.6rem !important;
  }

  .section-title {
    font-size: clamp(1.6rem, 5.5vw, 1.95rem) !important;
    line-height: 1.22 !important;
    margin-bottom: 0.6rem !important;
  }

  .section-subtitle {
    font-size: 0.94rem !important;
    line-height: 1.5 !important;
  }

  /* Hero Section Mobile */
  .hero-section {
    padding: 1.8rem 0 2rem !important;
    min-height: auto;
    width: 100% !important;
    overflow: hidden;
  }

  .hero-glow {
    display: none !important;
  }

  .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
    text-align: center;
    width: 100% !important;
  }

  .hero-content {
    align-items: center;
    display: flex;
    flex-direction: column;
    width: 100% !important;
    gap: 0.9rem;
  }

  .hero-badge-pill {
    font-size: 0.74rem;
    padding: 0.3rem 0.8rem;
    max-width: 100%;
    line-height: 1.3;
  }

  .hero-title {
    font-size: clamp(2rem, 7vw, 2.5rem) !important;
    line-height: 1.12 !important;
    margin-bottom: 0.2rem;
  }

  .hero-slogan {
    border: none;
    padding: 0;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    margin-bottom: 0.5rem;
    max-width: 100% !important;
    color: var(--text-secondary);
  }

  /* CTAs da Hero em Mobile */
  .hero-ctas {
    display: flex;
    flex-direction: column;
    width: 100% !important;
    gap: 0.65rem;
    margin-top: 0.6rem;
  }

  .hero-ctas .btn {
    width: 100% !important;
    padding: 0.8rem 1.1rem;
    font-size: 0.92rem;
    min-height: 48px;
  }

  /* Foto Oficial da Candidata na Hero */
  .hero-media-wrapper {
    margin: 0.5rem auto 0;
    width: 100% !important;
    max-width: 320px;
  }

  .hero-image-frame {
    width: 100% !important;
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  }

  .hero-candidate-photo {
    width: 100% !important;
    height: 350px !important;
  }

  .candidate-name-overlay {
    display: none;
  }

  .hero-image-overlay {
    justify-content: center;
    padding: 0.75rem;
  }

  .floating-card {
    display: none !important;
  }

  /* Badges de Confiança */
  .hero-trust-badges {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    width: 100% !important;
  }

  .trust-item {
    width: 100% !important;
    max-width: 300px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    justify-content: flex-start;
  }

  /* ------------------------------------------------------------------------
     FAIXA DE ESTATÍSTICAS EM MOBILE (Grid 2x2 Inteligente - Reduz 250px de Scroll)
     ------------------------------------------------------------------------ */
  .stats-counter-bar {
    width: 100% !important;
    padding: 1.2rem 0 !important;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
    width: 100% !important;
  }

  .stat-box {
    width: 100% !important;
    border-right: none !important;
    border-bottom: none !important;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 0.7rem 0.6rem !important;
    align-items: center;
    gap: 0.65rem !important;
  }

  .stat-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.15rem !important;
    border-radius: 10px !important;
  }

  .stat-value {
    font-size: 1.45rem !important;
    line-height: 1.1 !important;
  }

  .stat-label {
    font-size: 0.72rem !important;
    line-height: 1.25 !important;
  }

  /* ------------------------------------------------------------------------
     FILTROS HORIZONTAIS COM SWIPE (Pill Scroll - Elimina 200px de Poluição)
     ------------------------------------------------------------------------ */
  .proposal-filters {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    justify-content: flex-start !important;
    gap: 0.5rem !important;
    padding: 0.2rem 0.2rem 0.8rem !important;
    margin-bottom: 1.5rem !important;
    scrollbar-width: none !important;
    width: 100% !important;
  }

  .proposal-filters::-webkit-scrollbar {
    display: none !important;
  }

  .filter-btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    padding: 0.5rem 0.95rem !important;
    font-size: 0.82rem !important;
    min-height: 40px !important;
  }

  /* Grid dos Cards de Propostas em Mobile */
  .proposals-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    width: 100% !important;
  }

  .proposal-card {
    width: 100% !important;
    padding: 1.4rem 1.2rem !important;
  }

  .proposal-icon-box {
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    border-radius: 12px;
  }

  .proposal-title {
    font-size: 1.2rem !important;
    line-height: 1.3 !important;
  }

  .proposal-summary {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    margin-bottom: 1.2rem !important;
  }

  /* Seção Biografia em Mobile */
  .about-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    text-align: left;
    width: 100% !important;
  }

  .about-text-content {
    width: 100% !important;
    padding: 0 !important;
  }

  .about-text-content p {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    margin-bottom: 0.9rem !important;
  }

  .about-main-image img {
    height: 280px !important;
    width: 100% !important;
    border-radius: 16px !important;
  }

  .about-quote-card {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    margin-top: 0.9rem !important;
    width: 100% !important;
    padding: 1rem 1.1rem !important;
  }

  .about-quote-card p {
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
  }

  /* Linha do Tempo (Timeline) Alinhada */
  .timeline {
    padding-left: 1.3rem !important;
    margin-top: 1.4rem !important;
    width: 100% !important;
  }

  .timeline::before {
    left: 4px !important;
  }

  .timeline-dot {
    left: -1.3rem !important;
    width: 10px !important;
    height: 10px !important;
    top: 5px !important;
  }

  .timeline-item {
    margin-bottom: 1.2rem !important;
  }

  .timeline-title {
    font-size: 0.98rem !important;
  }

  .timeline-desc {
    font-size: 0.86rem !important;
    line-height: 1.4 !important;
  }

  /* Central de Materiais em Mobile */
  .materials-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    width: 100% !important;
  }

  .flyer-preview-box {
    padding: 1rem !important;
  }

  .flyer-preview-box img {
    max-height: 380px !important;
  }

  .material-card {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.9rem !important;
    width: 100% !important;
    padding: 1.15rem !important;
  }

  .material-card .btn {
    width: 100% !important;
    min-height: 46px;
  }

  /* Formulário de Voluntário */
  .volunteer-card {
    padding: 1.8rem 1.15rem !important;
    border-radius: 20px !important;
    width: 100% !important;
  }

  .form-row {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .form-control {
    font-size: 16px !important; /* Previne auto-zoom no Safari iOS */
    padding: 0.85rem 1rem !important;
    min-height: 48px;
  }

  .checkbox-grid {
    grid-template-columns: 1fr !important;
    gap: 0.6rem !important;
  }

  .checkbox-label {
    min-height: 46px;
    padding: 0.65rem 0.85rem !important;
    font-size: 0.84rem !important;
  }

  .form-submit-container .btn {
    width: 100% !important;
    padding: 0.85rem 1.5rem !important;
  }

  /* Galeria de Vídeos & Player Modal Mobile */
  .videos-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.85rem !important;
    width: 100% !important;
  }

  .video-card {
    border-radius: 14px !important;
  }

  .video-thumb-wrapper {
    aspect-ratio: 9 / 12 !important;
  }

  .video-info {
    padding: 0.85rem 0.75rem 1rem !important;
  }

  .video-category-tag {
    font-size: 0.68rem !important;
    margin-bottom: 0.25rem !important;
  }

  .video-title {
    font-size: 0.92rem !important;
    margin-bottom: 0.35rem !important;
    line-height: 1.25 !important;
  }

  .video-desc {
    font-size: 0.78rem !important;
    line-height: 1.4 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.75rem !important;
  }

  .video-watch-btn {
    font-size: 0.75rem !important;
    padding: 0.45rem 0.5rem !important;
  }

  .video-play-btn {
    width: 44px !important;
    height: 44px !important;
    font-size: 1rem !important;
  }

  .modal-video-card {
    max-width: 95vw !important;
    border-radius: 16px !important;
  }

  .video-iframe-container {
    max-height: 65vh !important;
  }

  /* Seção de Contatos */
  .contact-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    width: 100% !important;
  }

  .contact-card {
    padding: 1.3rem !important;
  }

  /* Rodapé */
  .footer-official {
    padding: 2.75rem 0 1.5rem !important;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 1.75rem !important;
    margin-bottom: 2rem !important;
  }

  .footer-legal-badge {
    white-space: normal !important;
    line-height: 1.4 !important;
    font-size: 0.72rem !important;
  }

  /* Botão Flutuante do WhatsApp */
  .whatsapp-float-btn {
    width: 52px !important;
    height: 52px !important;
    font-size: 1.5rem !important;
    bottom: 18px !important;
    right: 18px !important;
  }
}

/* --------------------------------------------------------------------------
   6. SMARTPHONES COMPACTOS (iPhone SE, telas até 390px)
   -------------------------------------------------------------------------- */
@media (max-width: 390px) {
  .container {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  .section-title {
    font-size: 1.5rem !important;
  }

  .hero-title {
    font-size: 1.85rem !important;
  }

  .hero-candidate-photo {
    height: 310px !important;
  }

  .stat-box {
    padding: 0.55rem 0.45rem !important;
    gap: 0.45rem !important;
  }

  .stat-icon {
    width: 34px !important;
    height: 34px !important;
    font-size: 1rem !important;
  }

  .stat-value {
    font-size: 1.3rem !important;
  }

  .stat-label {
    font-size: 0.68rem !important;
  }

  .btn {
    font-size: 0.85rem !important;
    padding: 0.7rem 0.9rem !important;
  }

  .modal-content-card {
    padding: 1.2rem 0.85rem !important;
    width: 95% !important;
  }

  .videos-grid {
    grid-template-columns: 1fr !important;
    gap: 1.2rem !important;
  }
}
