/* ============================================================
   PequeGenios — Hoja de estilos principal
   Plataforma educativa para niños de 3 a 12 años
   ------------------------------------------------------------
   Estructura:
   1. Variables (colores, tipografía, espaciado) — EDITA AQUÍ
   2. Reset y base
   3. Utilidades y layout
   4. Header / Navegación
   5. Hero
   6. Componentes (tarjetas, botones, badges, testimonios)
   7. Secciones específicas
   8. Footer
   9. Responsive
   ============================================================ */

/* ============ 1. VARIABLES — EDITA AQUÍ ============ */
:root {
  /* Colores de marca — paleta editorial cálida */
  --color-primary: #5f9c8e;      /* Verde salvia */
  --color-primary-dark: #4a7d71;
  --color-secondary: #e0897a;    /* Coral */
  --color-accent: #f2cf7a;       /* Mantequilla */
  --color-green: #7cb1a6;        /* Salvia claro */
  --color-blue: #8fb8d8;         /* Azul empolvado */
  --color-pink: #e3a0bb;         /* Rosa empolvado */

  /* Neutros cálidos */
  --color-text: #3a3a3c;
  --color-text-soft: #8a8a8f;
  --color-bg: #fffdf9;           /* Crema cálido */
  --color-bg-alt: #f3f0ea;       /* Arena suave */
  --color-border: #e7e1d5;

  /* Tipografía */
  --font-base: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --font-heading: 'Baloo 2', 'Nunito', sans-serif;

  /* Espaciado y formas */
  --radius: 18px;
  --radius-lg: 32px;
  --shadow: 0 10px 30px rgba(108, 75, 216, 0.12);
  --shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.06);
  --max-width: 1180px;
  --header-height: 76px;
}

