/* ==========================================================================
   HOJA DE ESTILOS RESPONSIVA UNIFICADA (CUMPY)
   Páginas: index.html | aliados.html | fundadores.html
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. RESET DE SEGURIDAD PARA MÓVILES
   -------------------------------------------------------------------------- */
body {
  overflow-x: hidden; /* Evita el scroll horizontal por animaciones u ondas */
}

/* Accesibilidad: Desactivar animaciones pesadas si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
  .topband .ondas,
  .hero .ondas,
  #wa {
    animation: none !important;
  }
}

/* --------------------------------------------------------------------------
   0.1. MONITORES GRANDES (Mín. 1440px)
   -------------------------------------------------------------------------- */
@media (min-width: 1440px) {
  .hero-visual {
    width: calc(100% + 260px);
    margin-left: -100px;
    clip-path: inset(0 120px 0 0);
  }

  .hero-video-frame {
    width: calc(100% + 60px);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .38) 4%, #000 15%);
    mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .38) 4%, #000 15%);
  }

  .hero-video-frame::before {
    background:
      linear-gradient(90deg, rgba(255, 255, 255, .9) 0%, rgba(255, 255, 255, .45) 4%, transparent 14%),
      linear-gradient(0deg, rgba(255, 255, 255, .82) 0%, rgba(255, 255, 255, .3) 10%, transparent 24%);
  }

}

/* --------------------------------------------------------------------------
   1. LAPTOPS Y MONITOR MEDIANO (Máx. 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  section {
    padding: 60px 20px;
  }
  .step-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .step-reveal-icon {
    top: auto;
    right: 0;
    bottom: -54px;
    width: 190px;
    height: 190px;
    transform: none;
    opacity: .3;
  }

  .foot-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 24px;
  }
}

@media (max-width: 970px) {
  .nav-links .btn,
  .nav-links a:not(.btn) {
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   2. TABLETS EN ORIENTACIÓN VERTICAL (Máx. 900px)
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  /* Heroes */
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-content {
    order: 1;
    align-items: center;
    text-align: center;
  }
  .hero-content > * { text-align: center; }
  .hero-content .hero-ctas,
  .hero-content .hero-trust {
    width: 100%;
    justify-content: center;
  }
  .index-page .topband > .ondas-b { display: none; }
  .hero-visual {
    order: 2;
    margin-top: 32px;
    width: 100%;
    margin-left: 0;
    clip-path: none;
  }
  .hero-video-frame::before { display: none; }
  .mockup-container {
    height: auto;
    min-height: 0;
  }
  .hero-video-frame { width: 100%; }
  .hero-ctas, .hero-trust {
    justify-content: center;
  }
  .hero p.sub {
    margin-left: auto;
    margin-right: auto;
  }

  /* Métricas y Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-featured {
    grid-column: span 2;
    flex-direction: column;
    text-align: center;
    gap: 24px;
    padding: 30px 20px;
  }
  .stat-featured .left {
    flex-direction: column;
    gap: 12px;
  }
  .stat-featured .right {
    text-align: center;
  }

  /* Grillas de 3 a 2 columnas */
  .caps-grid,
  .price-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cap-detail-wrapper {
    grid-template-rows: 1fr; /* Muestra el detalle desplegado en pantallas táctiles */
  }

  /* Producto y Capas */
  .prod-intro-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .prod-intro-grid .sec-title {
    justify-content: center;
  }
  .chain-flow {
    justify-content: center;
  }
  .layer-2col {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .macro-card {
    padding: 32px 24px;
  }
  .layer-head .lead {
    margin-left: 0;
    margin-top: 8px;
  }

  /* Evidencia */
  .evi-tranquility-icon {
    display: none;
  }
  .evi-card {
    grid-template-columns: 1fr;
    padding: 36px 24px;
    text-align: center;
  }
  .evi-honest {
    border-left: none;
    border-top: 3px solid var(--violet);
    padding-left: 0;
    padding-top: 12px;
  }

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

  .pt-grid {
    gap: 32px;
  }

  .pq-grid { gap: 20px; }
  .pq-card { padding: 32px 24px; }
}

