/**
 * impresion.css — Portada de XETA 3D STUDIO:
 *   - Hero "El Pensador capa a capa" (template-parts/hero-print.php)
 *   - Sección de impresión 3D (template-parts/print-section.php)
 *
 * Fondo oscuro con sesgo cian, neón naranja para la pieza física
 * y cian para el archivo digital.
 *
 * @package Astra Child - Xeta 3D Studio
 */

/* ==========================================================================
   Portada a ancho completo (Astra)
   ========================================================================== */
html,
body.home {
  overflow-x: clip;
}

body.home,
body.home #page,
body.home #content,
body.home #content > .ast-container,
body.home .site-content,
body.home .site-content > .ast-container,
body.home #primary,
body.home .xeta-front-page {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  background-color: #030b0e !important;
  box-sizing: border-box !important;
}

.xeta-print {
  --xp-bg: #030b0e;
  --xp-panel: #0e1417;
  --xp-panel-2: #131b1f;
  --xp-line: #1f2c34;
  --xp-fg: #e4e7ea;
  --xp-muted: #93a2ac;
  --xp-orange: #ff6a1a;
  --xp-orange-soft: #ffb68c;
  --xp-cyan: #68dcf7;
  --xp-cyan-deep: #0f3a45;

  position: relative;
  width: 100%;
  background: var(--xp-bg);
  color: var(--xp-fg);
  font-family: var(--font-text, "Plus Jakarta Sans", system-ui, sans-serif);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  scroll-margin-top: 90px;
}

.xeta-print *,
.xeta-print *::before,
.xeta-print *::after {
  box-sizing: border-box;
}

.xeta-print h1,
.xeta-print h2,
.xeta-print h3 {
  font-family: var(--font-heading, "Space Grotesk", sans-serif);
  color: var(--xp-fg);
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}
.xeta-print h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  line-height: 1.1;
}
.xeta-print p {
  margin: 0;
}
.xeta-print :focus-visible {
  outline: 2px solid var(--xp-cyan);
  outline-offset: 2px;
  border-radius: 4px;
}

.xp-eyebrow {
  font-family: var(--font-mono, "Roboto Mono", ui-monospace, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--xp-cyan);
}
.xp-lead {
  color: var(--xp-muted);
  max-width: 62ch;
  font-size: 1.02rem;
}

/* ==========================================================================
   Botones
   ========================================================================== */
.xp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.xp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1.35rem;
  border-radius: 12px;
  font-family: var(--font-text, "Plus Jakarta Sans", sans-serif);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}
.xp-btn--primary {
  color: #ffffff !important;
  background: linear-gradient(135deg, #ff7a1f 0%, #ff5500 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    0 4px 16px rgba(255, 102, 0, 0.32);
}
.xp-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.45),
    0 8px 22px rgba(255, 102, 0, 0.45);
}
.xp-btn--ghost {
  color: var(--xp-fg) !important;
  background: rgba(7, 10, 12, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.xp-btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}
.xp-btn--block {
  width: 100%;
}

/* ==========================================================================
   1. Hero
   ========================================================================== */
.xp-hero {
  position: relative;
  height: clamp(560px, 92vh, 820px);
  overflow: hidden;
  background: radial-gradient(
    ellipse 70% 70% at 64% 42%,
    #0d1d23 0%,
    var(--xp-bg) 72%
  );
  border-bottom: 1px solid var(--xp-line);
}
/* Hero principal de la portada: ocupa la pantalla bajo el header */
.xp-hero--main {
  height: clamp(640px, calc(100svh - 96px), 940px);
}
.xp-hero--main .xp-hero__copy > * {
  max-width: 600px;
}
.xp-hero--main .xp-hero__title {
  font-size: clamp(2.3rem, 4.4vw, 4rem) !important;
}
.xp-hero--main .xp-hero__lead {
  max-width: 46ch;
}

.xp-hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.6s ease;
  /* Arrastrar gira la pieza; el scroll vertical sigue funcionando en móvil */
  touch-action: pan-y;
  cursor: grab;
}
.xp-hero__canvas:active {
  cursor: grabbing;
}
.xp-hero__canvas.is-ready {
  opacity: 1;
}

