/* =============================================================
   Gap-the-Code · Book Landing CSS
   Estilos específicos para la landing del libro
   "IA Generativa para Profesores".
   Carga DESPUÉS de fase3.css (lo extiende, no lo reemplaza).
   ============================================================= */

/* ---------- 1. HERO ---------- */
.book-hero {
  position: relative;
  padding: var(--sp-12) 0 var(--sp-12);
  background: linear-gradient(180deg, #FBFAFE 0%, #fff 100%);
  overflow: hidden;
}
.book-hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-10);
  align-items: center;
}
@media (min-width: 900px) {
  .book-hero { padding: var(--sp-16) 0; }
  .book-hero__inner {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: var(--sp-12);
  }
}

/* Copy izquierdo */
.book-hero__copy { min-width: 0; }

.book-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-plum);
  letter-spacing: 0.02em;
  margin-bottom: var(--sp-5);
}
.book-hero__badge-dot {
  width: 8px;
  height: 8px;
  background: #2ECC71;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.18);
  animation: book-pulse 2s ease-in-out infinite;
}
@keyframes book-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.92); }
}

.book-hero__title {
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--c-ink);
  margin: 0 0 var(--sp-5);
}
.book-hero__title em {
  background: var(--grad-brand, linear-gradient(135deg, #442854 0%, #BA2C69 100%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: normal;
}

.book-hero__lede {
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--c-text);
  margin: 0 0 var(--sp-7);
  max-width: 540px;
}

/* Bloque precio */
.book-hero__price {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
  padding: var(--sp-4) var(--sp-5);
  background: linear-gradient(135deg, #FDFBFF 0%, var(--c-wash) 100%);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  max-width: 540px;
}
.book-hero__price-amount {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  color: var(--c-ink);
  letter-spacing: -0.02em;
  line-height: 1;
}
.book-hero__price-meta {
  font-size: var(--fs-sm);
  color: var(--c-text-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.book-hero__price-prime {
  display: inline-block;
  background: linear-gradient(135deg, #00A8E1 0%, #0073BB 100%);
  color: #fff;
  font-weight: 800;
  font-size: var(--fs-xs);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* CTAs */
.book-hero__ctas {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-7);
}

/* Bullets stat */
.book-hero__bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  max-width: 540px;
}
.book-hero__bullets li {
  text-align: left;
  padding: 0;
  margin: 0;
}
.book-hero__bullet-num {
  display: block;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  color: var(--c-plum);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.book-hero__bullets li > span:last-child {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-text-soft);
  line-height: 1.3;
  font-weight: 500;
}

/* Visual derecho con libro */
.book-hero__visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}
.book-hero__glow {
  position: absolute;
  inset: 10% 5%;
  background: radial-gradient(closest-side, rgba(245, 166, 35, 0.32) 0%, transparent 70%);
  filter: blur(48px);
  z-index: 0;
  pointer-events: none;
  animation: book-glow 5s ease-in-out infinite;
}
@keyframes book-glow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}
.book-hero__img {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  height: auto;
  display: block;
  filter: drop-shadow(0 24px 48px rgba(68, 40, 84, 0.20));
  transform: rotate(-2deg);
  transition: transform 400ms ease;
}
.book-hero__img:hover {
  transform: rotate(0deg) scale(1.02);
}
@media (min-width: 900px) {
  .book-hero__img { max-width: 560px; }
}

/* ---------- 2. QUÉ ENCUENTRAS DENTRO ---------- */
.book-inside {
  padding-top: var(--sp-16);
  padding-bottom: var(--sp-16);
}

/* Mockup portada+contraportada */
.book-spread {
  margin: 0 auto var(--sp-10);
  max-width: 880px;
  text-align: center;
}
.book-spread__img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 16px 36px rgba(68, 40, 84, 0.12));
  border-radius: var(--r-md);
}
.book-spread__caption {
  margin-top: var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--c-text-soft);
  font-style: italic;
}

/* Stats reusable */
.book-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-8);
  max-width: 720px;
  margin-inline: auto;
}
@media (min-width: 640px) {
  .book-stats { grid-template-columns: repeat(4, 1fr); }
}

