/* =====================================================================
   RESPONSIVE — ESTACIONAMIENTO (.parking-page)
   ---------------------------------------------------------------------
   Móvil:  < 768px
   Tablet: 768px – 1199.98px
   Desktop ≥ 1200px: intacto (todo dentro de media queries).

   Scope: .rsp .parking-page  → no colisiona con otras páginas.
   Principio: ADAPTAR, no redimensionar. Cada sección pasa a flujo
   normal (flex apilado) manteniendo colores, tipografías, imágenes
   y el mismo orden de secciones que en desktop.

   Nota: el orden del DOM ya coincide con el orden visual deseado
   (subtítulo → título → badges → descripción → phone app → GIF BLE →
   descripción → pill → título pasos → lista → slider → footer),
   por lo que no se necesita reordenar con `order`.
   ===================================================================== */

/* ═══════════════════════════════════════════════════════════
   BASE COMPARTIDA (móvil + tablet)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1199.98px) {

  /* ── Lienzo: la página pasa a columna en flujo normal ── */
  .rsp .parking-page {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
    width: 100%;
    height: auto;
    min-height: 100vh;
    background: #ffffff;
  }

  /* ── Decorativos anclados a coordenadas del lienzo 1440px ──
     Vector curvo de fondo y banda blanca auxiliar: no re-anclan
     en flujo → ocultos. (Círculos y módulos BLE se CONSERVAN,
     recompuestos dentro de .pk-radar más abajo.) */
  .rsp .parking-page .pk-vector-bottom,
  .rsp .parking-page .pk-white-band {
    display: none;
  }

  /* ════════ SECCIÓN: HERO ════════ */

  /* Fondo hero: imagen cover anclada al tope de la página */
  .rsp .parking-page .pk-hero-bg {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    z-index: 0;
    pointer-events: none;
  }

  .rsp .parking-page .pk-hero-bg picture {
    display: block;
    width: 100%;
    height: 100%;
  }

  .rsp .parking-page .pk-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
  }

  /* Subtítulo "Entra. Paga. Sal." */
  .rsp .parking-page .pk-hero-subtitle {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: auto;
    text-align: center;
    z-index: 2;
  }

  /* Título "Todo desde tu teléfono" */
  .rsp .parking-page .pk-hero-title {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: auto;
    text-align: center;
    z-index: 2;
  }

  /* Badges de descarga (App Store / Google Play) */
  .rsp .parking-page .pk-hero-download {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    align-self: center;
    z-index: 2;
  }

  .rsp .parking-page .pk-hero-download-buttons {
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .rsp .parking-page .pk-hero-download-buttons a {
    display: flex;
    align-items: center;
    min-height: 44px; /* área táctil mínima */
  }

  /* ════════ SECCIÓN: DESCRIPCIONES (intro y "líderes") ════════ */
  .rsp .parking-page .pk-description {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    align-self: center;
    text-align: center;
    z-index: 2;
  }

  /* ════════ SECCIÓN: TELÉFONOS — coreografía idéntica al desktop ════════
     phone1 (app de pago) viaja hacia abajo con el scroll (transform
     inline por JS, medido sobre este layout) y se funde con phone2
     (GIF bluetooth) dentro del radar. */
  .rsp .parking-page .pk-phone-1 {
    position: relative;
    left: auto;
    top: auto;
    width: min(300px, 70vw);
    height: auto;
    align-self: center;
    z-index: 4;
    will-change: transform, opacity;
  }

  .rsp .parking-page .pk-phone-1 img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
  }

  /* ── RADAR: composición fiel al desktop, a escala porcentual ──
     Caja de referencia del lienzo: x 326–1070, y 1250–1811 (744×561).
     Círculos, GIF y módulos BLE conservan sus posiciones relativas,
     rotaciones de entrada (is-in) y transiciones de opacidad. */
  .rsp .parking-page .pk-radar {
    position: relative;
    width: min(560px, 94vw);
    aspect-ratio: 744 / 561;
    align-self: center;
    margin-top: 48px;
    z-index: 3;
  }

  .rsp .parking-page .pk-radar .abs {
    position: absolute;
  }

  .rsp .parking-page .pk-circle {
    height: auto;
    aspect-ratio: 1 / 1;
    border-width: 2px;
  }

  .rsp .parking-page .pk-circle-outer { left: 5%;    top: 0;     width: 91.7%; }
  .rsp .parking-page .pk-circle-mid   { left: 15.2%; top: 13.4%; width: 71.2%; }
  .rsp .parking-page .pk-circle-inner { left: 24.7%; top: 26.2%; width: 52.2%; }

  .rsp .parking-page .pk-phone-2 {
    left: 30.6%;
    top: 6.4%;
    width: 40.3%;
    height: auto;
    z-index: 5;
  }

  .rsp .parking-page .pk-phone-2 img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
  }

  .rsp .parking-page .pk-floating-icon {
    width: 13.6%; /* 101px / 744px del lienzo */
    height: auto;
    z-index: 5;
  }

  .rsp .parking-page .pk-floating-icon img {
    width: 100%;
    height: auto;
  }

  .rsp .parking-page .pk-icon-top          { left: 11.2%; top: 8.6%; }
  .rsp .parking-page .pk-icon-bottom-right { left: 86.4%; top: 74.5%; }
  .rsp .parking-page .pk-icon-bottom-left  { left: 0;     top: 82%; }
  .rsp .parking-page .pk-icon-right        { left: 79.8%; top: 21.7%; }
  .rsp .parking-page .pk-icon-left-mid     { left: 13.6%; top: 43.7%; }

  /* ════════ SECCIÓN: ¿CÓMO USAR? (pill + título) ════════ */
  .rsp .parking-page .pk-pill {
    position: relative;
    left: auto;
    top: auto;
    align-self: flex-start;
    z-index: 2;
  }

  .rsp .parking-page .pk-steps-title {
    position: relative;
    left: auto;
    top: auto;
    z-index: 2;
  }

  /* ════════ SECCIÓN: PASOS — lista índice ════════
     Se mantiene como índice de los 4 pasos (contiene los nombres
     de cada paso). Conserva la animación de entrada escalonada
     (.pk-steps-list.is-in), disparada por el IntersectionObserver
     del slider con threshold reducido en móvil (ver Estacionamiento.jsx). */
  .rsp .parking-page .pk-steps-list {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    z-index: 2;
  }

  .rsp .parking-page .pk-steps-list .pk-step-item {
    min-height: 44px; /* área táctil mínima */
  }

  /* ════════ SECCIÓN: PASOS — slider crossfade como en desktop ════════
     Solo la tarjeta ACTIVA es visible; cambia por clic en la lista o
     por el autoplay del JS. Patrón grid: todas las tarjetas en la misma
     celda (alto automático = tarjeta más alta) sin apilarse hacia abajo. */
  .rsp .parking-page .pk-slider {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    height: auto;
    overflow: hidden;
    border-radius: 34px;
    display: grid;
    z-index: 2;
  }

  .rsp .parking-page .pk-slider .pk-step-card {
    grid-area: 1 / 1;
    position: relative;
    inset: auto;
    height: auto;
    /* opacity/transform/transition del desktop intactos:
       el crossfade .is-active del JS sigue funcionando */
  }

  .rsp .parking-page .pk-step-card-text,
  .rsp .parking-page .pk-step-card-1 .pk-step-card-text {
    width: auto;
    min-width: 0;
  }

  .rsp .parking-page .pk-step-card-img {
    width: 100%;
    flex-shrink: 0;
  }

  /* Badges superpuestos en la imagen del paso 1.
     En desktop usan position:fixed (funciona por el transform del
     lienzo); sin ese transform quedarían pegados al viewport. */
  .rsp .parking-page .pk-downloads-overlay {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    justify-content: center;
    align-items: center;
  }

  .rsp .parking-page .pk-downloads-overlay a {
    display: flex;
    align-items: center;
    min-height: 44px; /* área táctil mínima */
  }

  /* ════════ SECCIÓN: FOOTER ════════
     (el layout interno lo resuelve core.css) */
  .rsp .parking-page #global-footer {
    width: 100%;
  }
}