/* ============ 2. RESET Y BASE ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--color-text);
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

p { color: var(--color-text-soft); }

a { color: var(--color-primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--color-primary-dark); }

img { max-width: 100%; display: block; }

ul { list-style: none; }

/* ============ 3. UTILIDADES Y LAYOUT ============ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 72px 0; }
.section--alt { background: var(--color-bg-alt); }
.section--tight { padding: 48px 0; }

.text-center { text-align: center; }
.mt-1 { margin-top: 12px; } .mt-2 { margin-top: 24px; } .mt-3 { margin-top: 40px; }

.section-head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.section-head p { font-size: 1.1rem; margin-top: 12px; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-bg-alt);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: .85rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.grid { display: grid; gap: 28px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ============ 4. HEADER / NAVEGACIÓN ============ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--color-primary);
}
.logo:hover { color: var(--color-primary); }
.logo-mark {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-blue));
  border-radius: 12px;
  display: grid; place-items: center;
  color: #fff; font-size: 1.4rem;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-menu > li { position: relative; }
.nav-menu a {
  display: block;
  padding: 10px 14px;
  color: var(--color-text);
  font-weight: 600;
  border-radius: 10px;
}
.nav-menu a:hover { background: var(--color-bg-alt); color: var(--color-primary); }
.nav-menu a.active { color: var(--color-primary); }

/* Dropdown "Más" */
.has-dropdown > a::after { content: " ▾"; font-size: .8em; }
.dropdown {
  position: absolute;
  top: 100%; left: 0;
  min-width: 260px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
  opacity: 0; visibility: hidden;
  transform: translateY(8px);
  transition: all .2s;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown a { padding: 10px 12px; font-weight: 500; }

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

/* Selector de idioma */
.lang-select {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: var(--font-base);
  font-weight: 600;
  color: var(--color-text);
  background: #fff;
  cursor: pointer;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 26px; height: 3px;
  background: var(--color-primary);
  border-radius: 3px;
  transition: .3s;
}

/* ============ 5. HERO ============ */
.hero {
  background: radial-gradient(circle at 20% 20%, #f7f2e8, var(--color-bg) 60%);
  padding: 80px 0;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero h1 span { color: var(--color-primary); }
.hero p.lead { font-size: 1.25rem; margin-top: 20px; max-width: 520px; }
.hero-cta { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }

.hero-art {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--color-primary), var(--color-blue));
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 6rem;
  box-shadow: var(--shadow);
  position: relative;
}
.hero-art::after {
  content: "";
  position: absolute; inset: -20px;
  background: radial-gradient(circle, var(--color-accent) 0%, transparent 8%),
              radial-gradient(circle, var(--color-pink) 0%, transparent 6%);
  background-position: 10% 90%, 90% 10%;
  background-repeat: no-repeat;
  background-size: 60px 60px, 50px 50px;
}

/* ============ 6. COMPONENTES ============ */
/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(95, 156, 142, 0.32);
}
.btn-primary:hover { color: #fff; transform: translateY(-2px); }
.btn-outline {
  background: #fff;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary); color: #fff; }
.btn-light { background: #fff; color: var(--color-primary); }

/* Tarjetas */
.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px 26px;
  box-shadow: var(--shadow-soft);
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-icon {
  width: 60px; height: 60px;
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 1.8rem;
  margin-bottom: 18px;
  color: #fff;
}
.card h3 { margin-bottom: 10px; }

/* Colores rotativos para iconos */
.bg-primary { background: var(--color-primary); }
.bg-secondary { background: var(--color-secondary); }
.bg-green { background: var(--color-green); }
.bg-blue { background: var(--color-blue); }
.bg-pink { background: var(--color-pink); }
.bg-accent { background: var(--color-accent); }

/* Badges de descarga de apps */
.app-badges { display: flex; gap: 12px; flex-wrap: wrap; }
.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--color-text);
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
}
.app-badge:hover { color: #fff; background: #000; }
.app-badge small { display: block; font-size: .7rem; opacity: .8; font-weight: 400; }
.app-badge b { font-size: .95rem; }

/* Estadísticas */
.stats { display: flex; flex-wrap: wrap; gap: 40px; justify-content: center; }
.stat { text-align: center; }
.stat b {
  font-family: var(--font-heading); font-size: 2.6rem; color: var(--color-primary);
  display: flex; align-items: flex-end; justify-content: center;
  min-height: 3rem; line-height: 1.1;
}
.stat span { color: var(--color-text-soft); font-weight: 600; }

/* Testimonios */
.testimonial {
  background: #fff;
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
}
.testimonial p { font-style: italic; color: var(--color-text); }
.testimonial .author { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.testimonial .avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-pink), var(--color-secondary));
  display: grid; place-items: center; color: #fff; font-weight: 700;
}
.testimonial .author b { display: block; }
.testimonial .author small { color: var(--color-text-soft); }

/* Franja CTA */
.cta-band {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 56px 40px;
  text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.85); font-size: 1.15rem; margin-top: 12px; }
.cta-band .hero-cta { justify-content: center; }

/* ============ 7. SECCIONES ESPECÍFICAS ============ */
/* Cabecera interior de página */
.page-hero {
  background: linear-gradient(135deg, var(--color-bg-alt), var(--color-bg));
  padding: 64px 0;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}
.page-hero p { font-size: 1.15rem; max-width: 640px; margin: 16px auto 0; }
.breadcrumb { font-size: .9rem; color: var(--color-text-soft); margin-bottom: 12px; }
.breadcrumb a { font-weight: 600; }

/* Lista de características con check */
.feature-list li {
  display: flex; gap: 12px; align-items: flex-start;
  margin-bottom: 14px; color: var(--color-text);
}
.feature-list li::before {
  content: "✓";
  flex-shrink: 0;
  width: 24px; height: 24px;
  background: var(--color-green);
  color: #fff; border-radius: 50%;
  display: grid; place-items: center;
  font-size: .8rem; font-weight: 700;
}

/* Split (imagen + texto) */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split-art {
  aspect-ratio: 1/1;
  border-radius: var(--radius-lg);
  display: grid; place-items: center;
  font-size: 5rem; color: #fff;
}

