/* ============================================================
   AO Landing Page — Optimizacion Movil / Responsive
   Cargado DESPUES del CSS principal para poder sobreescribir.
   Breakpoints:
     <=1024px  -> menu hamburguesa + header compacto
     <=900px   -> categorias apiladas, tipografia intermedia
     <=600px   -> tipografia fina para telefonos
     (hover:none) -> ajustes para pantallas tactiles
   ============================================================ */

/* ---------- TACTIL: sin cursor custom, sin efectos hover raros ---------- */
@media (hover: none), (pointer: coarse) {
  .cursor-dot,
  .cursor-outline {
    display: none !important;
  }

  * {
    cursor: auto !important;
  }

  /* El header no debe expandirse al "hover" (tap fantasma en tactil) */
  #main-header:hover {
    background-color: transparent !important;
    height: auto !important;
  }

  #main-header:hover .header-hero {
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* Las categorias no deben "crecer" con hover en tactil */
  .category-card:hover {
    flex: 1 !important;
  }
}

/* ---------- BOTON HAMBURGUESA + OVERLAY (ocultos en desktop) ---------- */
#mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 3001;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0;
}

#mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  margin: 4px auto;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#mobile-menu-toggle.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

#mobile-menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

#mobile-menu-toggle.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

#mobile-nav-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.15rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overflow-y: auto;
  padding: 4.5rem 1.5rem 2.5rem;
}

#mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

#mobile-nav-overlay a {
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.2rem 0.5rem;
}

#mobile-nav-overlay a.mobile-nav-sub {
  font-size: 1rem;
  opacity: 0.75;
  letter-spacing: 1.5px;
}

#mobile-nav-overlay a.mobile-nav-cta {
  border: 1px solid var(--color-terracotta, #E89A7B);
  color: var(--color-terracotta, #E89A7B);
  border-radius: 10px;
  padding: 0.6rem 2rem;
  margin-top: 0.4rem;
}

.mobile-nav-divider {
  width: 42px;
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
  margin: 0.5rem 0;
}

/* Evitar scroll del fondo con el menu abierto */
body.mobile-nav-open {
  overflow: hidden;
}

/* ============================================================
   <=1024px — HEADER COMPACTO CON HAMBURGUESA
   ============================================================ */
@media screen and (max-width: 1024px) {

  /* Ocultar navegacion de escritorio */
  .center-nav,
  .right-nav,
  .hero-bottom-bar,
  .header-hero {
    display: none !important;
  }

  #mobile-menu-toggle {
    display: block;
  }

  /* Barra compacta translucida para que el logo siempre se lea */
  #main-header {
    height: 72px !important;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0)) !important;
  }

  .static-logo-container {
    top: 16px !important;
    left: 1.25rem !important;
  }

  .hero-logo {
    width: 84px !important;
  }

  .header-top {
    padding: 1rem 1.25rem;
  }
}

/* ============================================================
   <=900px — SECCIONES PRINCIPALES
   ============================================================ */
