/* =========================
   CAMPOS FORMULARIO
========================= */
.campo{
  display:flex;
  flex-direction:column;
  gap:5px;
  margin-bottom:10px;
}

/* INPUTS */
.campo input{
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.08);
  background:#0f172a;
  color:white;
  outline:none;
  transition:0.2s;
}

/* FOCUS */
.campo input:focus{
  border-color:#0251fd;
  box-shadow:0 0 0 2px rgba(2,81,253,0.2);
}

/* ERROR TEXTO */
.campo{
  display:flex;
  flex-direction:column;
  gap:5px;
  margin-bottom:10px;
}

.error{
  color:#ff4d4d;
  font-size:12px;
  opacity:0;
  transform:translateY(-4px);
  transition:0.2s;
}

.error.activo{
  opacity:1;
  transform:translateY(0);
}

.input-error{
  border:1px solid #ff4d4d !important;
}

.input-ok{
  border:1px solid #00c853 !important;
}


/*------- CUANDO DA CLICK EN CONTINUAR EN WHATSAP PROCESANDO------*/
.btn-loading{
  opacity:0.7;
  pointer-events:none;
}

/* =========================================================
   CARRITO FLOTANTE GLOBAL
   ========================================================= */

.carrito-flotante {
  position: fixed !important;
  right: 20px !important;
  bottom: 20px !important;
  left: auto !important;
  top: auto !important;

  width: 280px;
  max-width: calc(100vw - 32px);

  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 16px;
  padding: 14px;

  z-index: 9999;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);

  display: block;
}

.carrito-titulo {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 10px;
}

.carrito-ui {
  margin-top: 10px;
}

/* Productos dentro del carrito */
.carrito-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;

  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);

  font-size: 13px;
  color: #e5e7eb;
}

.carrito-item:last-child {
  border-bottom: none;
}

.carrito-item button {
  min-height: auto;
  width: 24px;
  height: 24px;

  padding: 0;
  border-radius: 50%;

  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;

  font-size: 14px;
  line-height: 1;
}

.carrito-item button:hover {
  background: rgba(239, 68, 68, 0.35);
}

.carrito-total {
  margin-top: 12px;
  padding-top: 12px;

  border-top: 1px solid rgba(255, 255, 255, 0.12);

  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}

.carrito-acciones {
  display: flex;
  flex-direction: column;
  gap: 8px;

  margin-top: 12px;
}

.carrito-acciones button {
  width: 100%;
  min-height: 42px;

  border: none;
  border-radius: 12px;

  background: linear-gradient(135deg, #0251fd, #00aaff);
  color: #ffffff;

  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.carrito-acciones button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 170, 255, 0.22);
}

/* Responsive */
@media (max-width: 600px) {
  .carrito-flotante {
    right: 12px !important;
    bottom: 12px !important;
    width: calc(100vw - 24px);
  }
}

/* =========================================================
   CARRITO CERRADO / ABIERTO
   ========================================================= */

/* Cuando el carrito está cerrado, solo se ve este botón */
.btn-ver-carrito {
  width: 100%;
  min-height: 46px;

  border: none;
  border-radius: 14px;

  background: linear-gradient(135deg, #0251fd, #00aaff);
  color: #ffffff;

  font-size: 15px;
  font-weight: 800;
  cursor: pointer;

  box-shadow: 0 10px 25px rgba(0, 170, 255, 0.25);
  transition: 0.2s ease;
}

.btn-ver-carrito:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0, 170, 255, 0.35);
}

/* Panel cuando el carrito está abierto */
.carrito-panel {
  width: 100%;
}

/* Encabezado del panel abierto */
.carrito-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  margin-bottom: 10px;
  padding-bottom: 10px;

  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.carrito-header strong {
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
}

/* Botón cerrar */
.btn-cerrar-carrito {
  width: 30px;
  height: 30px;

  border: none;
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;

  font-size: 22px;
  line-height: 1;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: 0.2s ease;
}

.btn-cerrar-carrito:hover {
  background: rgba(239, 68, 68, 0.9);
  transform: rotate(90deg);
}

/* Mejora para mostrar precio y eliminar */
.carrito-item {
  align-items: center;
}

.carrito-item > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.carrito-item small {
  color: #94a3b8;
  font-size: 12px;
}

.carrito-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: right;
}

.carrito-item-right strong {
  color: #ffffff;
  font-size: 12px;
  white-space: nowrap;
}

/* =========================================================
   CARRITO CERRADO MÁS COMPACTO
   ========================================================= */

