/* ══════════════════════════════════════
   Botón "Ver en 3D" sobre las fotos
══════════════════════════════════════ */
.ver3d-btn {
  position: absolute; z-index: 3; top: 1rem; left: 1rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.95rem 0.55rem 0.75rem; border-radius: 999px; cursor: pointer;
  font: 600 0.8rem/1 "Inter", sans-serif; letter-spacing: 0.01em; color: var(--text);
  background: rgba(11,15,23,0.62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0,242,254,0.35);
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
  transition: background var(--dur-base), color var(--dur-base), transform 300ms var(--ease-out-expo), box-shadow var(--dur-base);
}
.ver3d-btn svg { color: var(--accent); transition: transform 600ms var(--ease-out-expo), color var(--dur-base); }
.ver3d-btn:hover { background: var(--accent); color: #04121a; transform: translateY(-2px); box-shadow: var(--shadow-accent); }
.ver3d-btn:hover svg { color: #04121a; transform: rotate(-30deg); }
.ver3d-btn:active { transform: translateY(0) scale(0.97); }
.ver3d-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ver3d-btn::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  border: 1px solid var(--accent); opacity: 0; animation: ver3d-ping 2.8s var(--ease-out-expo) infinite;
}
@keyframes ver3d-ping { 0% { opacity: 0.7; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.18, 1.5); } }
@media (prefers-reduced-motion: reduce) { .ver3d-btn::before { display: none; } }
/* corrige el fondo de las tarjetas de métodos: la regla .metodo-card > * lo
   dejaba en relative con altura 0 y la foto nunca se veía */
.metodo-card > .metodo-card-bg { position: absolute; z-index: 0; }
/* en las tarjetas de métodos (sus hijos son relative por defecto) */
.metodo-card > .ver3d-btn { position: absolute; top: 1.25rem; left: auto; right: 1.25rem; }

/* ══════════════════════════════════════
   Visor 3D (pantalla completa)
══════════════════════════════════════ */
.v3d {
  position: fixed; inset: 0; z-index: 2000; background: #05070b; color: var(--text);
  opacity: 0; transition: opacity 400ms var(--ease-out-expo);
}
.v3d.is-open { opacity: 1; }
.v3d[hidden] { display: none; }
.v3d h2 { color: var(--text); }
.v3d-stage { position: absolute; inset: 0; overflow: hidden; }
.v3d-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.v3d-stage canvas:active { cursor: grabbing; }
.v3d-stage::after {           /* viñeta */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(5,7,11,0) 55%, rgba(5,7,11,0.55) 100%);
}

.v3d-glass {
  background: rgba(11,15,23,0.6); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-md);
}

.v3d-top {
  position: absolute; z-index: 2; top: 0; left: 0; right: 0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1.25rem 1.5rem 4rem;
  background: linear-gradient(to bottom, rgba(5,7,11,0.85), rgba(5,7,11,0));
  pointer-events: none;
}
.v3d-top > * { pointer-events: auto; }
.v3d-kicker { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
#v3d-title { font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 800; line-height: 1.1; margin-top: 0.2rem; letter-spacing: -0.01em; }
.v3d-sub { font-size: 0.875rem; color: var(--text-muted); margin-top: 0.25rem; max-width: 34rem; }

.v3d-actions { display: flex; align-items: center; gap: 0.75rem; }
.v3d-modes { display: flex; gap: 0.2rem; padding: 0.3rem; border-radius: 999px; }
.v3d-modes button {
  border: 0; background: none; color: var(--text-muted); cursor: pointer;
  font: 600 0.8rem "Inter", sans-serif; padding: 0.55rem 0.95rem; border-radius: 999px;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.v3d-modes button:hover { color: var(--text); }
.v3d-modes button[aria-pressed="true"] { color: #04121a; background: var(--accent); }

.v3d-close {
  width: 44px; height: 44px; flex: none; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: var(--text);
  transition: background var(--dur-fast), transform var(--dur-fast);
}
.v3d-close:hover { background: rgba(0,242,254,0.15); transform: rotate(90deg); }

/* miniaturas de espacios */
.v3d-bottom {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
  padding: 3rem 1.5rem 1.25rem;
  background: linear-gradient(to top, rgba(5,7,11,0.85), rgba(5,7,11,0));
  pointer-events: none;
}
.v3d-bottom > * { pointer-events: auto; }
.v3d-thumbs { display: flex; gap: 0.6rem; max-width: 100%; overflow-x: auto; padding: 0.25rem; scrollbar-width: none; }
.v3d-thumbs::-webkit-scrollbar { display: none; }
.v3d-thumbs button {
  position: relative; flex: none; width: 120px; height: 68px; border-radius: 10px; cursor: pointer;
  background-size: cover; background-position: center;
  border: 1px solid var(--border-md); overflow: hidden; opacity: 0.6;
  transition: opacity var(--dur-base), border-color var(--dur-base), transform 300ms var(--ease-out-expo);
}
.v3d-thumbs button::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(5,7,11,0.85), rgba(5,7,11,0) 70%); }
.v3d-thumbs button span {
  position: absolute; z-index: 1; left: 0.5rem; right: 0.5rem; bottom: 0.4rem;
  font: 600 0.68rem/1.2 "Inter", sans-serif; color: var(--text); text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.v3d-thumbs button:hover { opacity: 0.9; transform: translateY(-2px); }
.v3d-thumbs button[aria-selected="true"] { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-accent); }
.v3d-hint { font-size: 0.75rem; color: rgba(248,250,252,0.6); }

.v3d-modes button:focus-visible, .v3d-close:focus-visible, .v3d-thumbs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* loader */
.v3d-loader {
  position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 1rem;
  color: var(--text-muted); font-size: 0.875rem; background: rgba(5,7,11,0.85);
}
.v3d-loader[hidden] { display: none; }
.v3d-loader i {
  width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid rgba(0,242,254,0.15); border-top-color: var(--accent);
  animation: v3d-spin 0.9s linear infinite;
}
@keyframes v3d-spin { to { transform: rotate(360deg); } }

@media (max-width: 767px) {
  .v3d-top { flex-wrap: wrap; padding: 1rem 1rem 3rem; }
  .v3d-top > div:first-child { flex: 1; min-width: 0; }
  .v3d-actions { order: 3; width: 100%; }
  .v3d-modes { flex: 1; }
  .v3d-modes button { flex: 1; padding: 0.5rem 0.4rem; }
  .v3d-thumbs button { width: 96px; height: 56px; }
  .v3d-hint { display: none; }
}
