/* ── Libros Padre Horacio Bojorge ───────────────────────────────── */

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

:root {
    --teal:      #2c92a6;
    --teal-dark: #1f6e7e;
    --teal-light:#e8f6f9;
    --gold:      #c8a84b;
    --gold-dark: #8B6914;
    --gold-light:#fdf8ec;
    --cream:     #f5f0e8;
    --cream-2:   #ede6d6;
    --dark:      #1a1a2e;
    --text:      #2d2d2d;
    --muted:     #6b6560;
    --white:     #ffffff;
    --radius:    12px;
    --shadow:    0 8px 32px rgba(0,0,0,.10);
    --shadow-sm: 0 2px 8px rgba(0,0,0,.07);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--cream);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
.hjb-header {
    background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 100%);
    border-bottom: 4px solid var(--gold);
    position: relative;
    overflow: hidden;
}
.hjb-header::after {
    content: '';
    position: absolute;
    bottom: -40px; right: -40px;
    width: 220px; height: 220px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
}
.hjb-header-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 22px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}
.hjb-header-logo h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -.3px;
    line-height: 1.2;
}
.hjb-header-logo span {
    font-size: 12px;
    color: rgba(255,255,255,.72);
    letter-spacing: 2px;
    text-transform: uppercase;
    display: block;
    margin-top: 2px;
}
.hjb-volver {
    color: var(--white);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border: 2px solid rgba(255,255,255,.45);
    padding: 8px 20px;
    border-radius: 30px;
    letter-spacing: .4px;
    transition: all .22s;
    white-space: nowrap;
    background: rgba(255,255,255,.08);
}
.hjb-volver:hover {
    background: rgba(255,255,255,.2);
    border-color: rgba(255,255,255,.8);
}

/* ══════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════ */
.hjb-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 48px 28px 64px;
    flex: 1;
    width: 100%;
}

/* ══════════════════════════════════════════
   SECCIONES / CARDS
══════════════════════════════════════════ */
.hjb-seccion {
    background: var(--white);
    border-radius: var(--radius);
    padding: 48px 52px;
    margin-bottom: 28px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(200,168,75,.15);
    position: relative;
}
.hjb-seccion-titulo {
    font-size: 22px;
    font-weight: 700;
    color: var(--teal-dark);
    padding-bottom: 16px;
    margin-bottom: 32px;
    border-bottom: 3px solid var(--gold);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -.2px;
}
.hjb-don-seccion {
    border-top: 5px solid var(--teal);
    background: linear-gradient(160deg, #fff 60%, var(--teal-light) 100%);
}
.hjb-don-titulo { color: var(--teal-dark) !important; }

/* ══════════════════════════════════════════
   AVISOS
══════════════════════════════════════════ */
.hjb-aviso {
    padding: 13px 18px;
    border-radius: 8px;
    margin-bottom: 22px;
    font-size: 14px;
    line-height: 1.6;
}
.hjb-ok   { background:#edf7ed; border-left:4px solid #2e7d32; color:#1b5e20; }
.hjb-warn { background:#fff8e1; border-left:4px solid #f9a825; color:#5f4200; }
.hjb-err  { background:#fdecea; border-left:4px solid #c62828; color:#7f0000; }

/* ══════════════════════════════════════════
   TOGGLE MONEDA
══════════════════════════════════════════ */
.hjb-moneda-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    background: var(--cream);
    border-radius: 8px;
    padding: 6px 8px;
    width: fit-content;
    border: 1px solid var(--cream-2);
}
.hjb-moneda-toggle strong {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .8px;
    padding-right: 6px;
}
.hjb-moneda-toggle label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    padding: 5px 14px;
    border-radius: 6px;
    transition: background .18s;
}
.hjb-moneda-toggle label:has(input:checked) {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    color: var(--teal-dark);
    font-weight: 700;
}
.hjb-moneda-toggle input[type="radio"] {
    accent-color: var(--teal);
}

/* Referencias de precios */
.hjb-precios-ref {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
.hjb-precios-ref span {
    background: var(--teal-light);
    border: 1.5px solid rgba(44,146,166,.3);
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 14px;
    color: var(--teal-dark);
    font-weight: 700;
}

/* ══════════════════════════════════════════
   GRILLA DE LIBROS
══════════════════════════════════════════ */
.hjb-instruccion { color: var(--muted); font-size: 14px; margin-bottom: 28px; }

.hjb-libros-grilla {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
    margin-bottom: 28px;
}

.hjb-libro-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
    border: 1.5px solid #e8e0d0;
    border-radius: 14px;
    cursor: pointer;
    background: var(--white);
    overflow: hidden;
    transition: transform .26s cubic-bezier(.34,1.4,.64,1), box-shadow .26s ease;
    box-shadow: 0 4px 18px rgba(0,0,0,.09);
    user-select: none;
}
.hjb-libro-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0,0,0,.15);
}
.hjb-libro-item:has(.hjb-check:checked) {
    border-color: var(--teal);
    box-shadow: 0 6px 24px rgba(44,146,166,.25);
}

