/**
 * H Dias Extintores & LA Projetos - Responsive
 * Arquivo separado para media queries e responsividade
 */

/* ===============================================
   RESPONSIVIDADE GERAL
   =============================================== */

/* Desktop Large (1024px+) */
@media (max-width: 1024px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
  }
  
  .hero-title {
    font-size: 3rem;
  }
}

/* Tablet (900px) */
@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  
  .timeline {
    flex-direction: column;
    align-items: center;
  }
  
  .timeline-item {
    min-width: 100%;
    max-width: none;
  }
  
  /* Split section responsivo */
  .history-expertise {
    flex-direction: column;
  }
  
  .half {
    flex: 1 1 100%;
    min-height: 400px;
    background-attachment: scroll; /* Melhor performance em mobile */
    padding: 0;
  }
  
  .company-title {
    font-size: 1.5rem;
  }
  
  /* Counters responsivo */
  .counters {
    align-items: stretch; /* Stretch items on tablet */
  }
  
  .counter-card {
    flex: 1 1 calc(50% - 6px);
    min-width: 140px;
    max-width: none;
  }
  
  .counter-card.highlight {
    flex: 1 1 100%;
    margin: 0 0 12px 0;
    max-width: none;
  }
}

/* Acessibilidade - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .fade-in, .slide-left, .slide-right, .scale-in, .fade-up, 
  .rotate-in, .bounce-in, .blur-in, .section-reveal {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
    animation: none !important;
  }
  
  .floating-bg {
    animation: none !important;
  }
  
  .typing-effect {
    animation: none !important;
    border-right: none !important;
  }
  
  .scroll-progress {
    display: none !important;
  }
}

/* Tablet/Mobile Principal (768px) */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--spacing-md);
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  
  /* Header Mobile */
  .nav-left,
  .nav-right {
    display: none;
  }
  
  .hamburger {
    display: flex;
    order: 2;
  }
  
  .logo {
    flex: 0 0 auto;
    order: 1;
    padding: var(--spacing-xs);
  }
  
  .logo-image {
    height: 40px;
    transition: all var(--transition);
  }
  
  .logo:hover .logo-image {
    transform: scale(1.05);
  }
  
  .nav-layout {
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: var(--spacing-md);
  }
  
  .nav-main .container {
    padding: 0 var(--spacing-lg);
  }
  
  .logo-text {
    font-size: 1rem;
  }
  
  /* Hero Mobile */
  .hero {
    min-height: 90vh;
    padding: var(--spacing-md) 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .hero-inner {
    grid-template-columns: 1fr;
    padding-top: 80px;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
    gap: var(--spacing-md);
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
  }
  
  .hero-title {
    font-size: 2.5rem;
    line-height: 1.15;
    margin-bottom: var(--spacing-lg);
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: var(--spacing-xl);
    padding: 0 var(--spacing-sm);
  }
  
  .trust-bar {
    display: none; /* Escondido no mobile */
  }
  
  .btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
  }
  
  /* Centralizar botões em geral no mobile */
  .section .btn,
  .card .btn,
  .timeline-item .btn {
    margin: 0 auto;
    display: block;
    text-align: center;
  }
  
  .section {
    padding: var(--spacing-xl) 0;
  }
  
  /* Melhor espaçamento do texto hero no mobile */
  .hero-text {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  
  .counters {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }
  
  /* Floating elements menor em mobile */
  .floating-bg.circle {
    width: 60px;
    height: 60px;
  }
  
  .floating-bg.square {
    width: 50px;
    height: 50px;
  }
  
  /* Logos dos órgãos responsivo */
  .cert-logos {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
    gap: var(--spacing-lg) !important;
  }
  
  .cert-item img {
    width: 60px !important;
    height: 60px !important;
    margin-bottom: var(--spacing-sm) !important;
  }
  
  .cert-item {
    padding: var(--spacing-md);
  }
  
  .cert-info strong {
    font-size: 0.9rem;
  }
  
  .cert-info span {
    font-size: 0.8rem !important;
  }
  
  /* Testimonials mobile */
  .testimonial-slide {
    padding: var(--spacing-lg);
  }
  
  .testimonial-photo img {
    width: 70px;
    height: 70px;
  }
  
  .testimonial-content {
    font-size: 1rem;
  }
  
  .testimonial-content::before,
  .testimonial-content::after {
    font-size: 2.5rem;
  }
  
  .testimonial-content::before {
    left: -15px;
  }
  
  .testimonial-content::after {
    right: -15px;
  }
  
  .slider-controls {
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
  }
  
  .slider-btn {
    width: 100%;
    max-width: 200px;
  }

  /* Services timeline mobile */
  .services-header {
    margin-bottom: var(--spacing-2xl);
  }
  
  .timeline-wrapper {
    padding-left: 40px;
    max-width: none;
  }
  
  .vertical-line {
    left: 20px;
  }
  
  .timeline-item.left,
  .timeline-item.right {
    padding-left: 60px;
    padding-right: 0;
    justify-content: flex-start;
  }
  
  .timeline-dot {
    left: 20px;
  }
  
  .timeline-card {
    max-width: none;
    padding: 24px;
  }
}

