/* ==========================================================================
   FUENTE DE SABIDURIA — DESIGN SYSTEM ULTRA ELEGANTE (BLANCO & ORO IMPERIAL)
   Estética: Mármol Blanco Puro, Oro Celestial & Tipografía de Alta Gama
   ========================================================================== */

/* 1. VARIABLES & RESET */
:root {
  /* Paleta Cromática: Blanco Absoluto y Oro Puro */
  --bg-space: #ffffff;
  --bg-obsidian: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-glass-nav: rgba(255, 255, 255, 0.95);
  --bg-subtle: #f8fafc;

  --gold-primary: #b8860b;
  --gold-light: #dfb15b;
  --gold-dark: #8c6507;
  --gold-glow: 0 0 25px rgba(184, 134, 11, 0.22);
  --gold-gradient: linear-gradient(135deg, #d4af37 0%, #b8860b 50%, #8c6507 100%);
  --gold-gradient-soft: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(184, 134, 11, 0.05) 100%);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-gold: #9e7327;

  --border-gold: rgba(184, 134, 11, 0.25);
  --border-subtle: rgba(184, 134, 11, 0.15);

  /* Tipografías */
  --font-serif-title: 'Cinzel', Georgia, serif;
  --font-serif-body: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Transiciones y Sombras */
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-luxury: 0 16px 40px -10px rgba(184, 134, 11, 0.12), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 24px 50px -10px rgba(184, 134, 11, 0.2), 0 8px 24px rgba(0, 0, 0, 0.06);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
  background-color: #ffffff;
}

body.luxury-theme {
  font-family: var(--font-sans);
  background-color: #ffffff;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Canvas de Partículas Suaves */
#cosmic-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background: #ffffff;
}

/* Contenedor Universal */
.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Utilidades Tipográficas y Botones */
.gold-gradient-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  font-weight: 800;
}

.text-center { text-align: center; }
.w-100 { width: 100%; }

.section-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dark);
  background: var(--gold-gradient-soft);
  border: 1px solid var(--border-gold);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-serif-title);
  font-size: clamp(2rem, 4vw, 2.85rem);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 48px;
}

/* Paneles Glassmorphism Blancos */
.glass-panel {
  background: #ffffff;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-luxury);
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(184, 134, 11, 0.5), transparent);
}

/* Botón de Oro Brillante */
.btn-gold-glow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  color: #ffffff;
  background: var(--gold-gradient);
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(184, 134, 11, 0.3);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.btn-gold-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: rotate(30deg);
  transition: transform 0.6s;
}

.btn-gold-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(184, 134, 11, 0.45);
}

.btn-gold-glow:hover::after {
  transform: rotate(30deg) translate(50%, 50%);
}

/* ==========================================================================
   2. NAVEGACIÓN PRINCIPAL
   ========================================================================== */
.luxury-header {
  position: sticky;
  top: 0;
  z-index: 99;
  background: var(--bg-glass-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-gold);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  transition: var(--transition-smooth);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.logo-emblem {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 2px 8px rgba(184, 134, 11, 0.3));
  transition: transform 0.4s ease;
}

.brand-logo:hover .logo-emblem {
  transform: rotate(45deg);
}

.logo-title {
  font-family: var(--font-serif-title);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}

.logo-tagline {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--text-muted);
  font-weight: 700;
  display: block;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.25s;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--gold-dark);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold-gradient);
  transition: width 0.3s ease;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.action-btn {
  background: #ffffff;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: var(--transition-smooth);
}

.action-btn:hover {
  background: var(--gold-gradient-soft);
  border-color: var(--gold-primary);
  color: var(--gold-dark);
}

.search-trigger, .library-trigger {
  position: relative;
  padding: 10px 14px;
}

.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--gold-primary);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(184, 134, 11, 0.4);
}

.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}

.mobile-toggle span {
  width: 24px;
  height: 2px;
  background: var(--gold-primary);
  transition: 0.3s;
}

/* ==========================================================================
   3. SECCIÓN HERO MONUMENTAL
   ========================================================================== */
.hero-section {
  padding: 80px 0 100px;
  position: relative;
  background: #ffffff;
  overflow: hidden;
}

.hero-glow-sphere {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(223, 177, 91, 0.12) 0%, transparent 70%);
  top: -100px;
  left: 20%;
  pointer-events: none;
  filter: blur(60px);
}

