/* ==========================================================================
   The CSR Universe — E-Book Store
   Everything is scoped under .bs so theme styles cannot leak in or out.
   ========================================================================== */
.bs {
    /* Warm "reading room" palette: cream paper, espresso ink, muted book colours. */
    --ink: #2e2219;
    --ink-2: #4a3b2f;
    --muted: #7a6a5c;
    --line: #e8dfd1;
    --bg: #f6f1e8;
    --card: #fffdf9;
    --brand: #3b2a1e;
    --brand-2: #56402f;
    --brand-soft: #efe5d6;
    --sale: #1f7a45;
    --sale-soft: #e7f3ea;
    --danger: #b91c1c;
    --danger-soft: #fef2f2;
    --warn: #92400e;
    --warn-soft: #fffbeb;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.5;
    padding-bottom: 56px;
    overflow-x: clip;
}
.bs *, .bs *::before, .bs *::after { box-sizing: border-box; }
/* Theme resets: the site theme styles bare h1/h2/a/header globally. */
.bs h1, .bs h2, .bs h3, .bs h4, .bs p { margin: 0; font-family: inherit; text-transform: none; color: inherit; background: none; }
.bs :where(a) { color: inherit; text-decoration: none; }
.bs :where(a):hover { text-decoration: none; }
.bs img { max-width: 100%; display: block; }
.bs button { font-family: inherit; }
.bs .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.bs-wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .bs-wrap { padding: 0 24px; } }

