/* =========================================================
   I EDUCATION — shared stylesheet
   Used by: includes/header.php, includes/footer.php,
            books.php (and any other page that includes them)
   ========================================================= */

:root {
    --font-main: 'Anek Bangla', sans-serif;

    --c-bg:            #FAF9FF;
    --c-surface:       #FFFFFF;
    --c-lavender:      #F1ECFB;
    --c-lavender-dark: #E1D6F7;

    --c-navy:          #1E1B4B;
    --c-navy-soft:     #4C3A8A;
    --c-purple:        #6D28D9;
    --c-pink:          #EC4899;

    --c-gold:          #F5B301;
    --c-gold-dark:     #DE9F00;
    --c-green:         #16A34A;
    --c-green-bg:      #E7F8EE;

    --c-gray:          #6B7280;
    --c-gray-light:    #9CA3AF;
    --c-border:        #E7E1F5;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-pill: 999px;

    --shadow-card: 0 12px 30px rgba(76, 29, 149, 0.09);
    --shadow-header: 0 2px 16px rgba(30, 27, 75, 0.06);

    --header-h: 78px;
    --container-w: 1200px;
}

* {
    box-sizing: border-box;
    scroll-behavior: smooth;

}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: var(--c-bg);
    color: var(--c-navy);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container {
    width: 100%;
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 24px;
}

/* Focus visibility for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--c-purple);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* =========================================================
   HEADER
   ========================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--c-surface);
    box-shadow: var(--shadow-header);
}

.header-bar { height: var(--header-h); }

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 28px;
}

/* Brand / logo */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand-mark { display: flex; align-items: center; }

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--c-pink);
    letter-spacing: 0.3px;
}

.brand-title-sub {
    color: var(--c-navy);
    font-size: 18px;
    font-weight: 800;
    margin-left: 3px;
    letter-spacing: 0.5px;
}

.brand-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--c-pink);
    font-style: italic;
}

.brand--sm .brand-title { font-size: 19px; }
.brand-title--sm .brand-title-sub { font-size: 15px; }

/* Main nav (desktop) */
.main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-left: 8px;
    flex: 1;
}

.nav-link {
    font-size: 15px;
    font-weight: 600;
    color: var(--c-navy);
    padding: 8px 2px;
    position: relative;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 2px;
    background: var(--c-purple);
    transform: scaleX(0);
    transition: transform 0.18s ease;
}

.nav-link:hover::after,
.nav-link.is-active::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--c-purple); }

/* Header actions (right side) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.btn-affiliate {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #FCEFD3;
    color: #7A5300;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

.icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-pill);
    background: var(--c-lavender);
    color: var(--c-navy);
    flex-shrink: 0;
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--c-pink);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-login {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--c-navy);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 11px 20px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

.btn-login--sm { padding: 8px 14px; font-size: 13px; }

/* Hamburger (hidden on desktop) */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: var(--c-lavender);
    border: none;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.hamburger span {
    width: 20px;
    height: 2px;
    background: var(--c-navy);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile dropdown menu — matches the reference screenshot:
   white panel, brand + cart + login + close at the top,
   then a stacked list of links each tinted a different color. */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--c-surface);
    z-index: 300;
    box-shadow: 0 16px 30px rgba(30, 27, 75, 0.12);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease, visibility 0.22s;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    max-height: 90vh;
    overflow-y: auto;
}

.mobile-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--c-border);
}

.mobile-menu-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--c-lavender);
    color: var(--c-navy);
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    padding: 8px 10px 18px;
}