/* Ocultar checkbox nativo */
.hjb-libro-item input[type="checkbox"] { display: none; }

/* Imagen */
.hjb-libro-tapa-wrap {
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
    flex-shrink: 0;
}
.hjb-libro-tapa {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .36s ease;
}
.hjb-libro-item:hover .hjb-libro-tapa { transform: scale(1.05); }

/* Placeholder sin tapa */
.hjb-libro-sin-tapa {
    width: 100%;
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, var(--teal-light) 0%, var(--cream) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    opacity: .45;
    flex-shrink: 0;
}

/* Info */
.hjb-libro-info {
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 9px;
    flex: 1;
}
.hjb-libro-info::before {
    content: '';
    display: block;
    width: 36px;
    height: 3px;
    background: var(--teal);
    border-radius: 2px;
}
.hjb-libro-titulo {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.35;
    font-family: Georgia, serif;
}
.hjb-libro-desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
    flex: 1;
}

/* Botón */
.hjb-btn-comprar-libro {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: var(--teal);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    margin-top: 6px;
    transition: background .2s;
    letter-spacing: .3px;
}
.hjb-btn-comprar-libro:hover { background: var(--teal-dark); }
.hjb-libro-item:has(.hjb-check:checked) .hjb-btn-comprar-libro {
    background: var(--gold-dark);
}

/* ══════════════════════════════════════════
   FORMULARIO
══════════════════════════════════════════ */

.hjb-campo { margin-bottom: 16px; }
.hjb-campo label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .8px;
}
.hjb-campo input[type="text"],
.hjb-campo input[type="email"],
.hjb-campo input[type="number"] {
    width: 100%;
    max-width: 420px;
    padding: 11px 15px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    transition: border-color .2s, box-shadow .2s;
}
.hjb-campo input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(44,146,166,.13);
}
.hjb-campo small { color: var(--muted); font-size: 12px; margin-top: 5px; display: block; }

/* ══════════════════════════════════════════
   BOTONES PRINCIPALES
══════════════════════════════════════════ */
.hjb-btn-comprar,
.hjb-btn-donar {
    display: block;
    width: 100%;
    max-width: 420px;
    padding: 15px 32px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: .3px;
    transition: all .22s;
    margin-top: 8px;
    text-align: center;
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 18px rgba(44,146,166,.35);
}
.hjb-btn-comprar:hover,
.hjb-btn-donar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(44,146,166,.45);
    background: linear-gradient(135deg, var(--teal-dark) 0%, #155f6e 100%);
}
.hjb-btn-comprar:active,
.hjb-btn-donar:active  { transform: translateY(0); }
.hjb-btn-comprar:disabled,
.hjb-btn-donar:disabled { background: #bbb; box-shadow: none; cursor: not-allowed; transform: none; }

.hjb-seguro { font-size: 12px; color: var(--muted); margin-top: 12px; }

/* ══════════════════════════════════════════
   DONACIÓN
══════════════════════════════════════════ */
.hjb-donacion-desc {
    color: var(--muted);
    font-size: 15px;
    margin-bottom: 22px;
    line-height: 1.7;
    border-left: 3px solid var(--teal);
    padding-left: 14px;
    font-style: italic;
}

.hjb-montos-rapidos {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}
.hjb-monto-btn {
    background: var(--white);
    border: 2px solid rgba(44,146,166,.3);
    border-radius: 8px;
    padding: 12px 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--teal-dark);
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
    text-align: center;
}
.hjb-monto-btn:hover {
    background: var(--teal-light);
    border-color: var(--teal);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44,146,166,.2);
}
.hjb-monto-btn.activo {
    background: var(--teal);
    color: var(--white);
    border-color: var(--teal);
    box-shadow: 0 4px 12px rgba(44,146,166,.35);
}

