/* =====================================================================
   Math Love Institute — Books module styles
   Every class is prefixed bk- so nothing touches existing selectors
   (.slide, .slider-dot, .arrow, .card … are used by the current site).
   Uses the theme variables already declared in assets/css/style.css.
   ===================================================================== */

.bk-wrap { max-width: 1400px; margin: 0 auto; padding: 0 2rem; }

/* ── Page hero (listing / status pages) ── */
.bk-page-hero {
    background: linear-gradient(135deg, var(--primary, #1e5a96), #2874b8);
    color: #fff; text-align: center; padding: 3.2rem 1.5rem 2.6rem;
}
.bk-page-hero h1 { font-size: 2.4rem; margin-bottom: .4rem; }
.bk-page-hero p  { opacity: .92; font-size: 1.05rem; }

/* ── Filters ── */
.bk-filters {
    display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center;
    margin: 2rem auto 1rem; max-width: 900px;
}
.bk-filters select, .bk-filters input {
    padding: .65rem 1rem; border: 2px solid #e9ecef; border-radius: 10px;
    font-size: .95rem; background: #fff; min-width: 170px; font-family: inherit;
}
.bk-filters button, .bk-filters a.bk-reset {
    padding: .65rem 1.3rem; border-radius: 10px; border: none; cursor: pointer;
    font-weight: 600; font-size: .95rem; text-decoration: none; font-family: inherit;
}
.bk-filters button { background: var(--primary, #1e5a96); color: #fff; }
.bk-filters a.bk-reset { background: #eef2f7; color: #333; }

/* ── Grid + card ── */
.bk-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.8rem; padding: 1.5rem 0 4rem;
}
.bk-card {
    background: #fff; border-radius: 16px; overflow: hidden; position: relative;
    box-shadow: 0 4px 18px rgba(30, 90, 150, .10); display: flex; flex-direction: column;
    transition: transform .25s ease, box-shadow .25s ease; text-decoration: none; color: inherit;
}
.bk-card:hover { transform: translateY(-5px); box-shadow: 0 12px 30px rgba(30, 90, 150, .18); }
.bk-cover {
    position: relative; aspect-ratio: 3 / 4; background: linear-gradient(135deg, #eef3fa, #dde8f5);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.bk-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.bk-card:hover .bk-cover img { transform: scale(1.04); }
.bk-cover .bk-noimg { font-size: 3.5rem; color: var(--primary, #1e5a96); opacity: .5; }
.bk-ribbon {
    position: absolute; top: 12px; left: 12px; background: var(--secondary, #e91e63); color: #fff;
    font-size: .72rem; font-weight: 700; padding: .25rem .65rem; border-radius: 20px; letter-spacing: .5px;
}
.bk-off {
    position: absolute; top: 12px; right: 12px; background: #16a34a; color: #fff;
    font-size: .75rem; font-weight: 700; padding: .25rem .6rem; border-radius: 20px;
}
.bk-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; flex: 1; }
.bk-meta { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .55rem; }
.bk-tag {
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
    padding: .2rem .6rem; border-radius: 6px; background: #eef3fa; color: var(--primary, #1e5a96);
}
.bk-tag.bk-tag-alt { background: #fff1ea; color: #c2410c; }
.bk-title { font-size: 1.08rem; line-height: 1.35; color: var(--dark, #1a1a2e); margin-bottom: .35rem; font-weight: 700; }
.bk-short { color: #666; font-size: .9rem; margin-bottom: .9rem; flex: 1; }
.bk-prices { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .9rem; }
.bk-mrp { color: #888; text-decoration: line-through; font-size: .95rem; }
.bk-mrp-label { color: #888; font-size: .78rem; }
.bk-sp { color: var(--primary, #1e5a96); font-size: 1.45rem; font-weight: 800; }
.bk-sp small { font-size: .72rem; font-weight: 700; color: #16a34a; margin-right: .25rem; letter-spacing: .4px; }

.bk-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .8rem 1.4rem; border-radius: 50px; border: none; cursor: pointer;
    font-weight: 700; font-size: .95rem; text-decoration: none; font-family: inherit;
    background: linear-gradient(135deg, var(--accent, #ff6b35), #ff8c42); color: #fff;
    transition: transform .2s ease, box-shadow .2s ease; box-shadow: 0 4px 14px rgba(255, 107, 53, .3);
}
.bk-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255, 107, 53, .4); color: #fff; }
.bk-btn.bk-btn-block { width: 100%; }
.bk-btn.bk-btn-outline {
    background: #fff; color: var(--primary, #1e5a96); border: 2px solid var(--primary, #1e5a96); box-shadow: none;
}
.bk-btn.bk-btn-outline:hover { background: var(--primary, #1e5a96); color: #fff; }
.bk-btn.bk-btn-lg { padding: 1rem 2.2rem; font-size: 1.08rem; }
.bk-btn[disabled], .bk-btn.bk-loading { opacity: .7; pointer-events: none; }
.bk-card-actions { display: flex; gap: .5rem; }
.bk-card-actions .bk-btn { flex: 1; padding: .7rem .8rem; font-size: .88rem; }

.bk-empty { text-align: center; padding: 4rem 1rem; color: #777; }
.bk-empty i { font-size: 3rem; color: #c7d4e6; margin-bottom: 1rem; display: block; }

/* ── Homepage book slider ── */
.bk-home { background: linear-gradient(180deg, #f5f8fc 0%, #ffffff 100%); padding: 2.4rem 0 1.8rem; }
.bk-home-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
    flex-wrap: wrap; margin-bottom: 1.4rem;
}
.bk-home-head h2 { font-size: 2rem; color: var(--primary, #1e5a96); line-height: 1.2; }
.bk-home-head h2 i { color: var(--accent, #ff6b35); margin-right: .35rem; }
.bk-home-head p { color: #666; margin-top: .2rem; }
.bk-home-nav { display: flex; gap: .5rem; align-items: center; }
.bk-home-nav a.bk-all { color: var(--primary, #1e5a96); font-weight: 700; text-decoration: none; margin-right: .6rem; white-space: nowrap; }
.bk-nav-btn {
    width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--primary, #1e5a96);
    background: #fff; color: var(--primary, #1e5a96); cursor: pointer; font-size: 1rem;
    display: inline-flex; align-items: center; justify-content: center; transition: all .2s;
}
.bk-nav-btn:hover { background: var(--primary, #1e5a96); color: #fff; }
.bk-track {
    display: grid; grid-auto-flow: column; grid-auto-columns: 225px;
    gap: 1.5rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
    padding: .4rem .2rem 1.2rem; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.bk-track::-webkit-scrollbar { display: none; }
.bk-track > .bk-card { scroll-snap-align: start; }
.bk-track .bk-short { display: none; }
.bk-track .bk-title { font-size: .98rem; }
.bk-track .bk-card-actions .bk-btn { padding: .6rem .5rem; font-size: .82rem; }

/* ── Details page ── */
.bk-crumb { font-size: .9rem; color: #777; padding: 1.4rem 0 .4rem; }
.bk-crumb a { color: var(--primary, #1e5a96); text-decoration: none; }
.bk-detail {
    display: grid; grid-template-columns: minmax(260px, 400px) 1fr; gap: 3rem;
    padding: 1.2rem 0 4rem; align-items: start;
}
.bk-detail-cover {
    border-radius: 18px; overflow: hidden; box-shadow: 0 14px 40px rgba(30, 90, 150, .2);
    background: linear-gradient(135deg, #eef3fa, #dde8f5); aspect-ratio: 3 / 4;
    display: flex; align-items: center; justify-content: center; position: sticky; top: 100px;
}
.bk-detail-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bk-detail h1 { font-size: 2.2rem; line-height: 1.2; color: var(--dark, #1a1a2e); margin: .5rem 0 .3rem; }
.bk-detail .bk-subtitle { font-size: 1.15rem; color: var(--secondary, #e91e63); font-weight: 600; margin-bottom: 1rem; }
.bk-info-row { display: flex; flex-wrap: wrap; gap: 1.6rem; margin: 1rem 0 1.4rem; padding: 1rem 0; border-top: 1px solid #eef0f4; border-bottom: 1px solid #eef0f4; }
.bk-info-row div span { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .6px; color: #888; }
.bk-info-row div strong { font-size: 1.02rem; color: var(--dark, #1a1a2e); }
.bk-features { list-style: none; margin: 0 0 1.6rem; padding: 0; display: grid; gap: .6rem; }
.bk-features li { display: flex; align-items: center; gap: .7rem; font-size: 1.05rem; font-weight: 600; color: #2d3748; }
.bk-features li i { color: #16a34a; font-size: 1.15rem; }
.bk-pricebox {
    background: #f6f9fd; border: 1px solid #e3ebf5; border-radius: 16px; padding: 1.4rem 1.5rem; margin-bottom: 1.6rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap;
}
.bk-pricebox .bk-sp { font-size: 2.3rem; }
.bk-pricebox .bk-save { display: inline-block; margin-top: .25rem; color: #16a34a; font-weight: 700; font-size: .9rem; }
.bk-desc { color: #444; line-height: 1.8; margin-top: .4rem; }
.bk-desc h3 { color: var(--primary, #1e5a96); margin-bottom: .6rem; font-size: 1.2rem; }
.bk-trust { display: flex; flex-wrap: wrap; gap: 1.2rem; color: #666; font-size: .88rem; margin-top: 1rem; }
.bk-trust i { color: var(--primary, #1e5a96); margin-right: .3rem; }

/* ── Checkout / status panels ── */
.bk-panel-wrap { max-width: 560px; margin: 2.5rem auto 4rem; padding: 0 1rem; }
.bk-panel { background: #fff; border-radius: 18px; box-shadow: 0 8px 32px rgba(30, 90, 150, .13); overflow: hidden; }
.bk-panel-head { background: linear-gradient(135deg, var(--primary, #1e5a96), #2874b8); color: #fff; padding: 1.2rem 1.5rem; }
.bk-panel-head h2 { font-size: 1.35rem; margin: 0; }
.bk-panel-body { padding: 1.5rem; }
.bk-summary { display: flex; gap: 1rem; align-items: center; padding-bottom: 1.2rem; margin-bottom: 1.2rem; border-bottom: 1px dashed #dde3ec; }
.bk-summary img, .bk-summary .bk-thumb { width: 70px; height: 92px; object-fit: cover; border-radius: 8px; background: #eef3fa; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--primary, #1e5a96); font-size: 1.6rem; }
.bk-summary h3 { font-size: 1.02rem; line-height: 1.35; color: var(--dark, #1a1a2e); margin-bottom: .3rem; }
.bk-field { margin-bottom: 1.1rem; }
.bk-field label { display: block; font-weight: 600; margin-bottom: .4rem; color: #333; font-size: .95rem; }
.bk-field input {
    width: 100%; padding: .85rem 1rem; border: 2px solid #e9ecef; border-radius: 10px;
    font-size: 1rem; font-family: inherit; transition: border-color .2s; box-sizing: border-box;
}
.bk-field input:focus { outline: none; border-color: var(--primary, #1e5a96); }
.bk-field .bk-hint { font-size: .8rem; color: #888; margin-top: .3rem; }
.bk-field .bk-err { font-size: .82rem; color: #dc3545; margin-top: .3rem; }
.bk-mobile-group { display: flex; }
.bk-mobile-group span { padding: .85rem .9rem; background: #f1f4f8; border: 2px solid #e9ecef; border-right: none; border-radius: 10px 0 0 10px; font-weight: 600; color: #555; }
.bk-mobile-group input { border-radius: 0 10px 10px 0; }
.bk-alert { padding: .9rem 1.1rem; border-radius: 10px; margin-bottom: 1.1rem; font-size: .93rem; display: flex; gap: .6rem; align-items: flex-start; }
.bk-alert i { margin-top: .15rem; }
.bk-alert-error   { background: #fdecee; color: #a61b29; border-left: 4px solid #dc3545; }
.bk-alert-info    { background: #eaf3fc; color: #1e4f80; border-left: 4px solid #2874b8; }
.bk-alert-warn    { background: #fff7e6; color: #8a5300; border-left: 4px solid #f0ad4e; }
.bk-secure-note { text-align: center; font-size: .82rem; color: #888; margin-top: .9rem; }

.bk-status { text-align: center; padding: 2rem 1.5rem 1.6rem; }
.bk-status-icon { width: 84px; height: 84px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 2.4rem; color: #fff; margin-bottom: 1rem; }
.bk-status-icon.ok   { background: #16a34a; box-shadow: 0 8px 24px rgba(22, 163, 74, .35); }
.bk-status-icon.bad  { background: #dc3545; box-shadow: 0 8px 24px rgba(220, 53, 69, .3); }
.bk-status-icon.wait { background: #f0ad4e; box-shadow: 0 8px 24px rgba(240, 173, 78, .3); }
.bk-status h2 { font-size: 1.7rem; margin-bottom: .3rem; color: var(--dark, #1a1a2e); }
.bk-status p { color: #666; }
.bk-kv { text-align: left; background: #f8fafc; border-radius: 12px; padding: 1rem 1.2rem; margin: 1.3rem 0; }
.bk-kv div { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border-bottom: 1px solid #eef0f4; font-size: .93rem; }
.bk-kv div:last-child { border-bottom: none; }
.bk-kv span { color: #777; }
.bk-kv strong { color: var(--dark, #1a1a2e); text-align: right; word-break: break-word; }
.bk-actions { display: flex; flex-direction: column; gap: .7rem; }

/* ── Homepage popup: book-linked slide additions ── */
#popupTrack > a.bk-popup-slide {
    min-width: 100%; width: 100%; display: flex; align-items: center; justify-content: center;
    background: #0d1b3e; text-decoration: none;
}
.bk-popup-inner { position: relative; display: block; width: 100%; }
#popupTrack > a.bk-popup-slide img { min-width: 0; width: 100%; max-height: 82vh; object-fit: contain; display: block; }
.bk-popup-cta {
    position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%);
    display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap;
    background: linear-gradient(135deg, var(--accent, #ff6b35), #ff8c42); color: #fff;
    padding: .7rem 1.6rem; border-radius: 50px; font-weight: 700; font-size: 1rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .35); font-family: 'Segoe UI', Tahoma, sans-serif;
    transition: transform .2s ease;
}
a.bk-popup-slide:hover .bk-popup-cta { transform: translateX(-50%) translateY(-2px); }
.bk-popup-title {
    position: absolute; top: 0; left: 0; right: 0; padding: .7rem 3.2rem .9rem 1rem;
    background: linear-gradient(180deg, rgba(0,0,0,.65), rgba(0,0,0,0)); color: #fff;
    font-weight: 700; font-size: 1rem; font-family: 'Segoe UI', Tahoma, sans-serif; text-align: left;
}

/* ── Overall Books popup on books.php (same look as the homepage popup) ── */
.bk-ov-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .78);
    z-index: 99999; justify-content: center; align-items: center;
}
.bk-ov-box {
    position: relative; width: 92%; max-width: 680px; background: #0d1b3e;
    border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .7);
}
.bk-ov-close {
    position: absolute; top: 10px; right: 10px; z-index: 20; width: 34px; height: 34px;
    border: none; border-radius: 50%; background: #e53935; color: #fff; font-size: 20px; line-height: 1;
    cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s;
}
.bk-ov-close:hover { background: #b71c1c; }
.bk-ov-track { display: flex; transition: transform .5s cubic-bezier(.77, 0, .18, 1); }
.bk-ov-slide {
    min-width: 100%; width: 100%; display: flex; align-items: center; justify-content: center;
    background: #0d1b3e; text-decoration: none;
}
.bk-ov-slide img { width: 100%; max-height: 82vh; object-fit: contain; display: block; }
a.bk-ov-slide:hover .bk-popup-cta { transform: translateX(-50%) translateY(-2px); }
.bk-ov-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 15; width: 38px; height: 38px;
    border: none; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.bk-ov-arrow:hover { background: rgba(0, 0, 0, .8); }
.bk-ov-prev { left: 10px; }
.bk-ov-next { right: 10px; }
.bk-ov-dots { position: absolute; bottom: 12px; width: 100%; display: flex; justify-content: center; gap: 8px; }
.bk-ov-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; opacity: .35; border: none; cursor: pointer; padding: 0; transition: opacity .3s, transform .3s; }
.bk-ov-dot.active { opacity: 1; transform: scale(1.25); }

/* ── Responsive ── */
@media (max-width: 992px) {
    .bk-detail { grid-template-columns: 1fr; gap: 2rem; }
    .bk-detail-cover { position: relative; top: 0; max-width: 340px; margin: 0 auto; width: 100%; }
}
@media (max-width: 768px) {
    .bk-wrap { padding: 0 1rem; }
    .bk-page-hero h1 { font-size: 1.8rem; }
    .bk-home-head h2 { font-size: 1.55rem; }
    .bk-track { grid-auto-columns: 44%; gap: 1rem; }
    .bk-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .bk-body { padding: .85rem .85rem 1rem; }
    .bk-title { font-size: .98rem; }
    .bk-sp { font-size: 1.25rem; }
    .bk-short { display: none; }
    .bk-card-actions { flex-direction: column; }
    .bk-detail h1 { font-size: 1.65rem; }
    .bk-pricebox .bk-sp { font-size: 1.9rem; }
    .bk-pricebox .bk-btn { width: 100%; }
    .bk-filters select, .bk-filters input { min-width: 0; flex: 1 1 45%; }
    .bk-popup-cta { bottom: 30px; font-size: .9rem; padding: .55rem 1.1rem; }
}
@media (max-width: 480px) {
    .bk-track { grid-auto-columns: 60%; }
    .bk-grid { grid-template-columns: 1fr 1fr; }
    .bk-home-nav .bk-nav-btn { display: none; }
}
