/* ==========================================================================
   TARJETA MAGNÉTICA FLOTANTE DE CONTACTO (CTA GLOBAL REACTIVA AL MOUSE)
   TSolutions IPIDD / Eclipcss - Mexicali, B.C.
   ========================================================================== */

:root {
  --mag-qr-glow-color: #32ff7e; /* Verde limón neón */
  --mag-qr-glow-rgb: 50, 255, 126;
  --mag-qr-accent-gold: #f5d061;
}

/* Contenedor principal de la tarjeta flotante */
.magnetic-qr-floating-wrapper {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 999980;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: auto;
  user-select: none;
  font-family: 'Quicksand', 'Advent Pro', sans-serif;
}

/* Cuerpo de la tarjeta con estilo magnético bancario VIP */
.magnetic-qr-card {
  position: relative;
  width: 210px;
  background: linear-gradient(145deg, rgba(13, 19, 33, 0.95) 0%, rgba(20, 29, 47, 0.96) 60%, rgba(10, 15, 26, 0.98) 100%);
  border-radius: 18px;
  border: 1.5px solid rgba(var(--mag-qr-glow-rgb), calc(0.3 + var(--proximity-alpha, 0)));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  cursor: pointer;
  transform-style: preserve-3d;
  perspective: 1000px;
  transform: perspective(1000px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) scale(var(--proximity-scale, 1));
  transition: border-color 0.15s ease-out, transform 0.12s ease-out;
  
  /* Resplandor dinámico sensible al cursor del mouse */
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7),
              0 0 calc(10px + var(--proximity-glow, 0px)) rgba(var(--mag-qr-glow-rgb), calc(0.2 + var(--proximity-alpha, 0))),
              inset 0 0 calc(5px + var(--proximity-glow, 0px) * 0.4) rgba(var(--mag-qr-glow-rgb), calc(0.1 + var(--proximity-alpha, 0) * 0.3));
}

/* Efecto hover directo con intensidad máxima */
.magnetic-qr-card:hover {
  border-color: rgba(var(--mag-qr-glow-rgb), 0.95);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.85),
              0 0 35px rgba(var(--mag-qr-glow-rgb), 0.9),
              0 0 75px rgba(var(--mag-qr-glow-rgb), 0.45),
              inset 0 0 16px rgba(var(--mag-qr-glow-rgb), 0.3);
}

/* Banda magnética superior de alta seguridad */
.magnetic-qr-stripe {
  background: #070a10;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.magnetic-qr-stripe::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--mag-qr-glow-rgb), 0.5), transparent);
}

.magnetic-qr-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.magnetic-qr-beacon {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mag-qr-glow-color);
  box-shadow: 0 0 8px var(--mag-qr-glow-color);
  animation: magQrPulse 1.8s infinite ease-in-out;
}

@keyframes magQrPulse {
  0% { transform: scale(0.8); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px var(--mag-qr-glow-color); }
  100% { transform: scale(0.8); opacity: 0.6; }
}

.magnetic-qr-security-code {
  font-family: 'Monoton', monospace, sans-serif;
  font-size: 8px;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.65);
}

.magnetic-qr-minimize-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.magnetic-qr-minimize-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Interior de la tarjeta */
.magnetic-qr-content {
  padding: 12px 14px 14px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Fila de chip y badge CONTACTO */
.magnetic-qr-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Microchip EMV metálico */
.magnetic-emv-chip {
  width: 32px;
  height: 24px;
  background: linear-gradient(135deg, #fce07a 0%, #e6b800 40%, #997a00 100%);
  border-radius: 5px;
  border: 1px solid #ffea9f;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.magnetic-emv-chip::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(90deg, transparent 0, transparent 6px, rgba(0,0,0,0.2) 6px, rgba(0,0,0,0.2) 7px),
              repeating-linear-gradient(0deg, transparent 0, transparent 6px, rgba(0,0,0,0.2) 6px, rgba(0,0,0,0.2) 7px);
}

/* Badge con la leyenda CONTACTO */
.magnetic-qr-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: rgba(var(--mag-qr-glow-rgb), 0.12);
  border: 1px solid rgba(var(--mag-qr-glow-rgb), 0.5);
  border-radius: 30px;
  box-shadow: 0 0 10px rgba(var(--mag-qr-glow-rgb), 0.2);
}

.magnetic-qr-badge-text {
  font-family: 'Advent Pro', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--mag-qr-glow-color);
  text-shadow: 0 0 8px rgba(var(--mag-qr-glow-rgb), 0.7);
  text-transform: uppercase;
}

