/* ============================================
   LearnZone — Main Stylesheet
   Dark / Light theme, mobile-first
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── Dark mode — cozy library/cafe ──────────── */
:root,
[data-theme="dark"] {
  --bg: #110f0b;           /* Deep walnut */
  --surface: #1a1712;      /* Dark warm wood */
  --surface2: #231e17;     /* Warm panel */
  --border: #352a1e;       /* Warm wood grain */
  --border-light: #4a3a28; /* Lighter wood */
  --accent: #4d7a58;       /* Library lamp green */
  --accent-hover: #3c6046;
  --accent-dim: rgba(77,122,88,0.15);
  --purple: #8a6242;       /* Warm cognac/leather */
  --purple-hover: #72502e;
  --purple-dim: rgba(138,98,66,0.15);
  --text: #f2e8d5;         /* Warm parchment */
  --text-dim: #7a6a52;     /* Muted warm */
  --text-mid: #a8906e;     /* Warm mid-tone */
  --error: #c85050;
  --success: #4a8a60;
  --warning: #c4923a;
  --warm-glow: rgba(200,160,70,0.10);
  --warm-glow-hover: rgba(200,160,70,0.22);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --header-h: 60px;
  --sidebar-w: 260px;
  --shadow: 0 4px 28px rgba(0,0,0,0.38);
  --shadow-lg: 0 20px 80px rgba(0,0,0,0.52);
  --grain-opacity: 0.04;
}

/* ── Light mode — warm parchment/cafe ───────── */
[data-theme="light"] {
  --bg: #f7f1e6;           /* Warm parchment */
  --surface: #fefcf5;      /* Cream */
  --surface2: #ece4d0;     /* Warm sand */
  --border: #d4c4a0;       /* Warm tan */
  --border-light: #c0ae8a;
  --accent: #2a6640;       /* Deep forest green */
  --accent-hover: #1e5030;
  --accent-dim: rgba(42,102,64,0.12);
  --purple: #7a4e30;       /* Warm cognac */
  --purple-hover: #623e22;
  --purple-dim: rgba(122,78,48,0.12);
  --text: #1a1208;         /* Deep espresso */
  --text-dim: #6a5840;     /* Warm muted */
  --text-mid: #52402a;
  --error: #a83838;
  --success: #226640;
  --warning: #8a5a0a;
  --warm-glow: rgba(140,100,40,0.10);
  --warm-glow-hover: rgba(140,100,40,0.20);
  --shadow: 0 4px 20px rgba(40,28,12,0.12);
  --shadow-lg: 0 16px 60px rgba(40,28,12,0.2);
  --grain-opacity: 0.025;
}

/* ── Reset ───────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.25s, color 0.25s;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, textarea, select { font-family: inherit; outline: none; }

/* ── Typography ──────────────────────────────── */
h1, h2, h3, h4 { font-family: 'Lora', serif; line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(26px, 5vw, 42px); }
h2 { font-size: clamp(20px, 4vw, 30px); }
h3 { font-size: clamp(17px, 3vw, 22px); }
h4 { font-size: 17px; }

/* grain removed — smooth backgrounds */

