/* ============================================================
   CHD CONSTRUCCIONES - FICHA DE PAQUETE / PROPIEDAD
   (pages/publicacion.php). Se carga después de chd-base.css.

   - Galería tipo revista (StPageFlip + revista.js).
   - Descripción ordenada: introducción + "Qué incluye".
   - Consulta en tarjeta lateral fija (escritorio).
   ============================================================ */

.page-ficha main { padding-top: var(--h-header-h); }

/* ══════════════════════════════════════════
   ENCABEZADO
══════════════════════════════════════════ */
.pub-top { padding-top: clamp(28px, 4vw, 48px); }

.pub-crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 14px;
  color: var(--h-muted);
}
.pub-crumbs li { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.pub-crumbs li + li::before { content: '/'; color: var(--h-line-strong); }
.pub-crumbs a { color: var(--h-text); text-decoration: none; transition: color 0.2s; }
.pub-crumbs a:hover { color: var(--h-heading); text-decoration: underline; text-underline-offset: 4px; }
.pub-crumbs [aria-current] span {
  display: block;
  max-width: 32ch;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pub-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 32px 40px;
  align-items: end;
  padding-top: clamp(28px, 4vw, 48px);
  padding-bottom: clamp(40px, 5vw, 64px);
}
.pub-head__main { grid-column: 1 / 9; }
.pub-head__type {
  font-size: 15px;
  font-weight: 500;
  color: var(--h-accent-text);
  margin-bottom: 14px;
}
.pub-head__title {
  font-size: clamp(2.5rem, 5.5vw, 4.75rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.045em;
  color: var(--h-heading);
  max-width: 18ch;
  text-wrap: balance;
}
.pub-head__place {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 15px;
  color: var(--h-muted);
}
.pub-head__place i { font-size: 13px; }

.pub-head__side { grid-column: 9 / 13; }
.pub-price { display: flex; flex-direction: column; gap: 4px; }
.pub-price small { font-size: 14px; color: var(--h-muted); }
.pub-price strong {
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  color: var(--h-heading);
}
.pub-head__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  margin-top: 22px;
}

/* ══════════════════════════════════════════
   FOTO PRINCIPAL
   Se muestra completa y sin agrandarse más que su tamaño real; si es
   más pequeña que el marco, la misma foto desenfocada rellena el fondo.
══════════════════════════════════════════ */
.pub-hero { padding-bottom: clamp(48px, 6vw, 80px); }
.pub-hero__photo {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 78vh;
  padding: 0;
  border: 0;
  border-radius: var(--h-r-media);
  overflow: hidden;
  background: var(--h-tint);
  cursor: zoom-in;
}
.pub-hero__backdrop {
  position: absolute;
  inset: -48px;
  z-index: -1;
  width: calc(100% + 96px);
  height: calc(100% + 96px);
  object-fit: cover;
  filter: blur(40px) saturate(1.1);
  opacity: 0.6;
}
.pub-hero__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: var(--h-photo-filter);
  box-shadow: 0 10px 40px rgba(var(--h-shadow), 0.18);
  transition: transform 0.9s var(--h-ease-out);
}
/* Con el alto real conocido: llenar el alto del marco sin pasar de 1,5x */
.pub-hero__img[style*="--max-h"] { height: min(100%, var(--max-h)); }
.pub-hero__photo:hover .pub-hero__img { transform: scale(1.015); }
.pub-hero__photo:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 4px; }

/* ══════════════════════════════════════════
   ÁLBUM TIPO REVISTA (fotos secundarias; la principal es la portada)
══════════════════════════════════════════ */
.pub-gallery {
  background: var(--h-tint);
  padding-block: clamp(56px, 7vw, 104px) clamp(36px, 5vw, 64px);
  transition: background-color 0.3s;
}
.pub-gallery__head {
  max-width: 1120px;
  margin: 0 auto clamp(28px, 4vw, 48px);
}
.pub-gallery__meta {
  margin-top: 12px;
  font-size: clamp(1rem, 1.1vw, 1.0625rem);
  color: var(--h-muted);
}
.pub-book-stage {
  max-width: 1120px;
  margin: 0 auto;
  filter: drop-shadow(0 18px 30px rgba(var(--h-shadow), 0.12));
}
.pub-book { margin: 0 auto; outline: none; }
.pub-book:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 12px; border-radius: 4px; }

