/* ============================================================
   ENDLESS BOOK PUBLICATION v2 — Master Stylesheet
   Brand: Green (#2ea84a) | Fonts: Playfair Display + DM Sans
   Mobile-first, fully responsive
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,900;1,400&family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ── */
:root {
  --g1: #0a2e12;
  --g2: #1a6e2e;
  --g3: #2ea84a;
  --g4: #5cd97a;
  --g5: #80e89a;
  --gp: #e8f7ec;
  --gpp: #f2fbf5;
  --black: #0e1a11;
  --dark: #1c2e20;
  --text: #2d3a30;
  --muted: #6b7c6e;
  --border: #c8e6ce;
  --white: #ffffff;
  --gold: #e8c44a;
  --red: #e53935;
  --orange: #f57c00;
  --blue: #1565c0;
  --sh: 0 4px 24px rgba(46,168,74,.12);
  --sh-md: 0 8px 32px rgba(46,168,74,.15);
  --sh-lg: 0 12px 48px rgba(14,26,17,.18);
  --sh-xl: 0 24px 80px rgba(14,26,17,.22);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --trans: all .22s ease;
  --font-head: 'Playfair Display', serif;
  --font-body: 'DM Sans', sans-serif;
  --header-h: 72px;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--text); background: var(--white); overflow-x: hidden; line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }
ul, ol { list-style: none; }
input, select, textarea { font-family: inherit; }

/* ── Typography ── */
h1,h2,h3,h4,h5 { font-family: var(--font-head); color: var(--black); line-height: 1.2; }
h1 { font-size: clamp(28px,5vw,54px); }
h2 { font-size: clamp(22px,3.5vw,38px); }
h3 { font-size: clamp(18px,2.5vw,26px); }
p { line-height: 1.7; }

/* ── Containers ── */
.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
section { padding: 72px 0; }