/* ═══════════════════════════════════════════════════════════
   MÓVIL  (< 768px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {

  /* ── HERO ── (altura del banner homologada al patrón de Servicios:
     555px; la composición interna —badges, teléfonos, GIF— se conserva) */
  .rsp .parking-page .pk-hero-bg {
    height: 555px;
  }

  .rsp .parking-page .pk-hero-subtitle {
    margin: 128px 24px 0;
    font-size: clamp(20px, 5.5vw, 26px);
    line-height: 1.3;
  }

  .rsp .parking-page .pk-hero-title {
    margin: 12px 24px 0;
    font-size: clamp(34px, 10vw, 44px);
    line-height: 1.12;
  }

  .rsp .parking-page .pk-hero-download {
    margin: 28px 24px 0;
  }

  .rsp .parking-page .pk-hero-download-buttons img {
    height: 48px;
  }

  /* ── DESCRIPCIONES ── */
  .rsp .parking-page .pk-description {
    width: calc(100% - 48px);
    font-size: 5vw;
    line-height: 1.4;
    margin: 130px auto 0; /* descripción "líderes" (tras el GIF BLE) */
  }

  /* Descripción intro: entra justo después del fondo hero
     Va entre el teléfono y el radar (orden aprobado por el cliente). */
  .rsp .parking-page .pk-description-duplicate {
    margin-top: 48px;
  }

  /* ── TELÉFONOS ── */
  .rsp .parking-page .pk-phone-1 {
    width: min(280px, 72vw);
    margin-top: 40px;
  }

  /* El radar (círculos + GIF + módulos), con aire tras la descripción */
  .rsp .parking-page .pk-radar {
    width: min(480px, 94vw);
    margin-top: 80px;
  }

  /* ── ¿CÓMO USAR? ── */
  .rsp .parking-page .pk-pill {
    margin: 72px 24px 0;
  }

  .rsp .parking-page .pk-pill span {
    font-size: 17px;
    line-height: 1.4;
  }

  .rsp .parking-page .pk-steps-title {
    margin: 20px 24px 0;
    width: auto;
    max-width: 560px;
    font-size: clamp(22px, 6.4vw, 27px);
    line-height: 1.25;
  }

  /* ── PASOS: lista índice ── */
  .rsp .parking-page .pk-steps-list {
    margin: 28px 24px 0;
  }

  /* ── PASOS: pila de tarjetas ── */
  .rsp .parking-page .pk-slider {
    margin: 24px 24px 0;
    gap: 24px;
  }

  .rsp .parking-page .pk-slider .pk-step-card {
    padding: 20px;
    border-radius: 28px;
    gap: 18px;
  }

  .rsp .parking-page .pk-step-card-text {
    font-size: 16px;
    line-height: 1.45;
  }

  .rsp .parking-page .pk-step-card-img {
    height: min(360px, 95vw);
    border-radius: 22px;
  }

  /* ── FOOTER ── */
  .rsp .parking-page #global-footer {
    margin-top: 100px;
  }
}