.carrito-flotante {
  width: auto !important;
  min-width: auto !important;
  padding: 0 !important;

  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

/* Ocultar el título "Carrito" cuando está cerrado */
.carrito-flotante:has(.btn-ver-carrito) .carrito-titulo {
  display: none;
}

/* Quitar margen extra del contenedor */
.carrito-flotante:has(.btn-ver-carrito) .carrito-ui {
  margin-top: 0;
}

/* Botón pequeño flotante */
.btn-ver-carrito {
  width: auto;
  min-height: 42px;
  padding: 0 16px;

  border-radius: 999px;

  font-size: 14px;
  font-weight: 800;

  white-space: nowrap;
}
/* Cuando está abierto, vuelve a ser panel */
.carrito-flotante:has(.carrito-panel) {
  width: 280px !important;
  max-width: calc(100vw - 32px);

  padding: 14px !important;

  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 16px;

  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
}

/* Mostrar título cuando está abierto */
.carrito-flotante:has(.carrito-panel) .carrito-titulo {
  display: block;
}

/* Responsive abierto */
@media (max-width: 600px) {
  .carrito-flotante:has(.carrito-panel) {
    right: 12px !important;
    bottom: 12px !important;
    width: calc(100vw - 24px) !important;
  }
}

/* =========================================================
   ANIMACIÓN PREVIA AL CHECKOUT
   ========================================================= */

.checkout-transition {
  position: fixed;
  inset: 0;
  z-index: 99999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 22px;

  background:
    radial-gradient(circle at top, rgba(0, 170, 255, 0.25), transparent 35%),
    radial-gradient(circle at bottom right, rgba(0, 255, 204, 0.18), transparent 35%),
    rgba(2, 6, 23, 0.96);

  backdrop-filter: blur(10px);

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.checkout-transition.active {
  opacity: 1;
  pointer-events: all;
}

.checkout-transition-card {
  width: min(420px, 100%);
  padding: 32px 24px;

  border-radius: 24px;
  border: 1px solid rgba(0, 170, 255, 0.28);

  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.96));

  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.55),
    0 0 45px rgba(0, 170, 255, 0.18);

  text-align: center;

  transform: translateY(14px) scale(0.96);
  animation: checkoutCardIn 0.35s ease forwards;
}

.checkout-logo-pulse {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 120px;
  min-height: 54px;

  margin-bottom: 22px;
  padding: 0 18px;

  border-radius: 18px;

  background: rgba(0, 170, 255, 0.08);
  border: 1px solid rgba(0, 255, 204, 0.18);

  box-shadow:
    0 0 25px rgba(0, 170, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);

  animation: logoCheckoutPulse 1.15s ease-in-out infinite;
}

.checkout-logo-pulse span {
  font-size: clamp(22px, 6vw, 34px);
  font-weight: 900;
  letter-spacing: 1px;

  background: linear-gradient(90deg, #ffffff, #00aaff, #00ffcc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.checkout-loader-ring {
  width: 74px;
  height: 74px;

  margin: 0 auto 20px;

  border-radius: 50%;
  padding: 5px;

  background:
    conic-gradient(from 0deg, #0251fd, #00aaff, #00ffcc, #0251fd);

  animation: checkoutSpin 0.9s linear infinite;
}

.checkout-loader-ring span {
  display: block;
  width: 100%;
  height: 100%;

  border-radius: 50%;
  background: #020617;
}

.checkout-transition-card h3 {
  margin: 0 0 8px;

  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
}

.checkout-transition-card p {
  max-width: 320px;
  margin: 0 auto;

  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.5;
}

.checkout-loading-dots {
  display: flex;
  justify-content: center;
  gap: 7px;

  margin-top: 20px;
}

.checkout-loading-dots i {
  width: 8px;
  height: 8px;

  border-radius: 50%;
  background: #00ffcc;

  animation: checkoutDots 0.8s ease-in-out infinite;
}

.checkout-loading-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.checkout-loading-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes checkoutCardIn {
  to {
    transform: translateY(0) scale(1);
  }
}

@keyframes logoCheckoutPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 25px rgba(0, 170, 255, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }

  50% {
    transform: scale(1.04);
    box-shadow:
      0 0 38px rgba(0, 255, 204, 0.38),
      inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
}

@keyframes checkoutSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes checkoutDots {
  0%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-5px);
  }
}

@media (max-width: 600px) {
  .checkout-transition {
    padding: 18px;
  }

  .checkout-transition-card {
    padding: 28px 18px;
    border-radius: 22px;
  }

  .checkout-loader-ring {
    width: 64px;
    height: 64px;
  }

  .checkout-transition-card h3 {
    font-size: 20px;
  }

  .checkout-transition-card p {
    font-size: 13px;
  }
}

/* =========================================================
   WHATSAPP SOPORTE A LA IZQUIERDA
   ========================================================= */

.wa-soporte {
  left: 20px !important;
  right: auto !important;
  bottom: 20px !important;
}

/* En móvil también queda a la izquierda */
@media (max-width: 600px) {
  .wa-soporte {
    left: 15px !important;
    right: auto !important;
    bottom: 80px !important;
  }
}

/* =========================================================
   ANIMACIÓN REDIRECCIÓN AFILIADOS
   ========================================================= */

.afiliados-transition {
  position: fixed;
  inset: 0;
  z-index: 999999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;

  background:
    radial-gradient(circle at top, rgba(124, 58, 237, 0.24), transparent 34%),
    radial-gradient(circle at bottom right, rgba(0, 170, 255, 0.20), transparent 38%),
    rgba(2, 6, 23, 0.97);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.afiliados-transition.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.afiliados-transition-card {
  width: min(520px, 100%);
  padding: 30px 24px;

  border-radius: 24px;

  background:
    linear-gradient(180deg, rgba(17, 24, 43, 0.98), rgba(7, 11, 24, 0.99));

  border: 1px solid rgba(255, 255, 255, 0.10);

  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.55),
    0 0 42px rgba(124, 58, 237, 0.16);

  text-align: center;
  color: #ffffff;

  transform: translateY(12px) scale(0.96);
  animation: afiliadosCardIn 0.32s ease forwards;
}