/* ── HEADER ─────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 500;
  transition: background-color 0.25s, border-color 0.25s;
}
[data-theme="dark"] .site-header { background: rgba(13,12,11,0.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
[data-theme="light"] .site-header { background: rgba(245,242,237,0.97); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
}
.header-left { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.hamburger {
  width: 38px; height: 38px;
  background: none; border: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  position: relative; z-index: 1;
}
.hamburger:hover { background: var(--surface2); }
.hamburger-icon { display: flex; flex-direction: column; gap: 5px; width: 18px; }
.hamburger-icon span { display: block; height: 1.5px; background: var(--text); border-radius: 2px; transition: all 0.25s; }

.logo-link { display: flex; align-items: center; gap: 10px; text-decoration: none; cursor: pointer; }
.header-logo { width: 38px; height: 38px; border-radius: 8px; object-fit: contain; }
.header-brand {
  font-family: 'Lora', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: -0.2px;
}
.header-brand em { font-style: normal; color: var(--text); font-weight: 700; }

.header-center { flex: 1; display: flex; justify-content: center; min-width: 0; }
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0 6px 0 14px;
  width: 100%;
  max-width: 440px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.search-bar svg { color: var(--text-dim); flex-shrink: 0; }
.search-bar input {
  flex: 1; background: none; border: none;
  color: var(--text); font-size: 13px; padding: 8px 0; min-width: 0;
}
.search-bar input::placeholder { color: var(--text-dim); }
.search-btn {
  padding: 5px 14px;
  background: var(--accent);
  border: none; border-radius: 100px;
  color: #fff; font-size: 12px; font-weight: 500;
  flex-shrink: 0; transition: background 0.2s;
  white-space: nowrap;
}
.search-btn:hover { background: var(--accent-hover); }

.header-right { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }

.theme-toggle {
  width: 36px; height: 36px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.theme-toggle:hover { background: var(--border); color: var(--text); }
/* In dark mode: show sun (to go light), hide moon */
.icon-sun { display: block; }
.icon-moon { display: none; }
/* In light mode: show moon (to go dark), hide sun */
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

.cart-btn {
  position: relative;
  width: 36px; height: 36px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  transition: background 0.2s, border-color 0.2s;
}
.cart-btn:hover { background: var(--border); }
.cart-count {
  position: absolute; top: -5px; right: -5px;
  min-width: 17px; height: 17px;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 100px;
  display: none; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg);
}
.cart-count.visible { display: flex; }

/* ── SIDEBAR ─────────────────────────────────── */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 600;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.sidebar-overlay.open { opacity: 1; pointer-events: all; }

.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 700;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }

.sidebar-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-logo { display: flex; align-items: center; gap: 9px; }
.sidebar-logo img { width: 28px; height: 28px; border-radius: 5px; }
.sidebar-logo span { font-family: 'Lora', serif; font-size: 14px; font-weight: 700; }
.sidebar-close {
  width: 30px; height: 30px; background: none; border: none;
  color: var(--text-dim); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: background 0.2s;
}
.sidebar-close:hover { background: var(--surface2); color: var(--text); }

.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-section-label {
  font-size: 9px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--text-mid); padding: 14px 20px 6px;
}
.sidebar-link {
  display: block;
  padding: 10px 20px;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  border-left: 2px solid transparent;
}
.sidebar-link:hover, .sidebar-link.active {
  background: var(--surface2);
  color: var(--text);
  border-left-color: var(--accent);
  text-shadow: 0 0 20px rgba(200,220,200,0.2);
}
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-dim); line-height: 1.8;
}
.sidebar-footer a { color: var(--accent); }

/* ── CART SIDEBAR ─────────────────────────────── */
.cart-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 800; opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.cart-overlay.open { opacity: 1; pointer-events: all; }

.cart-sidebar {
  position: fixed; top: 0; right: 0;
  width: min(380px, 100vw); height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 900;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
}
.cart-sidebar.open { transform: translateX(0); }

.cart-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.cart-header h3 { font-size: 16px; }
.cart-close {
  width: 32px; height: 32px; background: none; border: none;
  color: var(--text-dim); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: background 0.2s;
}
.cart-close:hover { background: var(--surface2); color: var(--text); }
.cart-items { flex: 1; overflow-y: auto; padding: 16px; }

.cart-empty {
  height: 200px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text-dim); gap: 8px; text-align: center;
}
.cart-empty-icon { font-size: 32px; opacity: 0.25; line-height: 1; margin-bottom: 4px; }