.mobile-nav-link {
    padding: 14px 12px;
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

.mobile-nav-link:active { background: var(--c-lavender); }

/* Distinct colors per link, echoing the reference screenshot */
.mnc-1 { color: #1E1B4B; }
.mnc-2 { color: #4338CA; }
.mnc-3 { color: #7C3AED; }
.mnc-4 { color: #C026D3; }
.mnc-5 { color: #DB2777; }
.mnc-6 { color: #E11D48; }
.mnc-7 { color: #9333EA; }

.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(30, 27, 75, 0.35);
    z-index: 250;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s;
}

.mobile-menu-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* =========================================================
   BREADCRUMB
   ========================================================= */

.breadcrumb {
    padding: 22px 0 6px;
    font-size: 14px;
    color: var(--c-gray);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumb a { color: var(--c-gray); }
.breadcrumb a:hover { color: var(--c-purple); }
.breadcrumb .current { color: var(--c-navy); font-weight: 600; }
.breadcrumb .sep { color: var(--c-gray-light); }

/* =========================================================
   BOOK DETAILS PAGE
   ========================================================= */

.book-section {
    padding: 18px 0 64px;
}

.book-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 56px;
    align-items: start;
}

/* Cover / gallery */
.book-cover-wrap {
    position: relative;
    background: var(--c-lavender);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-card);
}

.discount-tag {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    border-radius: var(--radius-pill);
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    z-index: 2;
}

.discount-tag span { padding: 7px 14px; }
.discount-tag .tag-label { background: var(--c-navy); color: #fff; }
.discount-tag .tag-value { background: var(--c-gold); color: #4A3200; }

.book-cover {
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 20px 34px rgba(30, 27, 75, 0.22);
}

/* Placeholder cover artwork (swap the <svg> for a real <img> when available) */
.book-cover svg { width: 100%; height: 100%; display: block; }

/* Info column */
.book-info { padding-top: 4px; }

.badge-level {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--c-lavender);
    color: var(--c-purple);
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    margin-bottom: 16px;
}

.book-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--c-navy);
    margin: 0 0 16px;
    line-height: 1.25;
}

.book-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    font-size: 15px;
    color: var(--c-gray);
    margin-bottom: 16px;
}

.book-meta b { color: var(--c-navy); font-weight: 700; }

.book-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.stars { display: flex; gap: 2px; color: var(--c-gold); }
.rating-score { font-size: 14px; color: var(--c-gray); font-weight: 600; }

.price-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 26px;
}

.price-now {
    font-size: 34px;
    font-weight: 800;
    color: var(--c-purple);
}

.price-old {
    font-size: 18px;
    color: var(--c-gray-light);
    text-decoration: line-through;
}

.price-save {
    background: var(--c-green-bg);
    color: var(--c-green);
    font-size: 13px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
}

.qty-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 26px;
}

.qty-label { font-size: 15px; font-weight: 600; color: var(--c-navy); }

.qty-control {
    display: flex;
    align-items: center;
    background: var(--c-surface);
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    font-size: 18px;
    font-weight: 700;
    color: var(--c-navy);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover { background: var(--c-lavender); }

.qty-value {
    width: 44px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 34px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    padding: 15px 30px;
    border-radius: var(--radius-md);
    border: 1.5px solid transparent;
    flex: 1 1 200px;
    min-width: 180px;
}

.btn-primary { background: var(--c-gold); color: #4A3200; }
.btn-primary:hover { background: var(--c-gold-dark); }

.btn-outline {
    background: var(--c-surface);
    border-color: var(--c-navy);
    color: var(--c-navy);
}
.btn-outline:hover { background: var(--c-lavender); }

/* Trust / feature strip */
.trust-strip {
    display: flex;
    flex-wrap: wrap;
    border-top: 1px solid var(--c-border);
    padding-top: 22px;
    gap: 10px;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--c-navy);
    padding: 4px 18px 4px 0;
    border-right: 1px solid var(--c-border);
}

.trust-item:last-child { border-right: none; }
.trust-item svg { flex-shrink: 0; }

/* =========================================================
   PRODUCT TABS (description / index-ish content, optional use)
   ========================================================= */

.book-detail-tabs {
    margin-top: 48px;
    border-top: 1px solid var(--c-border);
    padding-top: 32px;
}

.book-detail-tabs h2 {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 14px;
}

.book-detail-tabs p {
    color: var(--c-gray);
    font-size: 15px;
    max-width: 74ch;
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    background: var(--c-navy);
    color: #E6E2F5;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    padding: 56px 24px 40px;
}

.footer-brand-col .brand-title { color: #fff; }
.footer-brand-col .brand-title-sub { color: #C9C2EA; }
.footer-brand-col .brand-tag { color: var(--c-gold); }

.footer-about {
    font-size: 14px;
    color: #B9B2DA;
    line-height: 1.7;
    margin: 16px 0 20px;
    max-width: 34ch;
}

.footer-social { display: flex; gap: 10px; }

.social-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
}

.social-btn:hover { background: var(--c-gold); color: var(--c-navy); }

.footer-heading {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 18px;
}

.footer-links { display: flex; flex-direction: column; gap: 12px; }
.footer-links a { font-size: 14px; color: #B9B2DA; }
.footer-links a:hover { color: var(--c-gold); }
.footer-contact li { font-size: 14px; color: #B9B2DA; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-bottom-inner {
    padding: 18px 24px;
    text-align: center;
    font-size: 13px;
    color: #9089B8;
}

/* Floating chat button */
.chat-fab {
    position: fixed;
    left: 22px;
    bottom: 22px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    background: var(--c-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(109, 40, 217, 0.4);
    z-index: 150;
}

.chat-fab:hover { background: #5B21B6; }

/* =========================================================
   BOOKS LISTING PAGE
   ========================================================= */

.books-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(120deg, var(--c-lavender) 0%, #FBF2E3 100%);
    padding: 48px 0 40px;
}

.books-hero-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    color: var(--c-lavender-dark);
}

.books-hero-decor .decor { position: absolute; opacity: 0.9; }
.decor-book  { top: 18%; left: 6%; }
.decor-shelf { top: 20%; right: 6%; color: #D9CBEF; }
.decor-star  { bottom: 10%; right: 14%; }
.decor-medal { bottom: 14%; left: 12%; }

.books-hero-inner {
    position: relative;
    z-index: 1;
    text-align: center;
}

.books-hero-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--c-navy);
    margin: 0 0 26px;
    line-height: 1.3;
}

.books-hero-title span {
    color: var(--c-purple);
    position: relative;
}

.books-hero-title span::after {
    content: '';
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: -8px;
    height: 3px;
    background: var(--c-gold);
    border-radius: 2px;
}

.books-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 26px;
    flex-wrap: wrap;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--c-surface);
    padding: 12px 22px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    font-size: 14px;
    color: var(--c-navy-soft);
}

.stat-pill b { color: var(--c-navy); font-weight: 800; }

.books-toolbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.category-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--c-surface);
    color: var(--c-navy);
    font-size: 14px;
    font-weight: 700;
    padding: 11px 20px;
    border-radius: var(--radius-pill);
    box-shadow: 0 4px 12px rgba(30,27,75,0.06);
    white-space: nowrap;
}

.filter-pill:hover { background: var(--c-lavender); }

.filter-pill.is-active {
    background: var(--c-gold);
    color: #4A3200;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--c-surface);
    border-radius: var(--radius-pill);
    padding: 6px 6px 6px 20px;
    box-shadow: var(--shadow-card);
    width: 100%;
    max-width: 560px;
}

.search-icon { color: var(--c-gray-light); flex-shrink: 0; }

.search-bar input[type="text"] {
    flex: 1;
    border: none;
    outline: none;
    font-family: var(--font-main);
    font-size: 14.5px;
    background: transparent;
    color: var(--c-navy);
    min-width: 0;
    padding: 10px 0;
}

.search-bar input::placeholder { color: var(--c-gray-light); }

.btn-search {
    background: var(--c-gold);
    color: #4A3200;
    border: none;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 14px;
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    flex-shrink: 0;
}

.btn-search:hover { background: var(--c-gold-dark); }

/* ---- Grid + cards ---- */

.books-grid-section { padding: 44px 0 20px; }

.books-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.book-card {
    background: var(--c-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.book-card-cover {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
}

.book-card-cover svg { width: 100%; height: 100%; display: block; }

.card-discount {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--c-navy);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 9px;
    border-radius: var(--radius-sm);
    z-index: 2;
}

.book-card-body {
    padding: 16px 16px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-category {
    display: inline-block;
    align-self: flex-start;
    background: #FCEFD3;
    color: #7A5300;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: var(--radius-pill);
    margin-bottom: 10px;
}

.card-title {
    font-size: 16.5px;
    font-weight: 800;
    color: var(--c-navy);
    margin: 0 0 4px;
    line-height: 1.35;
}

.card-title a:hover { color: var(--c-purple); }

.card-author {
    font-size: 13px;
    color: var(--c-purple);
    margin: 0 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--c-gray);
    font-weight: 600;
    margin-bottom: 14px;
}

.card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.card-price { display: flex; flex-direction: column; }

.card-price .price-now {
    font-size: 17px;
    font-weight: 800;
    color: var(--c-purple);
}

.card-price .price-old {
    font-size: 12px;
    color: var(--c-gray-light);
    text-decoration: line-through;
}

.btn-order {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--c-navy);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 16px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-order:hover { background: #2E2A6B; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--c-gray);
}

.empty-state p { margin-bottom: 18px; font-size: 15px; }

/* ---- Pagination ---- */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0 20px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    color: var(--c-navy);
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(30,27,75,0.06);
}

.page-btn:hover { background: var(--c-lavender); }

.page-btn.is-active {
    background: var(--c-purple);
    color: #fff;
}

.page-btn.page-nav { font-size: 18px; }

.page-btn.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* =========================================================
   COURSES LISTING PAGE
   ========================================================= */

.courses-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.course-card {
    background: var(--c-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.course-thumb {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    background: linear-gradient(160deg, var(--thumb-a), var(--thumb-b));
    overflow: hidden;
}

.course-discount {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: flex;
    border-radius: var(--radius-sm);
    overflow: hidden;
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 3px 8px rgba(0,0,0,0.25);
}

.course-discount .cd-label { background: var(--c-navy); color: #fff; padding: 4px 7px; }
.course-discount .cd-value { background: var(--c-gold); color: #4A3200; padding: 4px 7px; }

.course-small-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    background: #16A34A;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

.course-tag-overlay {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 3;
    background: rgba(255,255,255,0.92);
    color: var(--c-navy);
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
}

/* Feature-panel thumbnail */
.thumb-feature {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
}

.tf-left, .tf-right {
    padding: 10px 9px 30px;
    color: #fff;
    overflow: hidden;
}

.tf-left { background: rgba(0,0,0,0.15); }
.tf-right { background: rgba(0,0,0,0.32); }

.tf-heading {
    font-size: 10.5px;
    font-weight: 800;
    color: #FDE68A;
    margin: 0 0 6px;
}

.tf-heading-alt { color: #93C5FD; }

.tf-left ul, .tf-right ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tf-left li, .tf-right li {
    font-size: 9.5px;
    line-height: 1.35;
    opacity: 0.95;
}

/* Banner-style thumbnail */
.thumb-banner {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px 16px;
    gap: 4px;
}

.banner-line {
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    line-height: 1.3;
    margin: 0;
}

.banner-line-main {
    font-size: 26px;
    color: var(--c-gold);
    letter-spacing: 0.5px;
}

/* Course body / text content */
.course-body {
    padding: 16px 16px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.course-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--c-navy);
    margin: 0 0 6px;
    line-height: 1.35;
}

.course-title a:hover { color: var(--c-purple); }

.course-desc {
    font-size: 13px;
    color: var(--c-gray);
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--c-purple);
    font-weight: 600;
    margin-bottom: 14px;
}

.course-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.price-free {
    font-size: 16px;
    font-weight: 800;
    color: var(--c-green);
}

.btn-details {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--c-gold);
    color: #4A3200;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 16px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

.btn-details:hover { background: var(--c-gold-dark); }

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Tablet */
@media (max-width: 992px) {
    .main-nav { display: none; }
    .btn-affiliate span { display: none; }
    .btn-affiliate { padding: 10px; }

    .book-layout { grid-template-columns: 360px 1fr; gap: 36px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }

    .books-hero-title { font-size: 34px; }
    .books-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

/* Mobile */
@media (max-width: 768px) {
    :root { --header-h: 66px; }

    .container { padding: 0 16px; }

    .brand-tag { display: none; }
    .btn-affiliate,
    .btn-login { display: none; }
    .hamburger { display: flex; }

    .header-actions { gap: 8px; }
    .icon-btn { width: 38px; height: 38px; }

    .book-layout {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .book-cover-wrap { max-width: 320px; margin: 0 auto; padding: 18px; }

    .book-title { font-size: 24px; }
    .price-now { font-size: 28px; }

    .cta-row .btn { flex: 1 1 100%; }

    .trust-strip { justify-content: space-between; }
    .trust-item {
        border-right: none;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 6px;
        font-size: 12px;
        flex: 1 1 22%;
        padding: 4px 4px;
    }

    .footer-grid { grid-template-columns: 1fr; padding: 40px 20px 30px; gap: 30px; }
    .footer-about { max-width: none; }

    .chat-fab { width: 48px; height: 48px; left: 16px; bottom: 16px; }

    /* ---- Books listing: hero ---- */
    .books-hero { padding: 30px 0 28px; }
    .books-hero-title { font-size: 22px; margin-bottom: 18px; }
    .decor { transform: scale(0.7); }

    .books-stats { gap: 10px; margin-bottom: 18px; }
    .stat-pill { padding: 9px 14px; font-size: 12.5px; gap: 6px; }

    .category-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        width: 100%;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .category-filters::-webkit-scrollbar { display: none; }
    .filter-pill { padding: 9px 16px; font-size: 13px; }

    .search-bar { padding: 5px 5px 5px 14px; }
    .btn-search { padding: 10px 16px; font-size: 13px; }

    /* ---- Books listing: cards become horizontal rows ---- */
    .books-grid-section { padding: 28px 0 10px; }

    .books-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .book-card {
        flex-direction: row;
        align-items: stretch;
    }

    .book-card-cover {
        width: 108px;
        aspect-ratio: auto;
        flex-shrink: 0;
    }

    .book-card-body {
        padding: 12px 12px 12px 14px;
        gap: 2px;
    }

    .card-category { font-size: 10.5px; padding: 3px 9px; margin-bottom: 6px; }
    .card-title { font-size: 14.5px; margin-bottom: 2px; }
    .card-author { font-size: 12px; }
    .card-rating { font-size: 12px; margin-bottom: 8px; }

    .card-footer { flex-wrap: wrap; }
    .card-price .price-now { font-size: 15px; }
    .btn-order { padding: 7px 13px; font-size: 12px; }

    .pagination { margin: 26px 0 10px; gap: 6px; }
    .page-btn { min-width: 36px; height: 36px; font-size: 13px; }
}

@media (max-width: 380px) {
    .book-card-cover { width: 92px; }
    .card-title { font-size: 13.5px; }
}

@media (max-width: 420px) {
    .book-title { font-size: 21px; }
    .price-now { font-size: 24px; }
    .btn { font-size: 14.5px; padding: 14px 20px; }
}