.xp-hero__copy {
  position: relative;
  z-index: 1;
  width: min(1600px, 100%);
  height: 100%;
  margin: 0 auto;
  padding: clamp(28px, 8vh, 72px) 20px 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  pointer-events: none;
}
.xp-hero__copy > * {
  max-width: 470px;
}
.xp-hero__copy .xp-actions {
  pointer-events: auto;
}
.xp-hero__title {
  font-size: clamp(2.5rem, 5.6vw, 4.6rem) !important;
  line-height: 0.95 !important;
  letter-spacing: -0.045em !important;
}
.xp-file {
  color: var(--xp-cyan);
}
.xp-hot {
  color: var(--xp-orange);
}
.xp-hero__lead {
  color: var(--xp-muted);
  font-size: 1rem;
  max-width: 40ch;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}

.xp-hud {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: 90vw;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding: 12px 16px;
  border: 1px solid var(--xp-line);
  border-radius: 12px;
  background: rgba(9, 14, 17, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.xp-hud__controls {
  flex: 1 1 260px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.xp-hud__play {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--xp-line);
  background: var(--xp-panel-2);
  color: var(--xp-fg);
  cursor: pointer;
}
.xp-hud__play:hover {
  border-color: var(--xp-orange);
  background: var(--xp-panel-2);
  color: var(--xp-fg);
}
.xp-hud__scrub {
  flex: 1;
  min-width: 0;
  accent-color: var(--xp-orange);
  cursor: pointer;
}
.xp-hud__readout {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-family: var(--font-mono, "Roboto Mono", monospace);
  font-size: 0.78rem;
  color: var(--xp-muted);
}
.xp-hud__readout b {
  color: var(--xp-fg);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.xp-hud__z b {
  color: var(--xp-orange-soft);
}

/* ==========================================================================
   Contenedor y secciones
   ========================================================================== */
.xp-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 88px 20px 96px;
  display: flex;
  flex-direction: column;
  gap: 104px;
}
.xp-section {
  scroll-margin-top: 110px;
}
.xp-section__head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

/* ==========================================================================
   2. Cómo funciona
   ========================================================================== */
.xp-steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 32px;
  align-items: stretch;
}
.xp-steps__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--xp-line);
}
.xp-steps__list li {
  border-bottom: 1px solid var(--xp-line);
}
.xp-step {
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  padding: 20px 12px 20px 0;
  background: none;
  border: 0;
  text-align: left;
  color: var(--xp-muted);
  font: inherit;
  cursor: pointer;
  position: relative;
}
/* Avance del paso activo: lo controla impresion.js (--xp-progress de 0 a 1),
   así se pausa junto con la animación */
.xp-step::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: 100%;
  background: var(--xp-orange);
  transform: scaleX(0);
  transform-origin: left center;
}
.xp-step.is-active::after {
  transform: scaleX(var(--xp-progress, 0));
}
.xp-step__n {
  font-family: var(--font-mono, "Roboto Mono", monospace);
  font-size: 0.85rem;
  color: var(--xp-muted);
  padding-top: 2px;
}
.xp-step__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.xp-step__title {
  font-family: var(--font-heading, "Space Grotesk", sans-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--xp-fg);
  opacity: 0.6;
}
.xp-step__text {
  font-size: 0.92rem;
  line-height: 1.5;
}
.xp-step.is-active .xp-step__n {
  color: var(--xp-orange);
}
.xp-step.is-active .xp-step__title {
  opacity: 1;
}
.xp-step:hover .xp-step__title {
  opacity: 1;
}

.xp-steps__stage {
  position: relative;
  min-height: 420px;
  border: 1px solid var(--xp-line);
  border-radius: 16px;
  overflow: hidden;
  background: radial-gradient(
    ellipse 70% 60% at 50% 45%,
    #0d1d23,
    var(--xp-bg)
  );
}
.xp-steps__stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.xp-steps__caption {
  position: absolute;
  left: 14px;
  top: 14px;
  font-family: var(--font-mono, "Roboto Mono", monospace);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--xp-cyan);
  background: rgba(9, 14, 17, 0.78);
  padding: 6px 10px;
  border-radius: 8px;
}
.xp-steps__caption.is-part {
  color: var(--xp-orange-soft);
}