@media screen and (max-width: 900px) {

  /* ---------- HERO ---------- */
  .main-title {
    font-size: 3rem;
    padding: 0 1rem;
    letter-spacing: 0.08em;
  }

  /* ---------- VISION (Innovamos... / SOMOS AO) ---------- */
  #vision-scroll-section {
    height: 180vh;
    /* Menos scroll "pegado" en movil */
  }

  .vision-content {
    padding: 1.5rem;
  }

  #reveal-text {
    font-size: 1.6rem;
    line-height: 1.35;
    gap: 0.28em;
  }

  #reveal-signature {
    font-size: 3.4rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 1rem;
    margin-top: 2rem;
    width: 100%;
  }

  .stat-item {
    width: auto;
    margin-bottom: 0;
  }

  .stat-number {
    font-size: 2rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .stat-separator {
    display: none;
  }

  /* ---------- CATEGORIAS DE PROYECTOS ---------- */
  #project-categories {
    height: auto !important;
  }

  .categories-container {
    flex-direction: column;
    height: auto !important;
  }

  .category-card {
    flex: none !important;
    width: 100%;
    min-height: 0 !important;
    height: 210px !important;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    align-items: center !important;
    padding-bottom: 0 !important;
  }

  /* Imagen de fondo mucho mas visible */
  .category-card .cat-bg {
    opacity: 0.65 !important;
    filter: grayscale(35%) !important;
  }

  /* Ligero oscurecido inferior para legibilidad del texto */
  .category-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.15) 60%, rgba(0, 0, 0, 0.35) 100%);
    z-index: 1;
    pointer-events: none;
  }

  /* Tarjeta de vidrio compacta */
  .category-card .cat-content {
    width: auto;
    max-width: 92%;
    padding: 0.9rem 1.5rem;
    gap: 0.45rem;
    border-radius: 16px;
    transform: none !important;
  }

  .category-card:hover .cat-content {
    transform: none !important;
  }

  .cat-content h3 {
    font-size: 1.15rem !important;
    margin-bottom: 0 !important;
    white-space: normal;
    text-align: center;
  }

  /* Stats en fila horizontal compacta */
  .cat-stats {
    flex-direction: row !important;
    justify-content: center;
    gap: 1.6rem !important;
  }

  .cat-stat-sqm {
    font-size: 1.35rem;
  }

  .cat-stat-count {
    font-size: 1.15rem;
  }

  .cat-stats div {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
  }

  .view-link {
    display: none;
  }

  /* ---------- CAREERS ---------- */
  #careers-section {
    padding: 4rem 1.5rem 5rem;
  }

  .careers-layout {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }

  .careers-text {
    padding-left: 0;
  }

  .careers-text h2 {
    font-size: 2.2rem;
  }

  .say-hello-btn {
    font-size: 1.6rem;
  }

  .careers-visual {
    height: auto;
    max-height: 300px;
    overflow: hidden;
  }

  .social-links-display {
    position: static;
    justify-content: center;
    margin-top: 2.5rem;
  }

  /* ---------- SERVICIOS ---------- */
  #services {
    padding: 3.5rem 1.25rem;
  }

  #services .services-container-wide {
    padding: 0 0.5rem;
  }

  .services-header {
    margin-bottom: 2.5rem;
    gap: 1rem;
  }

  .services-title {
    font-size: 2.4rem;
  }

  .services-subtitle {
    font-size: 1rem;
    padding: 0 0.5rem;
  }
}

/* ============================================================
   <=600px — TELEFONOS (ajuste fino)
   ============================================================ */
@media screen and (max-width: 600px) {

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

  #reveal-text {
    font-size: 1.3rem;
  }

  #reveal-signature {
    font-size: 2.7rem;
  }

  .stat-number {
    font-size: 1.7rem;
  }

  .category-card {
    height: 190px !important;
  }

  .services-title {
    font-size: 2rem;
  }

  .careers-text h2 {
    font-size: 1.8rem;
  }

  /* Colage de personas: limitar altura en telefonos */
  .careers-visual {
    max-height: 220px;
  }

  footer {
    padding: 1.5rem;
    font-size: 0.8rem;
  }
}

/* ============================================================
   TELEFONOS EN HORIZONTAL (altura reducida)
   ============================================================ */
@media screen and (max-height: 500px) and (orientation: landscape) {

  .main-title {
    font-size: 2rem;
  }

  #reveal-signature {
    font-size: 2.5rem;
  }

  #reveal-text {
    font-size: 1.2rem;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  #mobile-nav-overlay {
    gap: 0.55rem;
    justify-content: flex-start;
  }

  #mobile-nav-overlay a {
    font-size: 1rem;
  }

  #mobile-nav-overlay a.mobile-nav-sub {
    font-size: 0.85rem;
  }
}