.cart-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cart-item:last-child { border-bottom: none; }
.cart-item-thumb { width: 56px; height: 72px; border-radius: 6px; overflow: hidden; background: var(--surface2); flex-shrink: 0; }
.cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: 'Lora',serif; font-size: 20px; font-weight: 700; color: var(--text-dim); }
.cart-item-details { flex: 1; min-width: 0; }
.cart-item-title { font-size: 13px; font-weight: 500; line-height: 1.3; margin-bottom: 3px; }
.cart-item-variant { font-size: 11px; color: var(--text-dim); margin-bottom: 5px; }
.cart-item-price { font-size: 13px; font-weight: 600; }
.cart-item-actions { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.cart-item-qty-btn { width: 22px; height: 22px; background: var(--surface2); border: 1px solid var(--border); border-radius: 5px; color: var(--text); font-size: 13px; display: flex; align-items: center; justify-content: center; transition: background 0.15s; }
.cart-item-qty-btn:hover { background: var(--border); }
.cart-item-qty { font-size: 12px; font-weight: 600; min-width: 18px; text-align: center; }
.cart-item-remove { background: none; border: none; color: var(--error); font-size: 11px; margin-left: auto; opacity: 0.7; transition: opacity 0.2s; }
.cart-item-remove:hover { opacity: 1; }

.cart-footer { padding: 20px 20px 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.cart-total { display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 600; padding-bottom: 4px; }
.cart-total-amount { color: var(--accent); }
.cart-note { font-size: 11px; color: var(--text-dim); text-align: center; }
.cart-note a { color: var(--accent); }

/* ── LAYOUT ───────────────────────────────────── */
.main-content { padding-top: var(--header-h); }
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ── BUTTONS ──────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  transition: all 0.18s; cursor: pointer;
  text-decoration: none; border: none; white-space: nowrap;
}
.btn:active { transform: scale(0.985); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-purple { background: var(--purple); color: #fff; }
.btn-purple:hover { background: var(--purple-hover); }
.btn-outline { background: transparent; color: var(--text-mid); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--text-dim); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--text-mid); color: var(--text); }
.btn-full { width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-sm { padding: 7px 14px; font-size: 12px; }

/* ── HERO ─────────────────────────────────────── */
.hero {
  position: relative;
  padding: 100px 20px 100px;
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background-image: url('/images/hero-books.webp');
  background-size: cover;
  background-position: center 40%;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  backdrop-filter: blur(2px);
  background: rgba(13,12,11,0.58);
  z-index: 0;
}
[data-theme="light"] .hero::before {
  background: rgba(245,240,228,0.86);
}
.hero > * { position: relative; z-index: 1; }
.hero-glow { display: none; }
.hero-eyebrow {
  display: inline-block;
  padding: 5px 14px;
  background: var(--accent-dim);
  border: 1px solid rgba(77,122,88,0.35);
  border-radius: 100px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 22px;
}
[data-theme="light"] .hero-eyebrow { background: rgba(42,102,64,0.12); border-color: rgba(42,102,64,0.3); }
.hero h1 { margin-bottom: 16px; font-size: clamp(32px, 6vw, 56px); text-shadow: 0 2px 16px rgba(0,0,0,0.4); }
.hero h1 .highlight { color: var(--accent); }
[data-theme="light"] .hero h1 { color: var(--text); text-shadow: 0 1px 4px rgba(255,255,255,0.5); }
[data-theme="light"] .hero h1 .highlight { color: var(--accent); text-shadow: 0 1px 8px rgba(42,102,64,0.2); }
.hero p {
  font-size: 17px; color: rgba(255,255,255,0.85);
  max-width: 520px; margin: 0 auto 32px;
  font-weight: 400; line-height: 1.7;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}
[data-theme="light"] .hero p { color: rgba(24,16,6,0.82); text-shadow: none; font-weight: 400; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
[data-theme="light"] .hero-actions .btn-outline {
  color: var(--text);
  border-color: rgba(24,16,6,0.35);
  background: rgba(255,255,255,0.5);
}
[data-theme="light"] .hero-actions .btn-outline:hover {
  background: rgba(255,255,255,0.75);
  border-color: var(--text);
}
.hero-note { margin-top: 14px; font-size: 13px; color: rgba(255,255,255,0.7); }
[data-theme="light"] .hero-note { color: rgba(24,16,6,0.72); }
.hero-note-link { color: var(--accent); font-weight: 600; }
[data-theme="light"] .hero-note-link { text-decoration: underline; text-underline-offset: 2px; }

/* ── SECTIONS ─────────────────────────────────── */
.section { padding: 56px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; gap: 16px; }
.section-title { font-size: clamp(26px, 4vw, 36px); color: var(--text); }
.section-title .highlight { color: var(--accent); }
.section-title .highlight-purple { color: var(--purple); }
.section-link { color: var(--accent); font-size: 13px; white-space: nowrap; }
.section-link:hover { text-decoration: underline; }

/* ── PRODUCT GRID ─────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; } }

/* ── PRODUCT CARD ─────────────────────────────── */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), border-color 0.25s, box-shadow 0.25s;
  cursor: pointer;
  display: flex; flex-direction: column;
  box-shadow: 0 2px 18px var(--warm-glow);
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 48px var(--warm-glow-hover), 0 0 0 1px var(--border-light);
}
.product-card.is-ebook:hover { border-color: rgba(77,122,88,0.5); }
.product-card.is-course:hover { border-color: rgba(138,98,66,0.5); }

.card-thumb {
  position: relative; width: 100%;
  aspect-ratio: 3/4; overflow: hidden;
  background: var(--surface2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.card-thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.4s cubic-bezier(0.4,0,0.2,1); }
.product-card:hover .card-thumb img { transform: scale(1.03); }
.card-thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: 'Lora',serif; font-size: 48px; font-weight: 700; color: var(--border); }
.card-thumb::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.45) 0%, transparent 100%);
  pointer-events: none;
}