/* ==========================================================================
   3. Cotizador
   ========================================================================== */
.xp-quote {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  border: 1px solid var(--xp-line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--xp-panel);
}
.xp-quote__viewer {
  position: relative;
  min-height: 460px;
  background: radial-gradient(
    ellipse 70% 60% at 50% 45%,
    #0d1d23,
    var(--xp-bg)
  );
}
.xp-quote__viewer canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.xp-drop {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px dashed #2d4652;
  border-radius: 10px;
  background: rgba(9, 14, 17, 0.8);
  font-size: 0.85rem;
  color: var(--xp-muted);
}
.xp-drop.is-over {
  border-color: var(--xp-cyan);
  color: var(--xp-fg);
}
.xp-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.xp-drop__btn {
  font-family: var(--font-mono, "Roboto Mono", monospace);
  font-size: 0.76rem;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--xp-cyan-deep);
  color: var(--xp-cyan);
  cursor: pointer;
}
.xp-drop__btn:hover {
  border-color: var(--xp-cyan);
}
.xp-drop input:focus-visible + .xp-drop__hint {
  outline: 2px solid var(--xp-cyan);
}
.xp-drop__file {
  font-family: var(--font-mono, "Roboto Mono", monospace);
  font-size: 0.76rem;
  color: var(--xp-fg);
  overflow-wrap: anywhere;
}
.xp-quote__dims {
  position: absolute;
  left: 12px;
  bottom: 12px;
  font-family: var(--font-mono, "Roboto Mono", monospace);
  font-size: 0.76rem;
  color: var(--xp-cyan);
  background: rgba(9, 14, 17, 0.8);
  padding: 6px 10px;
  border-radius: 8px;
}
.xp-quote__controls {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-left: 1px solid var(--xp-line);
  min-width: 0;
}
.xp-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.xp-field__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.xp-field__label {
  font-size: 0.82rem;
  color: var(--xp-muted);
}
.xp-field output {
  font-family: var(--font-mono, "Roboto Mono", monospace);
  font-size: 0.8rem;
  color: var(--xp-fg);
}
.xp-field input[type="range"] {
  width: 100%;
  accent-color: var(--xp-orange);
}
.xp-field input:disabled {
  opacity: 0.35;
}

.xp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.xp-chip {
  font-family: var(--font-mono, "Roboto Mono", monospace);
  font-size: 0.76rem;
  line-height: 1.2;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--xp-line);
  background: transparent;
  color: var(--xp-muted);
  cursor: pointer;
}
.xp-chip:hover {
  color: var(--xp-fg);
  border-color: #35505c;
  background: transparent;
}
.xp-chip[aria-pressed="true"] {
  color: #1a0a00;
  background: var(--xp-orange);
  border-color: var(--xp-orange);
  font-weight: 500;
}

.xp-results {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--xp-line);
  border: 1px solid var(--xp-line);
  border-radius: 12px;
  overflow: hidden;
}
.xp-results > div {
  background: var(--xp-panel-2);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.xp-results dt {
  font-size: 0.74rem;
  color: var(--xp-muted);
}
.xp-results dd {
  margin: 0;
  font-family: var(--font-mono, "Roboto Mono", monospace);
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
  color: var(--xp-fg);
}
.xp-results__price {
  grid-column: 1 / -1;
}
.xp-results__price dd {
  font-family: var(--font-heading, "Space Grotesk", sans-serif);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--xp-orange);
}
.xp-note {
  font-size: 0.8rem;
  color: var(--xp-muted);
}

/* ==========================================================================
   4. Materiales
   ========================================================================== */