/* Antes de que cargue la librería (o sin ella): solo la portada */
.pub-book:not(.is-ready) { width: min(100%, 440px); }
.pub-book:not(.is-ready) .pub-page { display: none; }
.pub-book:not(.is-ready) .pub-page:first-child {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
}

/* ── Página ── */
.pub-page {
  background: var(--h-surface);
  color: var(--h-heading);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.pub-page img { -webkit-user-drag: none; pointer-events: none; }
.pub-page__inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 8% 8% 5%;
}
.pub-page__frame {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pub-page__frame img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(var(--h-shadow), 0.14);
}
.pub-page__folio {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 6%;
  padding-top: 4%;
  border-top: 1px solid var(--h-line);
  font-size: clamp(9px, 1.05vw, 12px);
  color: var(--h-muted);
}
.pub-page__folio span:first-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pub-page__folio span:last-child { font-weight: 600; color: var(--h-heading); font-variant-numeric: tabular-nums; }
.pub-page.--left .pub-page__folio { flex-direction: row-reverse; }

/* Sombra del lomo: da volumen a la doble página */
.pub-page::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.pub-page.--left::after  { background: linear-gradient(to left,  rgba(var(--h-shadow), 0.16), rgba(var(--h-shadow), 0) 9%); }
.pub-page.--right::after { background: linear-gradient(to right, rgba(var(--h-shadow), 0.16), rgba(var(--h-shadow), 0) 9%); }

/* ── Portada ── */
.pub-page--cover .pub-page__inner { padding: 0; }
.pub-page__masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6% 7% 4%;
  font-size: clamp(9px, 1.1vw, 12px);
  color: var(--h-muted);
}
.pub-page__brand {
  font-size: clamp(18px, 2.6vw, 30px);
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--h-heading);
}
.pub-page__cover-photo { flex: 1; min-height: 0; }
.pub-page__cover-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-page__cover-title {
  padding: 5% 7% 7%;
  font-size: clamp(15px, 2.2vw, 26px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

/* ── Contraportada ── */
.pub-page--back { background: var(--h-tint); }
.pub-page--back .pub-page__inner {
  align-items: center;
  justify-content: center;
  gap: 4%;
  text-align: center;
}
.pub-page__logo { width: 46%; height: auto; }
.pub-page__logo--white { display: var(--h-show-logo-white); }
.pub-page__logo--dark  { display: var(--h-show-logo-dark); }
.pub-page__back-text {
  font-size: clamp(10px, 1.2vw, 13px);
  line-height: 1.6;
  color: var(--h-muted);
}

/* ── Controles ── */
.pub-book-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  max-width: 1120px;
  margin: clamp(24px, 3vw, 36px) auto 0;
}
.pub-book-nav { display: flex; align-items: center; gap: 12px; }
.pub-icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--h-line-strong);
  border-radius: var(--h-r-control);
  background: var(--h-surface);
  color: var(--h-heading);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, opacity 0.2s, transform 0.15s;
}
.pub-icon-btn:hover:not(:disabled) { background: var(--h-btn-bg); border-color: var(--h-btn-bg); color: var(--h-btn-fg); }
.pub-icon-btn:active:not(:disabled) { transform: scale(0.96); }
.pub-icon-btn:disabled { opacity: 0.35; cursor: default; }
.pub-icon-btn[hidden] { display: none; }
.pub-book-count {
  min-width: 15ch;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--h-heading);
  font-variant-numeric: tabular-nums;
}
.pub-book-hint { font-size: 14px; color: var(--h-muted); }
.pub-book-tools { display: flex; gap: 8px; }
.pub-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--h-line-strong);
  border-radius: var(--h-r-control);
  background: transparent;
  color: var(--h-heading);
  font-family: var(--h-font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.pub-tool-btn i { width: 16px; font-size: 13px; }
.pub-tool-btn:hover { background: var(--h-surface); }
.pub-tool-btn[aria-pressed="false"] { color: var(--h-muted); }

/* ── Miniaturas ── */
.pub-thumbs {
  display: flex;
  justify-content: center;
  gap: 8px;
  max-width: 1120px;
  margin: 20px auto 0;
  overflow-x: auto;
  padding: 4px;
  scrollbar-width: none;
}
.pub-thumbs::-webkit-scrollbar { display: none; }
.pub-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 54px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--h-r-control);
  background: var(--h-surface);
  overflow: hidden;
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.2s, border-color 0.2s, transform 0.2s var(--h-ease-out);
}
.pub-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-thumb:hover { opacity: 1; transform: translateY(-2px); }
.pub-thumb.is-active { opacity: 1; border-color: var(--h-heading); }