/* Contenedor del código QR con contraste optimizado */
.magnetic-qr-viewport {
  position: relative;
  width: 146px;
  height: 146px;
  background: #ffffff;
  padding: 8px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), inset 0 0 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.magnetic-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Línea láser de escaneo animada */
.magnetic-qr-laser {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2.5px;
  background: linear-gradient(90deg, transparent 0%, var(--mag-qr-glow-color) 50%, transparent 100%);
  box-shadow: 0 0 10px var(--mag-qr-glow-color), 0 0 18px var(--mag-qr-glow-color);
  animation: magLaserTravel 2.4s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes magLaserTravel {
  0% { top: 6px; opacity: 0.3; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { top: calc(100% - 8px); opacity: 0.3; }
}

/* Pie de la tarjeta: Información de contacto */
.magnetic-qr-info {
  text-align: center;
  width: 100%;
}

.magnetic-qr-prompt {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #f8fafc;
  margin: 0;
  text-transform: uppercase;
  font-family: 'Advent Pro', sans-serif;
}

.magnetic-qr-subtext {
  font-size: 8.5px;
  color: #94a3b8;
  margin: 2px 0 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Botón interactivo directo de WhatsApp / Llamada */
.magnetic-qr-cta-link {
  width: 100%;
  margin-top: 4px;
  padding: 6px 12px;
  background: rgba(var(--mag-qr-glow-rgb), 0.12);
  border: 1px solid rgba(var(--mag-qr-glow-rgb), 0.4);
  border-radius: 8px;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.magnetic-qr-cta-link:hover {
  background: var(--mag-qr-glow-color);
  color: #050505;
  box-shadow: 0 0 15px rgba(var(--mag-qr-glow-rgb), 0.6);
  border-color: var(--mag-qr-glow-color);
}

/* Estado minimizado (Píldora flotante compacta) */
.magnetic-qr-floating-wrapper.is-minimized .magnetic-qr-card {
  display: none;
}

.magnetic-qr-pill-trigger {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(13, 19, 33, 0.96) 0%, rgba(20, 29, 47, 0.98) 100%);
  border: 1.5px solid rgba(var(--mag-qr-glow-rgb), 0.6);
  border-radius: 30px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7), 0 0 20px rgba(var(--mag-qr-glow-rgb), 0.4);
  cursor: pointer;
  backdrop-filter: blur(15px);
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.magnetic-qr-floating-wrapper.is-minimized .magnetic-qr-pill-trigger {
  display: flex;
}

.magnetic-qr-pill-trigger:hover {
  transform: translateY(-3px) scale(1.05);
  border-color: var(--mag-qr-glow-color);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8), 0 0 30px rgba(var(--mag-qr-glow-rgb), 0.7);
}

.magnetic-qr-pill-icon {
  width: 18px;
  height: 18px;
  color: var(--mag-qr-glow-color);
}

.magnetic-qr-pill-label {
  font-family: 'Advent Pro', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--mag-qr-glow-color);
  text-transform: uppercase;
}

/* Adaptabilidad a dispositivos móviles */
@media (max-width: 640px) {
  .magnetic-qr-floating-wrapper {
    bottom: 18px;
    left: 16px;
  }
  .magnetic-qr-card {
    width: 185px;
  }
  .magnetic-qr-viewport {
    width: 125px;
    height: 125px;
  }
}
