/* ============ Preventas: banners, página de la preventa y barra de reserva ============ */

/* ----- Banners ----- */
.pv-banners { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.pv-banners.compactos { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }

.pv-banner {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 220px;
  height: 100%;
  padding: clamp(18px, 2.4vw, 26px);
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  background:
    radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--pv-1) 55%, transparent), transparent 55%),
    linear-gradient(125deg, var(--pv-2) 0%, color-mix(in srgb, var(--pv-2) 70%, #000) 100%);
  border-radius: 22px;
  isolation: isolate;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  transition: transform 0.25s, box-shadow 0.25s;
}
.pv-banner.con-imagen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--pv-img) center / cover no-repeat;
  transition: transform 0.4s;
}
.pv-banner.con-imagen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, color-mix(in srgb, var(--pv-2) 92%, transparent) 0%, color-mix(in srgb, var(--pv-2) 55%, transparent) 45%, transparent 80%);
}
.pv-banner:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2); }
.pv-banner.con-imagen:hover::before { transform: scale(1.04); }
.pv-banner:focus-visible { outline: 3px solid var(--pv-1); outline-offset: 3px; }
.pv-banner.cerrada { min-height: 170px; }

.pv-banner-texto { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 520px; }
.pv-chip {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pv-sobre, var(--juego-sobre, #111));
  background: var(--pv-1, var(--juego-1));
  border-radius: 999px;
}
.pv-banner-titulo { font-size: clamp(1.35rem, 2.6vw, 1.9rem); line-height: 1.1; letter-spacing: -0.02em; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3); }
.pv-banner-sub { font-size: 0.95rem; color: rgba(255, 255, 255, 0.88); }
.pv-banner-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pv-banner-meta span { padding: 4px 10px; font-size: 0.8rem; font-weight: 600; background: rgba(255, 255, 255, 0.16); border-radius: 999px; backdrop-filter: blur(4px); }
.pv-banner-meta .pv-cierre { color: #111; background: #fff; }
.pv-banner-meta .pv-cierre.fin { color: #fff; background: rgba(0, 0, 0, 0.35); }
.pv-banner-cta { margin-top: 6px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.pv-banners.compactos .pv-banner-sub, .pv-banners.compactos .pv-banner-cta { display: none; }

.pv-portada { background: radial-gradient(circle at 90% 10%, rgba(42, 120, 214, 0.45), transparent 50%), linear-gradient(120deg, #1f1d1d, #3a3737); }
.pv-seccion { padding-left: 0; padding-right: 0; }
.pv-sin { margin-top: 18px; }

/* ----- Página de la preventa ----- */
.pv-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(200px, 30vw, 340px);
  margin: 8px 0 16px;
  padding: clamp(20px, 3.5vw, 36px);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--juego-1) 55%, transparent), transparent 55%),
    linear-gradient(125deg, var(--juego-2) 0%, color-mix(in srgb, var(--juego-2) 70%, #000) 100%);
  border-radius: 22px;
  isolation: isolate;
}
.pv-hero.con-imagen::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--pv-img) center / cover no-repeat; }
.pv-hero.con-imagen::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, color-mix(in srgb, var(--juego-2) 90%, transparent), transparent 75%); }
.pv-hero-texto { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: 640px; }
.pv-hero h1 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.7rem); line-height: 1.05; letter-spacing: -0.02em; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.3); }
.pv-hero p { margin: 0; font-size: 1.05rem; color: rgba(255, 255, 255, 0.9); }