.afiliados-brand {
  margin-bottom: 10px;

  font-size: clamp(30px, 7vw, 44px);
  font-weight: 900;
  letter-spacing: 1px;
}

.afiliados-brand span {
  background: linear-gradient(90deg, #7c3aed, #00aaff, #00ffcc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.afiliados-badge {
  width: fit-content;
  margin: 0 auto 16px;
  padding: 7px 14px;

  border-radius: 999px;

  background: rgba(124, 58, 237, 0.14);
  border: 1px solid rgba(124, 58, 237, 0.32);
  color: #d8b4fe;

  font-size: 12px;
  font-weight: 800;
}

.afiliados-transition-card h3 {
  max-width: 390px;
  margin: 0 auto 10px;

  font-size: clamp(22px, 5vw, 30px);
  line-height: 1.15;
  font-weight: 900;
}

.afiliados-transition-card p {
  max-width: 380px;
  margin: 0 auto 24px;

  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.55;
}

.afiliados-flow {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 10px;

  margin: 0 auto 22px;
}

.afiliados-flow-item {
  min-width: 62px;
  height: 46px;
  padding: 0 10px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 999px;

  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);

  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.afiliados-flow-line {
  position: relative;
  height: 6px;
  overflow: hidden;

  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.afiliados-flow-line span {
  position: absolute;
  top: 0;
  left: -45%;

  width: 45%;
  height: 100%;

  border-radius: 999px;
  background: linear-gradient(90deg, #7c3aed, #00aaff, #00ffcc);
}

/* Línea SZ -> Partners */
.afiliados-line-1 span {
  animation: afiliadosLineConnect 0.85s ease forwards;
  animation-delay: 0.45s;
}

/* Línea Partners -> Registro */
.afiliados-line-2 span {
  animation: afiliadosLineConnect 0.85s ease forwards;
  animation-delay: 1.55s;
}

.afiliados-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
}

.afiliados-dots i {
  width: 8px;
  height: 8px;

  border-radius: 50%;
  background: #00ffcc;

  animation: afiliadosDots 0.8s ease-in-out infinite;
}

.afiliados-dots i:nth-child(2) {
  animation-delay: 0.14s;
}

.afiliados-dots i:nth-child(3) {
  animation-delay: 0.28s;
}

/* Pasos activos de la secuencia */
.afiliados-step-sz {
  animation: afiliadosStepActive 0.45s ease forwards;
}

.afiliados-step-partners {
  animation: afiliadosStepActive 0.45s ease forwards;
  animation-delay: 1.2s;
}

.afiliados-step-registro {
  animation: afiliadosStepActive 0.45s ease forwards;
  animation-delay: 2.35s;
}

@keyframes afiliadosStepActive {
  0% {
    transform: scale(1);
    border-color: rgba(255, 255, 255, 0.09);
    box-shadow: none;
  }

  100% {
    transform: scale(1.06);
    border-color: rgba(0, 255, 204, 0.45);
    box-shadow: 0 0 24px rgba(0, 255, 204, 0.18);
    background: rgba(0, 170, 255, 0.12);
  }
}

@keyframes afiliadosCardIn {
  to {
    transform: translateY(0) scale(1);
  }
}

@keyframes afiliadosLineConnect {
  from {
    left: -45%;
  }

  to {
    left: 100%;
  }
}

@keyframes afiliadosDots {
  0%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-5px);
  }
}

@media (max-width: 640px) {
  .afiliados-transition {
    padding: 14px;
  }

  .afiliados-transition-card {
    padding: 24px 16px;
    border-radius: 22px;
  }

  .afiliados-flow {
    gap: 7px;
  }

  .afiliados-flow-item {
    min-width: 52px;
    height: 42px;
    font-size: 10px;
  }

  .afiliados-transition-card p {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .afiliados-transition-card,
  .afiliados-flow-line span,
  .afiliados-dots i,
  .afiliados-flow-item {
    animation: none !important;
  }
}

/* =========================================================
   VARIANTE REGRESO DESDE AFILIADOS
   Reutiliza la misma animación existente
   ========================================================= */

.afiliados-transition-regreso{
  background:
    radial-gradient(circle at top, rgba(0, 170, 255, 0.28), transparent 34%),
    radial-gradient(circle at bottom right, rgba(0, 255, 204, 0.20), transparent 38%),
    rgba(2, 6, 23, 0.97);
}

.afiliados-transition-regreso .afiliados-badge{
  background: rgba(0, 170, 255, 0.14);
  border-color: rgba(0, 170, 255, 0.34);
  color: #bfdbfe;
}

.afiliados-transition-regreso .afiliados-brand span{
  background: linear-gradient(90deg, #00aaff, #00ffcc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}