/* ── Buttons ── */
.btn-green {
  background: linear-gradient(135deg, var(--g3), var(--g2));
  color: var(--white); border: none; padding: 10px 24px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; transition: var(--trans); display: inline-flex;
  align-items: center; gap: 8px; cursor: pointer; white-space: nowrap;
}
.btn-green:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(46,168,74,.35); }
.btn-green.lg { padding: 13px 32px; font-size: 15px; border-radius: var(--radius-lg); }
.btn-outline {
  border: 2px solid var(--g3); color: var(--g3); background: transparent;
  padding: 9px 22px; border-radius: var(--radius); font-size: 14px; font-weight: 600;
  transition: var(--trans); display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
}
.btn-outline:hover { background: var(--g3); color: var(--white); }
.btn-white {
  background: var(--white); color: var(--g2); padding: 12px 28px;
  border-radius: var(--radius); font-weight: 700; font-size: 15px; transition: var(--trans);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-white:hover { transform: translateY(-2px); box-shadow: var(--sh-lg); }
.btn-ghost {
  border: 2px solid rgba(255,255,255,.6); color: var(--white); padding: 12px 28px;
  border-radius: var(--radius); font-weight: 600; font-size: 15px; transition: var(--trans);
  background: transparent; display: inline-flex; align-items: center; gap: 8px;
}
.btn-ghost:hover { background: rgba(255,255,255,.15); border-color: white; }
.btn-danger { background: var(--red); color: var(--white); border: none; padding: 8px 16px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.btn-sm { padding: 6px 14px !important; font-size: 12px !important; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--dark); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 11px 14px; border: 2px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: var(--font-body); color: var(--text); transition: var(--trans);
  background: var(--white);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--g3); box-shadow: 0 0 0 3px rgba(46,168,74,.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-full { grid-column: 1 / -1; }
.form-error { color: var(--red); font-size: 12px; margin-top: 4px; }

/* ── Flash messages ── */
.flash-message {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; font-size: 14px; font-weight: 500;
  position: sticky; top: var(--header-h); z-index: 200;
}
.flash-success { background: #d4edda; color: #1a5c2a; border-bottom: 2px solid #28a745; }
.flash-error   { background: #fce4ec; color: #b71c1c; border-bottom: 2px solid var(--red); }
.flash-message button { background: none; border: none; font-size: 20px; cursor: pointer; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 28px; right: 28px; max-width: 340px;
  background: var(--dark); color: var(--white); padding: 14px 20px;
  border-radius: var(--radius); font-size: 14px; font-weight: 500;
  box-shadow: var(--sh-xl); z-index: 3000;
  transform: translateY(80px) scale(.95); opacity: 0; transition: var(--trans);
  pointer-events: none;
}
.toast.show { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.toast.success { border-left: 4px solid var(--g4); }
.toast.error   { border-left: 4px solid var(--red); }

/* ── Loading overlay ── */
.loading-overlay {
  position: fixed; inset: 0; background: rgba(14,26,17,.6);
  display: flex; align-items: center; justify-content: center; z-index: 5000; display: none;
}
.loading-overlay.show { display: flex; }
.spinner {
  width: 52px; height: 52px; border: 4px solid rgba(255,255,255,.2);
  border-top-color: var(--g4); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════
   TOP BAR
═══════════════════════════════════════════════════════ */
.topbar { background: var(--g1); color: rgba(255,255,255,.75); font-size: 12.5px; padding: 7px 0; }
.topbar .inner { max-width: 1240px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tb-links { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.tb-links a { color: rgba(255,255,255,.7); transition: color .2s; font-size: 12px; }
.tb-links a:hover { color: var(--g5); }

/* ═══════════════════════════════════════════════════════
   HEADER — with real logo image
═══════════════════════════════════════════════════════ */
#site-header {
  background: var(--white); box-shadow: 0 2px 20px rgba(46,168,74,.1);
  position: sticky; top: 0; z-index: 100; transition: var(--trans);
}
#site-header.scrolled { box-shadow: 0 4px 30px rgba(14,26,17,.15); }
.header-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; height: var(--header-h); gap: 20px;
}

/* Logo with real image */
.logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; text-decoration: none; }
.logo-img {
  height: 56px; width: auto; max-width: 220px;
  object-fit: contain; display: block;
  filter: drop-shadow(0 2px 8px rgba(46,168,74,.2));
}
/* Fallback text logo if image fails */
.logo-icon {
  width: 50px; height: 50px;
  background: linear-gradient(135deg, var(--g3), var(--g2));
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 900; color: var(--white); font-family: var(--font-head);
  flex-shrink: 0;
}
.logo-text strong { display: block; font-family: var(--font-head); font-size: 18px; color: var(--black); line-height: 1.2; }
.logo-text span { font-size: 10.5px; color: var(--g3); font-weight: 500; }

/* Nav */
.main-nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.main-nav > a, .main-nav > .dropdown > .drop-toggle {
  color: var(--dark); font-size: 13.5px; font-weight: 500; padding: 8px 13px;
  border-radius: 8px; transition: var(--trans); white-space: nowrap;
}
.main-nav > a:hover, .main-nav > a.active { background: var(--gp); color: var(--g2); }

.dropdown { position: relative; }
.drop-toggle {
  color: var(--dark); font-size: 13.5px; font-weight: 500; padding: 8px 13px;
  border-radius: 8px; transition: var(--trans); background: none; cursor: pointer;
  display: flex; align-items: center; gap: 4px; border: none;
}
/* ✅ FIX: hover AND open/active state on drop-toggle */
.drop-toggle:hover,
.dropdown.open > .drop-toggle,
.drop-toggle.active { background: var(--gp); color: var(--g2); }

.dropdown-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--white); border: 1.5px solid var(--border); border-radius: 14px;
  padding: 10px; min-width: 230px; box-shadow: var(--sh-xl); z-index: 300;
  pointer-events: none; opacity: 0; transform: translateY(-8px);
  transition: opacity .18s ease, transform .18s ease;
}
/* ✅ FIX: show via both hover (desktop) AND .open class (JS toggle) */
.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
  display: block; pointer-events: auto;
  opacity: 1; transform: translateY(0);
  animation: none;
}
@keyframes fadeDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }
.dropdown-menu a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; border-radius: 8px; color: var(--text); transition: var(--trans); }
.dropdown-menu a:hover { background: var(--gp); color: var(--g2); }
.cat-mega { display: grid; grid-template-columns: 1fr 1fr; min-width: 380px; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 0; }
.user-menu a.danger { color: var(--red); }
.user-menu a.danger:hover { background: #fce4ec; }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; background: var(--gp);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  position: relative; transition: var(--trans); border: none; cursor: pointer;
}
.icon-btn:hover { background: var(--border); }
.cart-badge {
  position: absolute; top: -3px; right: -3px; background: var(--gold); color: var(--black);
  font-size: 10px; font-weight: 800; width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.user-btn {
  display: flex; align-items: center; gap: 8px; background: var(--gp);
  border: 1.5px solid var(--border); border-radius: 10px; padding: 6px 14px;
  font-size: 13.5px; font-weight: 600; color: var(--dark); cursor: pointer;
}
.user-avatar {
  width: 28px; height: 28px; background: var(--g3); color: var(--white);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; padding: 8px; cursor: pointer; }
.hamburger span { width: 22px; height: 2px; background: var(--dark); border-radius: 2px; display: block; transition: var(--trans); }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══════════════════════════════════════════════════════
   HERO SLIDER
═══════════════════════════════════════════════════════ */
.hero { position: relative; overflow: hidden; height: clamp(380px,55vw,540px); }
.slide { position: absolute; inset: 0; display: flex; align-items: center; opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.slide.active { opacity: 1; pointer-events: auto; }
.slide-bg-1 { background: linear-gradient(135deg, #0a2e12 0%, var(--g2) 50%, var(--g3) 100%); }
.slide-bg-2 { background: linear-gradient(135deg, #071e0c 0%, #0d4018 50%, #1a6e2e 100%); }
.slide-bg-3 { background: linear-gradient(135deg, #0f2a0a 0%, #1e5c0f 50%, #2ea82e 100%); }
.slide-content { max-width: 1240px; margin: 0 auto; padding: 0 60px; width: 100%; display: flex; align-items: center; justify-content: space-between; }
.slide-text { max-width: 560px; }
.slide-badge {
  display: inline-block; background: rgba(255,255,255,.14); color: var(--g5);
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 6px 16px; border-radius: 20px; border: 1px solid rgba(255,255,255,.18); margin-bottom: 20px;
}
.slide-text h1 { font-size: clamp(28px,4.5vw,52px); line-height: 1.1; color: var(--white); margin-bottom: 18px; font-weight: 900; }
.slide-text h1 span { color: var(--g5); }
.slide-text p { color: rgba(255,255,255,.78); font-size: clamp(14px,2vw,17px); line-height: 1.65; margin-bottom: 30px; }
.slide-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.slide-visual { flex-shrink: 0; }
.book-stack-hero { display: flex; gap: 12px; align-items: flex-end; }
.bh { border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 36px; box-shadow: var(--sh-xl); transition: transform .3s; }
.bh:hover { transform: translateY(-12px) rotate(-3deg); }
.bh1 { width: 88px; height: 130px; background: linear-gradient(160deg,#ff6b6b,#c0392b); }
.bh2 { width: 88px; height: 155px; background: linear-gradient(160deg,#f9ca24,#e67e22); }
.bh3 { width: 88px; height: 140px; background: linear-gradient(160deg,#6c5ce7,#a29bfe); }
.bh4 { width: 88px; height: 125px; background: linear-gradient(160deg,#00b894,#00cec9); }
.slide-dots { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 10; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.4); border: none; cursor: pointer; transition: var(--trans); padding: 0; }
.dot.active { background: var(--white); transform: scale(1.3); }
.slide-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.18);
  border: none; color: white; width: 44px; height: 44px; border-radius: 50%;
  font-size: 24px; cursor: pointer; z-index: 10; transition: var(--trans);
  display: flex; align-items: center; justify-content: center;
}
.slide-arrow:hover { background: rgba(255,255,255,.3); }
.sa-prev { left: 20px; }
.sa-next { right: 20px; }

/* ═══════════════════════════════════════════════════════
   STAT BAR
═══════════════════════════════════════════════════════ */
.stat-bar { background: var(--dark); padding: 20px 0; }
.stat-inner { max-width: 1240px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: center; align-items: center; gap: 0; flex-wrap: wrap; }
.stat-item { text-align: center; padding: 8px 32px; }
.stat-item .num { font-family: var(--font-head); font-size: 28px; font-weight: 900; color: var(--g4); line-height: 1; }
.stat-item .lbl { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.stat-sep { width: 1px; height: 40px; background: rgba(255,255,255,.15); }

/* ═══════════════════════════════════════════════════════
   SECTION HEADERS
═══════════════════════════════════════════════════════ */
.sec-header { text-align: center; margin-bottom: 48px; }
.sec-label {
  display: inline-block; background: var(--gp); color: var(--g2);
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 16px; border-radius: 20px; margin-bottom: 14px;
  border: 1px solid var(--border);
}
.sec-header h2 { margin-bottom: 12px; }
.sec-header p { color: var(--muted); max-width: 520px; margin: 0 auto; font-size: 16px; }

/* ═══════════════════════════════════════════════════════
   CATEGORIES GRID
═══════════════════════════════════════════════════════ */
.categories-section { background: var(--gpp); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.cat-card {
  background: var(--white); border: 2px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px 14px; text-align: center; transition: var(--trans); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.cat-card:hover { border-color: var(--g3); background: var(--gp); transform: translateY(-4px); box-shadow: var(--sh); }
.cat-icon { font-size: 32px; }
.cat-name { font-size: 13px; font-weight: 600; color: var(--dark); line-height: 1.3; }

/* ═══════════════════════════════════════════════════════
   BOOK CARDS
═══════════════════════════════════════════════════════ */
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.book-card {
  background: var(--white); border-radius: var(--radius-lg); overflow: hidden;
  border: 1.5px solid var(--border); transition: var(--trans); position: relative;
}
.book-card:hover { transform: translateY(-6px); box-shadow: var(--sh-lg); border-color: var(--g4); }
.book-cover {
  height: 240px; background: linear-gradient(135deg, var(--gp), var(--border));
  display: flex; align-items: center; justify-content: center; font-size: 64px;
  position: relative; overflow: hidden;
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-badge {
  position: absolute; top: 10px; right: 10px; background: var(--g3); color: var(--white);
  font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 20px; text-transform: uppercase;
}
.book-badge.feat { background: var(--gold); color: var(--black); }
.book-info { padding: 14px; }
.book-cat { font-size: 11px; color: var(--g3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.book-title { font-size: 14px; font-weight: 700; color: var(--black); margin-bottom: 4px; line-height: 1.35; font-family: var(--font-head); }
.book-author { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.book-stars { color: var(--gold); font-size: 12px; margin-bottom: 10px; }
.book-footer { display: flex; align-items: center; justify-content: space-between; }
.book-price { font-size: 18px; font-weight: 800; color: var(--g2); font-family: var(--font-head); }
.book-atc {
  width: 34px; height: 34px; background: linear-gradient(135deg,var(--g3),var(--g2));
  color: white; border: none; border-radius: 8px; font-size: 18px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--trans);
}
.book-atc:hover { transform: scale(1.1); }

/* ═══════════════════════════════════════════════════════
   PUBLISH CTA BANNER
═══════════════════════════════════════════════════════ */
.pub-cta {
  background: linear-gradient(135deg, var(--g1) 0%, var(--g2) 60%, var(--g3) 100%);
  padding: 72px 0;
}
.pub-inner { max-width: 1240px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 48px; }
.pub-text { max-width: 580px; }
.pub-text h2 { font-size: clamp(28px,4vw,46px); color: var(--white); margin-bottom: 16px; }
.pub-text h2 span { color: var(--g5); }
.pub-text p { color: rgba(255,255,255,.8); font-size: 16px; line-height: 1.7; margin-bottom: 28px; }
.pub-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.pub-stats { display: flex; gap: 16px; flex-wrap: wrap; flex-shrink: 0; }
.ps-card {
  background: rgba(255,255,255,.12); border: 1.5px solid rgba(255,255,255,.2);
  border-radius: var(--radius-lg); padding: 20px 24px; text-align: center; min-width: 110px;
}
.ps-card .big { display: block; font-size: 28px; font-weight: 900; color: var(--g5); font-family: var(--font-head); }
.ps-card .sm { font-size: 12px; color: rgba(255,255,255,.7); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════
   HOW IT WORKS
═══════════════════════════════════════════════════════ */
.how-section { background: var(--gpp); }
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step-card {
  background: var(--white); border-radius: var(--radius-lg); padding: 28px 22px;
  border: 1.5px solid var(--border); position: relative; transition: var(--trans);
}
.step-card:hover { border-color: var(--g3); box-shadow: var(--sh); }
.step-num {
  width: 48px; height: 48px; background: linear-gradient(135deg,var(--g3),var(--g2));
  color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; font-family: var(--font-head); margin-bottom: 16px;
}
.step-card h3 { font-size: 16px; margin-bottom: 10px; }
.step-card p { font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.step-arrow { position: absolute; top: 50%; right: -16px; transform: translateY(-50%); font-size: 22px; color: var(--g4); font-weight: 700; z-index: 1; }

/* ═══════════════════════════════════════════════════════
   TESTIMONIALS
═══════════════════════════════════════════════════════ */
.testi-section { background: var(--white); }
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.testi-card {
  background: var(--gpp); border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px; transition: var(--trans);
}
.testi-card:hover { border-color: var(--g4); box-shadow: var(--sh); transform: translateY(-3px); }
.testi-stars { color: var(--gold); font-size: 16px; margin-bottom: 14px; }
.testi-text { font-size: 14px; color: var(--text); line-height: 1.7; margin-bottom: 18px; font-style: italic; }
.testi-author { display: flex; align-items: center; gap: 12px; }
.ta-ava { font-size: 32px; }
.ta-name { font-weight: 700; font-size: 14px; color: var(--dark); }
.ta-role { font-size: 12px; color: var(--g3); font-weight: 500; }

/* ═══════════════════════════════════════════════════════
   PRINT COST CALCULATOR
═══════════════════════════════════════════════════════ */
.calc-section { background: var(--gpp); padding: 60px 0; }
.calc-wrap { display: grid; grid-template-columns: 1fr 380px; gap: 32px; align-items: start; }
.calc-form {
  background: var(--white); border-radius: var(--radius-xl);
  border: 1.5px solid var(--border); padding: 32px;
}
.calc-form h3 { margin-bottom: 24px; font-size: 20px; }
.calc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.calc-group { margin-bottom: 18px; }
.calc-group label { display: block; font-size: 13px; font-weight: 600; color: var(--dark); margin-bottom: 6px; }
.calc-group input,
.calc-group select,
.calc-group textarea {
  width: 100%; padding: 11px 14px; border: 2px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: var(--font-body); transition: var(--trans);
  background: white; box-sizing: border-box;
}
.calc-group input:focus,
.calc-group select:focus,
.calc-group textarea:focus {
  outline: none; border-color: var(--g3); box-shadow: 0 0 0 3px rgba(46,168,74,.1);
}

/* Result sidebar */
.calc-result { position: sticky; top: 90px; }
.result-card {
  background: linear-gradient(135deg, var(--g1), var(--g2)); color: white;
  border-radius: var(--radius-xl); padding: 32px; margin-bottom: 16px;
}
.result-card h3 { color: white; margin-bottom: 24px; font-size: 18px; }
.result-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.12); font-size: 14px;
}
.result-line:last-child { border-bottom: none; }
.result-line .rl { color: rgba(255,255,255,.7); }
.result-line .rv { font-weight: 700; color: var(--g5); }
.result-total {
  background: rgba(255,255,255,.15); border-radius: 12px;
  padding: 18px; text-align: center; margin-top: 20px;
}
.result-total .tl { font-size: 13px; color: rgba(255,255,255,.7); margin-bottom: 6px; }
.result-total .tv { font-size: 38px; font-weight: 900; color: white; font-family: var(--font-head); }
.result-total .tsub { font-size: 11px; color: var(--g5); margin-top: 4px; }
.calc-cta {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 22px; border: 1.5px solid var(--border); text-align: center;
}
.calc-cta p { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

/* Calc CTA promo block (homepage) */
.calc-cta-inner {
  background: white;
  border-radius: 24px;
  border: 2px solid var(--border);
  padding: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.calc-feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.calc-feature-card {
  background: var(--gpp);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border);
}
.calc-feature-card .cfc-icon { font-size: 24px; margin-bottom: 8px; }
.calc-feature-card .cfc-title { font-weight: 700; font-size: 13px; margin-bottom: 4px; color: var(--dark); }
.calc-feature-card .cfc-desc  { font-size: 12px; color: var(--muted); }

/* ═══════════════════════════════════════════════════════
   SERVICES
═══════════════════════════════════════════════════════ */
.services-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap: 24px; }
.svc-card {
  background: var(--white); border: 2px solid var(--border); border-radius: var(--radius-xl);
  padding: 32px 26px; transition: var(--trans); position: relative; overflow: hidden;
}
.svc-card.popular { border-color: var(--g3); }
.svc-card.popular::before { content: 'Most Popular'; position: absolute; top: 16px; right: -28px; background: var(--g3); color: white; font-size: 10px; font-weight: 700; padding: 4px 40px; transform: rotate(30deg); letter-spacing: .05em; text-transform: uppercase; }
.svc-card:hover { transform: translateY(-6px); box-shadow: var(--sh-lg); border-color: var(--g3); }
.svc-icon { font-size: 40px; margin-bottom: 18px; }
.svc-name { font-size: 20px; font-family: var(--font-head); font-weight: 700; margin-bottom: 8px; }
.svc-desc { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.svc-price { font-size: 28px; font-weight: 900; color: var(--g2); font-family: var(--font-head); margin-bottom: 18px; }
.svc-price small { font-size: 13px; font-weight: 400; color: var(--muted); font-family: var(--font-body); }
.svc-features { list-style: none; margin-bottom: 24px; }
.svc-features li { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--gp); display: flex; gap: 8px; align-items: flex-start; }
.svc-features li::before { content: '✓'; color: var(--g3); font-weight: 700; flex-shrink: 0; margin-top: 2px; }

/* ═══════════════════════════════════════════════════════
   CONTACT
═══════════════════════════════════════════════════════ */
.contact-strip { background: var(--g1); padding: 28px 0; }
.cs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.cs-item { display: flex; align-items: center; gap: 14px; }
.cs-ico { font-size: 28px; flex-shrink: 0; }
.cs-item strong { display: block; color: white; font-size: 14px; margin-bottom: 3px; }
.cs-item span { font-size: 12px; color: rgba(255,255,255,.6); }

/* ═══════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════ */
footer { background: var(--black); color: rgba(255,255,255,.75); padding: 60px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-brand {}
.footer-desc { font-size: 13.5px; color: rgba(255,255,255,.55); line-height: 1.8; margin: 16px 0 20px; max-width: 300px; }
.social-links { display: flex; gap: 10px; }
.sl {
  width: 36px; height: 36px; background: rgba(255,255,255,.08); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  transition: var(--trans); color: rgba(255,255,255,.7);
}
.sl:hover { background: var(--g3); color: white; }
.footer-col h4 { color: white; font-size: 15px; margin-bottom: 18px; font-family: var(--font-head); }
.footer-col a { display: block; color: rgba(255,255,255,.55); font-size: 13px; padding: 5px 0; transition: var(--trans); }
.footer-col a:hover { color: var(--g4); padding-left: 4px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 20px 0; }
.footer-bottom-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-bottom-inner p { font-size: 13px; color: rgba(255,255,255,.4); }
.payment-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.pb { background: rgba(255,255,255,.08); font-size: 11.5px; padding: 4px 12px; border-radius: 6px; color: rgba(255,255,255,.5); }

/* Footer logo */
.footer-logo img { height: 50px; width: auto; object-fit: contain; filter: brightness(1.2); }

/* ═══════════════════════════════════════════════════════
   PAGE BANNER (bookstore / inner pages)
═══════════════════════════════════════════════════════ */
.page-banner { background: linear-gradient(135deg, var(--g2) 0%, var(--g3) 100%); color: white; padding: 40px 0 32px; margin-bottom: 0; }
.page-banner h1 { font-size: clamp(22px,3vw,34px); margin-bottom: 6px; color: white; }
.page-banner p  { color: rgba(255,255,255,.8); font-size: 15px; margin-bottom: 12px; }
.breadcrumb { font-size: 13px; color: rgba(255,255,255,.65); }
.breadcrumb a { color: rgba(255,255,255,.8); text-decoration: underline; }

/* ═══════════════════════════════════════════════════════
   BOOKSTORE / FILTERS  (legacy + new classes unified)
═══════════════════════════════════════════════════════ */

/* Layout */
.bookstore-layout,
.store-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 28px;
  align-items: start;
  margin-top: 28px;
  margin-bottom: 40px;
}

/* Filter Panel */
.sidebar-filters,
.filter-panel {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar-filters::-webkit-scrollbar,
.filter-panel::-webkit-scrollbar { width: 4px; }
.sidebar-filters::-webkit-scrollbar-thumb,
.filter-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Filter Panel Header */
.fp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1.5px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 2;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.fp-header h3 { font-size: 15px; font-weight: 700; margin: 0; color: var(--dark); }
.fp-clear {
  font-size: 12px; color: var(--g3); font-weight: 600;
  text-decoration: none; padding: 3px 10px;
  border: 1.5px solid var(--g3); border-radius: 20px;
  transition: var(--trans);
}
.fp-clear:hover { background: var(--g3); color: white; }

/* Filter Sections */
.filter-section,
.fp-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.filter-section:last-child,
.fp-section:last-child { border-bottom: none; }
.filter-section h4,
.fp-section h4 {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 12px;
}

/* Filter Options */
.fp-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  cursor: pointer;
}
.fp-option input[type="radio"] { accent-color: var(--g3); width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }
.fp-option label { font-size: 13.5px; color: var(--text); cursor: pointer; flex: 1; }
.fp-option:hover label { color: var(--g2); }
.fp-count { font-size: 11px; color: var(--muted); background: var(--gp); padding: 1px 7px; border-radius: 10px; font-weight: 600; }

/* Price Range */
.fp-section input[type="range"],
.filter-section input[type="range"] {
  width: 100%; accent-color: var(--g3); cursor: pointer; margin-bottom: 6px;
}
.price-display { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* Legacy filter tags */
.filter-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-tag { padding: 5px 13px; border-radius: 20px; font-size: 12.5px; border: 1.5px solid var(--border); color: var(--text); cursor: pointer; transition: var(--trans); background: white; font-family: var(--font-body); }
.filter-tag:hover, .filter-tag.active { background: var(--g3); color: white; border-color: var(--g3); }

/* Store Top Bar */
.store-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.store-info h2 { font-size: 20px; margin-bottom: 2px; }
.store-info p  { font-size: 13px; color: var(--muted); }
.store-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.s-input {
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13.5px;
  font-family: var(--font-body);
  background: var(--white);
  color: var(--dark);
  transition: var(--trans);
  min-width: 200px;
}
.s-input:focus { outline: none; border-color: var(--g3); box-shadow: 0 0 0 3px rgba(46,168,74,.1); }
.s-select {
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13.5px;
  font-family: var(--font-body);
  background: var(--white);
  color: var(--dark);
  cursor: pointer;
  transition: var(--trans);
}
.s-select:focus { outline: none; border-color: var(--g3); }

/* Mobile Filter Toggle Button */
.filter-toggle-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  font-family: var(--font-body);
  transition: var(--trans);
}
.filter-toggle-btn:hover { border-color: var(--g3); color: var(--g3); }
.filter-toggle-btn .ftb-badge { background: var(--g3); color: white; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; }

/* Mobile Filter Drawer */
.filter-drawer-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 400; backdrop-filter: blur(2px); }
.filter-drawer-overlay.show { display: block; }
.filter-drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  z-index: 401;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  padding-bottom: env(safe-area-inset-bottom, 16px);
}
.filter-drawer.open { transform: translateY(0); }
.filter-drawer .fp-header { border-radius: 20px 20px 0 0; padding: 20px 20px 14px; }
.filter-drawer .drawer-apply { padding: 16px 20px; position: sticky; bottom: 0; background: var(--white); border-top: 1px solid var(--border); }
.filter-drawer .drawer-apply button { width: 100%; justify-content: center; }

/* Category Pills */
.cat-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.cpill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: var(--trans);
  white-space: nowrap;
}
.cpill:hover { border-color: var(--g3); color: var(--g3); }
.cpill.active { background: var(--g3); color: white; border-color: var(--g3); }

/* Books grid variant */
.books-grid.three { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

/* ═══════════════════════════════════════════════════════
   BOOK DETAIL PAGE
═══════════════════════════════════════════════════════ */
.book-detail-grid { display: grid; grid-template-columns: 320px 1fr; gap: 48px; align-items: start; }
.book-main-cover { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--sh-xl); }
.book-main-cover img { width: 100%; display: block; }
.book-detail-title { font-size: clamp(24px,3vw,38px); margin-bottom: 12px; }
.book-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* ═══════════════════════════════════════════════════════
   DASHBOARD LAYOUT (Author + Admin)
═══════════════════════════════════════════════════════ */
.dash-layout { display: flex; min-height: 100vh; background: #f0f7f2; }
.sidebar {
  width: 260px; background: var(--dark); position: fixed; top: 0; left: 0;
  height: 100vh; overflow-y: auto; z-index: 200; flex-shrink: 0;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  /* Ensure no inherited blur/filter */
  filter: none;
  backdrop-filter: none;
}
.sb-logo { padding: 20px 18px 12px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sb-logo img { height: 38px; width: auto; object-fit: contain; filter: brightness(1.3); }
.sb-brand strong { color: white; font-size: 14px; font-family: var(--font-head); display: block; }
.sb-brand span { color: rgba(255,255,255,.45); font-size: 11px; }
.sb-user { padding: 14px 18px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sb-ava { width: 36px; height: 36px; background: var(--g3); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; flex-shrink: 0; }
.sb-name { color: white; font-size: 13px; font-weight: 600; }
.sb-role { color: var(--g4); font-size: 11px; }
.sb-nav { padding: 12px 10px 20px; }
.sb-section { color: rgba(255,255,255,.3); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; padding: 12px 10px 6px; }
.sb-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  color: rgba(255,255,255,.65); font-size: 13.5px; transition: var(--trans); cursor: pointer;
  background: none; border: none; width: 100%; text-align: left; font-family: var(--font-body);
  text-decoration: none; margin-bottom: 2px;
}
.sb-link:hover { background: rgba(255,255,255,.07); color: white; }
.sb-link.active { background: var(--g3); color: white; font-weight: 600; }
.sb-ico { font-size: 16px; flex-shrink: 0; }
.sb-badge { margin-left: auto; background: rgba(255,255,255,.15); color: white; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.sb-badge.red { background: var(--red); }

.dash-main { margin-left: 260px; padding: 28px; flex: 1; min-width: 0; }
.ds { display: none; }
.ds.active { display: block; }
.dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.dash-header h1 { font-size: 26px; margin: 0; }
.dash-header p { color: var(--muted); font-size: 14px; margin: 4px 0 0; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.sc {
  background: white; border-radius: var(--radius-lg); padding: 20px; display: flex;
  align-items: center; gap: 14px; border: 1.5px solid var(--border); transition: var(--trans);
}
.sc:hover { box-shadow: var(--sh); border-color: var(--g4); }
.sc-ico { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.sc-ico.g { background: var(--gp); }
.sc-ico.b { background: #e3f2fd; }
.sc-ico.o { background: #fff3e0; }
.sc-ico.p { background: #f3e5f5; }
.sc-ico.r { background: #fce4ec; }
.sc-val { font-size: 22px; font-weight: 800; color: var(--black); font-family: var(--font-head); line-height: 1; }
.sc-lbl { font-size: 12px; color: var(--muted); margin-top: 4px; }

.panel { background: white; border-radius: var(--radius-lg); border: 1.5px solid var(--border); overflow: hidden; margin-bottom: 22px; }
.panel-header { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.panel-header h3 { font-size: 16px; margin: 0; }
.panel-body { padding: 20px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { text-align: left; padding: 10px 14px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f8faf8; border-bottom: 2px solid var(--border); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid #f0f5f0; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8faf8; }

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.badge.live     { background: #d4edda; color: #1a5c2a; }
.badge.pending  { background: #fff3cd; color: #856404; }
.badge.rejected { background: #fce4ec; color: #b71c1c; }
.badge.shipped  { background: #e3f2fd; color: #1565c0; }
.badge.cod      { background: #e8f5e9; color: #2e7d32; }
.badge.review   { background: #e8eaf6; color: #283593; }
.badge.paid     { background: #d4edda; color: #1a5c2a; }

.action-group { display: flex; gap: 6px; flex-wrap: wrap; }
.ab { padding: 4px 12px; border-radius: 6px; font-size: 11.5px; font-weight: 700; cursor: pointer; border: 1.5px solid; transition: var(--trans); font-family: var(--font-body); }
.ab.view     { border-color: var(--g3); color: var(--g3); background: transparent; }
.ab.view:hover { background: var(--g3); color: white; }
.ab.approve  { border-color: var(--g3); color: white; background: var(--g3); }
.ab.approve:hover { background: var(--g2); }
.ab.reject   { border-color: var(--red); color: var(--red); background: transparent; }
.ab.reject:hover { background: var(--red); color: white; }
.ab.edit     { border-color: var(--blue); color: var(--blue); background: transparent; }
.ab.edit:hover { background: var(--blue); color: white; }

/* ═══════════════════════════════════════════════════════
   PAGE LAYOUTS (Login, Register, Contact)
═══════════════════════════════════════════════════════ */
.page-hero { background: linear-gradient(135deg, var(--g1), var(--g2)); padding: 60px 0 40px; text-align: center; }
.page-hero h1 { color: white; font-size: clamp(26px,4vw,42px); }
.page-hero p { color: rgba(255,255,255,.7); font-size: 16px; margin-top: 10px; }
.breadcrumb { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 14px; font-size: 13px; color: rgba(255,255,255,.5); }
.breadcrumb a { color: rgba(255,255,255,.65); }
.breadcrumb a:hover { color: var(--g5); }

.auth-wrap { max-width: 480px; margin: 60px auto; padding: 0 20px; }
.auth-card { background: white; border-radius: var(--radius-xl); box-shadow: var(--sh-xl); padding: 36px; }
.auth-card h2 { font-size: 26px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }

.cart-layout { display: grid; grid-template-columns: 1fr 350px; gap: 28px; }
.cart-items { background: white; border-radius: var(--radius-xl); border: 1.5px solid var(--border); overflow: hidden; }
.cart-item { display: flex; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--border); align-items: center; }
.cart-item:last-child { border-bottom: none; }
.ci-cover { width: 72px; height: 96px; border-radius: 8px; background: var(--gp); display: flex; align-items: center; justify-content: center; font-size: 32px; overflow: hidden; flex-shrink: 0; }
.ci-cover img { width: 100%; height: 100%; object-fit: cover; }
.ci-info { flex: 1; }
.ci-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.ci-author { color: var(--muted); font-size: 13px; }
.ci-qty { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.qty-btn { width: 28px; height: 28px; border-radius: 6px; border: 1.5px solid var(--border); background: none; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--trans); }
.qty-btn:hover { background: var(--gp); border-color: var(--g3); }
.ci-price { font-size: 18px; font-weight: 800; color: var(--g2); font-family: var(--font-head); }
.order-summary { background: white; border-radius: var(--radius-xl); border: 1.5px solid var(--border); padding: 24px; position: sticky; top: 90px; }
.os-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.os-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--gp); font-size: 14px; }
.os-total { display: flex; justify-content: space-between; padding: 14px 0; font-size: 17px; font-weight: 800; color: var(--g2); }

/* ═══════════════════════════════════════════════════════
   CONTACT PAGE
═══════════════════════════════════════════════════════ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.contact-info { background: linear-gradient(135deg, var(--g1), var(--g2)); border-radius: var(--radius-xl); padding: 40px; color: white; }
.contact-info h2 { color: white; margin-bottom: 20px; }
.ci-row { display: flex; gap: 14px; margin-bottom: 22px; }
.ci-ico { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.ci-label { font-size: 12px; color: var(--g5); font-weight: 600; margin-bottom: 4px; }
.ci-val { font-size: 15px; color: rgba(255,255,255,.85); }
.contact-form-card { background: white; border-radius: var(--radius-xl); border: 1.5px solid var(--border); padding: 36px; }

/* ═══════════════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════════════ */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 36px; flex-wrap: wrap; }
.page-btn { width: 38px; height: 38px; border-radius: 8px; border: 1.5px solid var(--border); background: white; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--trans); font-family: var(--font-body); }
.page-btn:hover, .page-btn.active { background: var(--g3); color: white; border-color: var(--g3); }

/* ═══════════════════════════════════════════════════════
   MOBILE RESPONSIVE
═══════════════════════════════════════════════════════ */

/* Tablet — ≤ 1024px */
@media (max-width: 1024px) {
  .steps-grid { grid-template-columns: 1fr 1fr; }
  .step-arrow { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .testi-grid { grid-template-columns: 1fr 1fr; }
  .pub-inner { flex-direction: column; }
  .pub-stats { width: 100%; justify-content: center; }
  .bookstore-layout, .store-layout { grid-template-columns: 240px 1fr; }
  .cs-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
  .calc-wrap { grid-template-columns: 1fr; }
  .calc-result { position: static; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
}

/* Mobile — ≤ 768px */
@media (max-width: 768px) {
  :root { --header-h: 60px; }

  /* Topbar */
  .topbar .inner { flex-direction: column; gap: 4px; text-align: center; }
  .tb-links { justify-content: center; gap: 10px; }

  /* Header */
  .header-inner { height: var(--header-h); }
  .logo-img { height: 44px; max-width: 160px; }
  .main-nav {
    position: fixed; top: 0; left: -100%; width: 290px; height: 100vh;
    background: var(--dark); flex-direction: column; align-items: flex-start;
    padding: 0 0 24px; z-index: 150; transition: left .3s cubic-bezier(.4,0,.2,1);
    overflow-y: auto; gap: 0; box-shadow: 4px 0 32px rgba(0,0,0,.25);
  }
  .main-nav.open { left: 0; }

  /* Nav header strip inside mobile drawer */
  .main-nav::before {
    content: 'Menu';
    display: block;
    width: 100%;
    padding: 20px 18px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255,255,255,.35);
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
    box-sizing: border-box;
    margin-bottom: 8px;
  }

  .main-nav > a {
    color: rgba(255,255,255,.82); width: 100%; padding: 11px 18px;
    border-radius: 0; font-size: 14.5px; border-left: 3px solid transparent;
  }
  .main-nav > a:hover { background: rgba(255,255,255,.06); color: white; border-left-color: rgba(255,255,255,.2); }
  .main-nav > a.active { background: rgba(46,168,74,.18); color: var(--g4); border-left-color: var(--g3); font-weight: 600; }

  /* Dropdown inside mobile nav */
  .main-nav .dropdown { width: 100%; }
  .main-nav .drop-toggle {
    color: rgba(255,255,255,.82); width: 100%; padding: 11px 18px;
    font-size: 14.5px; border-radius: 0; border-left: 3px solid transparent;
    justify-content: space-between;
  }
  .main-nav .drop-toggle:hover { background: rgba(255,255,255,.06); color: white; }
  .main-nav .drop-toggle.active,
  .main-nav .dropdown.open > .drop-toggle {
    background: rgba(46,168,74,.18); color: var(--g4); border-left-color: var(--g3);
  }
  .main-nav .dropdown-menu {
    position: static; border: none;
    background: rgba(255,255,255,.04);
    border-radius: 0; margin: 0;
    padding: 4px 0 8px;
    display: none;
    opacity: 1; transform: none; pointer-events: auto;
    box-shadow: none;
  }
  .main-nav .dropdown.open .dropdown-menu { display: block !important; }
  .main-nav .dropdown-menu a {
    color: rgba(255,255,255,.6); font-size: 13.5px;
    padding: 9px 18px 9px 32px; border-radius: 0;
    border-left: 3px solid transparent;
  }
  .main-nav .dropdown-menu a:hover { background: rgba(255,255,255,.06); color: white; border-left-color: rgba(255,255,255,.2); }
  .main-nav .cat-mega { grid-template-columns: 1fr; min-width: unset; }

  .hamburger { display: flex; }
  .header-actions .btn-outline,
  .header-actions .btn-green { display: none; }

  /* Overlay for mobile nav */
  .nav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 140; backdrop-filter: blur(2px); }
  .nav-overlay.show { display: block; }

  /* Hero */
  .slide-content { padding: 0 24px; flex-direction: column; justify-content: center; text-align: center; gap: 24px; }
  .slide-visual { display: none; }
  .slide-actions { justify-content: center; }
  .slide-text h1 { font-size: 26px; }
  .slide-text p { font-size: 14px; }

  /* Stats bar */
  .stat-inner { gap: 0; }
  .stat-item { padding: 6px 16px; }
  .stat-item .num { font-size: 22px; }
  .stat-sep { height: 24px; }

  /* Sections */
  section { padding: 48px 0; }
  .sec-header { margin-bottom: 32px; }

  /* Categories */
  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .cat-card { padding: 16px 10px; }
  .cat-icon { font-size: 24px; }
  .cat-name { font-size: 11px; }

  /* Books */
  .books-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .book-cover { height: 180px; }

  /* Steps */
  .steps-grid { grid-template-columns: 1fr; }

  /* Testimonials */
  .testi-grid { grid-template-columns: 1fr; }

  /* CTA */
  .pub-inner { gap: 32px; }
  .pub-text h2 { font-size: 26px; }
  .pub-actions { flex-direction: column; align-items: flex-start; }
  .pub-stats { justify-content: center; }

  /* Contact strip */
  .cs-grid { grid-template-columns: 1fr; gap: 16px; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }

  /* Auth */
  .auth-card { padding: 24px; }

  /* Book detail */
  .book-detail-grid { grid-template-columns: 1fr; }

  /* Cart */
  .cart-layout { grid-template-columns: 1fr; }
  .order-summary { position: static; }

  /* Bookstore — mobile: hide sidebar, show drawer */
  .bookstore-layout,
  .store-layout { grid-template-columns: 1fr; }
  .filter-panel,
  .sidebar-filters { display: none; }
  .filter-toggle-btn { display: flex; }
  .store-top { flex-direction: column; align-items: flex-start; }
  .store-controls { width: 100%; }
  .s-input { min-width: unset; flex: 1; }
  .cat-pills { gap: 6px; }
  .cpill { font-size: 12px; padding: 5px 12px; }

  /* Calc — mobile */
  .calc-section { padding: 32px 0; }
  .calc-wrap { grid-template-columns: 1fr; gap: 20px; }
  .calc-result { position: static; }
  .calc-form { padding: 20px 16px; }
  .calc-row { grid-template-columns: 1fr; gap: 0; }
  .result-card { padding: 20px 16px; }
  .result-total .tv { font-size: 28px; }
  .calc-cta { padding: 18px 16px; }
  /* Calc promo block (homepage) */
  .calc-cta-inner { grid-template-columns: 1fr !important; padding: 24px 20px !important; gap: 24px !important; }
  .calc-feature-grid { grid-template-columns: 1fr 1fr; }
  .page-hero { padding: 40px 0 24px; }
  .page-hero h1 { font-size: 26px; }
  .faq-grid { grid-template-columns: 1fr !important; }

  /* Dashboard sidebar — mobile */
  .sidebar {
    transform: translateX(-100%);
    z-index: 500;           /* above everything */
    top: 0;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,.35);
  }
  /* Dedicated sidebar overlay (separate from nav overlay) */
  #sideOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 499;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
  #sideOverlay.show { display: block; }
  /* dashToggle button */
  .dash-toggle {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    color: var(--dark);
    transition: var(--trans);
  }
  .dash-toggle:hover { border-color: var(--g3); color: var(--g3); }
  .dash-main { margin-left: 0; padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* Form rows */
  .form-row { grid-template-columns: 1fr; }
}

/* Small mobile — ≤ 480px */
@media (max-width: 480px) {
  .books-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .book-cover { height: 160px; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-item .num { font-size: 18px; }
  .stat-sep { display: none; }
  .services-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .sc-val { font-size: 18px; }
  .slide-text h1 { font-size: 22px; }
  .toast { right: 12px; left: 12px; max-width: none; }
  /* Calc — small mobile */
  .calc-cta-inner { padding: 16px !important; }
  .calc-feature-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .calc-feature-card { padding: 12px; }
  .result-total .tv { font-size: 24px; }
  .calc-form { padding: 14px 12px; }
  /* Mobile nav full width */
  .main-nav { width: 100vw; max-width: 100vw; }
}

/* ═══════════════════════════════════════════════════════
   UTILITY CLASSES
═══════════════════════════════════════════════════════ */
.text-center { text-align: center; }
.text-green { color: var(--g3); }
.text-muted { color: var(--muted); }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }
.hidden { display: none; }
.fw-700 { font-weight: 700; }
.green-line { width: 48px; height: 3px; background: var(--g3); border-radius: 2px; margin: 12px auto 0; }

/* ── Bookstore: mobile-filter-bar hidden on desktop ────── */
.mobile-filter-bar { display: none !important; }
@media (max-width: 768px) {
  .mobile-filter-bar { display: flex !important; }
  .desktop-controls { display: none !important; }
  .store-top { margin-bottom: 8px; }
  .store-info { margin-bottom: 0; }
}

/* ── FAQ Grid (print calculator page) ───────────────── */
.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 768px) {
  .faq-grid { grid-template-columns: 1fr; }
}

/* ── Dashboard toggle button: hidden on desktop ────────────── */
.dash-toggle { display: none; }
@media (max-width: 768px) {
  .dash-toggle { display: flex !important; }
}

/* ── Mobile dashboard header bar ───────────────────────────── */
.mobile-dash-bar { display: none; }
@media (max-width: 768px) {
  .mobile-dash-bar {
    display: flex !important;
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 100;
    border-bottom: 1px solid var(--border);
    padding: 10px 0 !important;
    margin-bottom: 16px !important;
    margin-top: -16px;
  }
}
