/*
 * Hingenia — Ebooks v2 (biblioteca, versión clara, estático sin Vite).
 * Clases prefijadas .heb- para no chocar con Tailwind ni el tema.
 * Incluye overrides de modo oscuro (html.dark).
 */

.heb-main {
	--heb-bg: #ffffff;
	--heb-soft: #f6f7f9;
	--heb-canvas: #eef0f4;
	--heb-ink: #0b0b12;
	--heb-muted: #6b7280;
	--heb-border: #e6e7eb;
	--heb-blue: #2563eb;
	--heb-blue-dark: #1d4ed8;
	--heb-blue-soft: #eff4ff;
	--heb-green: #16a34a;
	--heb-gold: #f59e0b;
	background: var(--heb-canvas);
	color: var(--heb-ink);
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
	-webkit-font-smoothing: antialiased;
	line-height: 1.5;
	position: relative;
}
.heb-main * { box-sizing: border-box; }
.heb-main a { color: inherit; text-decoration: none; }
.heb-main button { font-family: inherit; cursor: pointer; }
.heb-wrap { max-width: 1240px; margin: 0 auto; padding: 0 28px; }

/* ---------- HERO ---------- */
.heb-hero { padding: 44px 0 8px; }
.heb-badge { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--heb-border); background: var(--heb-bg); border-radius: 999px; padding: 6px 14px 6px 7px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--heb-blue); font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.heb-badge .heb-mark { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; background: var(--heb-blue); }
.heb-title { margin-top: 18px; font-size: clamp(34px, 5vw, 70px); font-weight: 900; letter-spacing: -.035em; line-height: 1; max-width: 18ch; color: var(--heb-ink); }
.heb-title .heb-accent { color: var(--heb-blue); }
.heb-subtitle { margin-top: 16px; font-size: 17px; line-height: 1.6; color: var(--heb-muted); max-width: 60ch; }

.heb-searchbar { margin-top: 22px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--heb-border); border-radius: 14px; padding: 7px 7px 7px 16px; max-width: 680px; box-shadow: 0 8px 30px -22px rgba(0,0,0,.35); background: var(--heb-bg); }
.heb-searchbar svg { color: var(--heb-muted); flex-shrink: 0; }
.heb-searchbar input { flex: 1; border: 0; outline: 0; font-size: 15px; font-family: inherit; background: transparent; color: var(--heb-ink); }
.heb-searchbar button { border: 0; background: var(--heb-ink); color: #fff; font-family: inherit; font-size: 14px; font-weight: 600; padding: 11px 22px; border-radius: 9px; transition: transform .12s; }
.heb-searchbar button:hover { transform: translateY(-1px); }

.heb-trust { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 14px 18px; border: 1px solid var(--heb-border); border-radius: 14px; background: var(--heb-bg); }
.heb-trust-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: #334155; }
.heb-trust-chip .heb-ic { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 5px; background: var(--heb-blue-soft); color: var(--heb-blue); }
.heb-trust-sep { width: 1px; height: 22px; background: var(--heb-border); }
.heb-stats { display: flex; gap: 22px; margin-left: auto; }
.heb-stat { display: flex; align-items: baseline; gap: 6px; }
.heb-stat b { font-size: 19px; font-weight: 800; letter-spacing: -.02em; color: var(--heb-blue); }
.heb-stat span { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--heb-muted); }

/* ---------- CATÁLOGO ---------- */
.heb-catalog { padding: 34px 0 20px; }
.heb-catalog-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.heb-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--heb-muted); font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.heb-catalog-head h2 { margin-top: 6px; font-size: clamp(26px, 3vw, 36px); font-weight: 800; letter-spacing: -.028em; color: var(--heb-ink); }
.heb-sort { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--heb-muted); }
.heb-sort select { font-family: inherit; font-size: 13px; font-weight: 600; border: 1px solid var(--heb-border); border-radius: 9px; padding: 8px 12px; background: var(--heb-bg); color: var(--heb-ink); cursor: pointer; }

