/* ============================================================
   Tagora — Features Únicos (features-unicos.html)
   ============================================================ */

/* ── Main ── */
.page-main { flex: 1; width: 100%; }

/* ── Secciones oscuras ── */
.section-dark {
  background: linear-gradient(to bottom right, #0f172a, #020617);
  padding: 6rem 1.5rem;
  position: relative; overflow: hidden;
}
/* Menos padding inferior acerca el título "Tagora Dot" al visor de abajo;
   solo aplica al hero del Dot. */
.section-dark--hero   { padding-top: 6rem; padding-bottom: 1.5rem; }
.section-dark--border { border-bottom: 1px solid #1e293b; }

/* ── Sección clara (Presencia) ── */
.section-light {
  background: #f8fafc;
  padding: 6rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

/* ── Encabezados de sección ── */
.section-heading { text-align: center; margin-bottom: 4rem; }
.section-heading h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800; margin: 0 0 1rem;
}
.section-heading p { font-size: 1.125rem; margin: 0; }
.section-heading--dark h2 { color: #fff; }
.section-heading--dark p  { color: #94a3b8; }
.section-heading--light h2 { color: #0f172a; }
.section-heading--light p  { color: #64748b; font-weight: 500; }

/* ── Visor 3D del Dot ── */
/* ==========================================================================
   Visor 3D y Lienzo de Producto — Tagora Dot
   ========================================================================== */

/* Usa el mismo degradado que .section-dark para continuidad visual;
   max-height es solo un límite de seguridad, no el tamaño real. */
.viewer-section {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(to bottom right, #0f172a, #020617);
  border-top: 1px solid #1e293b;
  border-bottom: 1px solid #1e293b;
  padding: 1.5rem 0; max-height: 400px;
  position: relative; overflow: hidden;
}

/* Sin fondo propio: se ve el degradado de .viewer-section a través del disco.
   justify-content:flex-start evita que el canvas 3D quede bajo el botón de alternar. */
.viewer-3d {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  width: 100%; max-width: 460px; margin: 0 auto; aspect-ratio: 4 / 3;
  max-height: 350px;
  background: transparent; border: none; box-shadow: none;
  position: relative; overflow: hidden; z-index: 10;
}
/* Alternativa sin soporte de aspect-ratio: fija una altura explícita. */
@supports not (aspect-ratio: 1) {
  .viewer-3d { height: 345px; }
}

/* Bajo 768px, .viewer-section no tiene padding horizontal: se limita el
   ancho a 280px para que el disco no se vea sobredimensionado. */
@media (max-width: 767.98px) {
  .viewer-3d {
    max-width: 280px; aspect-ratio: auto; height: 300px; max-height: 300px;
  }
  #dot-canvas-placeholder { max-width: 280px; }
}

/* Ajuste responsivo para el visor ST6952 en móvil: reduce el tamaño de
   .model-viewer y centra la imagen de respaldo para evitar que se vea
   sobredimensionada. */
@media (max-width: 767.98px) {
  .model-viewer {
    width: 100%; max-width: 280px; height: 300px; max-height: 300px;
  }
  #canvas-placeholder {
    width: 100%; height: auto; max-height: 280px;
    object-fit: contain; object-position: center;
  }
}

/* Tablet (iPad 768-1023px): a mitad de camino entre el recorte móvil y el
   ancho completo de escritorio, .viewer-3d/.model-viewer con sus anchos base
   (460px/420px) quedan sobredimensionados para el viewport y el modelo choca
   contra el botón "Ver en 3D". Se limita el ancho igual que en móvil. */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .viewer-3d,
  .model-viewer {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem;
    max-width: 340px; margin: 0 auto;
    height: auto; max-height: none;
  }
  /* #canvas-container/#dot-canvas-container quedan como flex item real (sin
     position propio); se les da una altura concreta ya que el 320px fijo de
     .model-viewer/.viewer-3d ya no aplica en este rango. */
  #canvas-container,
  #dot-canvas-container {
    height: 220px;
  }
  /* .model-placeholder sigue absolute (superpuesto a #canvas-container para
     el crossfade con el canvas en vivo); left:50%+translateX centra el ancho
     auto sin depender de la resolución de left+right+width:auto en un
     elemento reemplazado. bottom:auto anula la reserva de 4.5rem del botón,
     que ya no hace falta porque el botón deja de ser absolute en este rango. */
  .model-placeholder {
    top: 0; left: 50%; right: auto; bottom: auto; transform: translateX(-50%);
    height: auto; max-height: 220px; width: auto;
    object-fit: contain; object-position: center;
  }
  /* .tagora-3d-toggle se inyecta vía JS (assets/model.js/model-dot.js) con
     position:absolute; se necesita más especificidad que su selector de
     clase (.tagora-3d-toggle, 0-1-0) para ganarle sin !important, ya que ese
     <style> se añade al <head> después de este archivo. */
  .viewer-3d .tagora-3d-toggle,
  .model-viewer .tagora-3d-toggle {
    position: relative; left: auto; bottom: auto; transform: none;
    margin-top: 1rem; z-index: 10;
  }
}

/* ── Tarjetas blancas (sección Presencia) ── */
.card--white {
  background: #fff; border-radius: 2rem;
  padding: 2rem; border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgb(0 0 0 / .05);
  transition: box-shadow 0.3s;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.card--white:hover { box-shadow: 0 4px 6px -1px rgb(0 0 0 / .07); }
.card--white h3 { font-size: 1.25rem; font-weight: 700; color: #0f172a; margin: 0 0 0.75rem; }
.card--white p  { font-size: 0.875rem; color: #64748b; line-height: 1.625; margin: 0; }

/* ── Panel de protocolos ── */
.protocol-panel {
  background: rgb(30 41 59 / .30);
  backdrop-filter: blur(12px);
  border-radius: 2.5rem; padding: 2.5rem;
  border: 1px solid rgb(51 65 85 / .50);
  margin-top: 6rem;
}
@media (min-width: 768px) { .protocol-panel { padding: 3.5rem; } }
.protocol-panel > h3 {
  font-size: 1.5rem; font-weight: 800; color: #fff;
  text-align: center; margin: 0 0 3rem;
}
.protocol-item { text-align: center; display: flex; flex-direction: column; align-items: center; }
.icon-box--protocol {
  width: 3.5rem; height: 3.5rem; border-radius: 9999px;
  background: rgb(30 41 59 / .80); border: 1px solid #334155;
  display: flex; align-items: center; justify-content: center;
  color: #cbd5e1; margin-bottom: 1.25rem;
  box-shadow: inset 0 2px 4px rgb(0 0 0 / .30);
}
.protocol-item h4 {
  font-size: 0.75rem; font-weight: 700; color: #fff;
  text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 0.5rem;
}
.protocol-item p { font-size: 0.75rem; color: #94a3b8; line-height: 1.625; max-width: 8.75rem; margin: 0; }

/* ── Escenarios ── */
.scenario-section {
  max-width: 80rem; margin: 0 auto;
  padding: 3rem 1.5rem 0;
}
@media (min-width: 768px) { .scenario-section { padding-top: 5rem; } }
.scenario-grid {
  display: grid; grid-template-columns: 1fr; gap: 3rem;
}
@media (min-width: 768px) {
  .scenario-grid { grid-template-columns: repeat(2, 1fr); gap: 4rem; align-items: stretch; }
}
.scenario-col { display: flex; flex-direction: column; }
.scenario-title-slot {
  height: 4rem; display: flex; align-items: flex-end; justify-content: center;
  margin-bottom: 1.5rem;
}
.scenario-title-slot h3 {
  width: 100%;
  font-size: 1rem; font-weight: 800; color: #1e293b;
  text-align: center; text-transform: uppercase;
  letter-spacing: 0.05em; line-height: 1.375; margin: 0;
}
@media (min-width: 768px) { .scenario-title-slot h3 { font-size: 1.125rem; } }
.scenario-img-wrap {
  height: 20rem; display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.5rem;
}
@media (min-width: 768px) { .scenario-img-wrap { height: 24rem; } }
.scenario-img {
  max-height: 100%; max-width: 100%; object-fit: contain;
  transform: scale(1.1);
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / .05));
}
.cta-box {
  flex: 1; position: relative; overflow: hidden;
  border-radius: 1.5rem; background: #fff;
  border: 1px solid #e2e8f0; padding: 2rem 1.5rem;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / .10);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
}
.cta-box__inner { position: relative; z-index: 10; width: 100%; }
.cta-badge {
  display: inline-block;
  background: #eff6ff; color: #2563eb;
  font-size: 10px; font-weight: 800;
  padding: 0.5rem 1rem; border-radius: 9999px;
  text-transform: uppercase; letter-spacing: 0.1em;
  border: 1px solid #bfdbfe; margin-bottom: 1rem;
}
.cta-text {
  color: #0f172a; font-size: 1.125rem; font-weight: 700;
  font-family: 'Outfit', 'Inter', sans-serif; line-height: 1.375;
  margin: 0;
}
.cta-text a { color: #2563eb; text-decoration: underline; text-underline-offset: 2px; }
.cta-text a:hover { color: #3b82f6; }
.text-accent { color: #2563eb; }

/* ==========================================================================
   Visor 3D y Lienzo de Producto — ST6952
   ========================================================================== */

/* Se mantiene el padding horizontal (a diferencia de .viewer-section) porque
   el título necesita margen respecto al borde en móvil; los márgenes evitan
   que la sección toque las tarjetas .cta-box de arriba. */
.model-section {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1.5rem;
  margin-top: 2rem; margin-bottom: 2rem;
  background: linear-gradient(to bottom right, #0f172a, #020617);
  border-top: 1px solid #1e293b; border-bottom: 1px solid #1e293b;
  position: relative; overflow: hidden;
}
.title-st6952 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800; color: #fff; text-align: center;
  margin: 0 0 0.75rem; position: relative; z-index: 10;
}

/* Sin fondo propio: flota sobre el degradado de .model-section;
   justify-content:flex-start reserva espacio para el botón de alternar. */
.model-viewer {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  width: 90%; max-width: 420px; margin: 0 auto;
  height: 320px; max-height: 320px;
  background: transparent; border: none; box-shadow: none;
  position: relative; overflow: hidden; z-index: 10;
}

/* Host compartido para ambos canvases 3D; se acorta 4.5rem para que el
   canvas en vivo no renderice bajo el botón de alternar. El tamaño va en
   CSS (no inline) para que esta regla pueda aplicarse sin !important. */
#canvas-container,
#dot-canvas-container {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: calc(100% - 4.5rem);
  background: transparent; border: none; box-shadow: none;
}

/* ==========================================================================
   Cuadrícula de Features — Centrado de la Última Tarjeta
   ========================================================================== */
/* Centra la 5ª tarjeta cuando queda sola en su fila (.grid-4 es 4 columnas
   desde 1024px); solo aplica desde 768px, antes es una sola columna. */
@media (min-width: 768px) {
  .grid-4 > *:last-child:nth-child(5) {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: 320px;
  }
}

/* ── Catálogo de dispositivos ────────────────────────────────── */
/* No hay reset global de box-sizing en el sitio; se aplica solo dentro de
   #catalog-root para que el padding no ensanche el contenido. */
#catalog-root,
#catalog-root *,
#catalog-root *::before,
#catalog-root *::after {
  box-sizing: border-box;
}

.catalog-wrap {
  padding: 2rem 1.5rem 6rem;
  max-width: 80rem; margin: 0 auto; width: 100%;
}
.catalog-panel {
  background: #fff; border-radius: 3rem;
  padding: 2.5rem; border: 1px solid #f1f5f9;
  box-shadow: 0 20px 50px -12px rgb(0 0 0 / .05);
  position: relative; overflow: hidden;
}
@media (min-width: 768px) { .catalog-panel { padding: 3.5rem 3.5rem 8rem 3.5rem; } }
.catalog-inner { position: relative; z-index: 10; }
.catalog-heading { text-align: center; margin-bottom: 4rem; }
.catalog-heading h3 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800; color: #1e293b; margin: 0 0 1.5rem;
}
.catalog-heading p { font-size: 1.125rem; color: #64748b; margin: 0; }
.catalog-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem;
}
@media (min-width: 1024px) { .catalog-grid { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }
@media (min-width: 1280px) { .catalog-grid { grid-template-columns: repeat(4, 1fr); } }

/* Bajo ~520px, 2 columnas dejan cada tarjeta muy angosta y la etiqueta se
   encima con la imagen; una sola columna da más ancho a cada una. */
@media (max-width: 520px) {
  .catalog-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* ── Tarjeta de dispositivo ── */
.device-card {
  position: relative; background: #f8fafc;
  border-radius: 1.5rem; border: 1px solid #f1f5f9;
  overflow: hidden; cursor: pointer;
  min-height: 320px;
  aspect-ratio:auto;
  display: flex; flex-direction: column;
  transition: border-color 0.3s, box-shadow 0.5s;
  min-width: 0;
}
.device-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 25px 50px -12px rgb(30 58 138 / .10);
}
.device-card__tag {
  position: absolute; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 20;
  background: rgb(255 255 255 / .90); backdrop-filter: blur(8px);
  color: #475569; font-size: 10px; font-weight: 800;
  padding: 0.375rem 0.75rem; border-radius: 9999px;
  text-transform: uppercase; letter-spacing: 0.05em;
  border: 1px solid #e2e8f0; transition: color 0.3s;
}
.device-card:hover .device-card__tag { color: #2563eb; }
.device-card__img-wrap {
  flex: 1; width: 100%; height: 180px; min-height: 140px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  /* Padding superior extra reserva espacio para .device-card__tag y evita
     que la imagen se solape con la etiqueta. */
  padding: 2.75rem 1.5rem 1.5rem;
  background: linear-gradient(to bottom, transparent, rgb(226 232 240 / .20));
  transition: background 0.5s;
}
.device-card:hover .device-card__img-wrap {
  background: linear-gradient(to bottom, transparent, rgb(226 232 240 / .40));
}
.device-card__img {
  /* Sin padding propio: .device-card__img-wrap ya centra con padding
     simétrico, evitando que la imagen se vea descentrada. */
  display: block; margin: auto; width: 100%; height: 100%;
  object-fit: contain; max-height: 85%; max-width: 85%;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / .05));
  transition: transform 0.7s; z-index: 10;
}
.device-card:hover .device-card__img { transform: scale(1.1) translateY(-4px); }
.device-card__footer {
  background: #fff; padding: 1.25rem;
  border-top: 1px solid #f1f5f9; z-index: 20; flex-shrink: 0;
  /* align-items:center centra el título y el CTA horizontalmente bajo la
     imagen. */
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 0.75rem 1rem 0.875rem;
  gap: 0.25rem;
  margin-top: auto;
}
.device-card__name {
  font-weight: 800; color: #1e293b;
  font-size: 0.875rem;
  text-align: center;
}
@media (min-width: 768px) { .device-card__name { font-size: 1rem; } }
.device-card__cta {
  /* Fila horizontal (texto + flecha); el centrado lo aporta
     .device-card__footer. */
  display: flex; align-items: center; gap: 0.25rem;
  color: #2563eb; font-size: 0.75rem;
  font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em;
}
.device-card__arrow { transition: transform 0.3s; flex-shrink: 0; display: block; }
.device-card:hover .device-card__arrow { transform: translateX(6px); }

/* ── Modal ── */
@keyframes zoom-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.device-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
@media (min-width: 768px) { .device-modal { padding: 2rem; } }
.device-modal__bg {
  position: absolute; inset: 0;
  background: rgb(2 6 23 / .70); backdrop-filter: blur(4px);
}
.device-modal__box {
  position: relative; z-index: 10; background: #fff;
  border-radius: 2.5rem; box-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);
  width: 100%; max-width: 42rem; max-height: 90vh;
  overflow-y: auto; display: flex; flex-direction: column;
  animation: zoom-in 0.2s ease-out;
}
.device-modal__header {
  position: relative; background: #0f172a;
  border-radius: 2.5rem 2.5rem 0 0;
  padding: 2.5rem 2rem 2rem; overflow: hidden; flex-shrink: 0;
}
.device-modal__close {
  position: absolute; top: 1.25rem; right: 1.25rem;
  background: #1e293b; color: #94a3b8;
  padding: 0.5rem; border-radius: 0.75rem;
  border: none; cursor: pointer; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.device-modal__close:hover { background: #334155; color: #fff; }
.device-modal__hero { display: flex; align-items: center; gap: 1.5rem; position: relative; z-index: 10; min-width: 0; flex-wrap: wrap; }
.device-modal__thumb {
  width: 6rem; height: 6rem; flex-shrink: 0;
  background: rgb(255 255 255 / .10); border-radius: 1rem;
  border: 1px solid rgb(255 255 255 / .10);
  display: flex; align-items: center; justify-content: center;
  padding: 0.5rem; overflow: hidden;
}
.device-modal__thumb img { object-fit: contain; max-height: 100%; max-width: 100%; }
.device-modal__badge {
  display: inline-block;
  background: rgb(59 130 246 / .20); color: #60a5fa;
  font-size: 10px; font-weight: 800;
  padding: 0.375rem 0.75rem; border-radius: 9999px;
  text-transform: uppercase; letter-spacing: 0.1em;
  border: 1px solid rgb(59 130 246 / .20); margin-bottom: 0.75rem;
}
.device-modal__title {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 800; color: #fff; line-height: 1.2; margin: 0;
}
.device-modal__subtitle { color: #94a3b8; font-size: 0.875rem; font-weight: 600; margin: 0.25rem 0 0; }
.device-modal__body { flex: 1; overflow-y: auto; }
.device-modal__abstract { padding: 2rem 2rem 1.5rem; }
.device-modal__abstract h4 { color: #1e293b; font-weight: 700; margin: 0 0 0.5rem; }
.device-modal__abstract p  { color: #64748b; font-size: 0.875rem; line-height: 1.625; margin: 0; }
.device-modal__specs { padding: 0 2rem 2rem; }
.spec-list {
  display: flex; flex-direction: column; gap: 0.75rem;
  list-style: none; padding: 0; margin: 0;
}
.spec-item {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1rem; background: #f8fafc;
  border-radius: 1rem; border: 1px solid #f1f5f9;
  transition: border-color 0.2s, background 0.2s;
}
.spec-item:hover { border-color: #bfdbfe; background: rgb(239 246 255 / .30); }
.spec-item__icon {
  margin-top: 0.125rem; color: #3b82f6;
  background: #eff6ff; padding: 0.5rem;
  border-radius: 0.75rem; border: 1px solid #bfdbfe;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.spec-item__label {
  font-size: 11px; font-weight: 800; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.1em;
  margin: 0 0 0.25rem; display: block;
}
.spec-item__value { color: #1e293b; font-weight: 600; font-size: 0.875rem; line-height: 1.375; margin: 0; }
.device-modal__dl { margin: 0 2rem; padding: 1.5rem 0 2rem; border-top: 1px solid #f1f5f9; }
.device-modal__dl-btn {
  display: flex; width: 100%; align-items: center; justify-content: center;
  gap: 0.5rem; background: #2563eb; color: #fff;
  font-weight: 700; padding: 0.875rem 1.5rem;
  border-radius: 1rem; text-decoration: none;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 4px 6px -1px rgb(37 99 235 / .20);
}
.device-modal__dl-btn:hover  { background: #1d4ed8; }
.device-modal__dl-btn:active { transform: scale(0.97); }

/* ==========================================================================
   Imágenes de Respaldo (WebP) — Ambos Visores 3D
   ========================================================================== */
/* Aplica a #dot-canvas-placeholder y #canvas-placeholder; bottom:4.5rem
   reserva espacio para el botón y object-fit:contain evita recortar la foto. */
.model-placeholder {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 4.5rem;
  height: auto;
  object-fit: contain;
  object-position: top;
  padding: 12px;
  box-sizing: border-box;
  background: transparent; border: none; box-shadow: none;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.model-placeholder.is-hidden { opacity: 0; }