.xp-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--xp-line);
  border-radius: 12px;
}
.xp-table {
  width: 100%;
  min-width: 680px;
  margin: 0 !important;
  border: 0 !important;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.xp-table th,
.xp-table td {
  text-align: left;
  padding: 14px 16px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--xp-line) !important;
  vertical-align: top;
  color: var(--xp-fg);
}
.xp-table thead th {
  font-family: var(--font-mono, "Roboto Mono", monospace);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--xp-muted);
  background: var(--xp-panel);
}
.xp-table tbody th {
  font-weight: 700;
}
.xp-table tbody th span {
  display: block;
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--xp-muted);
}
.xp-table tbody tr:last-child th,
.xp-table tbody tr:last-child td {
  border-bottom: 0 !important;
}
.xp-num {
  font-family: var(--font-mono, "Roboto Mono", monospace);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--xp-orange-soft) !important;
}

/* ==========================================================================
   5. Preguntas frecuentes + CTA
   ========================================================================== */
.xp-faq {
  border-top: 1px solid var(--xp-line);
}
.xp-faq details {
  border-bottom: 1px solid var(--xp-line);
}
.xp-faq summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 36px 20px 0;
  position: relative;
  font-family: var(--font-heading, "Space Grotesk", sans-serif);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--xp-fg);
}
.xp-faq summary::-webkit-details-marker {
  display: none;
}
.xp-faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono, "Roboto Mono", monospace);
  color: var(--xp-orange);
  font-size: 1.2rem;
}
.xp-faq details[open] summary::after {
  content: "−";
}
.xp-faq details p {
  color: var(--xp-muted);
  padding: 0 36px 20px 0;
  max-width: 70ch;
}

.xp-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 40px;
  border: 1px solid var(--xp-line);
  border-radius: 16px;
  background:
    radial-gradient(
      ellipse 60% 120% at 100% 100%,
      rgba(255, 106, 26, 0.14),
      transparent 60%
    ),
    var(--xp-panel);
}

/* ==========================================================================
   Créditos del modelo 3D (licencia CC BY-SA 4.0)
   ========================================================================== */
.xp-credits {
  max-width: 1120px;
  margin: 0 auto !important;
  padding: 0 20px 28px;
  font-family: var(--font-text, "Plus Jakarta Sans", sans-serif);
  font-size: 0.74rem;
  line-height: 1.5;
  color: #6f7d86;
  text-align: center;
}
.xp-credits a {
  color: #93a2ac;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ==========================================================================
   Responsive
   Hero apilado (texto arriba, pieza al centro, barra abajo) en móvil y en
   tablet vertical. Mantener sincronizado con STACKED_QUERY en impresion.js.
   ========================================================================== */
@media (max-width: 860px), (max-width: 1024px) and (orientation: portrait) {
  .xp-hero,
  .xp-hero--main {
    height: clamp(720px, calc(100svh - 72px), 1040px);
  }
  .xp-hero--main .xp-hero__copy > * {
    max-width: 640px;
  }
  .xp-hero__copy {
    justify-content: flex-start;
    padding-top: 36px;
    gap: 14px;
  }
  .xp-hero__copy::before {
    content: "";
    position: absolute;
    inset: 0 0 45% 0;
    z-index: -1;
    background: linear-gradient(
      180deg,
      rgba(7, 10, 12, 0.92) 0%,
      rgba(7, 10, 12, 0.55) 70%,
      transparent 100%
    );
  }
}

@media (max-width: 560px) {
  /* Más alto que la pantalla: el texto ocupa arriba y la pieza necesita su espacio */
  .xp-hero--main {
    height: clamp(880px, calc(100svh + 140px), 1000px);
  }
  .xp-hero--main .xp-actions .xp-btn {
    width: 100%;
  }
  .xp-hero--main .xp-hero__title {
    font-size: clamp(2rem, 9vw, 2.5rem) !important;
  }
}

@media (max-width: 860px) {
  .xp-hero__lead {
    font-size: 0.92rem;
  }
  .xp-steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .xp-steps__stage {
    min-height: 340px;
    order: -1;
  }
  .xp-quote {
    grid-template-columns: minmax(0, 1fr);
  }
  .xp-quote__viewer {
    min-height: 360px;
  }
  .xp-quote__controls {
    border-left: 0;
    border-top: 1px solid var(--xp-line);
  }
  .xp-container {
    gap: 80px;
    padding-top: 64px;
  }
  .xp-cta {
    padding: 28px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .xp-btn,
  .xp-hero__canvas {
    transition: none !important;
  }
}
