/* ===== Peak Discounters — Ebooks module styles ===== */
/* Palette follows the site theme (slate & amber). Where the site defines
   --teal-dark / --teal-darker / --yellow-hover globally (main.Master), the
   hero references them so it always matches the site header. */
:root {
    --pd-teal: #1e293b;        /* slate 800 — primary text/accents */
    --pd-teal-dark: #0f172a;   /* slate 900 */
    --pd-yellow: #f59e0b;      /* amber 500 — CTAs */
    --pd-orange: #d97706;      /* amber 600 — hover */
}

.books-hero {
    background: linear-gradient(135deg, var(--teal-dark, #1e293b) 0%, var(--teal-darker, #0f172a) 100%);
    color: #fff;
    padding: 3rem 0;
}
.books-hero h1 { font-weight: 800; font-size: 2.25rem; margin-bottom: .5rem; }
.books-hero p { opacity: .95; font-size: 1.1rem; margin: 0; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 2rem 0 1rem; }
.section-head h2 { font-weight: 700; color: #0f172a; font-size: 1.4rem; margin: 0; }
.section-head a { color: var(--pd-teal); font-weight: 600; text-decoration: none; }
.section-head a:hover { text-decoration: underline; }

/* Book cards grid */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem; }
.book-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden;
    display: flex; flex-direction: column; transition: box-shadow .2s ease, transform .2s ease;
    text-decoration: none; color: inherit;
}
.book-card:hover { box-shadow: 0 12px 30px rgba(0,0,0,.12); transform: translateY(-3px); color: inherit; }
.book-card .cover { aspect-ratio: 3/4; background: #f1f5f9 center/cover no-repeat; display: block; }
.book-card .cover.placeholder { display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 2rem; }
.book-card .body { padding: .8rem .9rem 1rem; display: flex; flex-direction: column; flex: 1; }
.book-card .title { font-weight: 700; color: #0f172a; font-size: 1rem; line-height: 1.25; margin-bottom: .15rem; }
.book-card .author { color: #64748b; font-size: .82rem; margin-bottom: .5rem; }
.book-card .meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.book-card .price { font-weight: 800; color: var(--pd-teal); }
.book-card .rating { color: var(--pd-orange); font-size: .82rem; }

/* Category chips */
.cat-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.cat-chip {
    display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .9rem; border-radius: 20px;
    background: #f0fbfb; color: var(--pd-teal-dark); border: 1px solid #cde9e9; text-decoration: none; font-weight: 600; font-size: .9rem;
}
.cat-chip:hover, .cat-chip.active { background: var(--pd-teal); color: #fff; border-color: var(--pd-teal); }
.cat-chip .count { opacity: .7; font-weight: 500; font-size: .8rem; }

/* Detail page */
.book-detail { display: grid; grid-template-columns: 300px 1fr; gap: 2.5rem; margin: 2rem 0; }
@media (max-width: 768px) { .book-detail { grid-template-columns: 1fr; } }
.book-detail .cover-col img { width: 100%; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.book-detail h1 { font-weight: 800; color: #0f172a; margin-bottom: .25rem; }
.book-detail .subtitle { color: #475569; font-size: 1.15rem; margin-bottom: .75rem; }
.book-detail .byline { color: #64748b; margin-bottom: 1rem; }
.book-detail .price-lg { font-size: 2rem; font-weight: 800; color: var(--pd-teal); }
.book-detail .desc { color: #334155; line-height: 1.7; margin: 1.25rem 0; }

.btn-buy {
    display: inline-flex; align-items: center; gap: .5rem; background: var(--pd-yellow); color: var(--pd-teal);
    font-weight: 700; text-transform: uppercase; letter-spacing: .3px; text-decoration: none;
    padding: .8rem 1.6rem; border-radius: 10px; border: 0; cursor: pointer; font-size: 1rem;
}
.btn-buy:hover { background: var(--pd-orange); color: var(--pd-teal); }
.btn-buy.secondary { background: #fff; color: var(--pd-teal); border: 2px solid var(--pd-teal); }
.buy-note { color: #64748b; font-size: .85rem; margin-top: .5rem; }

/* Sample pages gallery */
.sample-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem; }
.sample-pages a { display: block; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.sample-pages img { width: 100%; display: block; }
.sample-lightbox {
    position: fixed; inset: 0; background: rgba(0,0,0,.85); display: none; align-items: center; justify-content: center; z-index: 1090; padding: 1rem;
}
.sample-lightbox.show { display: flex; }
.sample-lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 6px; }
.sample-lightbox .close { position: absolute; top: 16px; right: 22px; color: #fff; font-size: 2.4rem; cursor: pointer; line-height: 1; background: none; border: 0; }

/* Reviews */
.review { border-top: 1px solid #e5e7eb; padding: 1rem 0; }
.review .stars { color: var(--pd-orange); }
.review .rname { font-weight: 600; color: #0f172a; }
.review .rdate { color: #94a3b8; font-size: .82rem; }
.review-form { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 12px; padding: 1.25rem; margin-top: 1rem; }
.star-input { direction: rtl; display: inline-flex; gap: .15rem; font-size: 1.6rem; }
.star-input input { display: none; }
.star-input label { color: #cbd5e1; cursor: pointer; }
.star-input input:checked ~ label,
.star-input label:hover, .star-input label:hover ~ label { color: var(--pd-orange); }

.empty-state { text-align: center; color: #64748b; padding: 3rem 1rem; }

/* Mobile: 2-up catalog grid and a smaller hero */
@media (max-width: 575px) {
    .book-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
    .books-hero { padding: 2rem 0; }
    .books-hero h1 { font-size: clamp(1.5rem, 7vw, 2.25rem); }
    .section-head h2 { font-size: 1.2rem; }
}