/* ══════════════════════════════════════════
   FOTO AMPLIADA (visor)
   Siempre oscuro: la foto manda. Rejilla:
     escritorio  "bar bar bar" / "prev stage next" / "strip strip strip"
     móvil       "bar bar bar" / "stage stage stage" / "prev strip next"
══════════════════════════════════════════ */
.pub-lightbox {
  --lb-bg:   #0A100C;
  --lb-fg:   #F2F4EF;
  --lb-soft: rgba(242, 244, 239, 0.62);
  --lb-line: rgba(242, 244, 239, 0.14);
  position: fixed;
  inset: 0;
  z-index: 3500;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 88px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "bar bar bar"
    "prev stage next"
    "strip strip strip";
  background: var(--lb-bg);
  color: var(--lb-fg);
  opacity: 0;
  transition: opacity 0.25s var(--h-ease-out);
  overflow: hidden;
  isolation: isolate;
}
.pub-lightbox[hidden] { display: none; }
.pub-lightbox.is-open { opacity: 1; }

/* Resplandor de la foto actual detrás de todo */
.pub-lightbox__ambient {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.pub-lightbox__ambient img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(80px) saturate(1.3);
  transform: scale(1.25);
  opacity: 0.28;
  transition: opacity 0.6s;
}
.pub-lightbox__ambient img:not([src]),
.pub-lightbox__ambient img[src=""] { opacity: 0; }

/* Barra superior */
.pub-lightbox__bar {
  grid-area: bar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px 14px;
}
.pub-lightbox__info { min-width: 0; }
.pub-lightbox__title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pub-lightbox__count {
  margin-top: 2px;
  font-size: 13px;
  color: var(--lb-soft);
  font-variant-numeric: tabular-nums;
}

/* Botones */
.pub-lightbox__btn {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--lb-line);
  border-radius: var(--h-r-control);
  background: rgba(242, 244, 239, 0.06);
  color: var(--lb-fg);
  font-size: 15px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.pub-lightbox__btn:hover { background: var(--lb-fg); border-color: var(--lb-fg); color: var(--lb-bg); }
.pub-lightbox__btn:active { transform: scale(0.95); }
.pub-lightbox__btn:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 3px; }
.pub-lightbox__prev { grid-area: prev; align-self: center; justify-self: center; }
.pub-lightbox__next { grid-area: next; align-self: center; justify-self: center; }

/* Foto */
.pub-lightbox__stage {
  grid-area: stage;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin: 0;
  padding: 8px 0;
}
.pub-lightbox__stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--h-r-control);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  user-select: none;
  transform: scale(0.97);
  transition: opacity 0.35s var(--h-ease-out), transform 0.5s var(--h-ease-out);
}
.pub-lightbox.is-open .pub-lightbox__stage img { transform: none; }
.pub-lightbox__stage img:not([src]) { opacity: 0; }
.pub-lightbox__stage.is-leaving img {
  opacity: 0;
  transform: translateX(calc(var(--dir, 0) * -32px)) scale(0.99);
  transition-duration: 0.16s;
}
.pub-lightbox__stage.is-entering img {
  opacity: 0;
  transform: translateX(calc(var(--dir, 0) * 32px)) scale(0.99);
  transition: none;
}

/* Cargando: una línea fina que recorre la parte inferior */
.pub-lightbox__stage::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 120px;
  height: 2px;
  margin-left: -60px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--lb-fg), transparent);
  background-size: 60px 100%;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.2s;
}
.pub-lightbox.is-loading .pub-lightbox__stage::after {
  opacity: 0.6;
  animation: lbLoading 1s linear infinite;
}
@keyframes lbLoading {
  from { background-position: -60px 0; }
  to   { background-position: 120px 0; }
}

/* Miniaturas */
.pub-lightbox__strip {
  grid-area: strip;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px 22px;
  overflow-x: auto;
  scrollbar-width: none;
}
.pub-lightbox__strip::-webkit-scrollbar { display: none; }
.pub-lightbox__thumb {
  flex: 0 0 auto;
  width: 68px;
  height: 50px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--h-r-control);
  background: rgba(242, 244, 239, 0.08);
  overflow: hidden;
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 0.2s, border-color 0.2s, transform 0.2s var(--h-ease-out);
}
.pub-lightbox__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-lightbox__thumb:hover { opacity: 0.85; transform: translateY(-2px); }
.pub-lightbox__thumb.is-active { opacity: 1; border-color: var(--lb-fg); }
.pub-lightbox__thumb:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .pub-lightbox,
  .pub-lightbox__stage img { transition: none; }
  .pub-lightbox.is-loading .pub-lightbox__stage::after { animation: none; }
}