/* Blog */
.post-card { overflow: hidden; padding: 0; }
.post-thumb {
  aspect-ratio: 16/9;
  display: grid; place-items: center;
  font-size: 3rem; color: #fff;
}
.post-body { padding: 24px; }
.post-body .tag {
  font-size: .8rem; font-weight: 700; color: var(--color-secondary);
  text-transform: uppercase;
}
.post-body h3 { margin: 8px 0; }

/* FAQ (acordeón) */
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  background: #fff;
}
.faq-question {
  width: 100%;
  text-align: left;
  padding: 20px 24px;
  background: none;
  border: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-question .icon { transition: transform .3s; color: var(--color-primary); flex-shrink: 0; }
.faq-item.open .faq-question .icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
  padding: 0 24px;
}
.faq-item.open .faq-answer { max-height: 400px; padding: 0 24px 20px; }

/* Formulario de contacto */
.form { display: grid; gap: 18px; max-width: 560px; margin: 0 auto; }
.form-row { display: grid; gap: 6px; }
.form label { font-weight: 600; }
.form input, .form textarea, .form select {
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  font-family: var(--font-base);
  font-size: 1rem;
}
.form input:focus, .form textarea:focus, .form select:focus {
  outline: none; border-color: var(--color-primary);
}
.form textarea { min-height: 140px; resize: vertical; }

/* Precios / planes */
.price-card { text-align: center; }
.price-card.featured { border: 2px solid var(--color-primary); transform: scale(1.03); }
.price { font-family: var(--font-heading); font-size: 2.4rem; color: var(--color-primary); margin: 8px 0; }
.price small { font-size: .9rem; color: var(--color-text-soft); font-weight: 400; }