.card-badge {
  position: absolute; top: 8px; left: 8px; z-index: 1;
  padding: 3px 9px; border-radius: 100px;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
  backdrop-filter: blur(4px);
}
.badge-featured { background: rgba(196,148,40,0.92); color: #fff; }
.badge-bestseller { background: rgba(217,95,95,0.92); color: #fff; }
.badge-type {
  position: absolute; top: 8px; right: 8px; left: auto; z-index: 1;
  padding: 3px 9px; border-radius: 100px;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
  backdrop-filter: blur(4px);
}
.badge-type.ebook { background: rgba(60,110,74,0.90); color: #fff; }
.badge-type.course { background: rgba(160,80,48,0.90); color: #fff; }

.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.card-title {
  font-family: 'Lora', serif;
  font-size: 15px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  color: var(--text);
}
.card-desc {
  font-size: 12px; color: var(--text-dim); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
  flex: 1;
}
.card-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.card-price { font-size: 20px; font-weight: 700; color: var(--accent); }
.card-price .currency { font-size: 13px; color: var(--text); font-weight: 600; margin-left: 3px; letter-spacing: 0.3px; }
.card-sold { font-size: 13px; color: var(--text); font-weight: 600; white-space: nowrap; }

.card-add-btn {
  width: 100%; padding: 11px;
  border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  transition: background 0.18s, transform 0.1s, opacity 0.18s;
  letter-spacing: 0.3px;
}
.card-add-btn:active { transform: scale(0.97); }
.card-add-btn.ebook { background: var(--accent); color: #fff; }
.card-add-btn.ebook:hover { background: var(--accent-hover); }
.card-add-btn.course { background: var(--purple); color: #fff; }
.card-add-btn.course:hover { background: var(--purple-hover); }
[data-theme="light"] .card-add-btn.ebook,
[data-theme="light"] .card-add-btn.course { color: #fff; }

/* ── SKELETON LOADING ─────────────────────────── */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.skeleton-thumb {
  width: 100%; aspect-ratio: 1;
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.skeleton-line {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-line.short { width: 55%; }
.skeleton-line.btn { height: 32px; border-radius: var(--radius-sm); margin-top: 2px; }

/* ── HORIZONTAL SCROLL ────────────────────────── */
.scroll-section { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.scroll-section::-webkit-scrollbar { height: 4px; }
.scroll-section::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.scroll-section .product-card { min-width: 140px; max-width: 160px; flex-shrink: 0; }
@media (min-width: 640px) { .scroll-section .product-card { min-width: 160px; max-width: 180px; } }

/* ── PAGE SEARCH ──────────────────────────────── */
.page-search-wrap { margin: 20px 0 4px; }
.page-search-input {
  width: 100%; max-width: 440px;
  padding: 11px 18px; border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-size: 14px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.page-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ── SORT SELECT ──────────────────────────────── */
.sort-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; padding-top: 16px; }
.sort-label { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); white-space: nowrap; }
.sort-select {
  padding: 9px 38px 9px 16px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 160px;
}
.sort-select:hover { border-color: var(--accent); }
.sort-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* ── PAGE HERO ────────────────────────────────── */
.page-hero {
  padding: 44px 28px 36px; margin-bottom: 8px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent-dim) 0%, var(--purple-dim) 100%);
  border: 1px solid var(--border);
}
.page-hero h1 { margin-bottom: 8px; font-size: clamp(22px, 4vw, 32px); }
.page-hero p { color: var(--text-dim); font-size: 15px; margin: 0; max-width: 560px; }

/* ── PRODUCT DETAIL ───────────────────────────── */
.product-detail { display: grid; grid-template-columns: 1fr; gap: 36px; padding: 40px 0; }
@media (min-width: 768px) { .product-detail { grid-template-columns: 1.2fr 1fr; gap: 56px; } }
.detail-thumb { border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--border); aspect-ratio: 1; max-height: 620px; }
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { display: flex; flex-direction: column; gap: 18px; }
.detail-type-badge { display: inline-block; padding: 4px 12px; border-radius: 100px; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; align-self: flex-start; }
.detail-type-badge.ebook { background: var(--accent-dim); color: var(--accent); }
.detail-type-badge.course { background: var(--purple-dim); color: var(--purple); }
.detail-title { font-size: 24px; line-height: 1.25; }
.detail-price { font-size: 22px; font-weight: 700; }
.detail-price .usdt { font-size: 13px; color: var(--text-dim); font-weight: 400; margin-left: 4px; }
.variant-group { display: flex; flex-direction: column; gap: 8px; }
.variant-label { font-size: 10px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); }
.variant-options { display: flex; gap: 8px; flex-wrap: wrap; }
.variant-btn { padding: 7px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-mid); font-size: 13px; font-weight: 500; transition: all 0.2s; }
.variant-btn:hover { border-color: var(--accent); color: var(--text); }
.variant-btn.selected { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.variant-btn.selected.course { border-color: var(--purple); background: var(--purple-dim); color: var(--purple); }
.qty-group { display: flex; flex-direction: column; gap: 8px; }
.qty-controls { display: flex; align-items: center; }
.qty-btn { width: 36px; height: 36px; background: var(--surface2); border: 1px solid var(--border); color: var(--text); font-size: 16px; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.qty-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.qty-btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.qty-btn:hover { background: var(--border); }
.qty-input { width: 48px; height: 36px; background: var(--surface); border: 1px solid var(--border); border-left: none; border-right: none; color: var(--text); text-align: center; font-size: 14px; font-weight: 600; }
.add-to-cart-btn { padding: 14px; border: none; border-radius: var(--radius); font-size: 14px; font-weight: 600; transition: background 0.18s, transform 0.1s; width: 100%; }
.add-to-cart-btn:active { transform: scale(0.99); }
.add-to-cart-btn.ebook { background: var(--accent); color: #fff; }
.add-to-cart-btn.ebook:hover { background: var(--accent-hover); }
.add-to-cart-btn.course { background: var(--purple); color: #fff; }
.add-to-cart-btn.course:hover { background: var(--purple-hover); }
.detail-description { font-size: 14px; color: var(--text-mid); line-height: 1.9; white-space: pre-wrap; }
.detail-section { border-top: 1px solid var(--border); padding-top: 20px; }
.detail-section h4 { font-family: 'DM Sans', sans-serif; font-size: 10px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 14px; }
.detail-section ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.detail-section ul li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--text-mid); line-height: 1.5; }
.detail-section ul li::before { content: '✓'; color: var(--success); font-size: 11px; font-weight: 700; flex-shrink: 0; width: 16px; margin-top: 2px; }
.detail-section p { font-size: 12px; color: var(--text-dim); margin-top: 10px; line-height: 1.6; }

/* ── FORMS ────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-label { font-size: 10px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); }
.form-input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  color: var(--text); font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); background: var(--surface); }
.form-input.error { border-color: var(--error); }
.form-input::placeholder { color: var(--text-dim); }
.form-hint { font-size: 12px; color: var(--text-dim); }
.form-hint.warning { color: var(--warning); }
.form-error { font-size: 12px; color: var(--error); display: none; }
.form-error.show { display: block; }
textarea.form-input { min-height: 100px; resize: vertical; }
select.form-input { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

/* Radio buttons */
.radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-card { flex: 1; min-width: 130px; display: flex; align-items: center; gap: 10px; padding: 13px 15px; background: var(--surface2); border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: border-color 0.2s; }
.radio-card input[type="radio"] { display: none; }
.radio-card.selected { border-color: var(--accent); background: var(--accent-dim); }
.radio-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: border-color 0.2s; }
.radio-card.selected .radio-dot { border-color: var(--accent); }
.radio-dot::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: 0; transition: opacity 0.2s; }
.radio-card.selected .radio-dot::after { opacity: 1; }
.radio-label { display: flex; flex-direction: column; }
.radio-label strong { font-size: 13px; }
.radio-label span { font-size: 11px; color: var(--text-dim); }

/* ── ALERTS ───────────────────────────────────── */
.alert { border-radius: var(--radius); padding: 16px 18px; font-size: 13px; line-height: 1.6; margin-bottom: 16px; }
.alert-icon { font-size: 20px; display: block; margin-bottom: 5px; }
.alert-title { font-size: 14px; font-weight: 600; display: block; margin-bottom: 3px; }
.alert-success { background: rgba(76,175,125,0.1); border: 1px solid rgba(76,175,125,0.3); color: var(--success); }
.alert-error { background: rgba(217,95,95,0.1); border: 1px solid rgba(217,95,95,0.3); color: var(--error); }
.alert-warning { background: rgba(224,154,48,0.1); border: 1px solid rgba(224,154,48,0.3); color: var(--warning); }
.alert-info { background: var(--accent-dim); border: 1px solid var(--border); color: var(--accent); }

/* ── TOAST ────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px; color: var(--text);
  box-shadow: var(--shadow-lg);
  max-width: 300px;
  pointer-events: all;
  animation: toastIn 0.25s ease;
}
.toast.toast-success { border-color: rgba(76,175,125,0.45); }
.toast.toast-error { border-color: rgba(217,95,95,0.45); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(4px); } }

/* ── SPINNER ──────────────────────────────────── */
.loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 20px; gap: 14px; color: var(--text-dim); }
.spinner { width: 36px; height: 36px; border: 2.5px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.3s ease; }

/* ── CHECKOUT ─────────────────────────────────── */
.checkout-layout { display: grid; grid-template-columns: 1fr; gap: 28px; padding: 36px 0; }
@media (min-width: 768px) { .checkout-layout { grid-template-columns: 1fr 360px; } }
.checkout-form { display: flex; flex-direction: column; gap: 40px; }
.order-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; height: fit-content; position: sticky; top: calc(var(--header-h) + 16px); }
.summary-title { font-size: 14px; font-weight: 600; letter-spacing: 0.5px; margin-bottom: 14px; }
.summary-item { display: flex; justify-content: space-between; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; gap: 10px; }
.summary-item:last-of-type { border-bottom: none; }
.summary-item-name { color: var(--text-mid); flex: 1; }
.summary-item-variant { color: var(--text-dim); font-size: 11px; }
.summary-item-price { font-weight: 600; flex-shrink: 0; }
.summary-total { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px solid var(--border); font-size: 16px; font-weight: 700; }
.summary-total-amount { color: var(--accent); }

/* ── PAYMENT ──────────────────────────────────── */
.payment-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; max-width: 500px; margin: 36px auto; text-align: center; }
.payment-qr { width: 180px; height: 180px; background: #fff; border-radius: 10px; padding: 10px; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; }
.payment-qr svg { width: 100%; height: 100%; }
.payment-address-box { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; text-align: left; }
.payment-address { flex: 1; font-family: monospace; font-size: 12px; color: var(--text-mid); word-break: break-all; }
.copy-btn { padding: 5px 12px; border-radius: 5px; background: var(--accent-dim); border: 1px solid var(--border); color: var(--accent); font-size: 11px; font-weight: 600; flex-shrink: 0; transition: background 0.2s; }
.copy-btn:hover { background: var(--accent); color: #fff; }
.payment-amount-big { font-family: 'Lora', serif; font-size: 30px; font-weight: 700; margin: 6px 0 3px; }
.payment-currency-label { font-size: 13px; color: var(--text-dim); margin-bottom: 18px; }
.payment-status-indicator { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--text-dim); padding: 11px; background: var(--surface2); border-radius: var(--radius-sm); margin-top: 18px; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); animation: pulse 1.5s ease infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }

/* ── SUCCESS PAGE ─────────────────────────────── */
.success-box { max-width: 500px; margin: 56px auto; text-align: center; padding: 0 16px; }
.success-icon { font-size: 56px; margin-bottom: 18px; display: block; }
.order-id-display { display: inline-block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 22px; font-family: 'Lora', serif; font-size: 20px; font-weight: 700; letter-spacing: 3px; color: var(--accent); margin: 18px 0; }
.success-steps { text-align: left; margin: 20px 0; }
.step { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; }
.step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-dim); border: 1px solid var(--border); color: var(--accent); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step-text { font-size: 13px; color: var(--text-mid); line-height: 1.5; }
.step-text strong { color: var(--text); }