/* ══════════════════════════════════════════
   DETALLE + CONSULTA
══════════════════════════════════════════ */
.pub-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 48px 40px;
  align-items: start;
  padding-top: clamp(56px, 7vw, 96px);
}
.pub-content { grid-column: 1 / 8; }

.pub-section + .pub-section { margin-top: clamp(40px, 5vw, 56px); }
.pub-section__title {
  font-size: 15px;
  font-weight: 500;
  color: var(--h-muted);
  padding-top: 24px;
  margin-bottom: 24px;
  border-top: 1px solid var(--h-line);
}

/* Características */
.pub-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 28px 24px;
}
.pub-spec { display: flex; flex-direction: column; gap: 8px; }
.pub-spec dt {
  order: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--h-muted);
}
.pub-spec dt i { width: 14px; font-size: 12px; }
.pub-spec dd {
  order: 1;
  font-size: clamp(1.75rem, 2.6vw, 2.25rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  color: var(--h-heading);
}

/* Descripción */
.pub-intro p {
  font-size: clamp(1.0625rem, 1.2vw, 1.1875rem);
  line-height: 1.7;
  color: var(--h-text);
  max-width: 62ch;
}
.pub-intro p + p { margin-top: 12px; }

/* Qué incluye */
.pub-includes__group + .pub-includes__group {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--h-line);
}
.pub-includes__label {
  font-size: 14px;
  font-weight: 600;
  color: var(--h-heading);
  margin-bottom: 14px;
}
.pub-includes ul {
  list-style: none;
  columns: 2;
  column-gap: 40px;
}
.pub-includes li {
  display: flex;
  gap: 10px;
  break-inside: avoid;
  padding-block: 6px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--h-text);
}
.pub-includes li i {
  flex-shrink: 0;
  margin-top: 5px;
  font-size: 11px;
  color: var(--h-accent);
}
.pub-includes.is-collapsed .is-extra { display: none; }
.pub-includes.is-collapsed {
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
}

.pub-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  margin-top: 16px;
  padding: 0 16px;
  border: 1px solid var(--h-line-strong);
  border-radius: var(--h-r-control);
  background: var(--h-surface);
  color: var(--h-heading);
  font-family: var(--h-font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.pub-more:hover { border-color: var(--h-heading); }
.pub-more[hidden] { display: none; }
.pub-more i { font-size: 11px; transition: transform 0.25s var(--h-ease-out); }
.pub-more[aria-expanded="true"] i { transform: rotate(180deg); }

.pub-note {
  margin-top: 24px;
  padding: 16px 20px;
  border-radius: var(--h-r-control);
  background: var(--h-tint);
  font-size: 15px;
  line-height: 1.6;
  color: var(--h-text);
}

/* Compartir */
.pub-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(40px, 5vw, 56px);
  padding-top: 24px;
  border-top: 1px solid var(--h-line);
}
.pub-share__label { font-size: 15px; font-weight: 500; color: var(--h-muted); }
.pub-share__links { display: flex; flex-wrap: wrap; gap: 8px; }
.pub-share__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--h-line);
  border-radius: var(--h-r-control);
  background: var(--h-surface);
  color: var(--h-heading);
  font-family: var(--h-font);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s;
}
.pub-share__btn i { font-size: 13px; }
.pub-share__btn:hover { border-color: var(--h-heading); }

/* ── Consulta ── */
.pub-aside {
  grid-column: 9 / 13;
  position: sticky;
  top: calc(var(--h-header-h) + 24px);
}
.pub-form-card {
  padding: clamp(22px, 2.4vw, 32px);
  border: 1px solid var(--h-line);
  border-radius: var(--h-r-media);
  background: var(--h-surface);
  transition: background-color 0.3s;
}
.pub-form-card__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--h-heading);
}
.pub-form-card__text { margin-top: 6px; font-size: 15px; color: var(--h-muted); }

