/* ==========================================================================
   RESPONSIVE MEDIA QUERIES - LC PHARMA
   ========================================================================== */

/* 1. NOTEBOOKS E TELAS GRANDES (máx: 1200px) */
@media (max-width: 1200px) {
  :root {
    --max-width: 960px;
  }
  
  .hero-title {
    font-size: 3rem;
  }
  
  .differentials-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  
  /* Se houver 5 cards, podemos centralizar os últimos dois em telas médias */
  .differentials-grid > *:nth-child(4),
  .differentials-grid > *:nth-child(5) {
    grid-column: span 1;
  }

  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

/* 2. TABLETS E NETBOOKS (máx: 991px) */
@media (max-width: 991px) {
  :root {
    --max-width: 720px;
    --header-height: 70px;
  }

  section {
    padding-top: 70px;
    padding-bottom: 70px;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--header-height) + 60px);
    padding-bottom: 60px;
  }

  .hero .container {
    grid-template-columns: 1fr;
    gap: 50px;
    text-align: center;
  }

  .hero-content {
    align-items: center;
  }

  .hero-title {
    font-size: 2.75rem;
  }

  .hero-desc {
    margin-right: auto;
    margin-left: auto;
  }

  .hero-visual {
    order: -1; /* Imagem vai para o topo no tablet/mobile */
  }

  .hero-composition {
    max-width: 380px;
  }

  /* Menu Mobile */
  .mobile-menu-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background-color: var(--white);
    flex-direction: column;
    gap: 24px;
    padding: 40px 24px;
    box-shadow: 0 10px 30px rgba(12, 44, 92, 0.05);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    border-top: 1px solid var(--border-color);
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    font-size: 1.15rem;
    width: 100%;
    text-align: center;
    padding: 10px 0;
  }

  .header-actions {
    display: none; /* Esconde CTA do header no menu flutuante em telas médias */
  }
  
  /* Exibe botão WhatsApp dentro do nav mobile quando menu estiver aberto */
  .nav-menu.active .header-actions-mobile {
    display: block !important;
    width: 100%;
    margin-top: 20px;
    text-align: center;
  }

  /* Animação hambúrguer → X */
  .mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  .mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Diferenciais */
  .differentials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .differentials-grid > *:nth-child(5) {
    grid-column: span 2; /* Último card ocupa a largura toda no tablet */
  }

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

  /* Modal */
  .modal-content {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 30px;
  }

  .modal-gallery {
    position: static;
    max-width: 480px;
    margin: 0 auto;
  }
  
  .modal-close-btn {
    top: 15px;
    right: 15px;
  }

  /* Footer */
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
  
  .footer-brand {
    grid-column: span 2;
    align-items: center;
    text-align: center;
  }
  
  .footer-desc {
    max-width: 100%;
  }
}

/* 3. CELULARES E TELAS PEQUENAS (máx: 767px) */
@media (max-width: 767px) {
  :root {
    --max-width: 100%;
  }

  section {
    padding-top: 60px;
    padding-bottom: 60px;
  }

  .section-title {
    font-size: 1.85rem;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-desc {
    font-size: 1rem;
  }

  /* Grid de Diferenciais */
  .differentials-grid {
    grid-template-columns: 1fr;
  }
  
  .differentials-grid > *:nth-child(5) {
    grid-column: span 1;
  }

  /* Grid de Produtos */
  .products-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .catalog-controls {
    gap: 16px;
  }

  .filter-btn {
    padding: 8px 18px;
    font-size: 0.875rem;
  }

  /* Modal */
  .modal-container {
    max-height: 95vh;
  }
  
  .modal-content {
    padding: 24px;
  }

  .modal-title-text {
    font-size: 1.45rem;
  }

  .modal-specs-table th {
    width: 45%;
  }

  .modal-actions {
    flex-direction: column;
    gap: 10px;
  }

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

  .footer-brand {
    grid-column: span 1;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .footer-legal {
    justify-content: center;
  }
}
