/* =====================================================================
   RESPONSIVE CORE — PagoDirecto
   ---------------------------------------------------------------------
   Scope: TODO va dentro de `.rsp` (wrapper que solo tienen las páginas
   ya adaptadas). Las páginas sin adaptar conservan el lienzo 1440px
   escalado y NO se ven afectadas por este archivo.

   Breakpoints:
     - Tablet:  768px – 1199.98px
     - Móvil:   < 768px
   Desktop (≥1200px) queda 100% intacto.

   Principio: ADAPTAR, no redimensionar. Cada sección se re-maqueta en
   flujo normal (flex/grid) manteniendo colores, tipografías, imágenes
   y jerarquía del diseño original.
   ===================================================================== */

/* Ocultos por defecto en TODAS las resoluciones (solo existen en responsive) */
.menu-toggle,
.mobile-nav {
  display: none;
}

@media (max-width: 1199.98px) {

  /* ------------------------------------------------------------------
     1. RESET DEL LIENZO ESCALADO
     ------------------------------------------------------------------ */
  body:has(.rsp) {
    min-height: 0 !important;
    overflow-x: hidden;
  }

  .rsp .main-frame {
    transform: none;
    width: 100%;
    height: auto;
    min-height: 100vh;
    overflow: visible;
    overflow-x: clip;
  }

  .rsp img,
  .rsp picture,
  .rsp video,
  .rsp canvas {
    max-width: 100%;
  }

  /* ------------------------------------------------------------------
     2. HEADER — pill glass con hamburguesa
     ------------------------------------------------------------------ */
  .rsp .site-header {
    top: 14px;
    padding: 0 14px;
    justify-content: stretch;
  }

  /* Ocultar navegación desktop y CTAs laterales */
  .rsp .menu-inline,
  .rsp .header-cta,
  .rsp .header-side-cta {
    display: none;
  }

  .rsp .header-inner {
    width: 100%;
    max-width: none;
    height: 62px;
    justify-content: space-between;
    gap: 12px;
    padding: 0 10px 0 20px;
  }

  .rsp .site-logo {
    width: 158px;
    height: auto;
  }

  /* Botón hamburguesa */
  .rsp .menu-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
  }

  .rsp .menu-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: #ffffff;
    transition: transform 240ms ease, opacity 200ms ease;
  }

  .rsp .menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .rsp .menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) {
    opacity: 0;
  }
  .rsp .menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Panel de navegación móvil (mismo lenguaje liquid-glass del header) */
  .rsp .mobile-nav {
    display: block;
    position: fixed;
    top: 88px;
    left: 14px;
    right: 14px;
    z-index: 60;
    border-radius: 26px;
    background: linear-gradient(
      to bottom,
      rgba(4, 10, 40, 0.88),
      rgba(8, 18, 64, 0.92)
    );
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 22px 60px rgba(4, 10, 40, 0.45);
    padding: 10px 8px;
    max-height: calc(100dvh - 110px);
    overflow-y: auto;
    overscroll-behavior: contain;

    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 220ms ease, transform 220ms ease;
  }

  .rsp .mobile-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .rsp .mobile-nav-link,
  .rsp .mobile-nav-group-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 15px 18px;
    border: 0;
    background: transparent;
    color: #ffffff;
    font: 500 17px/1.2 "Outfit", sans-serif;
    text-decoration: none;
    border-radius: 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .rsp .mobile-nav-link.active,
  .rsp .mobile-nav-link:active {
    color: #ff0060;
  }

  .rsp .mobile-nav-group-trigger .chevron {
    width: 9px;
    height: 9px;
    border-right: 2px solid rgba(255, 255, 255, 0.7);
    border-bottom: 2px solid rgba(255, 255, 255, 0.7);
    transform: rotate(45deg);
    transition: transform 200ms ease;
    margin-right: 4px;
  }

  .rsp .mobile-nav-group.is-expanded .mobile-nav-group-trigger .chevron {
    transform: rotate(225deg);
  }

  .rsp .mobile-nav-group-items {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 240ms ease;
  }

  .rsp .mobile-nav-group.is-expanded .mobile-nav-group-items {
    grid-template-rows: 1fr;
  }

  .rsp .mobile-nav-group-items > div {
    overflow: hidden;
  }

  /* Sub-items: mismos iconos y animación que el dropdown desktop */
  .rsp .mobile-nav .dropdown-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 18px 10px 22px;
    color: rgba(255, 255, 255, 0.88);
    font: 400 16px/1.25 "Outfit", sans-serif;
    text-decoration: none;
    border-radius: 14px;
  }

  .rsp .mobile-nav .dropdown-item.is-current,
  .rsp .mobile-nav .dropdown-item:active {
    color: #ff0060;
  }

  /* Icono 48×48 idéntico al desktop (fondo claro + esquinas 14px) */
  .rsp .mobile-nav .dropdown-icon {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #f1f7fe;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    transition: background 150ms ease;
  }

  .rsp .mobile-nav .dropdown-icon img {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    object-fit: contain;
    transition: opacity 180ms ease;
  }

  /* Crossfade inactivo→activo como en desktop (al tocar o en página actual) */
  .rsp .mobile-nav .dropdown-icon-inactive { opacity: 1; }
  .rsp .mobile-nav .dropdown-icon-active { opacity: 0; }

  .rsp .mobile-nav .dropdown-item.is-current .dropdown-icon-active,
  .rsp .mobile-nav .dropdown-item:active .dropdown-icon-active {
    opacity: 1;
  }

  .rsp .mobile-nav .dropdown-item.is-current .dropdown-icon-inactive,
  .rsp .mobile-nav .dropdown-item:active .dropdown-icon-inactive {
    opacity: 0;
  }

  .rsp .mobile-nav-divider {
    height: 1px;
    margin: 8px 14px;
    background: rgba(255, 255, 255, 0.12);
  }

  /* CTAs dentro del panel */
  .rsp .mobile-nav-ctas {
    display: grid;
    gap: 10px;
    padding: 10px 12px 12px;
  }

  .rsp .mobile-nav-cta-primary {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50px;
    border-radius: 999px;
    background: #ff0060;
    color: #ffffff;
    font: 600 16px/1 "Outfit", sans-serif;
    text-decoration: none;
  }

  .rsp .mobile-nav-cta-secondary {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    font: 500 16px/1 "Outfit", sans-serif;
    text-decoration: none;
  }

  /* ------------------------------------------------------------------
     3. FOOTER — en flujo, apilado, con respiración generosa
     ------------------------------------------------------------------ */
  .rsp .footer {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: column;
    gap: 26px;
    padding: 80px 24px 72px;
  }

  /* footer-top se disuelve para poder reordenar: el copyright
     pasa al FINAL de toda la web */
  .rsp .footer-top {
    display: contents;
  }

  .rsp .footer-links.footer-links--cols {
    order: 1;
    margin-top: 14px;
  }

  .rsp .footer .copyright {
    order: 2;
    margin: 26px 0 0;
    padding-top: 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 14px;
    opacity: 0.85;
    width: 100%;
  }

  .rsp .footer-top img {
    width: 178px;
    height: auto;
  }

  /* Redes sociales más grandes y con área táctil cómoda */
  .rsp .socials {
    gap: 28px;
    margin: 10px 0 4px;
  }

  .rsp .social-link {
    width: 30px;
    height: 30px;
  }

  .rsp .footer-links.footer-links--cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    width: 100%;
  }

  .rsp .footer-col {
    display: grid;
    gap: 14px;
    align-content: start;
  }

  /* ------------------------------------------------------------------
     4. UTILIDADES COMPARTIDAS entre páginas adaptadas
     ------------------------------------------------------------------ */
  .rsp .section-pad {
    padding: 56px 24px;
  }

  /* Badges de descarga en fila, tamaño táctil */
  .rsp .store-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
  }
}

/* Tablet: marca a la izquierda, links a la derecha, copyright al final */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .rsp .footer {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 16px 56px;
    padding: 88px 48px 80px;
  }

  .rsp .footer-links.footer-links--cols {
    grid-column: 2;
    grid-row: 1 / span 3;
    width: auto;
    gap: 56px;
    margin-top: 0;
  }

  .rsp .footer .copyright {
    grid-column: 1 / -1;
    margin-top: 32px;
  }
}