.pub-form { display: grid; gap: 16px; margin-top: 22px; }
.pub-field { display: grid; gap: 6px; }
.pub-field label { font-size: 13px; font-weight: 500; color: var(--h-text); }
.pub-field__optional { font-weight: 400; color: var(--h-muted); }
.pub-field input,
.pub-field textarea {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--h-line);
  border-radius: var(--h-r-control);
  background: var(--h-bg);
  color: var(--h-heading);
  font-family: var(--h-font);
  font-size: 15px;
  transition: border-color 0.2s;
}
.pub-field textarea {
  height: auto;
  min-height: 112px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}
.pub-field input::placeholder,
.pub-field textarea::placeholder { color: var(--h-muted); }
.pub-field input:hover,
.pub-field textarea:hover { border-color: var(--h-line-strong); }
.pub-field input:focus,
.pub-field textarea:focus { border-color: var(--h-heading); outline: none; }
.pub-field input:focus-visible,
.pub-field textarea:focus-visible { outline: 2px solid var(--h-accent); outline-offset: 1px; }
.pub-field [aria-invalid="true"] { border-color: var(--h-danger); }
.pub-field__error { font-size: 13px; color: var(--h-danger); }
.pub-field__error[hidden] { display: none; }

.pub-form__status {
  padding: 12px 14px;
  border-radius: var(--h-r-control);
  font-size: 14px;
  line-height: 1.5;
}
.pub-form__status[hidden] { display: none; }
.pub-form__status.is-success { background: var(--h-tint); color: var(--h-accent-text); }
.pub-form__status.is-error { background: var(--h-tint); color: var(--h-danger); }
.pub-form__submit { width: 100%; }
.pub-form__submit:disabled { opacity: 0.7; cursor: progress; }
.pub-form__legal { font-size: 13px; line-height: 1.5; color: var(--h-muted); }
.pub-form__legal a { color: var(--h-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.pub-form__legal a:hover { color: var(--h-heading); }

.pub-aside__channels {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 24px;
  margin-top: 18px;
}
.pub-aside__channels i { color: var(--h-accent-text); }

/* ══════════════════════════════════════════
   OTROS PAQUETES
══════════════════════════════════════════ */
.pub-related {
  margin-top: var(--h-space-t);
  padding-block: clamp(56px, 7vw, 96px) var(--h-space-b);
  border-top: 1px solid var(--h-line);
}
.pub-related__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.pub-related__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.pub-related .pq-card__title { font-size: clamp(1.25rem, 1.7vw, 1.5rem); }
.pub-related .pq-card__price strong { font-size: clamp(1.25rem, 1.6vw, 1.5rem); }

/* ══════════════════════════════════════════
   NO ENCONTRADA
══════════════════════════════════════════ */
.pub-missing { padding-block: clamp(96px, 12vw, 160px) var(--h-space-b); }
.pub-missing__title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.05;
  color: var(--h-heading);
  max-width: 16ch;
  margin-bottom: 20px;
}
.pub-missing__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 32px; }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .pub-head { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .pub-head__main,
  .pub-head__side { grid-column: auto; }
  .pub-head__side {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px 32px;
    padding-top: 24px;
    border-top: 1px solid var(--h-line);
  }
  .pub-head__actions { margin-top: 0; }

  .pub-layout { grid-template-columns: minmax(0, 1fr); }
  .pub-content,
  .pub-aside { grid-column: auto; }
  .pub-aside { position: static; }

  .pub-related__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .pub-crumbs [aria-current] span { max-width: 20ch; }
  .pub-hero__photo { aspect-ratio: 4 / 3; max-height: none; }
  .pub-book-bar { justify-content: center; }
  .pub-book-nav { flex-basis: 100%; justify-content: space-between; }
  .pub-book-hint { display: none; }
  .pub-thumb { width: 60px; height: 45px; }
  .pub-thumbs { justify-content: flex-start; }

  .pub-includes ul { columns: 1; }
  .pub-related__grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }

  .pub-lightbox {
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    grid-template-areas:
      "bar bar bar"
      "stage stage stage"
      "prev strip next";
  }
  .pub-lightbox__bar { padding: 12px 12px 10px 16px; }
  .pub-lightbox__stage { padding: 4px 0; }
  .pub-lightbox__stage img { border-radius: 0; }
  .pub-lightbox__prev,
  .pub-lightbox__next { width: 44px; height: 44px; align-self: center; }
  .pub-lightbox__strip { justify-content: flex-start; padding: 14px 4px 20px; }
  .pub-lightbox__thumb { width: 56px; height: 42px; }
}

@media (max-width: 560px) {
  .pub-head__side { flex-direction: column; align-items: flex-start; }
  .pub-share { flex-direction: column; align-items: flex-start; }
}