.pv-datos li small { font-size: 0.78rem; color: var(--color-suave); }
.pv-datos .pv-fin { color: #b42318; }
.pv-form { margin-top: 6px; }

/* Productos */
.pv-productos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.pv-producto {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--color-borde);
  border-radius: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pv-producto.elegido { border-color: var(--juego-2); box-shadow: 0 0 0 2px color-mix(in srgb, var(--juego-1) 45%, transparent); }
.pv-producto.agotado { opacity: 0.6; }
.pv-producto-img { position: relative; aspect-ratio: 1; padding: 0; background: #f4f4f5; border: 0; border-radius: 12px; overflow: hidden; cursor: zoom-in; }
.pv-producto-img img { transition: transform 0.25s; }
.pv-producto-img:hover img { transform: scale(1.06); }
.pv-producto-img:focus-visible, .pv-producto-nombre:focus-visible, .pv-ver:focus-visible { outline: 3px solid var(--juego-1, #13bd0d); outline-offset: 2px; }
.pv-producto-img img { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; }
.pv-producto-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pv-producto-info h2 { margin: 0; font-size: 1rem; line-height: 1.25; }
.pv-producto-nombre { padding: 0; font: inherit; font-weight: inherit; color: inherit; text-align: left; background: none; border: 0; cursor: pointer; }
.pv-producto-nombre:hover { text-decoration: underline; text-underline-offset: 3px; }
.pv-producto-detalle { margin: 0; font-size: 0.85rem; color: var(--color-suave); }
.pv-producto-desc summary { font-size: 0.82rem; font-weight: 600; cursor: pointer; color: var(--color-suave); }
.pv-producto-desc p { margin: 6px 0 0; font-size: 0.85rem; line-height: 1.5; }
.pv-producto-etiquetas { display: flex; flex-wrap: wrap; gap: 4px; }
.pv-etq { padding: 2px 8px; font-size: 0.72rem; font-weight: 700; color: #3b4352; background: #eef0f3; border-radius: 999px; }
.pv-etq.pocos { color: #8a4b00; background: #fff1d6; }
.pv-etq.agotado { color: #8a1c12; background: #fdecea; }
.pv-etq.tuyo { color: #0b5d26; background: #dcf5e3; }
.pv-producto-compra { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.pv-precio { font-size: 1.1rem; white-space: nowrap; }
.pv-no { font-size: 0.8rem; color: var(--color-suave); }

.pv-cant { display: flex; align-items: center; border: 1px solid var(--color-borde); border-radius: 10px; overflow: hidden; }
.pv-cant button { width: 34px; height: 36px; font-size: 1.15rem; color: var(--color-texto); background: #f4f4f5; border: 0; cursor: pointer; }
.pv-cant button:disabled { opacity: 0.35; cursor: not-allowed; }
.pv-cant input { width: 40px; height: 36px; padding: 0; font: inherit; font-weight: 700; text-align: center; border: 0; -moz-appearance: textfield; }
.pv-cant input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Barra fija para reservar */
.pv-barra {
  position: sticky;
  bottom: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 12px 14px 12px 20px;
  color: #fff;
  background: #1f1d1d;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}
.pv-barra-texto { display: flex; flex-direction: column; }
.pv-barra-texto strong { font-size: 1.25rem; }
.pv-barra-texto span { font-size: 0.85rem; color: rgba(255, 255, 255, 0.75); }
.pv-barra .filtros-aplicar { flex: 0 0 auto; width: auto; min-width: 180px; margin: 0; justify-content: center; }
.pv-barra .filtros-aplicar:disabled { opacity: 0.5; cursor: not-allowed; }

.pv-textos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 0 32px; margin-top: 28px; }
.pv-politica p { padding: 14px 16px; font-size: 0.92rem; background: #f4f4f5; border-radius: 14px; }

/* Avisos en checkout y pedido */
.checkout-preventa { margin-bottom: 16px; padding: 14px 16px; background: #eaf2ff; border: 1px solid #c8dbf7; border-radius: 14px; }
.pedido-preventa { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; padding: 14px 16px; background: #eaf2ff; border: 1px solid #c8dbf7; border-radius: 14px; }
.pedido-preventa a { color: inherit; }
.pedido-tag-preventa { margin-left: 6px; padding: 1px 8px; font-size: 0.7rem; font-weight: 700; color: #1d4f91; background: #e3edff; border-radius: 999px; vertical-align: middle; }

@media (max-width: 640px) {
  .pv-banner { min-height: 190px; padding: 18px; border-radius: 18px; }
  .pv-hero { min-height: 180px; padding: 18px; border-radius: 18px; }
  .pv-producto { grid-template-columns: 72px minmax(0, 1fr); gap: 10px 12px; padding: 10px; }
  .pv-producto-compra { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; padding-top: 8px; border-top: 1px solid #eef0f3; }
  .pv-barra { bottom: 8px; padding: 10px 10px 10px 16px; border-radius: 14px; }
  .pv-barra .filtros-aplicar { min-width: 0; padding-left: 18px; padding-right: 18px; }
}

/* Prerreserva */
.pv-precios { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.pv-prerreserva { font-size: 0.8rem; font-weight: 600; color: var(--color-suave); }
.pv-prerreserva strong { display: block; font-size: 1.1rem; color: var(--color-texto); }
.pv-precios small { font-size: 0.78rem; color: var(--color-suave); white-space: nowrap; }
.pv-barra-texto small { font-size: 0.78rem; color: rgba(255, 255, 255, 0.7); }
.checkout-pagar-ahora { padding: 8px 10px; margin: 4px -10px 0; background: #eaf2ff; border-radius: 10px; font-weight: 700; }
.pedido-saldo { border-color: #c8dbf7; background: #f5f9ff; }
.pedido-monto small { display: block; font-size: 0.82rem; font-weight: 500; color: var(--color-suave); }
@media (max-width: 640px) {
  .pv-precios { align-items: flex-start; text-align: left; }
}
.pedido-tag-preventa.saldo { color: #8a4b00; background: #fff1d6; }

/* Precio promocional */
.pv-promo { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--color-suave); white-space: nowrap; }
.pv-promo-pct { padding: 1px 7px; font-size: 0.72rem; font-weight: 800; color: #fff; background: #d92d20; border-radius: 999px; }
.pv-precio.oferta { color: #d92d20; }
.pv-precios small.pv-promo-fin { font-weight: 700; color: #b42318; }

/* Inicio: franja delgada que lleva a Preventas */
.pv-franja-seccion { padding-top: 0; padding-bottom: 0; }
.pv-franja {
  display: flex; align-items: center; gap: 14px;
  max-width: 1280px; margin: 0 auto; padding: 14px 18px;
  color: #fff; background: #1f1d1d; border-radius: 16px; text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.pv-franja:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18); }
.pv-franja-icono { font-size: 1.4rem; line-height: 1; }
.pv-franja-texto { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pv-franja-texto strong { font-size: 1rem; }
.pv-franja-texto span { overflow: hidden; font-size: 0.85rem; color: rgba(255, 255, 255, 0.72); white-space: nowrap; text-overflow: ellipsis; }
.pv-franja-ir { flex: 0 0 auto; padding: 8px 14px; font-size: 0.88rem; font-weight: 700; color: #1f1d1d; background: #fff; border-radius: 999px; white-space: nowrap; }
@media (max-width: 640px) {
  .pv-franja { gap: 10px; padding: 12px 12px 12px 14px; border-radius: 14px; }
  .pv-franja-ir { padding: 7px 11px; font-size: 0.8rem; }
}

/* Inicio: la franja de preventas aparece como aviso flotante arriba (se puede cerrar).
   Sale cada vez que se entra al inicio. Sin JavaScript se queda como franja normal. */
.pv-franja-seccion.pv-popup {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 950;
  width: min(760px, calc(100% - 24px));
  padding: 0;
  transform: translate(-50%, calc(-100% - 40px));
  transition: transform 0.5s cubic-bezier(.22, .61, .36, 1);
}
@media (scripting: enabled) {
  /* Antes de que cargue el script ya está escondido arriba: no hay salto en la página */
  .pv-franja-seccion {
    position: fixed;
    top: 14px;
    left: 50%;
    z-index: 950;
    width: min(760px, calc(100% - 24px));
    padding: 0;
    transform: translate(-50%, calc(-100% - 40px));
    transition: transform 0.5s cubic-bezier(.22, .61, .36, 1);
  }
}
.pv-franja-seccion.visible { transform: translate(-50%, 0); }
.pv-popup .pv-franja { max-width: none; padding-right: 22px; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35); }
.pv-popup-cerrar {
  position: absolute;
  top: -10px;
  right: -10px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #1f1d1d;
  background: #fff;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.15s;
}
.pv-popup-cerrar:hover { transform: scale(1.08); }
.pv-popup-cerrar:focus-visible { outline: 3px solid #13bd0d; outline-offset: 2px; }
@media (max-width: 640px) {
  .pv-franja-seccion.pv-popup, .pv-franja-seccion { top: 10px; }
  .pv-popup-cerrar { top: -8px; right: -6px; width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .pv-franja-seccion, .pv-franja-seccion.pv-popup { transition: none; }
}

/* Botón "Ver detalles" */
.pv-ver {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  margin-top: 4px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-texto);
  background: #fff;
  border: 1px solid var(--color-borde);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.pv-ver:hover { background: #f4f4f5; border-color: var(--color-texto); }

/* Ventana de detalles */
.pv-modal {
  width: min(880px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
.pv-modal::backdrop { background: rgba(10, 12, 16, 0.55); backdrop-filter: blur(2px); }
.pv-modal[open] { animation: pv-modal-entrar 0.22s cubic-bezier(.22, .61, .36, 1); }
@keyframes pv-modal-entrar { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.pv-modal-cerrar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--color-texto);
  background: #fff;
  border: 1px solid var(--color-borde);
  border-radius: 50%;
  cursor: pointer;
}
.pv-modal-cuerpo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 28px;
  max-height: calc(100dvh - 32px);
  padding: 28px;
  overflow-y: auto;
}
.pv-modal-foto {
  position: sticky;
  top: 0;
  align-self: start;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 18px;
  background: #f4f4f5;
  border-radius: 16px;
}
.pv-modal-foto img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pv-modal-info { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding-right: 30px; }
.pv-modal-nombre { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.7rem); line-height: 1.2; }
.pv-modal-detalle { margin: 0; color: var(--color-suave); }
.pv-modal-precios .pv-precios { align-items: flex-start; text-align: left; }
.pv-modal-precios .pv-precio { font-size: 1.6rem; }
.pv-modal-precios .pv-prerreserva strong { font-size: 1.5rem; }
.pv-modal-etiquetas { display: flex; flex-wrap: wrap; gap: 4px; }
.pv-modal-etiquetas:empty { display: none; }
.pv-modal-compra { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pv-modal-compra:empty { display: none; }
.pv-modal-cant-txt { font-size: 0.85rem; font-weight: 700; color: var(--color-suave); }
.pv-modal-compra .pv-cant output { display: grid; place-items: center; width: 44px; height: 36px; font-weight: 700; }
.pv-modal-listo {
  margin-left: auto;
  padding: 10px 22px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--color-acento, #333);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.pv-modal-desc { padding-top: 14px; border-top: 1px solid var(--color-borde); }
.pv-modal-desc:empty { display: none; }
.pv-modal-desc h3 { margin: 0 0 8px; font-size: 0.95rem; }
.pv-modal-desc p { margin: 0; font-size: 0.95rem; line-height: 1.6; color: var(--color-texto); white-space: normal; }

@media (max-width: 700px) {
  .pv-modal { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  .pv-modal-cuerpo { grid-template-columns: 1fr; gap: 16px; max-height: 92dvh; padding: 18px; }
  .pv-modal-foto { position: static; aspect-ratio: 4 / 3; }
  .pv-modal-info { padding-right: 0; }
  .pv-modal-cerrar { top: 10px; right: 10px; }
}
@media (prefers-reduced-motion: reduce) { .pv-modal[open] { animation: none; } }