/* Mobile Pequeno (480px) */
@media (max-width: 480px) {
  .container {
    padding: 0 var(--spacing-sm);
  }
  
  .hero {
    min-height: 85vh;
    padding: var(--spacing-sm) 0;
    background-attachment: scroll;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .hero-inner {
    padding-top: 60px;
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
    width: 100%;
    margin: 0 auto;
    text-align: center;
  }
  
  .hero-title {
    font-size: 1.8rem;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
  }
  
  .hero-subtitle {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: var(--spacing-lg);
    padding: 0;
  }
  
  /* Trust bar já escondida desde 768px */
  
  .hero-cta {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    width: 100%;
  }
  
  .btn {
    width: 100%;
    max-width: 280px;
    padding: var(--spacing-md) var(--spacing-lg);
  }
  
  .counters {
    grid-template-columns: 1fr;
  }
  
  .counter {
    font-size: 2.5rem;
  }
  
  /* Esconder floating elements em telas muito pequenas */
  .floating-bg {
    display: none;
  }
  
  /* Scroll progress mais fino em mobile */
  .scroll-progress {
    height: 2px;
  }
  
  /* Split section mobile pequeno */
  .half {
    min-height: 350px;
    padding: 0;
  }
  
  .half .info {
    padding: var(--spacing-sm);
  }
  
  /* Logos dos órgãos mobile pequeno */
  .cert-logos {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--spacing-md) !important;
  }
  
  .cert-item img {
    width: 50px !important;
    height: 50px !important;
  }
  
  .cert-item {
    padding: var(--spacing-sm);
  }
  
  /* Testimonials mobile pequeno */
  .testimonial-slide {
    padding: var(--spacing-md);
  }
  
  .testimonial-photo img {
    width: 60px;
    height: 60px;
    border-width: 2px;
  }
  
  .testimonial-content {
    font-size: 0.95rem;
    margin-bottom: var(--spacing-md);
  }
  
  .testimonial-content::before,
  .testimonial-content::after {
    font-size: 2rem;
  }
  
  .testimonial-content::before {
    top: -5px;
    left: -10px;
  }
  
  .testimonial-content::after {
    bottom: -20px;
    right: -10px;
  }
  
  .testimonial-author {
    font-size: 1rem;
  }
  
  .testimonial-position {
    font-size: 0.85rem;
  }

  /* Services timeline mobile pequeno */
  .services-header {
    margin-bottom: var(--spacing-2xl);
  }
  
  .timeline-wrapper {
    padding-left: 20px;
    max-width: none;
  }
  
  .vertical-line {
    left: 10px;
  }
  
  .timeline-item.left,
  .timeline-item.right {
    padding-left: 40px;
  }
  
  .timeline-dot {
    left: 10px;
    width: 24px;
    height: 24px;
  }
  
  .timeline-dot span {
    font-size: 0.65rem;
  }
  
  .timeline-card {
    padding: 20px;
  }
  
  .card-content h3 {
    font-size: 1.1rem;
  }
}

/* Super pequeno para reduzir animações automaticamente */
@media (max-width: 320px) {
  .hero-title {
    font-size: 1.5rem;
  }
  
  .hero-subtitle {
    font-size: 0.9rem;
  }
  
  .cert-item img {
    width: 40px !important;
    height: 40px !important;
  }
  
  .cert-info strong {
    font-size: 0.8rem;
  }
  
  .cert-info span {
    font-size: 0.7rem !important;
  }
}

/* Reduzir animações em dispositivos lentos */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}