/* ═══════════════════════════════════════════════════════════
   TABLET  (768px – 1199.98px)
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1199.98px) {

  /* ── HERO ── (altura del banner homologada al patrón: 640px) */
  .rsp .parking-page .pk-hero-bg {
    height: 640px;
  }

  .rsp .parking-page .pk-hero-subtitle {
    margin: 150px 48px 0;
    font-size: clamp(26px, 3.2vw, 32px);
    line-height: 1.3;
  }

  .rsp .parking-page .pk-hero-title {
    margin: 12px 48px 0;
    font-size: clamp(40px, 5.5vw, 52px);
    line-height: 1.1;
  }

  .rsp .parking-page .pk-hero-download {
    margin: 32px 48px 0;
  }

  .rsp .parking-page .pk-hero-download-buttons {
    gap: 20px;
  }

  .rsp .parking-page .pk-hero-download-buttons img {
    height: 56px;
  }

  /* ── DESCRIPCIONES ── */
  .rsp .parking-page .pk-description {
    width: min(680px, calc(100% - 96px));
    font-size: clamp(22px, 2.6vw, 26px);
    line-height: 1.4;
    margin: 64px auto 0;
  }

  /* El teléfono libra el banner; espaciado normal para la descripción */
  .rsp .parking-page .pk-description-duplicate {
    margin-top: 56px;
  }

  /* ── TELÉFONOS ── */
  .rsp .parking-page .pk-phone-1 {
    width: 320px;
    margin-top: 48px;
  }

  /* El radar (círculos + GIF + módulos), con aire tras la descripción */
  .rsp .parking-page .pk-radar {
    width: 620px;
    margin-top: 96px;
  }

  /* ── ¿CÓMO USAR? ── */
  .rsp .parking-page .pk-pill {
    margin: 80px 48px 0;
  }

  .rsp .parking-page .pk-steps-title {
    margin: 20px 48px 0;
    width: auto;
    max-width: 640px;
    font-size: 30px;
    line-height: 1.25;
  }

  /* ── PASOS: lista índice ── */
  .rsp .parking-page .pk-steps-list {
    margin: 32px 48px 0;
    max-width: 560px;
  }

  /* ── PASOS: tarjetas en 2 columnas alternadas ── */
  .rsp .parking-page .pk-slider {
    margin: 32px 48px 0;
    gap: 28px;
  }

  .rsp .parking-page .pk-slider .pk-step-card {
    flex-direction: row;
    align-items: center;
    gap: 28px;
    padding: 28px;
  }

  /* Alterna texto/imagen en pasos pares */
  .rsp .parking-page .pk-slider .pk-step-card:nth-child(even) {
    flex-direction: row-reverse;
  }

  .rsp .parking-page .pk-step-card-text {
    flex: 1 1 42%;
    font-size: 18px;
    line-height: 1.45;
  }

  .rsp .parking-page .pk-step-card-img {
    flex: 1 1 58%;
    width: auto;
    height: 340px;
  }

  /* ── FOOTER ── */
  .rsp .parking-page #global-footer {
    margin-top: 80px;
  }
}