.heb-layout { display: grid; grid-template-columns: 244px 1fr; gap: 26px; align-items: start; }
.heb-sidebar { position: sticky; top: 20px; border: 1px solid var(--heb-border); border-radius: 16px; padding: 6px 6px 14px; background: var(--heb-bg); }
.heb-fgroup { padding: 14px 14px 6px; }
.heb-fgroup + .heb-fgroup { border-top: 1px solid var(--heb-border); }
.heb-flabel { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--heb-muted); font-family: ui-monospace, 'SF Mono', Menlo, monospace; margin-bottom: 10px; }
.heb-fbtn { width: 100%; display: flex; align-items: center; gap: 9px; border: 0; background: transparent; font-family: inherit; font-size: 14px; font-weight: 500; color: #374151; padding: 8px 10px; border-radius: 9px; cursor: pointer; text-align: left; transition: background .12s, color .12s; }
.heb-fbtn:hover { background: var(--heb-soft); }
.heb-fbtn .heb-count { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--heb-muted); font-family: ui-monospace, monospace; }
.heb-fbtn.active { background: var(--heb-ink); color: #fff; font-weight: 600; }
.heb-fbtn.active .heb-count { color: rgba(255,255,255,.65); }
.heb-fbtn .heb-free-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--heb-green); flex-shrink: 0; }
.heb-fbtn.active .heb-free-dot { background: #4ade80; }

.heb-results-meta { font-size: 13px; color: var(--heb-muted); margin-bottom: 14px; }
.heb-results-meta b { color: var(--heb-ink); font-weight: 700; }

.heb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.heb-card { border: 1px solid var(--heb-border); border-radius: 16px; overflow: hidden; background: var(--heb-bg); display: flex; flex-direction: column; transition: transform .16s, box-shadow .16s, border-color .16s; }
.heb-card:hover { transform: translateY(-4px); border-color: #cbd5e1; box-shadow: 0 26px 46px -28px rgba(0,0,0,.28); }
.heb-media { position: relative; aspect-ratio: 5 / 4; display: grid; place-items: center; overflow: hidden; background: var(--heb-soft); }
.heb-media-img { width: 100%; height: 100%; object-fit: cover; }
.heb-book { width: 118px; aspect-ratio: 3 / 4.2; border-radius: 4px 9px 9px 4px; padding: 15px 13px 13px 17px; display: flex; flex-direction: column; color: #fff; box-shadow: 0 18px 34px -12px rgba(0,0,0,.5), inset 7px 0 0 rgba(0,0,0,.18); transform: rotate(-3deg); transition: transform .22s; }
.heb-card:hover .heb-book { transform: rotate(0deg) translateY(-3px); }
.heb-book .heb-book-brand { font-size: 7.5px; font-weight: 800; letter-spacing: .16em; opacity: .85; }
.heb-book .heb-book-title { margin-top: auto; font-size: 12px; font-weight: 900; line-height: 1.12; letter-spacing: -.01em; text-shadow: 0 1px 4px rgba(0,0,0,.3); }
.heb-book .heb-book-author { font-size: 8px; opacity: .85; margin-top: 5px; }
.heb-pill { position: absolute; top: 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 5px 9px; border-radius: 999px; backdrop-filter: blur(4px); }
.heb-pill.heb-free { right: 12px; background: rgba(22,163,74,.96); color: #fff; }

.heb-card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.heb-card-cat { font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--heb-blue); font-family: ui-monospace, monospace; }
.heb-card-title { font-size: 16px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; color: var(--heb-ink); }
.heb-card-author { font-size: 12.5px; color: var(--heb-muted); }
.heb-card-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; font-weight: 600; color: var(--heb-muted); font-family: ui-monospace, monospace; }
.heb-card-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--heb-border); display: flex; align-items: center; justify-content: space-between; }
.heb-card-price { font-size: 16px; font-weight: 800; color: var(--heb-blue); }
.heb-card-price.heb-free { color: var(--heb-green); font-size: 13px; text-transform: uppercase; }
.heb-card-actions { display: flex; gap: 8px; margin-top: 12px; }
.heb-btn-detail { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--heb-ink); background: var(--heb-bg); border: 1px solid var(--heb-border); border-radius: 10px; padding: 10px 12px; transition: background .14s, border-color .14s; }
.heb-btn-detail:hover { background: var(--heb-soft); border-color: #cbd5e1; }
.heb-btn-cart { width: 42px; flex-shrink: 0; display: grid; place-items: center; color: #fff; background: var(--heb-blue); border: 0; border-radius: 10px; transition: background .14s, transform .12s; }
.heb-btn-cart:hover { background: var(--heb-blue-dark); transform: translateY(-1px); }

.heb-empty { grid-column: 1 / -1; border: 1px dashed var(--heb-border); border-radius: 16px; padding: 56px 20px; text-align: center; color: var(--heb-muted); }
.heb-empty b { display: block; color: var(--heb-ink); font-size: 16px; margin-bottom: 4px; }

/* ---------- POR QUÉ ---------- */
.heb-why { padding: 60px 0 10px; }
.heb-sec-head { text-align: center; margin-bottom: 36px; }
.heb-sec-head .heb-eyebrow { color: var(--heb-blue); }
.heb-sec-head h2 { margin-top: 8px; font-size: clamp(26px, 3.2vw, 40px); font-weight: 900; letter-spacing: -.035em; color: var(--heb-ink); }
.heb-why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.heb-why-card { border: 1px solid var(--heb-border); border-radius: 16px; background: var(--heb-bg); padding: 24px; }
.heb-why-card .heb-wic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--heb-blue-soft); color: var(--heb-blue); margin-bottom: 14px; }
.heb-why-card h3 { font-size: 17px; font-weight: 800; letter-spacing: -.02em; color: var(--heb-ink); }
.heb-why-card p { margin-top: 7px; font-size: 13.5px; color: var(--heb-muted); line-height: 1.55; }

