/* ─── WebAR / 3D Modal ─── */

/* Botón "Ver en 3D" en las tarjetas de producto */
.ar-cta {
  background: rgba(74, 144, 226, 0.12);
  color: #4A90E2;
  border: 1px solid rgba(74, 144, 226, 0.4);
  font-weight: 600;
}
.ar-cta:hover {
  background: rgba(74, 144, 226, 0.22);
  border-color: rgba(74, 144, 226, 0.7);
}

/* Modal AR — full-height en mobile para dejar sitio al canvas 3D */
.ar-modal {
  max-height: 95vh;
}

/* Cuerpo del modal sin padding para que el model-viewer ocupe ancho completo */
.ar-modal .modal-body.ar-body { padding: 0; }

/* Canvas del modelo */
model-viewer {
  display: block;
  width: 100%;
  height: 55vh;
  min-height: 320px;
  background: linear-gradient(180deg, #1a1f2a, #0d1118);
  --poster-color: transparent;
}

/* Botón AR (slot del model-viewer) */
.ar-launch-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: linear-gradient(135deg, #4A90E2, #357ABD);
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(74, 144, 226, 0.4);
}

/* Toolbar de acciones bajo el viewer */
.ar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-top: 1px solid var(--color-border);
}
.ar-actions .btn { flex: 1 1 auto; min-width: 140px; }

/* Panel de info nutricional (collapse bajo el viewer) */
.ar-info-panel {
  padding: 16px 18px;
  border-top: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.02);
  animation: slideUp 0.2s ease;
}
.ar-info-panel.hidden { display: none; }
.ar-info-panel h4 {
  font-size: 1rem;
  margin: 0 0 10px;
  color: var(--color-text);
}

.ar-nutrition-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.ar-nutrition-table tr { border-bottom: 1px solid rgba(255,255,255,0.06); }
.ar-nutrition-table tr:last-child { border-bottom: none; }
.ar-nutrition-table td {
  padding: 8px 0;
}
.ar-nutrition-table td:first-child {
  color: var(--color-text-muted);
}
.ar-nutrition-table td:last-child {
  text-align: right;
  font-weight: 700;
  color: var(--color-text);
}

.ar-source-badge {
  display: inline-block;
  font-size: 0.6875rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 200, 0, 0.12);
  color: #F5A623;
  border: 1px solid rgba(245, 166, 35, 0.4);
  margin-left: 8px;
  vertical-align: middle;
}

/* Estado de carga / error en el cuerpo de la modal */
.ar-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--color-text-muted);
}
.ar-state .ar-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--color-accent, #E94560);
  border-radius: 50%;
  animation: ar-spin 0.8s linear infinite;
  margin-bottom: 14px;
}
@keyframes ar-spin { to { transform: rotate(360deg); } }