.hero-glow-sphere.secondary {
  top: 200px;
  right: -100px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.08) 0%, transparent 70%);
}

.hero-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 60px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--gold-gradient-soft);
  border: 1px solid var(--border-gold);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--gold-dark);
  margin-bottom: 24px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--gold-primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--gold-primary);
  animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.hero-headline {
  font-family: var(--font-serif-title);
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 36px;
  max-width: 600px;
}

/* Buscador Hero */
.hero-search-wrapper {
  margin-bottom: 20px;
}

.hero-search-box {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid var(--border-gold);
  border-radius: var(--radius-full);
  padding: 8px 10px 8px 22px;
  box-shadow: var(--shadow-luxury);
  transition: var(--transition-smooth);
}

.hero-search-box:focus-within {
  border-color: var(--gold-primary);
  box-shadow: 0 8px 30px rgba(184, 134, 11, 0.25);
  transform: translateY(-2px);
}

.search-icon { color: var(--gold-primary); margin-right: 12px; }

.hero-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  font-family: var(--font-sans);
}

.hero-search-box input::placeholder {
  color: var(--text-muted);
}

.hero-search-btn {
  background: var(--gold-gradient);
  color: #ffffff;
  border: none;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
}

.hero-search-btn:hover {
  box-shadow: 0 6px 20px rgba(184, 134, 11, 0.45);
}

/* Escaparate 3D Hero */
.hero-showcase {
  display: flex;
  justify-content: center;
}

.luxury-pedestal {
  position: relative;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pedestal-halo {
  position: absolute;
  width: 320px;
  height: 320px;
  top: 15%;
  background: radial-gradient(circle, rgba(184, 134, 11, 0.15) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.hero-book-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  width: 100%;
}

/* Libro 3D */
.book-3d-wrapper {
  perspective: 1200px;
  margin-bottom: 28px;
  cursor: pointer;
}

.book-3d {
  width: 250px;
  height: 360px;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(-20deg) rotateX(8deg);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 20px 25px 45px rgba(0, 0, 0, 0.12), -5px 10px 25px rgba(184, 134, 11, 0.15);
  border-radius: 4px 12px 12px 4px;
}

.book-3d-wrapper:hover .book-3d {
  transform: rotateY(-5deg) rotateX(2deg) scale(1.04);
}

.book-cover-front {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 4px 12px 12px 4px;
  border: 1.5px solid var(--border-gold);
  backface-visibility: hidden;
  box-shadow: inset 4px 0 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.book-cover-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px 12px 12px 4px;
}

.book-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.88) 50%, rgba(255, 255, 255, 0.96) 100%);
  z-index: 2;
  pointer-events: none;
}

.book-cover-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.book-emboss-border {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border: 1px solid rgba(184, 134, 11, 0.45);
  border-radius: 2px 8px 8px 2px;
  pointer-events: none;
  z-index: 4;
}

.book-emblem-seal {
  font-size: 2.2rem;
  color: var(--gold-primary);
  margin-bottom: 20px;
  filter: drop-shadow(0 2px 8px rgba(184, 134, 11, 0.4));
}

.book-cover-title {
  font-family: var(--font-serif-title);
  font-size: 1.15rem;
  letter-spacing: 0.1em;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
  line-height: 1.3;
}

.book-cover-author {
  font-family: var(--font-serif-body);
  font-size: 1rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.book-edition-badge {
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  color: var(--gold-dark);
  font-weight: 800;
  border-top: 1px solid var(--border-gold);
  border-bottom: 1px solid var(--border-gold);
  padding: 4px 10px;
}

.book-spine {
  position: absolute;
  top: 0;
  left: 0;
  width: 36px;
  height: 100%;
  background: linear-gradient(90deg, #f1eae0 0%, #ffffff 50%, #f1eae0 100%);
  transform: rotateY(-90deg) translateX(-36px);
  transform-origin: left;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-gold);
}

.book-spine span {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--gold-dark);
  font-weight: 700;
  white-space: nowrap;
}

.book-pages {
  position: absolute;
  top: 3px;
  right: 0;
  width: 32px;
  height: 354px;
  background: repeating-linear-gradient(90deg, #f8f5ee 0px, #eee6d6 1px, #e3dac7 2px);
  transform: rotateY(90deg) translateX(16px);
  transform-origin: right;
  border-radius: 0 4px 4px 0;
}

.featured-book-actions {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-luxury);
}

.featured-tag {
  font-size: 0.7rem;
  color: var(--gold-dark);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 800;
}

