/* ============================================================
   OT SECURITY — DISEÑO RESPONSIVO UNIFICADO
   ============================================================ */

/* Solución Global para desbordamiento (Overflow Horizontal) */
html,
body {
  overflow-x: hidden !important;
  max-width: 100vw;
}

/* — Laptops y Desktops pequeños (max-width: 1024px) — */
@media (max-width: 1024px) {
  .hero {
    padding: 100px 5% 50px;
  }

  .hero h1 {
    font-size: clamp(3rem, 5vw, 4rem);
  }

  .section-title {
    font-size: clamp(2.8rem, 4vw, 3.5rem);
  }

  .hero-stats {
    gap: 1rem;
  }

  .stat-card {
    padding: 1.5rem;
  }

  .services-grid {
    gap: 1.5rem;
  }

  .why-grid,
  .contact-grid {
    gap: 3rem;
  }
}

/* — Tablets (max-width: 768px) — */
@media (max-width: 768px) {
  /* Solución al Bug de Safari/iOS con fondos 'fixed' */
  .contact-hero,
  .about-hero,
  .projects-hero,
  .services-hero {
    background-attachment: scroll !important;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(10, 25, 49, 0.98);
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    z-index: 999;
  }

  .nav-links.open {
    display: flex;
  }

  .hamburger {
    display: flex;
  }

  .hero-family {
    display: block;
    opacity: 0.15;
  }

  .hero-family img {
    content: url("../assets/images/inicio-movil.webp"); /* Reemplaza la imagen por la versión móvil */
    object-position: center; /* Centramos el enfoque ya que esta imagen está optimizada */
  }

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

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

  .why-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
  }

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

  .process-steps::before {
    display: none;
  }

  .step {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
    padding: 1.5rem;
    margin-left: 0 !important;
  }

  .step-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .ticker-label {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    white-space: normal;
    /* Permite que el texto se divida si es muy largo */
    text-align: center;
  }
}

/* — Teléfonos móviles (max-width: 480px) — */
@media (max-width: 480px) {

  /* Ajuste de títulos para evitar cortes horizontales */
  .section-title {
    font-size: clamp(2rem, 8vw, 2.5rem);
    word-break: break-word;
    /* Forza la ruptura si la palabra excede el ancho (ej. SERVICIOS) */
  }

  .hero h1 {
    font-size: clamp(2.2rem, 8vw, 3rem);
    line-height: 1.1;
    word-break: break-word;
  }

  .ticker-label {
    white-space: normal;
    letter-spacing: 0.1em;
    line-height: 1.4;
  }

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

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

  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

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

  .services-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .why-badge-float {
    position: absolute;
    bottom: -15px;
    right: 5px;
    padding: 1rem 1.2rem;
    transform: scale(0.85);
    /* Lo reduce proporcionalmente para móvil */
    transform-origin: bottom right;
    margin: 0;
    width: auto;
  }

  .contact-form {
    padding: 1.5rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand,
  .footer-col ul {
    align-items: center;
  }

  .footer-logo-wrap {
    justify-content: center;
  }

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

  .whatsapp-float {
    width: 50px;
    height: 50px;
    font-size: 1.8rem;
    bottom: 1.5rem;
    right: 1.5rem;
  }
}