/* Tienda / productos */
.product { text-align: center; padding: 0; overflow: hidden; }
.product-img { aspect-ratio: 1/1; display: grid; place-items: center; font-size: 4rem; color: #fff; }
.product-body { padding: 20px; }
.product .price { font-size: 1.6rem; }

/* Contenido legal / texto largo */
.prose { max-width: 800px; margin: 0 auto; }
.prose h2 { margin: 32px 0 12px; }
.prose h3 { margin: 24px 0 8px; }
.prose p, .prose li { margin-bottom: 12px; color: var(--color-text-soft); }
.prose ul { list-style: disc; padding-left: 22px; }

/* ============ 8. FOOTER ============ */
.footer {
  background: #201a35;
  color: #cfc9e6;
  padding: 64px 0 28px;
}
.footer h4 { color: #fff; margin-bottom: 16px; font-size: 1.1rem; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 32px;
}
.footer a { color: #cfc9e6; }
.footer a:hover { color: #fff; }
.footer li { margin-bottom: 10px; }
.footer .logo { color: #fff; margin-bottom: 16px; }
.footer .social { display: flex; gap: 12px; margin-top: 16px; }
.footer .social a {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(255,255,255,.1);
  display: grid; place-items: center; font-size: 1.1rem;
}
.footer .social a:hover { background: var(--color-primary); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  margin-top: 48px; padding-top: 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: .9rem;
}
.footer-bottom .legal-links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ============ 9. RESPONSIVE ============ */
@media (max-width: 900px) {
  .hero-grid, .split { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-art { max-width: 420px; margin: 0 auto; }

  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed;
    top: var(--header-height); left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    padding: 16px;
    gap: 4px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, padding .3s ease;
    box-shadow: var(--shadow);
  }
  .nav-menu.open { max-height: 90vh; overflow-y: auto; }
  .dropdown {
    position: static;
    opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none;
    max-height: 0; overflow: hidden; padding: 0;
    transition: max-height .3s;
  }
  .has-dropdown.open .dropdown { max-height: 500px; padding: 4px 0 4px 16px; }
  .has-dropdown:hover .dropdown { opacity: 1; }
}

@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .price-card.featured { transform: none; }
  .stats { gap: 24px; }
}

/* ============================================================
   10. CATÁLOGO DE LIBROS (Kraikus Publications)
   Componentes para mostrar libros, colecciones y el modal.
   ============================================================ */
:root { --cover-ar: 1000 / 1413; }  /* proporción real de las portadas */

/* ---- Selector de idioma con banderas ---- */
.lang-switch { display: flex; gap: 7px; }
.lang-btn {
  width: 30px; height: 20px; padding: 0; border: 1px solid var(--color-border);
  border-radius: 5px; background: none; cursor: pointer; overflow: hidden;
  display: flex; opacity: .5; transition: opacity .15s, border-color .15s, box-shadow .15s;
}
.lang-btn svg { width: 100%; height: 100%; display: block; }
.lang-btn:hover { opacity: .85; }
.lang-btn.active { opacity: 1; border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(108,75,216,.25); }

/* ---- Tarjeta de libro ---- */
.book-card { text-align: center; cursor: pointer; }
.book-card .cover-wrap {
  position: relative; border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-soft); transition: transform .2s, box-shadow .2s;
  aspect-ratio: var(--cover-ar); background: var(--color-bg-alt);
}
.book-card:hover .cover-wrap { transform: translateY(-6px); box-shadow: var(--shadow); }
.book-card .cover-wrap img { width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 18px; color: #fff; font-family: var(--font-heading);
  font-weight: 700; font-size: 16px; text-shadow: 0 1px 6px rgba(0,0,0,.25);
}
.book-card h4 { font-size: 15px; font-weight: 700; margin: 14px 0 2px; font-family: var(--font-heading); color: var(--color-text); }
.book-card .level { font-size: 13px; color: var(--color-text-soft); }
.book-card .price { font-size: 14px; color: var(--color-primary); font-weight: 700; margin-top: 4px; }
.book-card .price-alt { font-size: 12.5px; color: var(--color-text-soft); margin-top: 1px; }

/* ---- Grid de libros ---- */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 38px 26px; }

/* ---- Valoraciones (estrellas) ---- */
.rating { display: flex; align-items: center; gap: 7px; justify-content: center; margin-top: 5px; }
.stars { position: relative; display: inline-block; font-size: 15px; line-height: 1; letter-spacing: 1px; }
.stars-bg { color: #e2ddd0; }
.stars-fg { color: #f5b301; position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; }
.rating-num { font-size: 13px; color: var(--color-text-soft); font-weight: 600; }
.review-quote { background: var(--color-bg-alt); border-radius: 12px; padding: 14px 16px; font-size: 14.5px; font-style: italic; color: var(--color-text); margin-top: 16px; }
.review-author { display: block; font-style: normal; font-weight: 700; color: var(--color-text-soft); font-size: 13px; margin-top: 6px; }

/* ---- Estanterías por colección (carrusel) ---- */
.series-shelf { margin-bottom: 56px; scroll-margin-top: 90px; }
.series-shelf:last-child { margin-bottom: 0; }
.series-intro { display: flex; align-items: center; gap: 22px; margin-bottom: 22px; }
.series-img {
  width: 116px; height: 116px; border-radius: 18px; object-fit: cover; flex-shrink: 0;
  box-shadow: var(--shadow-soft);
}
.series-img-ph { display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--font-heading); font-size: 50px; font-weight: 800; text-shadow: 0 1px 8px rgba(0,0,0,.25); }
.series-text h3 { font-size: clamp(21px, 3vw, 30px); margin-bottom: 6px; }
.series-text p { color: var(--color-text-soft); font-size: 15.5px; line-height: 1.55; max-width: 640px; margin: 0 0 8px; }
.series-text .count { font-size: 13px; color: var(--color-primary); font-weight: 700; }
.shelf-row {
  display: flex; gap: 24px; overflow-x: auto; padding: 8px 2px 20px; margin: 0 -2px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.shelf-row::-webkit-scrollbar { height: 8px; }
.shelf-row::-webkit-scrollbar-track { background: transparent; }
.shelf-row::-webkit-scrollbar-thumb { background: rgba(108,75,216,.25); border-radius: 10px; }
.shelf-row .book-card { flex: 0 0 168px; width: 168px; scroll-snap-align: start; }

/* ---- Tarjeta de colección (portada / resumen) ---- */
.collection-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.collection-cover {
  position: relative; overflow: hidden;
  aspect-ratio: 16/9; display: grid; place-items: center; color: #fff;
  background-size: cover; background-position: center;
}
.coll-initial {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-heading); font-size: 3rem; font-weight: 800;
  color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.25);
}
.coll-book {
  position: relative; z-index: 1; height: 80%; width: auto;
  aspect-ratio: var(--cover-ar); object-fit: cover; border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0,0,0,.32);
}
.collection-body { padding: 22px 24px; display: flex; flex-direction: column; flex: 1; }
.collection-body h3 { margin-bottom: 8px; }
.collection-body p { font-size: 14.5px; flex: 1; }
.collection-body .count { font-size: 13px; color: var(--color-primary); font-weight: 700; margin-top: 14px; }

