:root {
  --bg-main: #0b0d12;
  --bg-surface: #141821;
  --bg-card: #1b202c;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --accent-red: #e50914;
  --accent-amber: #f59e0b;
  --accent-amber-hover: #d97706;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --radius: 8px;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

/* NAVBAR */
.navbar {
  position: fixed;
  top: 0; width: 100%; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 4%;
  background: linear-gradient(to bottom, rgba(11,13,18,0.95), rgba(11,13,18,0));
  transition: background 0.3s;
}
.navbar.scrolled { background: rgba(11, 13, 18, 0.96); border-bottom: 1px solid var(--border-subtle); }
.nav-left { display: flex; align-items: center; gap: 2rem; }
.logo { font-size: 1.5rem; font-weight: 800; color: #fff; text-decoration: none; letter-spacing: 1px; }
.logo span { color: var(--accent-red); }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 0.95rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: #fff; }

#searchInput {
  background: rgba(255,255,255,0.1); border: 1px solid var(--border-subtle);
  color: #fff; padding: 0.5rem 1rem; border-radius: 20px; width: 240px; outline: none;
}
#searchInput:focus { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.15); }

/* HERO */
.hero {
  position: relative; height: 72vh; min-height: 460px;
  background-size: cover; background-position: center;
  display: flex; align-items: flex-end; padding: 4rem 4%;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg-main) 8%, rgba(11,13,18,0.4) 60%, rgba(11,13,18,0.7) 100%),
              linear-gradient(to right, rgba(11,13,18,0.9) 20%, transparent 80%);
}
.hero-content { position: relative; z-index: 2; max-width: 650px; }
.badge-destacado {
  background: var(--accent-red); color: #fff; font-size: 0.75rem;
  font-weight: 700; padding: 0.25rem 0.6rem; border-radius: 4px; letter-spacing: 0.5px;
}
.hero-content h1 { font-size: clamp(2rem, 4vw, 3.2rem); margin: 0.6rem 0; line-height: 1.1; }
.hero-content p { color: #d1d5db; font-size: 1.05rem; margin-bottom: 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.tag-chip { background: rgba(255,255,255,0.12); padding: 0.2rem 0.65rem; border-radius: 12px; font-size: 0.8rem; color: #e5e7eb; }

.btn-play {
  background: #fff; color: #000; border: none; padding: 0.8rem 1.8rem;
  font-size: 1rem; font-weight: 700; border-radius: 6px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.5rem; transition: transform 0.2s, background 0.2s;
}
.btn-play:hover { background: #e5e7eb; transform: scale(1.03); }

/* FILTER BAR */
.filter-bar { padding: 1rem 4%; display: flex; align-items: center; gap: 1rem; overflow-x: auto; }
.filter-label { font-size: 0.85rem; color: var(--text-secondary); white-space: nowrap; }
.tag-pills { display: flex; gap: 0.5rem; }
.pill {
  background: var(--bg-surface); color: var(--text-secondary); border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.9rem; border-radius: 20px; cursor: pointer; font-size: 0.85rem; white-space: nowrap;
}
.pill.active, .pill:hover { background: #fff; color: #000; font-weight: 600; }

/* CARRUSELES */
.carousel-section { padding: 1.5rem 4%; }
.section-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.section-title { font-size: 1.35rem; font-weight: 700; margin-bottom: 0.9rem; }
.section-header .section-title { margin-bottom: 0; }
.affiliate-micro-badge { font-size: 0.75rem; color: var(--accent-amber); border: 1px solid rgba(245,158,11,0.3); padding: 0.15rem 0.5rem; border-radius: 4px; }

.carousel-row {
  display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem;
  scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: #374151 transparent;
}
.grid-results {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem;
}

/* TARJETAS DE DOCUMENTAL (16:9) */
.doc-card {
  flex: 0 0 280px; scroll-snap-align: start;
  background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid var(--border-subtle);
}
.doc-card:hover { transform: translateY(-5px) scale(1.02); box-shadow: 0 10px 25px rgba(0,0,0,0.6); border-color: rgba(255,255,255,0.25); }
.doc-thumb { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.play-badge {
  position: absolute; inset: 0; background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s; font-size: 2rem;
}
.doc-card:hover .play-badge { opacity: 1; }
.doc-info { padding: 0.85rem; }
.doc-info h3 { font-size: 1rem; margin-bottom: 0.35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-info p { font-size: 0.82rem; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* TARJETAS DE PRODUCTO AMAZON (LIBROS 2:3 Y REGALOS 1:1) */
.product-card {
  flex: 0 0 210px; scroll-snap-align: start;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: 0.85rem; display: flex; flex-direction: column; justify-content: space-between;
}
.product-img-box {
  width: 100%; aspect-ratio: 1 / 1; background: #fff; border-radius: 6px;
  overflow: hidden; display: flex; align-items: center; justify-content: center; margin-bottom: 0.75rem; padding: 0.5rem;
}
.product-card.book-type .product-img-box { aspect-ratio: 2 / 3; background: #111; padding: 0; }
.product-img-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.product-card.book-type .product-img-box img { width: 100%; height: 100%; object-fit: cover; }

.product-gama { font-size: 0.72rem; color: var(--accent-amber); font-weight: 600; text-transform: uppercase; margin-bottom: 0.25rem; }
.product-card h3 { font-size: 0.95rem; margin-bottom: 0.35rem; line-height: 1.3; }
.product-card p { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.btn-amazon {
  display: block; text-align: center; background: var(--accent-amber); color: #111;
  font-weight: 700; font-size: 0.85rem; padding: 0.55rem 0.8rem; border-radius: 6px;
  text-decoration: none; transition: background 0.2s;
}
.btn-amazon:hover { background: var(--accent-amber-hover); }

/* MODAL REPRODUCTOR */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,0.88);
  display: flex; align-items: center; justify-content: center; padding: 1rem; overflow-y: auto;
}
.hidden { display: none !important; }
.modal-container {
  position: relative; background: var(--bg-surface); width: 100%; max-width: 960px;
  border-radius: 12px; overflow: hidden; border: 1px solid var(--border-subtle);
  max-height: 92vh; overflow-y: auto;
}
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 10;
  background: rgba(0,0,0,0.75); color: #fff; border: 1px solid rgba(255,255,255,0.2);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1.1rem;
}
.video-wrapper { position: relative; aspect-ratio: 16 / 9; width: 100%; background: #000; }
.video-wrapper iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.modal-body { padding: 1.5rem 2rem; }
.modal-meta { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.modal-category { color: var(--accent-red); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; }
.modal-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.modal-doc-info h2 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.modal-doc-info p { color: #d1d5db; margin-bottom: 1.5rem; }

/* CROSS-SELLING DENTRO DEL MODAL */
.cross-sell-box {
  background: var(--bg-card); border-radius: 10px; padding: 1.25rem;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.cross-sell-box h3 { font-size: 1.1rem; color: #fff; }
.cross-sell-subtitle { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1rem; }
.cross-sell-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.cross-item {
  background: var(--bg-surface); border-radius: 8px; padding: 0.75rem;
  display: flex; gap: 0.75rem; align-items: center; border: 1px solid var(--border-subtle);
}
.cross-item img { width: 58px; height: 75px; object-fit: cover; border-radius: 4px; background: #fff; flex-shrink: 0; }
.cross-item-info { flex: 1; min-width: 0; }
.cross-item-type { font-size: 0.68rem; color: var(--accent-amber); font-weight: 700; text-transform: uppercase; }
.cross-item-info h4 { font-size: 0.85rem; margin: 0.15rem 0 0.4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cross-item .btn-amazon { padding: 0.35rem 0.6rem; font-size: 0.78rem; }
.legal-inline { font-size: 0.72rem; color: var(--text-secondary); margin-top: 0.85rem; }

/* FOOTER */
.site-footer {
  margin-top: 3rem; padding: 2.5rem 4%; background: #07080b;
  border-top: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: 0.82rem;
}
.footer-content { max-width: 900px; }
.footer-brand { color: #fff; margin-bottom: 0.6rem; }