﻿/* ==============================================
   MEADOWBOOKS — Bookstore Layout
   ============================================== */

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

:root {
  --navy:    #0d2818;
  --blue:    #1a5534;
  --accent:  #c8a84b;
  --text:    #111c13;
  --muted:   #5e7a65;
  --border:  #d8e8dc;
  --bg:      #f6fdf8;
  --white:   #ffffff;
  --radius:  8px;
  --shadow:  0 2px 12px rgba(0,0,0,.10);
  --font-heading: "Playfair Display", Georgia, serif;
  --font-body:    "Inter", system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--text);
  background:
    radial-gradient(ellipse at 10% 10%, rgba(26,85,52,.06) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 85%, rgba(200,168,75,.05) 0%, transparent 55%),
    var(--bg);
  overflow-x: hidden; }
img  { max-width: 100%; display: block; }
a    { color: inherit; text-decoration: none; }
ul   { list-style: none; }

.site-header {
  position: sticky; top: 0; z-index: 900;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex; align-items: center; gap: 20px;
  height: 60px; max-width: 1400px;
  margin-inline: auto; padding-inline: 24px;
}

.logo-mark {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  color: var(--navy); font-family: var(--font-heading); font-weight: 700; font-size: .95rem;
  text-decoration: none;
}
.logo-mark img { flex-shrink: 0; }

.header-search-wrap { flex: 1; max-width: 680px; margin-inline: auto; }

.header-search {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 50px; padding: 8px 18px;
  transition: border-color .2s, box-shadow .2s;
}
.header-search:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(26,60,94,.08); }
.search-icon { color: var(--muted); flex-shrink: 0; }
.header-search input {
  flex: 1; border: none; outline: none;
  font-size: .9rem; color: var(--text); background: transparent; font-family: var(--font-body);
}
.header-search input::placeholder { color: var(--muted); }

.header-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.header-blog-link {
  font-size: .85rem; font-weight: 600; color: var(--text);
  text-decoration: none; padding: 6px 2px;
  border-bottom: 2px solid transparent; transition: color .2s, border-color .2s;
  white-space: nowrap;
}
.header-blog-link:hover { color: var(--accent); border-bottom-color: var(--accent); }

.cat-dropdown-wrap { position: relative; }

.cat-dropdown-btn {
  display: flex; align-items: center; gap: 5px;
  font-size: .88rem; font-weight: 500; color: var(--text);
  padding: 7px 14px; border-radius: 6px;
  border: 1.5px solid var(--border); background: var(--white);
  cursor: pointer; transition: .2s; white-space: nowrap;
}
.cat-dropdown-btn:hover { border-color: var(--navy); color: var(--navy); }

.cat-dropdown-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 200px; z-index: 200; padding: 6px;
}
.cat-dropdown-menu.open { display: block; }

.cat-dropdown-menu li button {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 9px 12px; font-size: .86rem;
  color: var(--text); border-radius: 6px; cursor: pointer;
  border: none; background: none; font-family: var(--font-body); transition: .15s;
}
.cat-dropdown-menu li button:hover { background: var(--bg); color: var(--navy); }
.cat-count { font-size: .72rem; color: var(--muted); margin-left: 8px; }

.cart-btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--white); color: var(--text);
  cursor: pointer; transition: .2s;
}
.cart-btn:hover { border-color: var(--navy); color: var(--navy); }

.cart-count {
  position: absolute; top: -4px; right: -4px;
  background: var(--accent); color: #fff;
  font-size: .6rem; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}

.search-results-panel {
  position: fixed; top: 60px; left: 0; right: 0;
  background: var(--white); border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(0,0,0,.12); z-index: 800;
  max-height: calc(100vh - 60px); overflow-y: auto;
}
.search-results-inner { max-width: 1400px; margin-inline: auto; padding: 20px 24px; }
.search-results-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.search-results-header span { font-weight: 600; font-size: .95rem; color: var(--navy); }
.search-results-header button { font-size: 1.4rem; color: var(--muted); cursor: pointer; border: none; background: none; line-height: 1; }
.search-results-header button:hover { color: var(--text); }

