/* Visor 3D CPD Titán — estilos del componente (se cargan igual en WordPress).
   Todos los selectores van bajo .t3d para que los estilos globales del tema/Elementor
   (h3, p, button…) no los pisen. */
.t3d {
  --t3d-navy: #041321;
  --t3d-gold: #e7c56c;
  --t3d-gold-dark: #9e7824;
  --t3d-text: #e9edf5;
  --t3d-muted: #9aa6bb;
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  background: radial-gradient(120% 90% at 70% 20%, #0b2340 0%, #020a13 70%);
  min-height: 420px;
  aspect-ratio: 4 / 3.4;
  max-height: min(78vh, 680px); /* a todo el ancho no ocupa más que la pantalla */
  color: var(--t3d-text);
  font-family: Roboto, Arial, sans-serif;
  line-height: 1.4;
  text-align: left;
  isolation: isolate;
  box-sizing: border-box;
}
.t3d *, .t3d *::before, .t3d *::after { box-sizing: border-box; }
.t3d .t3d-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: none; display: block; cursor: grab; }
.t3d .t3d-canvas:active { cursor: grabbing; }
.t3d .t3d-fade { position: absolute; inset: 0; background: #020a13; opacity: 0; pointer-events: none; transition: opacity .35s ease; z-index: 3; }
.t3d .t3d-fade.on { opacity: 1; }

.t3d .t3d-hud { position: absolute; left: 16px; bottom: 16px; max-width: min(300px, calc(100% - 150px)); z-index: 2; pointer-events: none; }
.t3d .t3d-card {
  background: rgba(4, 19, 33, .78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(231, 197, 108, .28);
  border-radius: 12px;
  padding: 14px 16px 12px;
}
.t3d .t3d-title { margin: 0 0 6px; padding: 0; font: 600 18px/1.25 Roboto, Arial, sans-serif; color: var(--t3d-gold); letter-spacing: .01em; text-transform: none; }
.t3d .t3d-text { margin: 0 0 10px; padding: 0; font: 400 13px/1.5 Roboto, Arial, sans-serif; color: var(--t3d-text); min-height: 3em; }
.t3d .t3d-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.t3d .t3d-steps li { counter-increment: s; position: relative; margin: 0; padding: 3px 0 3px 28px; font: 400 12.5px/1.4 Roboto, Arial, sans-serif; color: var(--t3d-muted); transition: color .3s; list-style: none; }
.t3d .t3d-steps li::before {
  content: counter(s); position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid rgba(154, 166, 187, .5); font-size: 11px; line-height: 17px; text-align: center; transition: all .3s;
}
.t3d .t3d-steps li.done { color: var(--t3d-text); }
.t3d .t3d-steps li.done::before { background: var(--t3d-gold-dark); border-color: var(--t3d-gold); color: #fff; content: '✓'; }
.t3d .t3d-steps li.now::before { background: var(--t3d-gold); color: var(--t3d-navy); content: counter(s); box-shadow: 0 0 0 4px rgba(231, 197, 108, .2); }

.t3d .t3d-tools { position: absolute; right: 14px; bottom: 14px; z-index: 2; display: flex; gap: 8px; }
.t3d .t3d-btn {
  font: 500 13px/1.2 Roboto, Arial, sans-serif; color: var(--t3d-navy); background: var(--t3d-gold);
  border: 0; border-radius: 999px; padding: 8px 14px; margin: 0; cursor: pointer; text-transform: none; letter-spacing: 0;
  box-shadow: none; transition: transform .15s, background .15s;
}
.t3d .t3d-btn:hover { background: #f1d68d; color: var(--t3d-navy); transform: translateY(-1px); }
.t3d .t3d-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.t3d .t3d-hint { position: absolute; right: 16px; top: 14px; z-index: 2; font-size: 12px; color: var(--t3d-muted); pointer-events: none; transition: opacity .6s; }
.t3d.t3d-touched .t3d-hint { opacity: 0; }
.t3d .t3d-loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: var(--t3d-muted); }
.t3d.t3d-ready .t3d-loading { display: none; }
.t3d.t3d-nogl { background-size: contain; background-repeat: no-repeat; background-position: center; }
.t3d.t3d-nogl .t3d-loading { display: none; }

/* Interacción: cursor y etiqueta del objeto bajo el ratón */
.t3d .t3d-canvas.t3d-pointer { cursor: pointer; }
.t3d .t3d-tip {
  position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; max-width: 260px;
  padding: 6px 10px; border-radius: 8px; font-size: 12px; line-height: 1.35; color: var(--t3d-text);
  background: rgba(4, 19, 33, .9); border: 1px solid rgba(231, 197, 108, .45);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.t3d .t3d-tip[hidden] { display: none; }

/* Visor estrecho (columna de Elementor, tablet): panel compacto */
.t3d { container-type: inline-size; }
@container (max-width: 760px) {
  .t3d .t3d-hud { max-width: min(270px, calc(100% - 140px)); left: 12px; bottom: 12px; }
  .t3d .t3d-card { padding: 10px 12px; }
  .t3d .t3d-title { font-size: 15px; margin-bottom: 4px; }
  .t3d .t3d-hud .t3d-text { font-size: 12px; min-height: 0; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .t3d .t3d-steps li:not(.now) { display: none; }
  .t3d .t3d-steps li { font-size: 12px; }
}

@media (max-width: 640px) {
  .t3d { aspect-ratio: 3 / 4; min-height: 0; }
  .t3d .t3d-hud { left: 10px; top: 10px; bottom: auto; right: 10px; max-width: none; }
  .t3d .t3d-hint { display: none; }
  .t3d .t3d-card { padding: 10px 12px; }
  .t3d .t3d-title { font-size: 16px; }
  .t3d .t3d-text { font-size: 12.5px; min-height: 0; }
  .t3d .t3d-steps { display: none; }
}
@media (prefers-reduced-motion: reduce) { .t3d .t3d-fade, .t3d .t3d-btn { transition: none; } }

/* Elementor: el widget Shortcode que contiene el visor ocupa todo el ancho de su contenedor */
.elementor-widget-shortcode:has(.titan3d-viewer) { width: 100%; max-width: 100%; }

/* Clase para el contenedor de Elementor del visor: se queda fijo al hacer scroll junto a las tarjetas (escritorio) */
@media (min-width: 1025px) {
  .titan3d-sticky { position: sticky !important; top: var(--titan3d-sticky-top, 120px); align-self: flex-start; }
}

/* Botones / tarjetas de Elementor que lanzan una escena (clase CSS titan-scene-…) */
[class*="titan-scene-"], [data-titan-scene] { cursor: pointer; transition: box-shadow .25s, transform .25s; border-radius: 12px; }
[class*="titan-scene-"]:hover, [data-titan-scene]:hover { transform: translateY(-2px); }
[class*="titan-scene-"].titan-active, [data-titan-scene].titan-active { box-shadow: 0 0 0 1px #e7c56c, 0 8px 24px rgba(231, 197, 108, .15); }