/* ---------- Store bar ---------- */
.bs-bar { background: var(--card); border-bottom: 1px solid var(--line); }
.bs-bar .bs-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.bs-bar { position: sticky; top: 0; z-index: 1000; background: rgba(255, 253, 249, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.bs-bar .bs-wrap { min-height: 64px; }
.bs-bar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bs-bar-logo { display: inline-flex; flex: 0 0 auto; }
.bs-bar-logo img { height: 38px; width: auto; border-radius: 4px; }
.bs-bar-divider { width: 1px; height: 26px; background: var(--line); }
.bs-bar-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--ink); white-space: nowrap; }
.bs-bar-account { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; color: var(--ink); margin-left: 4px; }
.bs-bar-account:hover { border-color: var(--brand); }
.bs-avatar-sm { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.bs-bar .bs-bar-signin { height: 38px; padding: 0 16px; margin-left: 4px; font-size: 14px; }
@media (max-width: 560px) {
    .bs-bar .bs-wrap { min-height: 58px; gap: 6px; }
    .bs-bar-logo img { height: 30px; }
    .bs-bar-divider, .bs-bar-brand span { display: none; }
    .bs-bar-link { padding: 0 9px; }
    .bs-bar-account { padding: 0 4px; border: 0; }
    .bs-bar .bs-bar-signin { padding: 0 12px; }
}
.bs-bar-brand svg { color: var(--brand); }
.bs-bar-links { display: flex; align-items: center; gap: 4px; }
.bs-bar-link { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 14px; position: relative; }
.bs-bar-link:hover { background: var(--brand-soft); color: var(--brand); }
.bs-bar-link:focus-visible { outline: 3px solid rgba(59, 42, 30, .35); outline-offset: 1px; }
.bs-badge-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.bs-badge-count[data-count="0"] { display: none; }
@media (max-width: 480px) { .bs-bar-link .bs-hide-sm { display: none; } }

/* ---------- Hero: illustrated bookshelf (pure CSS) ---------- */
.bs-hero { position: relative; background: radial-gradient(ellipse at 50% 0%, #fbf7ef 0%, #f1e9dc 70%); border-bottom: 1px solid var(--line); overflow: hidden; }
.bs-hero-inner { text-align: center; padding: 52px 0 0; }
@media (min-width: 768px) { .bs-hero-inner { padding-top: 76px; } }
.bs-hero-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(59, 42, 30, .06); color: var(--ink-2); font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
.bs-hero h1 { margin: 18px auto 0; max-width: 820px; font-size: clamp(34px, 6.2vw, 64px); line-height: 1.03; font-weight: 600; letter-spacing: -0.045em; color: #3a2a1f; text-wrap: balance; }
.bs-hero p.bs-hero-sub { margin: 18px auto 0; max-width: 560px; font-size: clamp(15px, 1.8vw, 18px); line-height: 1.55; color: var(--ink-2); text-wrap: balance; }
.bs-hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.bs-hero-cta .bs-btn { height: 50px; padding: 0 24px; border-radius: 12px; font-size: 15.5px; }
.bs-hero-cta .bs-btn--primary { background: #3b2a1e; box-shadow: 0 10px 24px rgba(59, 42, 30, .28), inset 0 1px 0 rgba(255, 255, 255, .12); }
.bs-hero-cta .bs-btn--primary:hover { background: #56402f; }
.bs-hero-cta .bs-btn--ghost { background: rgba(255, 253, 249, .7); }

.bs-shelfwrap { position: relative; max-width: 900px; margin: 48px auto 0; padding: 0 12px 40px; }
@media (min-width: 768px) { .bs-shelfwrap { margin-top: 64px; padding-bottom: 56px; } }
.bs-shelf { position: relative; height: 150px; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 0 28px; }
.bs-shelf + .bs-shelf { margin-top: 26px; }
@media (max-width: 640px) { .bs-shelf { height: 104px; padding: 0 10px; gap: 1px; } .bs-shelf + .bs-shelf { margin-top: 18px; } }
/* the plank */
.bs-shelf::after { content: ''; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px; border-radius: 3px;
    background: linear-gradient(#a8744c, #8a5b39); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 16px 28px -10px rgba(59, 42, 30, .45); }
/* soft cast shadow behind the books */
.bs-shelf::before { content: ''; position: absolute; left: 6%; right: 2%; bottom: -12px; height: 70%; transform: skewX(-38deg); transform-origin: bottom;
    background: linear-gradient(90deg, rgba(59, 42, 30, 0) 0%, rgba(59, 42, 30, .10) 30%, rgba(59, 42, 30, .06) 100%); filter: blur(6px); z-index: 0; }
.bs-spine { position: relative; z-index: 1; flex: 0 0 auto; width: var(--w, 18px); height: var(--h, 85%); background: var(--c, #d9774b); border-radius: 2px 2px 1px 1px;
    box-shadow: inset -3px 0 0 rgba(0, 0, 0, .08), inset 2px 0 0 rgba(255, 255, 255, .14); transform-origin: bottom left; }
.bs-spine::after { content: ''; position: absolute; left: 0; right: 0; top: var(--bt, 18%); height: var(--bh, 0px); background: var(--b, rgba(255, 255, 255, .35)); }
.bs-spine.is-lean { transform: rotate(var(--r, 10deg)); margin-left: 6px; }
.bs-spine.is-lean-l { transform: rotate(calc(var(--r, 10deg) * -1)); transform-origin: bottom right; margin-right: 6px; }
@media (max-width: 640px) { .bs-spine { width: calc(var(--w, 18px) * .62); } .bs-spine.is-hide-sm { display: none; } }
.bs-stack { position: relative; z-index: 1; display: flex; flex-direction: column-reverse; align-items: center; margin: 0 6px; }
.bs-stack span { display: block; height: var(--h, 12px); width: var(--w, 88px); background: var(--c, #3f6f78); border-radius: 2px; margin-top: 1px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08); }
@media (max-width: 640px) { .bs-stack span { width: calc(var(--w, 88px) * .6); height: calc(var(--h, 12px) * .75); } }

.bs-bubble { position: absolute; z-index: 3; left: var(--x); top: var(--y); transform: translate(-50%, -100%); padding: 8px 14px; border-radius: 12px; background: #fffdf9; color: #3a2a1f;
    font-size: 13.5px; font-weight: 600; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 8px 20px rgba(59, 42, 30, .14), 0 1px 0 rgba(59, 42, 30, .04);
    animation: bs-float 5s ease-in-out infinite; animation-delay: var(--d, 0s); transition: background .15s ease, color .15s ease; }
.bs-bubble::before, .bs-bubble::after { content: ''; position: absolute; border-radius: 50%; background: #fffdf9; box-shadow: 0 3px 8px rgba(59, 42, 30, .14); }
.bs-bubble::before { width: 9px; height: 9px; left: var(--tx, 30%); bottom: -13px; }
.bs-bubble::after { width: 5px; height: 5px; left: calc(var(--tx, 30%) + 9px); bottom: -21px; }
.bs-bubble:hover, .bs-bubble:focus-visible { background: #3b2a1e; color: #fff; outline: none; }
.bs-bubble:hover::before, .bs-bubble:hover::after, .bs-bubble:focus-visible::before, .bs-bubble:focus-visible::after { background: #3b2a1e; }
@keyframes bs-float { 0%, 100% { transform: translate(-50%, -100%); } 50% { transform: translate(-50%, calc(-100% - 5px)); } }
@media (max-width: 640px) { .bs-bubble { font-size: 12px; padding: 6px 10px; max-width: 150px; } .bs-bubble.is-hide-sm { display: none; } }

/* ---------- Page head ---------- */
.bs-head { padding: 28px 0 18px; }
.bs-head h1 { font-size: clamp(24px, 4.2vw, 34px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.bs-head p { margin-top: 6px; color: var(--muted); max-width: 640px; }
.bs-crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); padding-top: 18px; }
.bs-crumbs a:hover { color: var(--brand); }

/* ---------- Filters ---------- */
.bs-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.bs-search { position: relative; flex: 1 1 260px; }
.bs-search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.bs-input, .bs-select { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-size: 15px; padding: 0 14px; }
.bs-search .bs-input { padding-left: 40px; }
.bs-select { width: auto; min-width: 170px; padding-right: 34px; appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; }
.bs-input:focus, .bs-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59, 42, 30, .15); }
@media (max-width: 560px) { .bs-select { flex: 1 1 100%; } }

.bs-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 8px; scrollbar-width: none; }
.bs-chips::-webkit-scrollbar { display: none; }
.bs-chip { flex: 0 0 auto; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.bs-chip:hover { border-color: var(--brand); color: var(--brand); }
.bs-chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.bs-chip:focus-visible { outline: 3px solid rgba(59, 42, 30, .35); outline-offset: 2px; }
.bs-chip small { opacity: .7; font-weight: 500; }
.bs-result-meta { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }

/* ---------- Grid + card ---------- */
.bs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 640px) { .bs-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 992px) { .bs-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; } }

.bs-card { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
@media (hover: hover) { .bs-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #dccfbb; } }
.bs-card-link { display: block; }
.bs-card-link:focus-visible { outline: 3px solid rgba(59, 42, 30, .35); outline-offset: -3px; }

.bs-cover { position: relative; aspect-ratio: 3 / 4; background: linear-gradient(160deg, #efe6d7, #e3d6c1); overflow: hidden; }
.bs-cover img { width: 100%; height: 100%; object-fit: cover; }
.bs-cover-fallback { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 16px; text-align: center; color: var(--brand); font-weight: 700; font-size: 15px; line-height: 1.3; }
.bs-cover--empty .bs-cover-fallback { display: flex; }
.bs-tag { position: absolute; top: 10px; left: 10px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--sale); color: #fff; }
.bs-tag--muted { background: rgba(15, 23, 42, .78); }
.bs-tag--owned { left: auto; right: 10px; background: var(--brand); }

.bs-card-body { display: flex; flex-direction: column; flex: 1; padding: 12px 12px 14px; }
@media (min-width: 640px) { .bs-card-body { padding: 14px 16px 16px; } }
.bs-card-title { font-size: 14.5px; font-weight: 600; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.bs-card-author { margin-top: 3px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-price-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: 10px; }
.bs-price { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }
.bs-mrp { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.bs-off { font-size: 13px; font-weight: 700; color: var(--sale); }
.bs-card-actions { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; margin-top: auto; padding-top: 12px; }
.bs-card-actions .bs-btn { min-width: 0; padding: 0 10px; }
@media (max-width: 380px) { .bs-card-actions { grid-template-columns: 40px minmax(0, 1fr); gap: 6px; } .bs-card-actions .bs-btn { height: 40px; font-size: 13.5px; } .bs-card-actions .bs-btn--icon { width: 40px; } }

/* ---------- Buttons ---------- */
.bs-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font-size: 14.5px; font-weight: 600; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease; white-space: nowrap; user-select: none; -webkit-tap-highlight-color: transparent; }
.bs-btn:focus-visible { outline: 3px solid rgba(59, 42, 30, .35); outline-offset: 2px; }
.bs-btn--primary { background: var(--brand); color: #fff; }
.bs-btn--primary:hover { background: var(--brand-2); color: #fff; }
.bs-btn--ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.bs-btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.bs-btn--link { background: none; border: none; color: var(--muted); height: auto; padding: 4px 0; font-weight: 600; font-size: 13.5px; }
.bs-btn--link:hover { color: var(--danger); }
.bs-btn--icon { padding: 0; width: 44px; }
.bs-btn--block { width: 100%; }
.bs-btn--lg { height: 52px; font-size: 16px; border-radius: 12px; }
.bs-btn[disabled], .bs-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.bs-btn.is-loading { color: transparent !important; pointer-events: none; }
.bs-btn.is-loading::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: bs-spin .7s linear infinite; }
.bs-btn--primary.is-loading::after { border-color: #fff; border-right-color: transparent; }
.bs-btn--ghost.is-loading::after { border-color: var(--brand); border-right-color: transparent; }
@keyframes bs-spin { to { transform: rotate(360deg); } }

/* ---------- Pagination ---------- */
.bs-pager { display: flex; justify-content: center; gap: 8px; margin-top: 32px; }
.bs-pager a, .bs-pager span { min-width: 42px; height: 42px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; }
.bs-pager a:hover { border-color: var(--brand); color: var(--brand); }
.bs-pager .is-current { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Empty / notices ---------- */
.bs-empty { text-align: center; background: var(--card); border: 1px dashed #dccfbb; border-radius: var(--radius); padding: 48px 20px; }
.bs-empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.bs-empty h2 { font-size: 19px; font-weight: 700; }
.bs-empty p { color: var(--muted); margin: 6px auto 18px; max-width: 420px; }
.bs-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 14px; background: var(--brand-soft); color: var(--brand); }
.bs-note--warn { background: var(--warn-soft); color: var(--warn); }
.bs-note--error { background: var(--danger-soft); color: var(--danger); }
.bs-note svg { flex: 0 0 auto; margin-top: 2px; }

/* ---------- Book detail ---------- */
.bs-detail { display: grid; grid-template-columns: 1fr; gap: 24px; padding-top: 18px; }
@media (min-width: 900px) { .bs-detail { grid-template-columns: minmax(280px, 380px) 1fr; gap: 48px; padding-top: 28px; } }
.bs-detail-cover { width: 100%; max-width: 280px; margin: 0 auto; }
@media (min-width: 900px) { .bs-detail-cover { max-width: none; position: sticky; top: 96px; align-self: start; } }
.bs-detail-cover .bs-cover { border-radius: var(--radius); box-shadow: 0 18px 40px rgba(15, 23, 42, .14); }
.bs-eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.bs-detail h1 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-top: 8px; }
.bs-byline { margin-top: 8px; color: var(--muted); font-size: 15px; }
.bs-byline strong { color: var(--ink-2); font-weight: 600; }
.bs-buybox { margin-top: 20px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
@media (min-width: 640px) { .bs-buybox { padding: 22px; } }
.bs-buybox .bs-price { font-size: 30px; }
.bs-buybox .bs-mrp { font-size: 15px; }
.bs-save-pill { display: inline-flex; padding: 3px 10px; border-radius: 999px; background: var(--sale-soft); color: var(--sale); font-weight: 700; font-size: 13px; }
.bs-stock { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.bs-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sale); }
.bs-stock.is-low .bs-dot { background: #d97706; }
.bs-stock.is-out .bs-dot { background: var(--danger); }
.bs-buy-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.bs-buy-row .bs-btn { flex: 1 1 160px; }
.bs-qty-wrap { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.bs-qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden; }
.bs-qty button { width: 40px; height: 40px; border: 0; background: none; color: var(--ink); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.bs-qty button:hover:not(:disabled) { background: var(--brand-soft); color: var(--brand); }
.bs-qty button:disabled { color: #cbd5e1; cursor: not-allowed; }
.bs-qty button:focus-visible { outline: 3px solid rgba(59, 42, 30, .35); outline-offset: -3px; }
.bs-qty input { width: 44px; height: 40px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font: inherit; font-weight: 600; color: var(--ink); -moz-appearance: textfield; }
.bs-qty input::-webkit-outer-spin-button, .bs-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bs-qty input:focus { outline: none; background: var(--brand-soft); }
.bs-trust { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.bs-trust li { display: flex; gap: 8px; align-items: center; }
.bs-trust svg { color: var(--brand); flex: 0 0 auto; }
.bs-section { margin-top: 32px; }
.bs-section h2 { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.bs-prose { color: var(--ink-2); line-height: 1.75; font-size: 15.5px; overflow-wrap: anywhere; }
.bs-prose p { margin: 0 0 14px; }
.bs-prose img { height: auto; border-radius: 8px; }
.bs-specs { display: grid; grid-template-columns: 1fr; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; margin: 0; }
@media (min-width: 560px) { .bs-specs { grid-template-columns: 1fr 1fr; } }
.bs-specs div { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.bs-specs dt { color: var(--muted); font-weight: 500; }
.bs-specs dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; }

/* ---------- Cart / checkout ---------- */
.bs-layout { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
@media (min-width: 992px) { .bs-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; } }
.bs-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.bs-panel-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bs-panel-head h2 { font-size: 16px; font-weight: 700; }
.bs-panel-body { padding: 18px; }
.bs-step { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13px; align-items: center; justify-content: center; margin-right: 8px; }

.bs-line { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.bs-line:last-child { border-bottom: 0; }
@media (min-width: 640px) { .bs-line { grid-template-columns: 76px minmax(0, 1fr); } }
.bs-line .bs-cover { border-radius: 8px; }
.bs-line-title { font-weight: 600; font-size: 15px; line-height: 1.35; }
.bs-line-title a:hover { color: var(--brand); }
.bs-line-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.bs-line-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; margin-top: 12px; }
.bs-line-price { text-align: right; }
.bs-line-price .bs-price { font-size: 16px; }
.bs-line.is-busy { opacity: .55; pointer-events: none; }

.bs-summary { position: sticky; top: 96px; }
.bs-sum-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; color: var(--ink-2); padding: 5px 0; }
.bs-sum-row.is-save span:last-child { color: var(--sale); font-weight: 600; }
.bs-sum-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 14px; margin-top: 10px; border-top: 1px solid var(--line); font-weight: 700; font-size: 18px; }
.bs-sum-total small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.bs-coupon { display: flex; gap: 8px; margin: 14px 0 4px; }
.bs-coupon .bs-input { height: 42px; text-transform: uppercase; }
.bs-coupon .bs-btn { height: 42px; }
.bs-coupon-applied { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 4px; padding: 10px 12px; border-radius: 10px; background: var(--sale-soft); color: var(--sale); font-size: 14px; font-weight: 600; }
.bs-coupon-msg { font-size: 13px; min-height: 18px; color: var(--danger); }
.bs-secure { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 12px; color: var(--muted); font-size: 12.5px; }
.bs-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); margin: 16px 0; cursor: pointer; }
.bs-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: 0 0 auto; }
.bs-account { display: flex; align-items: center; gap: 12px; }
.bs-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; }
.bs-account-meta { min-width: 0; }
.bs-account-meta strong { display: block; }
.bs-account-meta span { display: block; color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.bs-auth { text-align: center; padding: 30px 20px; }
.bs-auth h2 { font-size: 20px; font-weight: 700; margin-top: 12px; }
.bs-auth p { color: var(--muted); margin: 6px auto 20px; max-width: 380px; }
.bs-auth-actions { display: grid; gap: 10px; max-width: 320px; margin: 0 auto; }
.bs-mini-lines { display: grid; gap: 12px; }
.bs-mini-line { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 14px; }
.bs-mini-line .bs-cover { border-radius: 6px; }
.bs-mini-line strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-mini-line span { color: var(--muted); font-size: 13px; }

/* ---------- Success / library ---------- */
.bs-success { max-width: 720px; margin: 28px auto 0; }
.bs-success-hero { text-align: center; padding: 30px 20px 24px; }
.bs-success-icon { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px; background: var(--sale-soft); color: var(--sale); display: flex; align-items: center; justify-content: center; }
.bs-success-icon.is-pending { background: var(--warn-soft); color: var(--warn); }
.bs-success-icon.is-failed { background: var(--danger-soft); color: var(--danger); }
.bs-success-hero h1 { font-size: clamp(22px, 3.4vw, 28px); font-weight: 700; }
.bs-success-hero p { color: var(--muted); margin-top: 6px; }
.bs-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px 18px; background: var(--bg); border-radius: 10px; margin: 0 18px 18px; font-size: 13.5px; }
@media (min-width: 640px) { .bs-kv { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bs-kv span { display: block; color: var(--muted); }
.bs-kv strong { display: block; color: var(--ink); overflow-wrap: anywhere; }
.bs-owned-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bs-owned-actions .bs-btn { height: 40px; }
.bs-lib-card .bs-card-actions { grid-template-columns: 1fr 1fr; }
.bs-lib-card.is-highlight { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59, 42, 30, .18); }
.bs-lib-meta { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ---------- Toasts ---------- */
.bs-toasts { position: fixed; z-index: 2147483000; right: 16px; left: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
@media (min-width: 769px) { .bs-toasts { left: auto; bottom: 24px; right: 24px; align-items: flex-end; } }
.bs-toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; max-width: 420px; width: 100%; padding: 12px 14px; border-radius: 12px; background: #0f172a; color: #fff; font-size: 14px; line-height: 1.45; box-shadow: 0 12px 32px rgba(15, 23, 42, .28); animation: bs-toast-in .22s ease; font-family: 'Inter', system-ui, sans-serif; }
.bs-toast.is-leaving { animation: bs-toast-out .2s ease forwards; }
.bs-toast-icon { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.bs-toast--success .bs-toast-icon { background: #22c55e; }
.bs-toast--error .bs-toast-icon { background: #ef4444; }
.bs-toast--info .bs-toast-icon { background: #3b82f6; }
.bs-toast-msg { flex: 1; }
.bs-toast a { color: #fde68a; font-weight: 600; text-decoration: underline; }
.bs-toast-close { background: none; border: 0; color: #94a3b8; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
@keyframes bs-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes bs-toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Blocking overlay (payment confirmation) ---------- */
.bs-overlay { position: fixed; inset: 0; z-index: 2147483001; background: rgba(15, 23, 42, .55); display: none; align-items: center; justify-content: center; padding: 20px; }
.bs-overlay.is-open { display: flex; }
.bs-overlay-card { background: #fff; border-radius: 16px; padding: 28px 24px; text-align: center; max-width: 340px; width: 100%; font-family: 'Inter', system-ui, sans-serif; color: var(--ink, #0f172a); }
.bs-overlay-card .bs-spinner { width: 36px; height: 36px; margin: 0 auto 14px; border-radius: 50%; border: 3px solid #eadfcd; border-top-color: #3b2a1e; animation: bs-spin .8s linear infinite; }
.bs-overlay-card strong { display: block; font-size: 17px; }
.bs-overlay-card span { display: block; margin-top: 6px; color: #64748b; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
    .bs *, .bs-toast, .bs-overlay-card .bs-spinner { animation-duration: .01ms !important; transition: none !important; }
}