/* Stat tile (reutilizado de material/index) */
.stat-tile {
  background: linear-gradient(135deg, #FDFBFF 0%, var(--c-wash) 100%);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  text-align: center;
}
.stat-tile__num {
  display: block;
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  font-weight: 800;
  color: var(--c-ink);
  line-height: 1;
  margin-bottom: var(--sp-2);
  letter-spacing: -0.02em;
}
.stat-tile__label {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-text-soft);
  font-weight: 500;
  line-height: 1.4;
}

/* ---------- 3. CTA FINAL ---------- */
.book-cta {
  background: linear-gradient(135deg, var(--c-ink, #442854) 0%, var(--c-plum, #782167) 50%, var(--c-magenta, #BA2C69) 100%);
  color: #fff;
  padding: var(--sp-12) 0;
  position: relative;
  overflow: hidden;
}
.book-cta__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-10);
  align-items: center;
}
@media (min-width: 900px) {
  .book-cta { padding: var(--sp-16) 0; }
  .book-cta__inner {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: var(--sp-12);
  }
}

.book-cta__copy { min-width: 0; }
.book-cta__title {
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: #fff;
  margin: 0 0 var(--sp-4);
}
.book-cta__lede {
  font-size: var(--fs-md);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 var(--sp-6);
  max-width: 520px;
}

.book-cta__price {
  display: inline-flex;
  align-items: baseline;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
  padding: var(--sp-3) var(--sp-5);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--r-lg);
  backdrop-filter: blur(8px);
}
.book-cta__price-amount {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
}
.book-cta__price-meta {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.78);
}

.book-cta__buttons {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}
/* Botón outline-light: estilo outline pero blanco para fondo oscuro */
.btn--outline-light {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}
.btn--outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}

.book-cta__small {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}
.book-cta__link-inline {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}
.book-cta__link-inline:hover {
  color: #FFE4F1;
}

/* Visual derecho con pila */
.book-cta__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.book-cta__img {
  width: 100%;
  max-width: 360px;
  height: auto;
  display: block;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.35));
  transform: rotate(3deg);
  transition: transform 400ms ease;
}
.book-cta__img:hover {
  transform: rotate(0deg) scale(1.03);
}
@media (min-width: 900px) {
  .book-cta__img { max-width: 420px; }
}

/* ---------- 4. Ajustes responsive globales ---------- */
@media (max-width: 720px) {
  .book-hero__bullets {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-2);
  }
  .book-hero__price-amount { font-size: 1.5rem; }
  .book-cta__price { padding: var(--sp-3) var(--sp-4); }
}

/* =============================================================
   v3 · Toggle Tapa blanda / Kindle
   ============================================================= */

.book-format-card {
  /* Hereda padding y bg de .book-hero__price o .book-cta__price */
  display: block !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

.book-format__tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(120, 33, 103, 0.08);
  border-radius: 999px;
  margin-bottom: 12px;
}
.book-format-card--dark .book-format__tabs {
  background: rgba(255, 255, 255, 0.10);
}

.book-format__tab {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-soft, #6B5974);
  font-family: inherit;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
  white-space: nowrap;
}
.book-format__tab:hover {
  color: var(--c-plum, #782167);
}
.book-format__tab.is-active {
  background: #fff;
  color: var(--c-plum, #782167);
  box-shadow: 0 2px 6px rgba(68, 40, 84, 0.12);
}
.book-format-card--dark .book-format__tab {
  color: rgba(255, 255, 255, 0.7);
}
.book-format-card--dark .book-format__tab:hover {
  color: #fff;
}
.book-format-card--dark .book-format__tab.is-active {
  background: rgba(255, 255, 255, 0.95);
  color: var(--c-plum, #782167);
}
.book-format__tab:focus-visible {
  outline: 2px solid var(--c-plum, #782167);
  outline-offset: 2px;
}

.book-format__row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* Animación cuando cambia el precio (feedback visual al toggle) */
[data-book-price] {
  display: inline-block;
  transition: opacity 180ms ease, transform 180ms ease;
}
.book-format__tab.is-active ~ * [data-book-price],
[data-book-price].changing {
  /* placeholder animación si quisiéramos refinar más */
}