/* =========================================
   HERO SECTION
   ========================================= */
.hero-section {
  background: linear-gradient(135deg, #040d06 0%, #091809 30%, #0d2818 65%, #163d22 100%);
  color: #fff;
  padding: 100px 32px 0;
  position: relative;
  overflow: hidden;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
}

/* Star-field canvas */
#heroStars { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; display: block; }

/* Centered single-column layout */
.hero-inner {
  position: relative; z-index: 1;
  max-width: 860px;
  margin-inline: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  padding-bottom: 80px;
}

/* ------- CENTER: TEXT ------- */
.hero-content { display: flex; flex-direction: column; align-items: center; gap: 0; width: 100%; }

.hero-eyebrow {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: .72rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: 22px;
}
.hero-star-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,209,102,.18);
  border: 1px solid rgba(255,209,102,.35);
}
.hero-star { font-size: .85rem; color: #ffd166; }

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.6rem, 4.5vw, 4.2rem);
  font-weight: 700;
  line-height: 1.12;
  color: #fff;
  margin-bottom: 26px;
  letter-spacing: -.02em;
}
.hero-title em {
  font-style: italic;
  background: linear-gradient(90deg, #7fc4fd, #c77dff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-body {
  font-size: clamp(.95rem, 1.4vw, 1.1rem);
  line-height: 1.8;
  color: rgba(255,255,255,.80);
  margin-bottom: 14px;
}
.hero-body strong { color: #fff; font-weight: 600; }

.hero-sub {
  font-size: clamp(.85rem, 1.1vw, .98rem);
  line-height: 1.75;
  color: rgba(255,255,255,.52);
  margin-bottom: 30px;
}

/* Category chips */
.hero-chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin-bottom: 36px;
}
.hero-chip {
  padding: 5px 14px;
  border-radius: 50px;
  font-size: .74rem; font-weight: 600;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.80);
  letter-spacing: .03em;
  transition: background .2s, border-color .2s;
}
.hero-chip:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.4); cursor: default; }

/* CTA buttons */
.hero-actions {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px;
  margin-bottom: 40px;
}

.hero-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 15px 34px; border-radius: 50px;
  font-size: .95rem; font-weight: 700;
  cursor: pointer; transition: all .25s;
  font-family: var(--font-body); text-decoration: none;
  letter-spacing: .01em;
}
.hero-btn-primary {
  background: #fff;
  color: #0d2240;
  box-shadow: 0 6px 28px rgba(0,0,0,.28), 0 0 0 0 rgba(255,255,255,.0);
}
.hero-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,0,0,.34);
}
.hero-btn-secondary {
  background: rgba(255,255,255,.10);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.30);
  backdrop-filter: blur(6px);
}
.hero-btn-secondary:hover {
  background: rgba(255,255,255,.20);
  border-color: rgba(255,255,255,.55);
  transform: translateY(-3px);
}

/* Stats row */
.hero-stats {
  display: flex; align-items: center; justify-content: center; gap: 24px;
}
.hero-stat { display: flex; flex-direction: column; gap: 1px; }
.hero-stat strong { font-size: 1.15rem; font-weight: 700; color: #fff; line-height: 1.2; }
.hero-stat span   { font-size: .72rem; color: rgba(255,255,255,.45); font-weight: 500; text-transform: uppercase; letter-spacing: .08em; }
.hero-stat-div    { width: 1px; height: 32px; background: rgba(255,255,255,.18); }

/* ------- BOOK STACK (decorative, centered below text) ------- */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 320px;
  margin-top: 10px;
}

/* glow underneath */
.hero-glow {
  position: absolute;
  width: 340px; height: 200px;
  background: radial-gradient(ellipse, rgba(127,196,253,.25) 0%, transparent 70%);
  bottom: 20px; left: 50%; transform: translateX(-50%);
  pointer-events: none;
}

.hero-book-stack {
  position: relative;
  width: 420px; height: 240px;
}

