/* ==========================================================================
   Verifactu (verifactu.html): Pasarela VeriFactu y Facturador.
   Va después de styles.css y motion.css. Reutiliza los componentes comunes;
   aquí solo está lo propio de la página: logos de producto, capturas en
   marco de navegador, galería y el ejemplo de petición.
   ========================================================================== */

/* Índice de los dos productos bajo la portada */
.product-index .cell { display: flex; flex-direction: column; gap: 10px; }
.product-index img { align-self: flex-start; width: auto; height: 44px; margin-bottom: 8px; }
.product-index .h3 { font-weight: 800; }
.product-index .link-arrow { margin-top: auto; padding-top: 8px; font-weight: 800; color: var(--blue); }

/* Cabecera de cada producto: logo + texto */
.product-head { max-width: 760px; margin-bottom: clamp(28px, 4vw, 48px); }
.product-logo { display: block; width: auto; height: clamp(44px, 5vw, 60px); margin-bottom: 20px; }

/* Captura en marco de navegador sencillo, esquinas rectas */
.screen { margin: 0; min-width: 0; }
.screen__frame {
  border: 2px solid var(--divider);
  background: #fff;
  box-shadow: 0 18px 40px rgba(0, 35, 79, .12);
}
.screen__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 2px solid var(--divider);
  background: var(--bg);
  font-size: 12px;
  line-height: 1;
  color: var(--subtle);
}
.screen__bar::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--sky);
  box-shadow: 14px 0 0 var(--sky), 28px 0 0 var(--sky);
  margin-right: 36px;
}
.screen img { display: block; width: 100%; height: auto; }
.screen figcaption { margin-top: 14px; }
.screen__title {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--text);
}
.screen__text { display: block; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* Texto + captura principal */
.showcase {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}
@media (min-width: 1000px) {
  .showcase { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .showcase--flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .showcase--flip > :first-child { order: 2; }
}

/* Galería de capturas: 1 → 2 columnas, sin filas incompletas (4 elementos) */
.screens {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 4vw, 48px) clamp(20px, 3vw, 40px);
}
@media (min-width: 760px) { .screens { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Lista de garantías (misma pauta que en Impacto social) */
.check-list { margin: 0; padding: 0; list-style: none; }
.check-list li {
  position: relative;
  padding: 12px 0 12px 32px;
  border-top: 1px solid var(--divider);
  font-size: 15px;
  line-height: 1.5;
}
.check-list li:first-child { border-top-width: 2px; }
.check-list li:last-child { border-bottom: 2px solid var(--divider); }
.check-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 18px;
  width: 13px;
  height: 7px;
  border-left: 3px solid var(--blue);
  border-bottom: 3px solid var(--blue);
  transform: rotate(-45deg);
}
.check-list strong { font-weight: 700; color: var(--text); }

/* Ejemplo de petición a la API */
.code {
  margin: 0;
  min-width: 0;
}
.code pre {
  margin: 0;
  padding: clamp(16px, 2.4vw, 24px);
  overflow-x: auto;
  background: var(--navy);
  color: #e8eef6;
  font: 13px/1.6 ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  tab-size: 2;
}
.code .k { color: var(--sky); }
.code .s { color: #ffd2e6; }
.code .n { color: #ffc49e; }
.code figcaption { margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* Flujo Facturador → Pasarela → AEAT */
.band--navy .cells { background: var(--on-dark-line); }
.band--navy .cell { background: var(--navy); }
.flow .cell img { display: block; width: auto; height: 34px; margin-bottom: 14px; }
.flow__aeat {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 10px;
  border: 2px solid var(--on-dark-line);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 18px;
}
.band--navy .flow .h3 { color: #fff; }
.band--navy .flow .text { color: var(--on-dark); }

/* Capturas ampliables: enlace a la versión en alta calidad */
.screen__zoom {
  position: relative;
  display: block;
  cursor: zoom-in;
}
.screen__zoom:focus-visible { outline-offset: -4px; }
.screen__hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--ease), transform var(--ease);
  pointer-events: none;
}
/* Lupa dibujada con bordes: círculo + mango */
.screen__hint::before {
  content: "";
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: 5px 5px 0 -3px currentColor;
}
.screen__zoom:hover .screen__hint,
.screen__zoom:focus-visible .screen__hint { opacity: 1; transform: none; }
@media (hover: none) {
  .screen__hint { opacity: .92; transform: none; }
}

/* Visor a pantalla completa (<dialog> nativo) */
.lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(12px, 2.5vw, 32px);
  border: 0;
  background: #001229;
  color: #fff;
  overflow: hidden;
}
.lightbox[open] {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  animation: lightbox-in .18s ease;
}
.lightbox::backdrop { background: transparent; }
@keyframes lightbox-in { from { opacity: 0; } to { opacity: 1; } }

.lightbox__figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 0;
  margin: 0;
}
.lightbox__img {
  justify-self: center;
  align-self: center;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  transition: opacity var(--ease);
}
.lightbox__img.is-loading { opacity: .6; }
.lightbox__caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  font-size: 15px;
  line-height: 1.4;
  text-align: center;
}
.lightbox__title { font-weight: 800; }
.lightbox__count { color: var(--on-dark); font-variant-numeric: tabular-nums; }

.lightbox__tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.lightbox__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border: 2px solid var(--on-dark-line);
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--ease), border-color var(--ease);
}
.lightbox__btn--text { font-size: 14px; }
.lightbox__btn:hover { background: rgba(255, 255, 255, .12); border-color: #fff; color: #fff; text-decoration: none; }
.lightbox__btn:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }

/* Con el visor abierto la página de fondo no se desplaza */
html:has(.lightbox[open]) { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .lightbox[open] { animation: none; }
  .screen__hint, .lightbox__img { transition: none; }
}