/* ══════════════════════════════════════════
   FILTROS POR CATEGORÍA
══════════════════════════════════════════ */
.hjb-cat-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding: 4px 0;
}
.hjb-cat-tab {
    background: var(--white);
    border: 1.5px solid var(--cream-2);
    border-radius: 24px;
    padding: 9px 22px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.hjb-cat-tab:hover {
    border-color: var(--teal);
    color: var(--teal-dark);
    background: var(--teal-light);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(44,146,166,.15);
}
.hjb-cat-tab.activo {
    background: var(--teal);
    border-color: var(--teal);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(44,146,166,.35);
}

/* ══════════════════════════════════════════
   BARRA FLOTANTE DE CHECKOUT
══════════════════════════════════════════ */
.hjb-bar-flotante {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--teal-dark);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    z-index: 500;
    box-shadow: 0 -4px 24px rgba(0,0,0,.25);
    gap: 16px;
}
.hjb-bar-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hjb-bar-cant  { font-size: 13px; opacity: .82; }
.hjb-bar-precio { font-size: 24px; font-weight: 800; line-height: 1.1; }
.hjb-bar-btn {
    background: var(--gold);
    color: var(--dark);
    border: none;
    border-radius: 8px;
    padding: 13px 28px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, color .2s;
    letter-spacing: .3px;
}
.hjb-bar-btn:hover { background: var(--gold-dark); color: var(--white); }

/* Resumen dentro del modal checkout */
.hjb-checkout-resumen {
    background: var(--teal-light);
    border: 1.5px solid rgba(44,146,166,.2);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 18px;
    font-size: 15px;
    font-weight: 700;
    color: var(--teal-dark);
}

/* ══════════════════════════════════════════
   BANNER DESCARGA GRATIS
══════════════════════════════════════════ */
.hjb-banner-gratis {
    background: linear-gradient(135deg, var(--gold-light) 0%, #fff 100%);
    border: 1.5px solid rgba(200,168,75,.4);
    border-radius: 12px;
    padding: 16px 22px;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 24px;
    line-height: 1.7;
}
.hjb-banner-gratis a { color: var(--teal-dark); font-weight: 700; }

/* Botón gratis por tarjeta */
.hjb-btn-gratis {
    display: block;
    width: 100%;
    padding: 7px;
    background: none;
    border: 1.5px solid rgba(44,146,166,.35);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--teal-dark);
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
    margin-top: 5px;
}
.hjb-btn-gratis:hover { background: var(--teal-light); border-color: var(--teal); }

/* Modal descarga gratis */
.hjb-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.52);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.hjb-modal-caja {
    background: var(--white);
    border-radius: 16px;
    padding: 32px 28px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 12px 48px rgba(0,0,0,.22);
}
.hjb-modal-caja h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--teal-dark);
    margin-bottom: 6px;
    font-family: Georgia, serif;
}
.hjb-modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.hjb-modal-cerrar-txt {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    margin-top: 10px;
    font-family: inherit;
    text-align: center;
}
.hjb-modal-cerrar-txt:hover { color: var(--text); }

/* ══════════════════════════════════════════
   TOGGLE DONACIÓN
══════════════════════════════════════════ */
.hjb-donar-toggle-wrap {
    text-align: center;
    margin: 8px 0 20px;
}
.hjb-donar-toggle {
    background: none;
    border: 2px solid var(--teal);
    color: var(--teal);
    padding: 10px 28px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
    letter-spacing: .3px;
}
.hjb-donar-toggle:hover {
    background: var(--teal);
    color: var(--white);
}

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.hjb-footer {
    background: var(--dark);
    color: #666;
    text-align: center;
    padding: 20px;
    font-size: 13px;
}
.hjb-footer a { color: var(--teal); text-decoration: none; }
.hjb-footer a:hover { color: var(--white); }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 900px) {
    .hjb-libros-grilla  { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}
@media (max-width: 680px) {
    .hjb-main           { padding: 28px 16px 48px; }
    .hjb-seccion        { padding: 28px 22px; }
    .hjb-montos-rapidos { grid-template-columns: repeat(4, 1fr); gap: 7px; }
    .hjb-monto-btn      { font-size: 13px; padding: 10px 4px; }
    .hjb-btn-comprar,
    .hjb-btn-donar      { max-width: 100%; }
    .hjb-libros-grilla  { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .hjb-libro-titulo   { font-size: 14px; }
    .hjb-header-logo h1 { font-size: 20px; }
    .hjb-bar-flotante   { padding: 12px 16px; }
    .hjb-bar-precio     { font-size: 18px; }
    .hjb-bar-btn        { padding: 11px 18px; font-size: 14px; }
    .hjb-cat-tab        { font-size: 12px; padding: 7px 14px; }
}
@media (max-width: 400px) {
    .hjb-libros-grilla  { grid-template-columns: 1fr; }
    .hjb-montos-rapidos { grid-template-columns: repeat(4, 1fr); gap: 5px; }
    .hjb-monto-btn      { font-size: 12px; padding: 8px 2px; }
}