.hero-book {
  position: absolute;
  width: 140px; height: 190px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.55), 4px 0 0 rgba(0,0,0,.25);
  transition: transform .4s ease;
}
.hero-book img,
.hero-book-gradient { width: 100%; height: 100%; object-fit: cover; }

/* Spread horizontally across the bottom */
.hero-book-1 { top: 30px;  left: 50%;  margin-left: -70px; z-index: 4; animation: heroFloat1 5s ease-in-out infinite; }
.hero-book-2 { top: 50px;  left: 50%;  margin-left: -210px; z-index: 3; opacity: .88; animation: heroFloat2 6s ease-in-out infinite; }
.hero-book-3 { top: 50px;  left: 50%;  margin-left:  70px; z-index: 3; opacity: .88; animation: heroFloat3 7s ease-in-out infinite; }
.hero-book-4 { top: 10px;  left: 50%;  margin-left: -350px; z-index: 2; opacity: .55; animation: heroFloat4 8s ease-in-out infinite; }

@keyframes heroFloat1 { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-14px) rotate(-4deg); } }
@keyframes heroFloat2 { 0%,100% { transform: translateY(-6px) rotate(-10deg); } 50% { transform: translateY(8px) rotate(-10deg); } }
@keyframes heroFloat3 { 0%,100% { transform: translateY(4px) rotate(5deg); } 50% { transform: translateY(-10px) rotate(5deg); } }
@keyframes heroFloat4 { 0%,100% { transform: translateY(-10px) rotate(-18deg); } 50% { transform: translateY(4px) rotate(-18deg); } }

/* Wave divider at bottom */
.hero-wave {
  margin-top: auto;
  line-height: 0;
}
.hero-wave svg {
  width: 100%;
  height: 60px;
  display: block;
}

/* =========================================
   BOOKS SECTIONS
   ========================================= */
.books-section { padding: 36px 0 0; }
.books-section-title {
  font-family: var(--font-heading); font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  color: var(--text); font-weight: 700; text-align: center; margin-bottom: 24px;
}

.carousel-wrap { position: relative; display: flex; align-items: center; gap: 8px; }
.books-carousel-track {
  display: flex; gap: 20px; overflow-x: auto; scroll-behavior: smooth;
  padding: 8px 4px 20px; scrollbar-width: none; -ms-overflow-style: none; flex: 1;
  justify-content: safe center;
}
.books-carousel-track::-webkit-scrollbar { display: none; }

.carousel-arrow {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%;
  background: var(--white); border: 1.5px solid var(--border); color: var(--text);
  font-size: 1.4rem; line-height: 1; display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow); transition: .2s; z-index: 2;
}
.carousel-arrow:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

.book-card { flex-shrink: 0; width: 150px; cursor: pointer; }

.book-card-cover-wrap {
  position: relative; width: 150px; height: 200px;
  border-radius: 4px; overflow: hidden; box-shadow: 0 3px 10px rgba(0,0,0,.18);
  transition: transform .2s, box-shadow .2s;
}
.book-card-cover-wrap:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.22); }
.book-card-img { width: 100%; height: 100%; object-fit: cover; }

.book-card-gradient {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end;
  padding: 14px 12px; color: rgba(255,255,255,.95);
}
.gradient-title { font-weight: 700; font-size: .85rem; line-height: 1.3; margin-bottom: 5px; }
.gradient-author { font-size: .68rem; opacity: .8; }

.book-card-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s;
}
.book-card-cover-wrap:hover .book-card-overlay { opacity: 1; }

.book-price-badge {
  position: absolute; bottom: 8px; left: 8px;
  background: rgba(26,60,94,.88); color: #fff;
  font-size: .75rem; font-weight: 700; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 50px;
  pointer-events: none; z-index: 2;
  backdrop-filter: blur(4px);
}