.featured-name {
  font-family: var(--font-serif-title);
  font-size: 1rem;
  color: var(--text-primary);
  margin: 6px 0;
}

.featured-stats {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.featured-buttons {
  display: flex;
  gap: 10px;
}

.btn-read-sample, .btn-listen-sample {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-read-sample {
  background: var(--gold-gradient);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.25);
}

.btn-listen-sample {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-gold);
}

.btn-listen-sample:hover {
  background: var(--gold-gradient-soft);
  color: var(--gold-dark);
}

/* ==========================================================================
   4. CATÁLOGO DE LIBROS (TARJETAS DE IMAGEN COMPLETA)
   ========================================================================== */
.catalog-section {
  padding: 40px 0 100px;
  background: #ffffff;
}

/* Grilla de Libros */
.books-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin-bottom: 50px;
}

@media (max-width: 1100px) {
  .books-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .books-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .books-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Tarjeta de Producto */
.book-card {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--border-gold);
  background: #ffffff;
  box-shadow: var(--shadow-luxury);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.book-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--gold-primary);
  box-shadow: var(--shadow-hover), 0 0 30px rgba(184, 134, 11, 0.35);
}

.book-card-link {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.book-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.42;
  overflow: hidden;
  background: #080c14;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-card-full-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.book-card:hover .book-card-full-img {
  transform: scale(1.06);
}

.book-card-glow-overlay {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
  transition: background 0.3s ease;
}

.book-card:hover .book-card-glow-overlay {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.1) 0%, transparent 60%);
}

.book-card-bottom-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1.5px solid var(--border-gold);
  gap: 10px;
}