/* ── CLAIM PAGE ───────────────────────────────── */
.claim-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px 32px; max-width: 460px; margin: 56px auto; box-shadow: var(--shadow-lg); }
.claim-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 24px; }
.claim-logo img { width: 64px; height: 64px; border-radius: 12px; margin-bottom: 8px; }
.claim-logo span { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--text-dim); }

/* ── INFO STRIP (features) ────────────────────── */
.info-strip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.info-strip-item {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center; padding: 28px 20px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s, transform 0.2s;
}
.info-strip-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.info-strip-icon { font-size: 30px; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; background: var(--surface2); border-radius: 12px; }
.info-strip-item h4 { font-size: 14px; font-weight: 600; margin: 0; }
.info-strip-item p { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin: 0; }

/* ── FOOTER ───────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); padding: 28px 20px; margin-top: 56px; }
.footer-inner { max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.footer-brand { display: flex; align-items: center; gap: 9px; font-family: 'Lora',serif; font-size: 15px; font-weight: 700; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.footer-links a { font-size: 13px; color: var(--text-dim); transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: 12px; color: var(--text-dim); }

/* ── DIVIDER ──────────────────────────────────── */
.divider { width: 36px; height: 2px; background: var(--accent); border-radius: 2px; margin: 0 auto 22px; }

