/* ==========================================
   1. ESTILOS BASE DE LA PÁGINA
   ========================================== */
body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #FFF;
  color: #000;
  min-height: 100vh;
  overflow-y: auto;
}

main {
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 20px;
  text-align: center;
}

main h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

main p {
  color: #94a3b8;
  font-size: 1.2rem;
  margin-bottom: 30px;
}

/* Bloqueo de scroll cuando el modal está activo */
body.modal-open-jrf {
  overflow: hidden;
}

/* ==========================================
   2. CONTENEDOR OVERLAY Y ESTRUCTURA 3D
   ========================================== */
.modal-overlay-jrf {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  perspective: 1200px;
  z-index: 99999;
}

.modal-overlay-jrf.active-jrf {
  opacity: 1;
  pointer-events: auto;
}

.modal-3d-jrf {
  background: transparent;
  max-width: 780px;
  width: 85%;
  height: 540px;
  position: relative;
  transform: rotateY(-60deg) rotateX(20deg) translateZ(-500px) scale(0.6);
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.modal-overlay-jrf.active-jrf .modal-3d-jrf {
  transform: rotateY(0deg) rotateX(0deg) translateZ(0) scale(1);
}

/* BOTÓN DE CIERRE */
.btn-close-modal-jrf {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #475569;
  font-size: 1.6rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.btn-close-modal-jrf:hover {
  color: #ffffff;
  background: #ef4444;
  transform: translateX(-50%) scale(1.1);
}

/* BOTONES LATERALES */
.nav-btn-jrf {
  position: absolute;
  top: 50%;
  background: #ffffff;
  color: #0ea5e9;
  border: 1px solid #e2e8f0;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.6rem;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-50%);
  transition: all 0.2s;
}

.nav-btn-jrf.prev-jrf { left: -40px; }
.nav-btn-jrf.next-jrf { right: -40px; }

.nav-btn-jrf:hover {
  background: #0ea5e9;
  color: #ffffff;
}

/* ==========================================
   3. BARAJA DE TARJETAS 3D
   ========================================== */
.slider-container-jrf {
  width: 100%;
  height: 100%;
  position: relative;
}

.slide-jrf {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
  box-sizing: border-box;
  text-align: center;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.front-jrf { transform: translateY(0) scale(1); z-index: 10; opacity: 1; }
.mid-jrf   { transform: translateY(25px) scale(0.93); z-index: 9; opacity: 0.9; }
.back-jrf  { transform: translateY(50px) scale(0.86); z-index: 8; opacity: 0.6; }
.hidden-jrf{ transform: translateY(75px) scale(0.8); z-index: 7; opacity: 0; pointer-events: none; }

.fly-out-left-jrf { transform: translateX(-110%) rotate(-10deg); opacity: 0; z-index: 11; }
.fly-out-right-jrf { transform: translateX(110%) rotate(10deg); opacity: 0; z-index: 11; }
.fly-out-instant-jrf { transition: none !important; }

/* CONTENIDO DE LAS CARTAS */
.slide-icon-jrf { font-size: 3.5rem; margin-bottom: 10px; }
.slide-jrf h2 { margin: 0 0 10px 0; font-size: 1.8rem; color: #0284c7; }
.slide-jrf p { color: #475569; font-size: 1.1rem; line-height: 1.5; margin: 0; }

/* VISOR PDF EN ANDROID Y ESCRITORIO */
.pdf-wrapper-jrf {
  width: 100%;
  height: 320px;
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.pdf-iframe-jrf {
  width: 100%;
  height: 100%;
  border: none;
}

/* PUNTOS DE NAVEGACIÓN */
.dots-container-jrf {
  position: absolute;
  bottom: -40px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 12px;
  z-index: 20;
}

.dot-jrf { width: 12px; height: 12px; background: #94a3b8; border-radius: 50%; cursor: pointer; transition: all 0.3s; }
.dot-jrf.active-jrf { background: #0ea5e9; transform: scale(1.3); }

/* RESPONSIVO */
@media (max-width: 480px) {
  .modal-3d-jrf { width: 100%; max-width: 384px; height: 516px; }
  .btn-close-modal-jrf { top: -10px; width: 40px; height: 40px; font-size: 1.3rem; }
  .nav-btn-jrf { width: 45px; height: 45px; }
  .nav-btn-jrf.prev-jrf { left: -20px; }
  .nav-btn-jrf.next-jrf { right: -20px; }
  .pdf-wrapper-jrf { height: 260px; }
}