/* ==========================================================================
   PIN FIBER - RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS
   Adaptación completa para Celulares, Tablets y Pantallas Grandes
   ========================================================================== */

/* --- Tablets y Portátiles Pequeños (<= 1024px) --- */
@media (max-width: 1024px) {
  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .plans-wrapper {
    grid-template-columns: 1fr;
    max-width: 550px;
    margin: 0 auto;
    gap: 2.5rem;
  }

  .promo-tigo-grid {
    grid-template-columns: 1fr;
    max-width: 550px;
    margin: 0 auto;
    gap: 2rem;
  }

  .footer-top,
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }

  .about-preview-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .sectors-modern-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Tablets y Móviles Grandes (<= 768px) --- */
@media (max-width: 768px) {
  .topbar {
    display: none; /* Ocultar topbar en móvil para ahorrar espacio vertical */
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 82%;
    max-width: 340px;
    height: 100vh;
    background: var(--pinfiber-night);
    flex-direction: column;
    align-items: flex-start;
    padding: 5.5rem 2rem 2rem;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.4);
    transition: right var(--trans-normal);
    z-index: 999;
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-menu .nav-link {
    color: var(--color-white);
    font-size: 1.15rem;
    width: 100%;
    padding: 0.85rem 1rem;
  }

  .nav-menu .nav-link:hover,
  .nav-menu .nav-link.active {
    background: rgba(0, 163, 255, 0.2);
    color: var(--pinfiber-cyan);
  }

  .nav-toggle {
    display: block;
  }

  .nav-actions .btn {
    display: none; /* Se reubica dentro del menú móvil */
  }

  .nav-menu .mobile-cta-wrap {
    margin-top: 1.5rem;
    width: 100%;
  }

  .nav-menu .mobile-cta-wrap .btn {
    display: flex;
    width: 100%;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-visual-col {
    order: -1; /* Tacómetro primero en móviles si se desea o centrado */
  }

  .hero-speed-meter-card {
    max-width: 360px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
  }

  .benefits-grid {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .cta-banner {
    padding: 2rem 1.5rem;
    text-align: center;
  }

  .cta-buttons {
    justify-content: center;
  }

  .footer-top,
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .footer-legal-links {
    justify-content: center;
  }

  .certificate-features-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .sectors-modern-grid {
    grid-template-columns: 1fr;
  }

  .unlisted-sector-banner {
    flex-direction: column;
    text-align: center;
  }

  .whatsapp-floating {
    bottom: 1.25rem;
    right: 1.25rem;
  }

  .whatsapp-popover {
    width: calc(100vw - 2.5rem);
    right: -0.5rem;
  }

  .cookies-banner {
    left: 1rem;
    right: 1rem;
    max-width: none;
    bottom: 1rem;
  }
}

/* --- Teléfonos Pequeños (<= 480px) --- */
@media (max-width: 480px) {
  .btn {
    width: 100%;
    padding: 0.75rem 1.25rem;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .cta-buttons {
    flex-direction: column;
    width: 100%;
  }

  .sector-pill {
    width: 100%;
    justify-content: center;
  }
}

/* --- Reglas Responsivas para Normativas, Speed Test y Pre-Footer CTA --- */
@media (max-width: 900px) {
  .normativas-layout {
    grid-template-columns: 1fr;
  }

  .normativas-sidebar {
    position: static;
  }

  .normativas-nav-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  .normativas-nav-link {
    white-space: nowrap;
  }

  .speedtest-metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .speedtest-tips-grid {
    grid-template-columns: 1fr;
  }

  .prefooter-cta-banner {
    flex-direction: column;
    text-align: center;
  }

  .prefooter-cta-content {
    padding: 1.5rem 1.25rem 1rem;
    max-width: 100%;
  }

  .prefooter-cta-subtitle {
    justify-content: center;
  }

  .prefooter-cta-actions {
    justify-content: center;
  }

  .prefooter-cta-visual {
    position: relative;
    width: 100%;
    height: 180px;
    min-height: 180px;
    top: auto;
    bottom: auto;
    right: auto;
  }

  .prefooter-devices-img {
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.4) 25%, black 60%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.4) 25%, black 60%);
    object-position: center bottom;
  }
}