/* ── ADMIN PAGES ──────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; background: var(--bg); }
.admin-sidebar { width: 210px; background: var(--surface); border-right: 1px solid var(--border); flex-shrink: 0; display: flex; flex-direction: column; position: fixed; height: 100vh; overflow-y: auto; z-index: 1; }
.admin-sidebar-header { padding: 18px 18px 14px; border-bottom: 1px solid var(--border); }
.admin-sidebar-header .brand { font-family: 'Lora', serif; font-size: 15px; font-weight: 700; }
.admin-sidebar-header .sub { font-size: 10px; color: var(--text-dim); letter-spacing: 1.5px; text-transform: uppercase; margin-top: 2px; }
.admin-nav { padding: 10px 0; flex: 1; }
.admin-nav-link { display: flex; align-items: center; gap: 9px; padding: 10px 18px; font-size: 13px; color: var(--text-dim); transition: all 0.15s; border-left: 2px solid transparent; }
.admin-nav-link:hover { background: var(--surface2); color: var(--text); }
.admin-nav-link.active { color: var(--accent); background: var(--accent-dim); border-left-color: var(--accent); }
.admin-nav-link .icon { width: 16px; text-align: center; font-size: 14px; }
.admin-sidebar-footer { padding: 14px 18px; border-top: 1px solid var(--border); }
.admin-main { margin-left: 210px; flex: 1; padding: 28px 32px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.admin-header h1 { font-size: 22px; }
.admin-header .subtitle { color: var(--text-dim); font-size: 13px; margin-top: 2px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat-label { font-size: 10px; color: var(--text-dim); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 7px; }
.stat-value { font-family: 'Lora', serif; font-size: 26px; font-weight: 700; }
.stat-sub { font-size: 11px; color: var(--text-dim); margin-top: 3px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 9px 13px; border-bottom: 1px solid var(--border); color: var(--text-dim); font-size: 10px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 11px 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: var(--surface2); }
.data-table tr:last-child td { border-bottom: none; }
.table-wrapper { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }

.status-badge { display: inline-block; padding: 3px 9px; border-radius: 100px; font-size: 10px; font-weight: 600; letter-spacing: 0.5px; }
.status-badge.ready, .status-badge.paid { background: rgba(76,175,125,0.12); color: var(--success); }
.status-badge.shipped { background: var(--accent-dim); color: var(--accent); }
.status-badge.failed, .status-badge.cancelled { background: rgba(217,95,95,0.12); color: var(--error); }
.status-badge.published { background: rgba(76,175,125,0.12); color: var(--success); }
.status-badge.draft, .status-badge.pending { background: rgba(136,136,136,0.12); color: var(--text-dim); }

.admin-login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.admin-login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 44px 36px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }

/* ── REVIEWS ──────────────────────────────────── */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 14px var(--warm-glow);
}
.review-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 8px 32px var(--warm-glow-hover); }
.review-stars { color: #f59e0b; font-size: 14px; letter-spacing: 1px; }
.review-text { font-size: 14px; line-height: 1.65; color: var(--text); flex: 1; }
.review-product { font-size: 12px; color: var(--accent); font-weight: 500; }
.review-footer { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.review-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
}
.review-name { font-size: 13px; font-weight: 600; }
.review-date { font-size: 11px; color: var(--text-dim); margin-left: auto; }

/* ── MOBILE ───────────────────────────────────── */
@media (max-width: 600px) {
  .search-bar { display: none; }
  .claim-card { padding: 24px 18px; }
  .admin-sidebar { display: none; }
  .admin-main { margin-left: 0; padding: 18px 16px; }
  .hero { padding: 48px 16px; }
  .section { padding: 40px 0; }
  .header-brand em { display: none; }
}
@media (max-width: 768px) {
  .product-detail { grid-template-columns: 1fr; }
  .detail-thumb { max-height: 280px; }
  .payment-box { padding: 22px 16px; }
  .checkout-layout { grid-template-columns: 1fr; }
}
