/* =========================================
   STYLE-AR.CSS (Exclusivo para scanner-ar.html)
   ========================================= */
:root {
  --bg-dark: #020108;
  --primary-purple: #8646f4;
  --primary-pink: #f271d9;
  --text-main: #ffffff;
  --text-muted: #a1a1aa;
}

/* ⚠️ REGLA DE ORO AR: Bloqueo absoluto de scroll ⚠️ */
html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden !important;
  background-color: #000;
  color: var(--text-main);
  font-family: "Inter", sans-serif;
}

* {
  box-sizing: border-box;
}

.ar-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  pointer-events: auto;
}

/* 🔥 FIX: Forzar el tamaño del logo a 80px */
.ar-header .logo img {
  height: 80px !important;
  width: auto !important;
  object-fit: contain;
}

/* Botones para UI */
.btn {
  padding: 12px 28px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  display: inline-block;
  border: none;
}
.btn-outline {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  background: rgba(2, 1, 5, 0.5);
  backdrop-filter: blur(8px);
}

/* =========================================
   PARCHES NATIVOS AR.JS (TU CÓDIGO ORIGINAL)
   ========================================= */
#ar-view {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #020109 !important; /* 🔥 FIX: Fondo oscuro de respaldo absoluto */
}

.ar-view-hidden {
  display: none !important;
  width: 100%;
  height: 100%;
}
#ar-view a-scene {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
}
#ar-view canvas.a-canvas {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  z-index: 2;
}
#ar-view video {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  margin: 0 !important;
  z-index: 1;
}

/* UI Del Escáner */
.scanner-frame {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.corner {
  position: absolute;
  width: 40px;
  height: 40px;
  border-color: var(--primary-purple);
  border-style: solid;
  transition: all 0.3s ease;
}
.top-left {
  top: 40px;
  left: 40px;
  border-width: 2px 0 0 2px;
}
.top-right {
  top: 40px;
  right: 40px;
  border-width: 2px 2px 0 0;
}
.bottom-left {
  bottom: 40px;
  left: 40px;
  border-width: 0 0 2px 2px;
}
.bottom-right {
  bottom: 40px;
  right: 40px;
  border-width: 0 2px 2px 0;
}

.scanner-idle {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px;
  border-radius: 24px;

  /* 🔥 FIX: Efecto Glassmorphism real y compatible con móviles */
  background: rgba(10, 10, 12, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.8),
    inset 0 0 10px rgba(255, 255, 255, 0.02);

  pointer-events: auto;
  width: 85%; /* Evita que choque con los bordes de la pantalla */
  max-width: 400px;
}

.scanner-idle p {
  color: var(--text-main);
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.status-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* Loading Overlay Original */
.ar-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 20;
  background: rgba(2, 1, 8, 0.88);
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.ar-loading-overlay span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.ar-spinner {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(242, 113, 217, 0.15);
  border-top-color: var(--primary-pink);
  border-radius: 50%;
  animation: ar-spin 0.9s linear infinite;
}
@keyframes ar-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Revertir body tag de AR.js para no bloquear UI */
body.a-body-loaded {
  overflow: auto !important;
  position: static !important;
}