.btn-add-cart {
  padding: 8px 16px; background: #fff; color: var(--navy);
  border: none; border-radius: 50px; font-size: .78rem; font-weight: 600;
  cursor: pointer; font-family: var(--font-body); transition: background .15s;
}
.btn-add-cart:hover { background: var(--accent); color: #fff; }

.book-card-info { padding: 10px 2px 0; }
.book-card-title {
  font-size: .83rem; font-weight: 600; color: var(--text); line-height: 1.35; margin-bottom: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.book-card-author { font-size: .75rem; color: var(--muted); margin-bottom: 3px; }
.book-card-price  { font-size: .8rem; font-weight: 700; color: var(--navy); }

.bestsellers-cta { text-align: center; padding: 32px 20px 0; }
.btn-bestsellers {
  display: inline-block; padding: 13px 36px; background: var(--accent); color: #fff;
  border: none; border-radius: 50px; font-size: .92rem; font-weight: 600;
  cursor: pointer; font-family: var(--font-body);
  box-shadow: 0 4px 16px rgba(91,45,142,.30); transition: .2s;
}
.btn-bestsellers:hover { background: #4a2475; transform: translateY(-1px); }

/* ===== BLOG SECTION ===== */
.blog-section { padding: 56px 0; background: var(--white); }
.blog-inner { max-width: 1200px; margin-inline: auto; padding-inline: 24px; }
.blog-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 32px;
}
.blog-section-title {
  font-family: var(--font-heading); font-size: clamp(1.5rem, 2.5vw, 2rem);
  color: var(--text);
}
.blog-view-all {
  font-size: .88rem; font-weight: 600; color: var(--accent);
  text-decoration: none; transition: opacity .2s;
}
.blog-view-all:hover { opacity: .75; }
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.blog-card {
  background: var(--bg); border-radius: 12px; overflow: hidden;
  text-decoration: none; color: inherit; display: flex; flex-direction: column;
  border: 1px solid #e5e7eb; transition: transform .2s, box-shadow .2s;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,.10); }
.blog-card-thumb { width: 100%; aspect-ratio: 16/9; overflow: hidden; background: #e8f0fe; }
.blog-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-card-thumb-fallback {
  width: 100%; height: 100%; display: flex; align-items: center;
  justify-content: center; font-size: 2.5rem;
  background: linear-gradient(135deg,#e8f0fe,#c7d7f8);
}
.blog-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.blog-card-date { font-size: .72rem; color: #6b7280; font-weight: 500; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em; }
.blog-card-title { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 10px; line-height: 1.4; }
.blog-card-excerpt { font-size: .85rem; color: #6b7280; line-height: 1.6; flex: 1; margin-bottom: 14px; }
.blog-card-read { font-size: .82rem; font-weight: 700; color: var(--accent); }

.browse-section { padding: 48px 0 60px; margin-top: 20px; }
.browse-inner { max-width: 1400px; margin-inline: auto; padding-inline: 24px; }
.browse-title {
  font-family: var(--font-heading); font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  text-align: center; margin-bottom: 28px; color: var(--text);
}
.browse-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.browse-card {
  position: relative; width: 240px; flex: 0 1 240px; height: 160px; border-radius: 10px; overflow: hidden;
  cursor: pointer; transition: transform .2s, box-shadow .2s;
}
.browse-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,.2); }
.browse-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.70) 0%, rgba(0,0,0,.20) 60%, transparent 100%);
}
.browse-card-content {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: #fff; text-align: center; padding: 16px;
}
.browse-icon { font-size: 1.8rem; margin-bottom: 6px; }
.browse-card-content h3 { font-size: .95rem; font-weight: 700; margin-bottom: 3px; }
.browse-card-content p  { font-size: .72rem; opacity: .85; }

.site-footer {
  background: var(--navy); color: rgba(255,255,255,.75);
  padding: 24px; text-align: center; font-size: .82rem;
}
.footer-inner { max-width: 1400px; margin-inline: auto; }
.site-footer p + p { margin-top: 6px; }
.site-footer a { color: #fff; text-decoration: underline; }
.site-footer a:hover { opacity: .8; }

.cart-sidebar {
  position: fixed; top: 0; right: -420px; width: 420px; max-width: 100vw;
  height: 100vh; background: var(--white); box-shadow: -4px 0 30px rgba(0,0,0,.12);
  z-index: 1000; display: flex; flex-direction: column; transition: right .3s ease;
}
.cart-sidebar.open { right: 0; }
.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.cart-header h2 { font-family: var(--font-heading); font-size: 1.2rem; color: var(--navy); }
.cart-close { font-size: 1.1rem; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.cart-close:hover { background: var(--bg); color: var(--text); }
.cart-items { flex: 1; overflow-y: auto; padding: 16px 24px; }
.cart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 200px; gap: 12px; color: var(--muted); font-size: .9rem;
}
.cart-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-cover {
  width: 46px; height: 62px; border-radius: 4px;
  flex-shrink: 0; object-fit: cover; display: block;
}
.cart-item-cover-grad {
  background: linear-gradient(135deg,#0d2818,#1a5534);
}
.cart-item-info { flex: 1; }
.cart-item-title { font-size: .87rem; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.cart-item-price { font-size: .78rem; color: var(--muted); margin-bottom: 8px; }
.cart-item-qty { display: flex; align-items: center; gap: 10px; }
.qty-btn {
  width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border);
  background: none; font-size: 1rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text); transition: .15s;
}
.qty-btn:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.qty-btn-locked {
  width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border);
  background: none; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center;
  color: var(--border); cursor: not-allowed; opacity: .45;
}
.qty-num { font-size: .88rem; font-weight: 600; min-width: 18px; text-align: center; }
.cart-item-remove { color: var(--muted); font-size: .85rem; cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.cart-item-remove:hover { color: #dc2626; background: #fee2e2; }
.cart-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.cart-total {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 1rem; color: var(--navy);
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.cart-email-wrap { display: flex; flex-direction: column; gap: 5px; }
.cart-email-wrap label { font-size: .8rem; font-weight: 600; color: var(--text); }
.cart-email-wrap input {
  padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: .88rem; outline: none; font-family: var(--font-body); transition: .2s;
}
.cart-email-wrap input:focus { border-color: var(--blue); }
.cart-email-hint { font-size: .72rem; color: var(--muted); }
.cart-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 999; }
.cart-overlay.open { display: block; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 24px; border-radius: 50px; font-weight: 600; font-size: .88rem;
  cursor: pointer; border: 2px solid transparent; transition: .2s; font-family: var(--font-body);
}
.btn-primary  { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover  { background: var(--blue); border-color: var(--blue); }
.btn-outline  { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover  { background: var(--navy); color: #fff; }
.btn-full { width: 100%; }
.btn-paystack {
  background: #0ba360; color: #fff; border-color: #0ba360;
  font-size: .92rem; letter-spacing: .01em;
}
.btn-paystack:hover  { background: #089150; border-color: #089150; }
.btn-paystack:disabled { background: #6bbf97; border-color: #6bbf97; cursor: not-allowed; }

.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--navy); color: #fff; padding: 10px 24px; border-radius: 50px;
  font-size: .85rem; font-weight: 500; box-shadow: 0 6px 24px rgba(0,0,0,.2);
  z-index: 2000; opacity: 0; transition: .3s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #dc2626; }

@media (max-width: 900px) {
  .hero-inner { padding-bottom: 40px; }
  .hero-visual { display: none; }
  .hero-section { min-height: auto; padding: 70px 20px 0; }
  .hero-title  { margin-bottom: 18px; }
  .hero-body   { margin-bottom: 10px; }
  .hero-sub    { margin-bottom: 20px; }
  .hero-chips  { margin-bottom: 24px; }
  .hero-actions { margin-bottom: 28px; }
}

@media (max-width: 640px) {
  .logo-text { display: none; }
  .header-search-wrap { max-width: 100%; }
  .browse-grid { grid-template-columns: repeat(2, 1fr); }
  .cart-sidebar { width: 100vw; }
  .carousel-arrow { display: none; }
  .hero-title { font-size: clamp(1.8rem, 7vw, 2.4rem); }
  .hero-btn { padding: 12px 22px; font-size: .85rem; }
  .hero-section { padding: 56px 16px 0; }
  .hero-eyebrow { font-size: .65rem; margin-bottom: 14px; }
  .hero-body, .hero-sub { font-size: .88rem; }
  .hero-stats { gap: 16px; }
}

@media (max-width: 420px) {
  /* Compact hero for small Android phones */
  .hero-section { padding: 48px 14px 0; }
  .hero-title { font-size: clamp(1.6rem, 8vw, 2.2rem); margin-bottom: 14px; }
  .hero-body, .hero-sub { display: none; }  /* hide secondary text; chips + CTA remain */
  .hero-chips { gap: 6px; margin-bottom: 20px; }
  .hero-chip  { font-size: .68rem; padding: 4px 10px; }
  .hero-actions { gap: 8px; margin-bottom: 22px; }
  .hero-btn { padding: 11px 18px; font-size: .82rem; }
  .hero-stats { gap: 10px; }
  .hero-stat strong { font-size: 1rem; }
}

/* ==============================================
   BOOK DETAIL MODAL
   ============================================== */
.bd-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 1100;
  backdrop-filter: blur(4px);
}
.bd-backdrop.open { display: block; }

.bd-modal {
  display: none; position: fixed;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(92vw, 860px); max-height: 90vh;
  background: var(--white); border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
  z-index: 1200; overflow: hidden;
  flex-direction: row;
}
.bd-modal.open { display: flex; }

/* ---- Gallery pane ---- */
.bd-gallery-wrap {
  position: relative; flex-shrink: 0;
  width: 340px; background: #111;
  display: flex; align-items: center; justify-content: center;
}
.bd-gallery { width: 100%; height: 100%; position: relative; overflow: hidden; }

.bd-gallery-img {
  display: none; width: 100%; height: 100%;
  object-fit: contain;          /* full image visible, letterboxed */
  object-position: center;
  max-height: 90vh;
}
/* Landscape images: fill width, let height auto */
.bd-gallery-img.landscape {
  object-fit: contain;
  width: 100%; height: auto;
  max-height: 90vh;
}
.bd-gallery-img.active { display: block; }

.bd-gallery-prev,
.bd-gallery-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.18); border: none; color: #fff;
  font-size: 1.4rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .2s; z-index: 2;
}
.bd-gallery-prev { left: 10px; }
.bd-gallery-next { right: 10px; }
.bd-gallery-prev:hover,
.bd-gallery-next:hover { background: rgba(255,255,255,.36); }
.bd-gallery-prev.hidden,
.bd-gallery-next.hidden { display: none; }

.bd-dots {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px;
}
.bd-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,.4); border: none; cursor: pointer; transition: .2s; padding: 0;
}
.bd-dot.active { background: #fff; transform: scale(1.3); }

/* ---- Info pane ---- */
.bd-info {
  flex: 1; padding: 32px 28px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
}
.bd-close {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,.45); border: none; color: #fff;
  font-size: .95rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.bd-close:hover { background: rgba(0,0,0,.7); }

.bd-author { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.bd-title  { font-family: var(--font-heading); font-size: clamp(1.2rem, 2vw, 1.7rem); color: var(--navy); line-height: 1.25; }
.bd-price  { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.bd-desc   { font-size: .9rem; line-height: 1.75; color: #374151; flex: 1; white-space: pre-wrap; }

.bd-btn-row {
  display: flex; gap: 10px; align-items: center; margin-top: auto;
}
.bd-add-btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 14px 28px; background: var(--navy); color: #fff;
  border: none; border-radius: 50px; font-size: .92rem; font-weight: 700;
  cursor: pointer; font-family: var(--font-body); transition: .2s;
}
.bd-add-btn:hover { background: var(--blue); transform: translateY(-2px); }
.bd-share-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 12px 20px; background: rgba(200,168,75,.10); color: var(--accent);
  border: 2px solid var(--accent); border-radius: 50px; font-size: .88rem; font-weight: 700;
  cursor: pointer; font-family: var(--font-body); transition: .2s; flex-shrink: 0;
  letter-spacing: .01em;
}
.bd-share-btn:hover {
  background: var(--accent); color: #fff;
  transform: translateY(-2px); box-shadow: 0 6px 18px rgba(200,168,75,.30);
}
.bd-share-btn svg { transition: transform .2s; }
.bd-share-btn:hover svg { transform: scale(1.15); }

/* Mobile: stack gallery on top */
@media (max-width: 680px) {
  .bd-modal { flex-direction: column; width: 95vw; max-height: 92vh; top: 50%; transform: translate(-50%, -50%); }
  .bd-gallery-wrap { width: 100%; height: 260px; }
  .bd-gallery-img { max-height: 260px; }
  .bd-info { padding: 20px 18px; gap: 10px; }
  .bd-btn-row { flex-direction: column; }
  .bd-add-btn, .bd-share-btn { width: 100%; justify-content: center; }
}

/* ==============================================
   NEWSLETTER SECTION
   ============================================== */
.newsletter-section {
  background: linear-gradient(135deg, #091809 0%, #0d2818 100%);
  padding: 64px 24px;
  text-align: center;
  color: #fff;
}
.newsletter-inner { max-width: 600px; margin: 0 auto; }
.newsletter-icon  { font-size: 2.5rem; margin-bottom: 14px; }
.newsletter-title {
  font-family: var(--font-heading); font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 12px; color: #fff;
}
.newsletter-body { font-size: .95rem; color: rgba(255,255,255,.72); margin-bottom: 28px; line-height: 1.7; }

.newsletter-fields {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.newsletter-fields input {
  flex: 1; min-width: 180px; padding: 12px 18px;
  border: none; border-radius: 50px; font-size: .9rem;
  font-family: var(--font-body); outline: none; background: rgba(255,255,255,.12);
  color: #fff; backdrop-filter: blur(4px);
  border: 1.5px solid rgba(255,255,255,.25);
  transition: border-color .2s;
}
.newsletter-fields input::placeholder { color: rgba(255,255,255,.5); }
.newsletter-fields input:focus { border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.18); }
.newsletter-btn {
  padding: 12px 28px; background: #fff; color: var(--navy);
  border: none; border-radius: 50px; font-size: .9rem; font-weight: 700;
  cursor: pointer; font-family: var(--font-body); transition: .2s; white-space: nowrap;
}
.newsletter-btn:hover { background: #e8f0fe; transform: translateY(-2px); }
.newsletter-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }

.newsletter-msg {
  margin-top: 16px; font-size: .88rem; font-weight: 600;
  padding: 10px 20px; border-radius: 50px;
  display: inline-block;
}
.newsletter-msg.success { background: rgba(52,211,153,.2); color: #6ee7b7; border: 1px solid rgba(52,211,153,.3); }
.newsletter-msg.error   { background: rgba(220,38,38,.2);  color: #fca5a5; border: 1px solid rgba(220,38,38,.3); }

/* ==============================================
   BOOK CARD — DETAILS BUTTON
   ============================================== */
.book-card-overlay {
  flex-direction: column; gap: 8px;
}
.btn-view {
  padding: 8px 16px; background: #fff; color: var(--navy);
  border: none; border-radius: 50px; font-size: .78rem; font-weight: 600;
  cursor: pointer; font-family: var(--font-body); transition: background .15s;
  white-space: nowrap;
}
.btn-view:hover { background: var(--accent); color: #fff; }

/* ==============================================
   PAYMENT METHOD TABS
   ============================================== */
.pay-method-wrap {
  display: flex; gap: 8px; margin-bottom: 4px;
}
.pay-method-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 10px; border-radius: 8px; font-size: .8rem; font-weight: 600;
  border: 1.5px solid var(--border); background: var(--bg); color: var(--muted);
  cursor: pointer; font-family: var(--font-body); transition: .2s;
}
.pay-method-btn:hover   { border-color: var(--navy); color: var(--navy); }
.pay-method-btn.active  { border-color: var(--navy); background: var(--navy); color: #fff; }