/* ---------- CTA ---------- */
.heb-cta-band { padding: 30px 0 64px; }
.heb-cta-inner { position: relative; overflow: hidden; border-radius: 24px; background: linear-gradient(135deg, var(--heb-blue-dark), var(--heb-blue) 55%, #3b82f6); color: #fff; padding: 46px 36px; text-align: center; }
.heb-cta-inner::before { content: ''; position: absolute; inset: 0; background-image: repeating-linear-gradient(45deg, transparent 0 40px, rgba(255,255,255,.06) 40px 41px); pointer-events: none; }
.heb-cta-inner h2 { position: relative; font-size: clamp(24px, 3vw, 38px); font-weight: 900; letter-spacing: -.03em; }
.heb-cta-inner p { position: relative; margin: 12px auto 0; max-width: 52ch; color: rgba(255,255,255,.9); }
.heb-cta-actions { position: relative; margin-top: 24px; display: flex; justify-content: center; gap: 11px; flex-wrap: wrap; }
.heb-btn-white { background: #fff; color: var(--heb-blue-dark); font-weight: 800; font-size: 14.5px; padding: 14px 24px; border-radius: 12px; border: 0; }
.heb-btn-outline { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); font-weight: 800; font-size: 14.5px; padding: 14px 24px; border-radius: 12px; }
.heb-btn-outline:hover { background: rgba(255,255,255,.12); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 980px) {
	.heb-layout { grid-template-columns: 1fr; }
	.heb-sidebar { position: static; }
	.heb-flist { display: flex; flex-wrap: wrap; gap: 6px; }
	.heb-fbtn { width: auto; }
	.heb-grid { grid-template-columns: repeat(2, 1fr); }
	.heb-stats { margin-left: 0; width: 100%; }
	.heb-why-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
	.heb-grid { grid-template-columns: 1fr; }
	.heb-wrap { padding: 0 18px; }
}

/* ---------- MODO OSCURO ---------- */
html.dark .heb-main { --heb-bg: #101012; --heb-soft: #18181b; --heb-canvas: #080809; --heb-ink: #e5e7eb; --heb-muted: #9aa1ac; --heb-border: rgba(255,255,255,.08); --heb-blue-soft: rgba(37,99,235,.18); background: #080809; }
html.dark .heb-trust-chip { color: #cbd5e1; }
html.dark .heb-fbtn { color: #cbd5e1; }
html.dark .heb-fbtn.active { background: #2563eb; }
html.dark .heb-searchbar button { background: #2563eb; }
html.dark .heb-btn-detail { color: #e5e7eb; }