.book-card-bottom-title {
  font-family: var(--font-serif-title);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.book-card-bottom-price {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 800;
  color: #b8860b;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(184, 134, 11, 0.08) 100%);
  border: 1px solid var(--border-gold);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* ==========================================================================
   5. VISOR DIGITAL E-READER (MODAL)
   ========================================================================== */
.reader-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  padding: 20px;
}

.reader-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.reader-modal-container {
  width: 100%;
  max-width: 960px;
  height: 90vh;
  background: #ffffff;
  border: 1.5px solid var(--border-gold);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

/* Temas del E-Reader */
.reader-modal-container.theme-obsidian {
  background: #080c14;
  color: #f1f5f9;
}
.reader-modal-container.theme-obsidian .reader-title { color: #fff; }
.reader-modal-container.theme-obsidian .reader-modal-header,
.reader-modal-container.theme-obsidian .reader-modal-footer {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
}

.reader-modal-container.theme-sepia {
  background: #fbf0d9;
  color: #2c2214;
}
.reader-modal-container.theme-sepia .reader-modal-header,
.reader-modal-container.theme-sepia .reader-modal-footer {
  background: #f3e5c8;
  border-color: rgba(44, 34, 20, 0.15);
  color: #2c2214;
}
.reader-modal-container.theme-sepia .reader-title { color: #2c2214; }

.reader-modal-container.theme-light {
  background: #ffffff;
  color: #0f172a;
}
.reader-modal-container.theme-light .reader-modal-header,
.reader-modal-container.theme-light .reader-modal-footer {
  background: #f8fafc;
  border-color: rgba(184, 134, 11, 0.2);
  color: #0f172a;
}
.reader-modal-container.theme-light .reader-title { color: #0f172a; }

.reader-modal-header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-gold);
  background: #ffffff;
}

.reader-badge {
  font-size: 0.65rem;
  color: var(--gold-dark);
  font-weight: 800;
  letter-spacing: 0.15em;
}

.reader-title {
  font-family: var(--font-serif-title);
  font-size: 1.05rem;
  color: var(--text-primary);
}

.reader-chapter-title {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.reader-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.reader-theme-picker {
  display: flex;
  gap: 6px;
}

.theme-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}

.theme-dot.active { border-color: var(--gold-primary); }
.theme-obsidian { background: #080c14; }
.theme-sepia { background: #fbf0d9; }
.theme-light { background: #ffffff; border: 1px solid #cbd5e1; }

.font-size-adjuster {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(184, 134, 11, 0.08);
  border: 1px solid var(--border-gold);
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
}

.btn-font-adj {
  background: transparent;
  border: none;
  color: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0 4px;
}

.reader-close-btn {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: inherit;
  cursor: pointer;
  line-height: 1;
}

.reader-progress-track {
  height: 3px;
  background: rgba(184, 134, 11, 0.15);
  width: 100%;
}

.reader-progress-bar {
  height: 100%;
  background: var(--gold-gradient);
  transition: width 0.3s;
}

.reader-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 48px 64px;
}

.reader-page-content {
  max-width: 680px;
  margin: 0 auto;
  font-family: var(--font-serif-body);
  font-size: 1.25rem;
  line-height: 1.85;
}

.reader-page-content h2 {
  font-family: var(--font-serif-title);
  font-size: 1.8rem;
  margin-bottom: 24px;
  text-align: center;
  color: inherit;
}

.reader-page-content p {
  margin-bottom: 24px;
  text-align: justify;
}

.reader-page-content .dropcap::first-letter {
  font-family: var(--font-serif-title);
  font-size: 3.5rem;
  float: left;
  line-height: 0.8;
  margin-right: 12px;
  color: var(--gold-primary);
}

.reader-modal-footer {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-gold);
  background: #ffffff;
}

.reader-nav-btns {
  display: flex;
  align-items: center;
  gap: 20px;
}

.btn-reader-nav {
  background: #ffffff;
  border: 1px solid var(--border-gold);
  color: inherit;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-reader-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.reader-page-indicator {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.8rem;
}

/* ==========================================================================
   6. FOOTER BLANCO Y ORO
   ========================================================================== */
.luxury-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-gold);
  padding-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 60px;
}

.footer-about-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 18px 0 24px;
  max-width: 320px;
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--border-gold);
  color: var(--gold-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: var(--transition-smooth);
}

.social-icon:hover {
  background: var(--gold-gradient);
  color: #ffffff;
}

.footer-heading {
  font-family: var(--font-serif-title);
  font-size: 0.95rem;
  color: var(--text-primary);
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--gold-dark);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding: 24px 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-badges {
  display: flex;
  gap: 20px;
  color: var(--text-secondary);
}

/* ==========================================================================
   7. DRAWER DE BIBLIOTECA & REPRODUCTOR FLOTANTE
   ========================================================================== */
.library-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(10px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.library-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.library-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 100%;
  max-width: 400px;
  height: 100vh;
  background: #ffffff;
  border-left: 1px solid var(--border-gold);
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
  z-index: 1001;
}

.library-drawer-overlay.active .library-drawer {
  right: 0;
}

.drawer-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-title-group h3 {
  font-family: var(--font-serif-title);
  font-size: 1.1rem;
  color: var(--text-primary);
}

.drawer-close-btn {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border: 1px solid var(--border-gold);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.drawer-item-title {
  font-family: var(--font-serif-title);
  font-size: 0.85rem;
  color: var(--text-primary);
}

.drawer-item-author {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-subtle);
  background: #ffffff;
}

.library-stats-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.btn-clear-library {
  background: transparent;
  border: none;
  color: #dc2626;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Reproductor Flotante de Audio */
.floating-audio-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-top: 1.5px solid var(--border-gold);
  z-index: 990;
  padding: 12px 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-audio-bar.active {
  transform: translateY(0);
}

.audio-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.audio-bar-book-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.mini-cover-badge {
  font-size: 1.5rem;
  background: var(--gold-gradient-soft);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-gold);
}

.audio-bar-title {
  font-family: var(--font-serif-title);
  font-size: 0.9rem;
  color: var(--text-primary);
}

.audio-bar-narrator {
  font-size: 0.75rem;
  color: var(--gold-dark);
  font-weight: 700;
}

.audio-bar-controls {
  flex: 1;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.audio-buttons-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.audio-btn-step {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.audio-btn-main-play {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gold-gradient);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
}

.audio-progress-container {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.audio-scrub-track {
  flex: 1;
  height: 4px;
  background: rgba(184, 134, 11, 0.2);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.audio-scrub-progress {
  height: 100%;
  width: 0%;
  background: var(--gold-primary);
  border-radius: 2px;
}

.audio-bar-extra {
  display: flex;
  align-items: center;
  gap: 12px;
}

.audio-speed-btn {
  background: #ffffff;
  border: 1px solid var(--border-gold);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.audio-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

/* Modal Búsqueda Global */
.search-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(16px);
  z-index: 1050;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.search-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.search-modal-box {
  width: 100%;
  max-width: 640px;
  max-height: 75vh;
  background: #ffffff;
  border: 1.5px solid var(--border-gold);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.search-input-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.search-input-header input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--text-primary);
  outline: none;
}

.search-modal-close {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.search-modal-results {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

.search-result-item:hover {
  background: var(--gold-gradient-soft);
}

/* Notificaciones Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #ffffff;
  border: 1px solid var(--border-gold);
  color: var(--text-primary);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  animation: slideInToast 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   8. RESPONSIVE BREAKPOINTS ULTRA OPTIMIZADO PARA TODOS LOS DISPOSITIVOS
   ========================================================================== */

/* Tabletas y Pantallas Medianas (<= 1024px) */
@media (max-width: 1024px) {
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  
  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-showcase {
    order: -1;
    margin-bottom: 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

/* Celulares Grandes y Pantallas Pequeñas (<= 768px) */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }

  .nav-container {
    height: 72px;
    padding: 0 16px;
  }

  .brand-logo {
    gap: 10px;
  }

  .logo-emblem {
    width: 36px;
    height: 36px;
  }

  .logo-title {
    font-size: 1.05rem;
  }

  .logo-tagline {
    font-size: 0.55rem;
    letter-spacing: 0.18em;
  }

  /* Menú Móvil Desplegable */
  .mobile-toggle {
    display: flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-gold);
    background: #ffffff;
    z-index: 101;
  }

  .mobile-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .mobile-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-menu {
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    gap: 0;
    border-bottom: 1.5px solid var(--border-gold);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.08);
    padding: 16px 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 98;
  }

  .nav-menu.mobile-open {
    max-height: 300px;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    width: 100%;
    padding: 14px 24px;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(184, 134, 11, 0.1);
  }

  .nav-actions {
    gap: 8px;
  }

  .nav-actions .btn-gold-glow {
    display: none;
  }

  .action-btn {
    padding: 8px 12px;
  }

  /* Hero en Móvil */
  .hero-section {
    padding: 40px 0 60px;
  }

  .hero-headline {
    font-size: clamp(1.85rem, 7vw, 2.6rem);
    line-height: 1.2;
    margin-bottom: 16px;
  }

  .hero-description {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 24px;
  }

  .book-3d {
    width: 210px;
    height: 300px;
  }

  .featured-book-actions {
    padding: 14px;
  }

  /* Catálogo en Móvil */
  .catalog-section {
    padding: 30px 0 70px;
  }

  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
  }

  .book-card-bottom-info {
    padding: 10px 12px;
    gap: 6px;
  }

  .book-card-bottom-title {
    font-size: 0.85rem;
  }

  .book-card-bottom-price {
    font-size: 0.95rem;
    padding: 3px 8px;
  }

  /* E-Reader Modal en Móvil */
  .reader-modal-overlay {
    padding: 0;
  }

  .reader-modal-container {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }

  .reader-modal-header {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .reader-modal-body {
    padding: 20px 16px;
  }

  .reader-modal-footer {
    padding: 12px 16px;
    flex-direction: column;
    gap: 12px;
  }

  .reader-nav-btns {
    width: 100%;
    justify-content: space-between;
  }

  /* Drawer en Móvil */
  .library-drawer {
    width: 100%;
    max-width: 100%;
  }

  /* Barra de Audio Flotante en Móvil */
  .floating-audio-bar {
    bottom: 0;
    padding: 10px 0 max(10px, env(safe-area-inset-bottom));
  }

  .audio-bar-inner {
    flex-direction: column;
    gap: 10px;
  }

  .audio-bar-controls {
    width: 100%;
  }

  /* Footer en Móvil */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .footer-badges {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Celulares Pequeños (<= 480px) */
@media (max-width: 480px) {
  .container {
    padding: 0 14px;
  }

  .books-grid {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
    gap: 24px;
  }

  .book-card {
    border-radius: var(--radius-md);
  }

  .book-card-img-wrap {
    aspect-ratio: 1 / 1.35;
  }

  .book-3d {
    width: 180px;
    height: 260px;
  }

  .logo-text-group {
    display: flex;
    flex-direction: column;
  }

  .logo-title {
    font-size: 0.95rem;
  }

  .logo-tagline {
    display: none;
  }
}

/* Celulares Extra Pequeños (<= 360px) */
@media (max-width: 360px) {
  .nav-actions {
    gap: 4px;
  }

  .action-btn {
    padding: 6px 8px;
  }

  .book-card-bottom-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .book-card-bottom-price {
    align-self: flex-end;
  }
}