/* --------------------------------------------------------------------------
   3. TABLETS PEQUEÑAS / PHABLETS (Máx. 860px - 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  /* Carrusel ROI */
  .c-slide {
    grid-template-columns: 1fr;
  }
  .c-slide-main {
    padding: 40px 24px;
  }
  .c-slide-side {
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 32px 24px;
  }
  .c-metric {
    font-size: 3rem;
  }
  .c-confirmation-icon {
    right: 12px;
    bottom: 12px;
    width: 60px;
    height: 60px;
  }
  .c-visual-bg {
    width: 120px;
    height: 120px;
  }

  /* Secciones de Aliados */
  .partner-grid,
  .feat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: min(340px, calc(100vw - 32px));
    position: absolute;
    top: calc(100% + 8px);
    left: auto;
    right: 0;
    background-color: #fff;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(4, 21, 51, .12);
    z-index: 1000;
  }

  .nav-links a:not(.btn),
  .nav-links .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    text-align: center;
  }
  .nav-links a:not(.btn) {
    padding: 10px 12px;
    border-radius: 10px;
  }
  .nav-links .btn {
    white-space: normal;
    line-height: 1.2;
  }

  .nav-links.menu-abierto {
    display: flex;
  }

  .index-page .stickytop {
    z-index: 1000;
  }
  .stickytop.menu-open > .promo-bar {
    display: none;
  }

  #wa {
    bottom: 80px; /* Eleva el botón de WhatsApp para no tapar elementos inferiores */
  }

  .seg-banner {
    flex-direction: column;
    text-align: center;
    padding: 32px 24px;
  }
  .highlight-block {
    padding: 36px 20px;
    margin: 40px auto;
  }
  .scarcity-watermark {
    right: -68px;
    width: 230px;
    height: 230px;
    opacity: .16;
  }
  .cta-watermark {
    width: 230px;
    height: 230px;
    opacity: .08;
  }
  .highlight-confirmation-icon {
    left: 12px;
    bottom: 58px;
    width: 104px;
    height: 104px;
    opacity: .25;
  }

  .layer-tabs {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .layer-tab {
    padding: 12px 10px;
    font-size: 0.88rem;
    justify-content: center;
    width: 100%;
  }

  .layer-tab .tab-text {
    white-space: nowrap;
  }

  .legal-card {
    padding: 24px 18px;
    }
  .legal-page .legal-header {
    padding-bottom: 32px;
  }
  .legal-page .legal-title {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }
  .legal-page .legal-sub {
    font-size: 1rem;
  }
  .legal-block h3 {
    font-size: 1.1rem;
    }

  .price-grid-fundadores {
    grid-template-columns: 1fr; /* 1 Sola columna */
  }

  .legal-card { padding: 24px 18px; }
  .legal-block h3 { font-size: 1.1rem; }

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

  .pt-grid { grid-template-columns: 1fr; } /* 1 sola columna en móviles */

  .pt-body { padding: 0 24px 32px; }

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

/* --------------------------------------------------------------------------
   4. MÓVILES ESTÁNDAR (Máx. 600px - 500px)
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .hero-inner { row-gap: 12px; }
  .hero-visual { margin-top: 0; }
  .mockup-container {
    height: auto;
    min-height: 0;
  }

  section {
    padding: 48px 16px;
  }

  .step-reveal-icon {
    right: 0;
    bottom: -48px;
    width: 160px;
    height: 160px;
    opacity: .28;
  }

  .video-lightbox {
    padding: 12px;
  }

  .video-lightbox-dialog {
    padding: 42px 12px 12px;
    border-radius: 14px;
  }

  .video-lightbox-player {
    max-height: 70vh;
  }

  /* Pasamos todas las grillas a 1 columna pura */
  .caps-grid,
  .bgrid,
  .price-grid,
  .foot-grid {
    grid-template-columns: 1fr;
  }

  /* Ajustes en Nav y Header */
  .spots-mini {
    display: none;
  }
  .logo-full {
    height: 38px;
  }

  .trust-badge-hero {
    border-radius: 16px;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    align-items: flex-start;
    padding: 16px 20px;
  }

  /* Ajustes en Formularios y Tarjetas */
  .form-card,
  .modal-content {
    padding: 28px 18px;
  }

  .modal-content {
    max-height: 90vh;
    overflow-y: auto; /* Permite scroll dentro del modal si el teléfono es muy corto */
  }

  .tower-wrapper {
    padding: 24px 16px;
  }

  .t-layer {
    padding: 12px 14px;
  }

}

@media (max-width: 500px) {
  /* Métricas */
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .stat-featured {
    grid-column: span 1;
  }
  .stat-featured .num {
    font-size: 3.2rem;
  }

  .promo-bar {
    padding: 6px 12px;
  }
  .promo-bar p {
    font-size: .82rem;
  }
  .b-card {
    flex-direction: column; gap: 16px; padding: 24px;
  }
}

/* --------------------------------------------------------------------------
   5. MÓVILES MUY PEQUEÑOS (Máx. 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  /* Botones principales ocupan todo el ancho para facilitar el clic */
  .hero-ctas .btn,
  .hero-section .hero-ctas .btn {
    width: 100%;
  }

  .sec-title {
    font-size: 1.6rem;
  }

  .macro-item {
    flex-direction: column;
    gap: 12px;
  }

  .macro-icon {
    width: 40px;
    height: 40px;
  }

  .foot-legal {
    flex-direction: column;
    text-align: center;
  }

  .layer-tabs {
    grid-template-columns: repeat(2, 1fr); /* Mantiene 2x2 en pantallas ultra pequeñas */
    gap: 6px;
    padding: 6px;
  }

  .layer-tab {
    padding: 10px 6px;
    font-size: 0.80rem;
    gap: 6px;
  }

  .layer-tab .tab-num {
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    flex-shrink: 0;
  }

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

@media (max-width: 468px) {
  .step-reveal-icon {
    display: none;
  }
}

 @media (hover: none) {
    .h-reveal-wrapper { grid-template-rows: 1fr; opacity: 1; }
    .h-reveal-inner { padding-top: 20px; }
    .h-indicator { display: none; }
  }
