/* ============================================================
   NUEVOS HORIZONTES — Responsive Overrides
   ============================================================ */

/* ============================================================
   TABLET — 1024px
   ============================================================ */
@media (max-width: 1024px) {
  /* Navbar: reduce logo size */
  .navbar__logo-main { font-size: 1rem; }

  /* Hero: reduce min-height */
  .hero { min-height: 85vh; }
  .hero__content { padding: var(--space-16) 0; }
  .hero__title { font-size: clamp(2rem, 5vw, 2.8rem); }

  /* Section spacing */
  .section { padding-top: var(--space-20); padding-bottom: var(--space-20); }
  .section-header { margin-bottom: var(--space-8); }
}

/* ============================================================
   MOBILE LANDSCAPE / SMALL TABLET — 768px
   ============================================================ */
@media (max-width: 768px) {
  /* Base typography adjustments */
  h1 { font-size: clamp(1.7rem, 6vw, 2.2rem); }
  h2 { font-size: clamp(1.4rem, 5vw, 1.8rem); }
  h3 { font-size: clamp(1.1rem, 4vw, 1.35rem); }

  .lead { font-size: var(--text-base); line-height: var(--leading-normal); }

  /* Sections */
  .section { padding-top: var(--space-12); padding-bottom: var(--space-12); }
  .section--lg { padding-top: var(--space-16); padding-bottom: var(--space-16); }
  .section-header { margin-bottom: var(--space-6); }

  /* Hero — 100vh is too tall on mobile */
  .hero { min-height: auto; padding-bottom: var(--space-12); }
  .hero__content {
    padding: var(--space-12) 0 var(--space-8);
    max-width: 100% !important;
  }
  .hero__title {
    font-size: clamp(1.75rem, 7vw, 2.2rem) !important;
    max-width: 100%;
  }
  .hero__subtitle { font-size: var(--text-base) !important; margin-bottom: var(--space-6) !important; }
  .hero__stat-row { gap: var(--space-6); }

  /* Page hero */
  .page-hero {
    padding: calc(var(--nav-height) + var(--space-10)) 0 var(--space-10);
  }
  .page-hero h1,
  .page-hero__title {
    font-size: clamp(1.6rem, 6vw, 2rem) !important;
    max-width: 100%;
  }
  .page-hero::before {
    width: 200px;
    height: 200px;
    bottom: -30px;
    right: -40px;
  }

  /* CTA buttons — stack on mobile */
  .hero__ctas,
  .cta-section__buttons {
    flex-direction: column;
    align-items: stretch;
  }
  .hero__ctas .btn,
  .cta-section__buttons .btn { width: 100%; }

  /* Buttons — larger touch targets */
  .btn { padding: 0.95rem 1.5rem; font-size: var(--text-sm); }
  .btn--lg { padding: 1rem 1.75rem; font-size: var(--text-base); }
  .btn--sm { padding: 0.7rem 1.25rem; font-size: var(--text-xs); }

  /* Footer */
  .footer { padding: var(--space-10) 0 var(--space-6); }
  .footer__grid { gap: var(--space-6); margin-bottom: var(--space-8); }

  /* Accordion */
  .accordion-item__header { padding: var(--space-4) var(--space-5); }
  .accordion-item__title { font-size: var(--text-sm); }
  .accordion-item__content { padding: 0 var(--space-5) var(--space-4); font-size: var(--text-sm); }

  /* Tags/badges wrap better */
  .tags-cloud { gap: var(--space-2); }

  /* Nosotros inline styles */
  .vmv-grid { grid-template-columns: 1fr !important; }
  .team-grid { grid-template-columns: 1fr !important; }

  /* Two-column layouts that use inline grid — force single column */
  [style*="grid-template-columns: repeat(2"] {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   MOBILE — 600px
   ============================================================ */
@media (max-width: 600px) {
  /* Container padding */
  .container { padding-left: var(--space-4); padding-right: var(--space-4); }

  /* Typography micro adjustments */
  h1 { font-size: clamp(1.5rem, 7vw, 1.9rem); }
  h2 { font-size: clamp(1.3rem, 6vw, 1.6rem); }

  /* Section spacing */
  .section { padding-top: var(--space-10); padding-bottom: var(--space-10); }

  /* Hero */
  .hero__content { padding: var(--space-8) 0 var(--space-6); }

  /* Page hero */
  .page-hero {
    padding: calc(var(--nav-height) + var(--space-8)) 0 var(--space-8);
  }

  /* Navbar inner padding */
  .navbar__inner { padding: 0 var(--space-4); }

  /* Mobile menu improvements */
  .navbar__mobile { padding: var(--space-6) var(--space-4); }
  .mobile-nav__link { font-size: var(--text-lg); padding: var(--space-3) 0; }

  /* Cards inline styling — reduce padding */
  [style*="padding: var(--space-10)"],
  [style*="padding:var(--space-10)"] {
    padding: var(--space-6) !important;
  }

  /* Contacto grid override */
  .contact-grid { grid-template-columns: 1fr !important; }

  /* Inline flex CTA rows — stack */
  [style*="display:flex"][style*="gap:var(--space-4)"][style*="justify-content:center"] {
    flex-direction: column;
    align-items: stretch;
  }

  /* Stats and numeric cards */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }

  /* Ensure all inline grid-3 go to 1 col */
  .grid-3 { grid-template-columns: 1fr !important; }

  /* WhatsApp float */
  .whatsapp-float {
    bottom: var(--space-4);
    right: var(--space-4);
  }

  /* Footer */
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: var(--space-3); }
}