/* ---- Buscador ---- */
.search-bar { max-width: 480px; margin: 0 auto 40px; position: relative; }
.search-bar input {
  width: 100%; padding: 14px 20px 14px 48px; border-radius: 999px;
  border: 1px solid var(--color-border); background: #fff; font-size: 16px; outline: none;
  font-family: var(--font-base); transition: border-color .15s, box-shadow .15s;
}
.search-bar input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(108,75,216,.18); }
.search-bar svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: var(--color-text-soft); }
.no-results { text-align: center; color: var(--color-text-soft); font-size: 16px; padding: 30px 0; display: none; }

/* ---- Modal de detalle del libro ---- */
.modal-back {
  position: fixed; inset: 0; z-index: 200; background: rgba(30,20,50,.55);
  backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; padding: 22px;
}
.modal-back.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius-lg); max-width: 560px; width: 100%;
  padding: 36px; position: relative; display: flex; flex-direction: column; gap: 20px;
  max-height: 90vh; overflow: auto;
}
.modal .close {
  position: absolute; top: 16px; right: 18px; width: 34px; height: 34px; border-radius: 50%;
  border: none; background: var(--color-bg-alt); font-size: 20px; cursor: pointer; color: var(--color-text-soft);
}
.modal .close:hover { background: var(--color-border); }
.modal-cover { width: 180px; aspect-ratio: var(--cover-ar); align-self: center; overflow: hidden; border-radius: 12px; box-shadow: var(--shadow); flex-shrink: 0; }
.modal-cover img { width: 100%; height: 100%; object-fit: cover; }
.modal-body { width: 100%; min-width: 0; }
.modal-body .tag { color: var(--color-primary); font-weight: 700; font-size: 13px; font-family: var(--font-heading); }
.modal-body h3 { font-size: 26px; margin: 6px 0 10px; }
.modal-body .meta { color: var(--color-text-soft); font-size: 14px; margin-bottom: 14px; }
.modal-body .desc { color: var(--color-text); font-size: 15px; line-height: 1.6; margin: 14px 0 20px; }
.fmt-label { font-size: 13px; color: var(--color-text-soft); font-weight: 700; margin: 14px 0 8px; }
.formats { display: flex; flex-wrap: wrap; gap: 8px; }
.formats .fmt {
  background: var(--color-bg-alt); padding: 8px 16px; border-radius: 999px; font-size: 13px;
  color: var(--color-text-soft); border: 1.5px solid transparent; font-family: var(--font-base);
  font-weight: 600; cursor: pointer; transition: all .15s;
}
.formats .fmt:hover { color: var(--color-text); }
.formats .fmt.active { background: #fff; color: var(--color-primary); border-color: var(--color-primary); }
.buy-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.buy-row .btn { flex: 1; min-width: 180px; justify-content: center; }
.buy-btn { flex-direction: column; gap: 2px; line-height: 1.2; }
.buy-btn .buy-label { font-size: 14px; }
.buy-btn .buy-price { font-size: 12.5px; font-weight: 700; opacity: .9; }

@media (max-width: 640px) {
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 28px 18px; }
  .shelf-row .book-card { flex-basis: 140px; width: 140px; }
  .series-intro { flex-direction: column; align-items: flex-start; gap: 14px; }
  .series-img { width: 92px; height: 92px; }
  .modal { padding: 24px 20px; }
  .modal-cover { width: 150px; }
  .modal-body h3 { font-size: 21px; }
}