/* ============================================================
   SMALL MOBILE — 400px
   ============================================================ */
@media (max-width: 400px) {
  .container { padding-left: var(--space-3); padding-right: var(--space-3); }

  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.05rem; }

  .section { padding-top: var(--space-8); padding-bottom: var(--space-8); }

  .hero__content { padding: var(--space-6) 0; }

  .btn { padding: 0.85rem 1.25rem; }
  .btn--lg { padding: 0.95rem 1.5rem; }

  .navbar__inner { padding: 0 var(--space-3); }
  .navbar__logo-main { font-size: 0.9rem; }
  .navbar__logo-sub { font-size: 0.5rem; }

  .mobile-nav__link { font-size: var(--text-base); }

  /* Accordion thinner */
  .accordion-item__header { padding: var(--space-3) var(--space-4); }
  .accordion-item__content { padding: 0 var(--space-4) var(--space-3); }
}

/* ============================================================
   TOUCH DEVICE IMPROVEMENTS
   ============================================================ */
@media (hover: none) {
  /* Remove hover transforms on touch — they feel sticky */
  .card:hover,
  .pilar-card:hover,
  .servicio-card:hover,
  .team-card:hover,
  .industria-badge:hover,
  .contact-option:hover,
  .vmv-card:hover {
    transform: none;
    box-shadow: inherit;
  }

  /* But keep :active feedback */
  .btn:active { transform: scale(0.97); }
}

/* ============================================================
   SAFE AREA (notch devices)
   ============================================================ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .footer__bottom {
    padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  }
  .whatsapp-float {
    bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  }
  .navbar__mobile {
    padding-bottom: calc(var(--space-8) + env(safe-area-inset-bottom));
  }
}

/* ============================================================
   LANDSCAPE PHONE
   ============================================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: auto; padding-bottom: var(--space-8); }
  .hero__content { padding: var(--space-8) 0; }
  .page-hero { padding: calc(var(--nav-height) + var(--space-6)) 0 var(--space-6); }
}

/* ============================================================
   PREFERS REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .reveal.visible { transition: none; }
  .btn { transition: none; }
  .card, .pilar-card, .servicio-card, .team-card { transition: none; }
  .accordion-item__body { transition: none; }
  .accordion-item__icon { transition: none; }
  .navbar__mobile { transition: none; }
  .whatsapp-float { transition: none; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .navbar, .whatsapp-float, .sticky-cta { display: none !important; }
  .hero { min-height: auto; }
  .section { padding: 1rem 0; }
  .reveal { opacity: 1; transform: none; }
  body { color: #000; background: #fff; }
}
