/* ============================================================
   Kitabzo — Complete Design System
   ============================================================ */

/* ─── Google Fonts ──────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Amiri:ital,wght@0,400;0,700;1,400&display=swap');

/* ─── CSS Custom Properties (Light Mode) ────────────────── */
:root {
  /* Primary Palette */
  --bg-primary: #FAFAF7;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F4F1EC;
  --bg-glass: rgba(255, 255, 255, 0.65);
  --bg-glass-strong: rgba(255, 255, 255, 0.85);
  --bg-hero-overlay: linear-gradient(135deg, rgba(15, 26, 18, 0.88) 0%, rgba(27, 107, 58, 0.75) 100%);

  /* Accent Colors */
  --accent-emerald: #1B6B3A;
  --accent-emerald-light: #2ECC71;
  --accent-emerald-rgb: 27, 107, 58;
  --accent-gold: #C9973A;
  --accent-gold-light: #F0C75E;
  --accent-gold-rgb: 201, 151, 58;

  /* Text */
  --text-primary: #1A1A1A;
  --text-secondary: #555555;
  --text-muted: #888888;
  --text-inverse: #FFFFFF;

  /* Borders & Shadows */
  --border-glass: rgba(255, 255, 255, 0.4);
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-accent: rgba(27, 107, 58, 0.2);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(201, 151, 58, 0.15);
  --shadow-card-hover: 0 12px 40px rgba(27, 107, 58, 0.15), 0 0 20px rgba(201, 151, 58, 0.1);

  /* Layout */
  --page-width: 1200px;
  --nav-height: 72px;
  --section-padding: 100px;
  --card-radius: 16px;
  --btn-radius: 12px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* Font Families */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-arabic: 'Amiri', serif;

  /* WhatsApp color */
  --whatsapp-green: #25D366;
}

/* ─── Dark Mode ─────────────────────────────────────────── */
[data-theme="dark"] {
  --bg-primary: #0C1410;
  --bg-secondary: #131F18;
  --bg-tertiary: #1A2B22;
  --bg-glass: rgba(19, 31, 24, 0.75);
  --bg-glass-strong: rgba(19, 31, 24, 0.9);
  --bg-hero-overlay: linear-gradient(135deg, rgba(8, 14, 10, 0.92) 0%, rgba(15, 60, 30, 0.8) 100%);

  --text-primary: #E8E6E1;
  --text-secondary: #A0A0A0;
  --text-muted: #666666;
  --text-inverse: #0C1410;

  --border-glass: rgba(46, 204, 113, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(46, 204, 113, 0.15);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(201, 151, 58, 0.12);
  --shadow-card-hover: 0 12px 40px rgba(46, 204, 113, 0.12), 0 0 25px rgba(201, 151, 58, 0.08);

  --accent-emerald: #2ECC71;
  --accent-emerald-light: #58D68D;
  --accent-gold: #F0C75E;
  --accent-gold-light: #F5D98A;
}

/* ─── Global Base ────────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*:focus-visible {
  outline: 2px solid var(--accent-emerald);
  outline-offset: 2px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background-color var(--transition-base), color var(--transition-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  font-weight: 700;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p {
  color: var(--text-secondary);
  line-height: 1.8;
}

.arabic-accent {
  font-family: var(--font-arabic);
  font-style: italic;
}

/* ─── Layout Utilities ──────────────────────────────────── */
.container {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: var(--section-padding) 0;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  margin-bottom: 16px;
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-emerald), var(--accent-gold));
  margin: 16px auto 0;
  border-radius: 2px;
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.section-subtitle {
  font-family: var(--font-arabic);
  color: var(--accent-gold);
  font-size: 1.1rem;
  margin-bottom: 8px;
  display: block;
}

/* ─── Glassmorphism Components ──────────────────────────── */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.glass-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}

.glass-card-static {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-md);
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: var(--btn-radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  letter-spacing: -0.3px;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-emerald), #15803D);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(var(--accent-emerald-rgb), 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 25px rgba(var(--accent-emerald-rgb), 0.4);
  transform: translateY(-2px);
}

.btn-gold {
  background: linear-gradient(135deg, var(--accent-gold), #D4A847);
  color: #1A1A1A;
  box-shadow: 0 4px 15px rgba(var(--accent-gold-rgb), 0.3);
}

.btn-gold:hover {
  box-shadow: 0 6px 25px rgba(var(--accent-gold-rgb), 0.4);
  transform: translateY(-2px);
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
  background: #1EBE5D;
  border-color: #1EBE5D;
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

/* Fix contrast in dark mode */
[data-theme="dark"] .btn-whatsapp {
  color: #FFFFFF !important;
}

.btn-outline {
  background: transparent;
  color: var(--accent-emerald);
  border: 2px solid var(--accent-emerald);
}

.btn-outline:hover {
  background: var(--accent-emerald);
  color: #FFFFFF;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 18px 42px;
  font-size: 1.05rem;
}

/* ─── Navigation ────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1020;
  transition: all var(--transition-base);
}

.navbar.scrolled {
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  box-shadow: var(--shadow-md);
}

body.menu-open .navbar.scrolled {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--bg-secondary);
  transition: none;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1001;
}

.nav-brand img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
}

.nav-brand-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.nav-brand-tagline {
  font-family: var(--font-arabic);
  font-size: 0.75rem;
  color: var(--accent-gold);
  line-height: 1;
}

.navbar.transparent:not(.scrolled) .nav-brand-name {
  color: #FFFFFF;
}

.navbar.transparent:not(.scrolled) .nav-brand-tagline {
  color: var(--accent-gold-light);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: all var(--transition-fast);
  position: relative;
}

.navbar.transparent:not(.scrolled) .nav-link {
  color: rgba(255, 255, 255, 0.85);
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-emerald);
  background: rgba(var(--accent-emerald-rgb), 0.08);
}

.navbar.transparent:not(.scrolled) .nav-link:hover,
.navbar.transparent:not(.scrolled) .nav-link.active {
  color: var(--accent-gold-light);
  background: rgba(255, 255, 255, 0.1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1001;
}

/* Theme Toggle */
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1.2rem;
}

.navbar.transparent:not(.scrolled) .theme-toggle {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

.theme-toggle:hover {
  background: rgba(var(--accent-gold-rgb), 0.15);
  border-color: var(--accent-gold);
  transform: rotate(15deg);
}

/* Mobile Menu Toggle */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
  z-index: 1001;
  background: none;
  border: none;
}

.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.navbar.transparent:not(.scrolled) .mobile-toggle span {
  background: #FFFFFF;
}

.mobile-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ─── Hero Section ──────────────────────────────────────── */
.hero {
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: url('../assets/images/hero-bg.png') center/cover no-repeat;
  padding-top: 120px;
  padding-bottom: 80px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg-hero-overlay);
  z-index: 1;
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero-content {
  max-width: 700px;
  padding: 40px 0;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--accent-gold-light);
  margin-bottom: 24px;
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-gold);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero h1 {
  color: #FFFFFF;
  margin-bottom: 12px;
  font-weight: 800;
  letter-spacing: -1px;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold), #E8B849);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-family: var(--font-arabic);
  font-size: 1.3rem;
  color: var(--accent-gold-light);
  margin-bottom: 16px;
  opacity: 0.9;
}

.hero-description {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 36px;
  max-width: 540px;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 48px;
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-stat h3 {
  color: var(--accent-gold-light);
  font-size: 2rem;
  font-weight: 800;
}

.hero-stat p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Animated particles behind hero */
.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.hero-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(201, 151, 58, 0.3);
  animation: float-particle 15s linear infinite;
}

@keyframes float-particle {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-10vh) rotate(720deg); opacity: 0; }
}

/* ─── Featured Books Carousel ───────────────────────────── */
.carousel-section {
  background: var(--bg-secondary);
}

.carousel-wrapper {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 -12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.carousel-wrapper::-webkit-scrollbar {
  display: none;
}

.carousel-track {
  display: flex;
  gap: 24px;
  padding: 12px;
  width: max-content;
}

.carousel-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.carousel-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass-strong);
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.carousel-btn:hover {
  background: var(--accent-emerald);
  color: #FFFFFF;
  border-color: var(--accent-emerald);
  transform: scale(1.1);
}

.carousel-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.carousel-dot.active {
  background: var(--accent-emerald);
  width: 28px;
  border-radius: 5px;
}

/* ─── Book Cards ────────────────────────────────────────── */
.product-card {
  width: 280px;
  background: var(--bg-secondary);
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: relative;
  scroll-snap-align: start;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(var(--accent-gold-rgb), 0.3);
}

.product-card-image {
  aspect-ratio: 1 / 1;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  position: relative;
}

.product-card-image img.product-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-image .product-cover-art {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.product-cover-art::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 70%, rgba(255,255,255,0.08) 0%, transparent 50%);
}

.product-cover-art .product-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.9;
}

.product-cover-art .product-cover-title {
  color: #FFFFFF;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  max-width: 180px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.product-cover-art .product-cover-author {
  color: rgba(255,255,255,0.7);
  font-size: 0.78rem;
  margin-top: 8px;
  font-family: var(--font-arabic);
}

.product-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 12px;
  background: var(--accent-gold);
  color: #1A1A1A;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card-category {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-emerald);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.product-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.product-card-description {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
  flex: 1;
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.product-card-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-emerald);
}

.product-card-price .currency {
  font-size: 0.85rem;
  font-weight: 600;
}

/* ─── Categories Grid ───────────────────────────────────── */
.categories-section {
  background: var(--bg-primary);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.category-card {
  padding: 40px 30px;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-emerald), var(--accent-gold));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.category-card:hover::before {
  opacity: 1;
}

.category-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: inline-block;
  transition: transform var(--transition-base);
}

.category-card:hover .category-icon {
  transform: scale(1.15) rotate(-5deg);
}

.category-card h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.category-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ─── Catalog Page ──────────────────────────────────────── */
.catalog-hero {
  padding: calc(var(--nav-height) + 60px) 0 40px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.catalog-hero h1 {
  margin-bottom: 8px;
}

.catalog-hero p {
  font-size: 1.05rem;
}

/* Search & Filters */
.filters-bar {
  padding: 24px 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.filters-wrapper {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 260px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--btn-radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 3px rgba(var(--accent-emerald-rgb), 0.1);
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
}

/* Autocomplete Panel */
.dag-autocomplete-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0; /* Ensures it doesn't overflow search box */
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
}

.dag-autocomplete-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dag-autocomplete-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.dag-autocomplete-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background var(--transition-fast);
}

.dag-autocomplete-item a:hover {
  background: var(--bg-secondary);
}

.dag-ac-thumb {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.dag-ac-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dag-ac-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.dag-ac-title {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dag-ac-brand {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dag-ac-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-emerald);
}

.filter-select {
  padding: 12px 36px 12px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--btn-radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  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 12px center;
  transition: all var(--transition-fast);
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent-emerald);
}

/* Book Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  padding: 40px 0;
  justify-items: center;
}

@media (max-width: 600px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

.products-grid .product-card {
  width: 100%;
  max-width: 100%;
  min-width: unset;
}

/* Results info */
.results-info {
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.results-count {
  font-weight: 600;
  color: var(--text-secondary);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 40px 0;
}

.page-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.page-btn:hover {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.page-btn.active {
  background: var(--accent-emerald);
  color: #FFFFFF;
  border-color: var(--accent-emerald);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* WordPress paginate_links() output (ul.page-numbers) */
.pagination ul.page-numbers {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.pagination ul.page-numbers li {
  margin: 0;
}

.pagination a.page-numbers,
.pagination span.page-numbers {
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.pagination a.page-numbers:hover {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.pagination span.page-numbers.current {
  background: linear-gradient(135deg, var(--accent-emerald), var(--accent-emerald-light));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(var(--accent-emerald-rgb), 0.35);
}

.pagination .page-numbers.dots {
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
  min-width: auto;
  padding: 0 4px;
}

.pagination .prev.page-numbers,
.pagination .next.page-numbers {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--accent-emerald);
}

.pagination .prev.page-numbers:hover,
.pagination .next.page-numbers:hover {
  background: var(--accent-emerald);
  color: #fff;
  border-color: var(--accent-emerald);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 480px) {
  .pagination a.page-numbers,
  .pagination span.page-numbers {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    font-size: 0.85rem;
  }
}

/* No results */
.no-results {
  text-align: center;
  padding: 80px 20px;
}

.no-results .no-results-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.4;
}

.no-results h3 {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.no-results p {
  color: var(--text-muted);
}

/* ─── About Page ────────────────────────────────────────── */
.about-hero {
  padding: calc(var(--nav-height) + 80px) 0 80px;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  text-align: center;
}

.about-hero h1 {
  margin-bottom: 16px;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.about-text h2 {
  margin-bottom: 16px;
}

.about-text p {
  margin-bottom: 16px;
  font-size: 1.02rem;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.value-card {
  padding: 32px 24px;
  text-align: center;
}

.value-card .value-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.value-card h4 {
  margin-bottom: 8px;
  color: var(--text-primary);
}

.value-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Mission / Vision */
.mission-vision {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}

.mv-card {
  padding: 40px 32px;
}

.mv-card h3 {
  color: var(--accent-emerald);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mv-card p {
  font-size: 0.95rem;
  line-height: 1.8;
}

/* Why Choose Us */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.feature-card {
  padding: 36px 24px;
  text-align: center;
}

.feature-card .feature-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(var(--accent-emerald-rgb), 0.1), rgba(var(--accent-gold-rgb), 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.5rem;
  transition: transform var(--transition-base);
}

.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(-5deg);
}

.feature-card h4 {
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ─── Contact Page ──────────────────────────────────────── */
.contact-hero {
  padding: calc(var(--nav-height) + 80px) 0 80px;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  text-align: center;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.contact-info-cards {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-card {
  padding: 28px 24px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.contact-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(var(--accent-emerald-rgb), 0.1), rgba(var(--accent-gold-rgb), 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.contact-card h4 {
  margin-bottom: 4px;
  color: var(--text-primary);
}

.contact-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.contact-card a {
  color: var(--accent-emerald);
  font-weight: 500;
}

.contact-card a:hover {
  color: var(--accent-gold);
}

/* Contact Form */
.contact-form {
  padding: 40px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--btn-radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 3px rgba(var(--accent-emerald-rgb), 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.social-links {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.social-link {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.social-link:hover {
  background: var(--accent-emerald);
  color: #FFFFFF;
  border-color: var(--accent-emerald);
  transform: translateY(-3px);
}

/* ─── FAQ Page ──────────────────────────────────────────── */
.faq-hero {
  padding: calc(var(--nav-height) + 80px) 0 80px;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  text-align: center;
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  margin-bottom: 12px;
  border-radius: var(--card-radius);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass-strong);
  transition: all var(--transition-fast);
}

.faq-item:hover {
  border-color: rgba(var(--accent-emerald-rgb), 0.2);
}

.faq-question {
  width: 100%;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  transition: color var(--transition-fast);
}

.faq-question:hover {
  color: var(--accent-emerald);
}

.faq-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(var(--accent-emerald-rgb), 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--accent-emerald);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base), padding var(--transition-base);
}

.faq-answer-inner {
  padding: 0 24px 20px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

/* ─── Footer ────────────────────────────────────────────── */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 80px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 60px;
}

.footer-brand p {
  margin: 16px 0;
  font-size: 0.9rem;
  max-width: 300px;
}

.footer-section h4 {
  margin-bottom: 20px;
  color: var(--text-primary);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section ul li a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-section ul li a:hover {
  color: var(--accent-emerald);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ─── Scroll Reveal Animations ──────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ─── Page transition ───────────────────────────────────── */
.page-enter {
  animation: pageEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ─── WhatsApp Floating Button ──────────────────────────── */
.whatsapp-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25D366;
  color: #FFFFFF;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  z-index: 999;
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.5);
}

.whatsapp-float::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.3);
  animation: whatsapp-ring 2s ease-in-out infinite;
}

@keyframes whatsapp-ring {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ─── Back to Top ───────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 100px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all var(--transition-base);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent-emerald);
  color: #FFFFFF;
  border-color: var(--accent-emerald);
}

/* ─── Loading Skeleton ──────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Inner Page Shared Header ──────────────────────────── */
.page-header {
  padding: calc(var(--nav-height) + 60px) 0 50px;
  background: url('../assets/images/hero-bg.png') center/cover no-repeat;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
  text-align: center;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg-hero-overlay);
  z-index: 1;
}

.page-header .container {
  position: relative;
  z-index: 2;
}

.page-header .breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.page-header .breadcrumb a {
  color: var(--accent-gold-light);
}

.page-header .breadcrumb a:hover {
  text-decoration: underline;
  color: #FFFFFF;
}

.page-header .section-subtitle {
  color: var(--accent-gold-light);
  opacity: 0.9;
}

.page-header h1 {
  margin-bottom: 12px;
  color: #FFFFFF;
}

.page-header p {
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.8);
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .hero-stats {
    gap: 32px;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 60px;
  }

  body {
    padding-bottom: 80px;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: 70vw;
    max-width: 320px;
    background: var(--bg-secondary);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transform: translateX(100%);
    opacity: 1;
    pointer-events: none;
    transition: transform var(--transition-base);
    z-index: 1010;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.25);
  }

  .nav-links.open {
    transform: translateX(0);
    pointer-events: auto;
  }

  .nav-links .nav-link {
    display: block;
    font-size: 1.2rem;
    padding: 14px 28px;
    color: var(--text-primary) !important;
    background: transparent !important;
    width: 100%;
    text-align: center;
    pointer-events: auto !important;
    position: relative;
    z-index: 1011;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  }

  .mobile-toggle {
    display: flex;
  }

  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1005;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
  }

  .mobile-nav-backdrop.active {
    opacity: 1;
    pointer-events: all;
  }

  .nav-brand-tagline {
    font-size: 0.65rem;
    line-height: 1.3;
    margin-top: 2px;
  }

  .nav-brand-name {
    font-size: 1rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: 20px;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .mission-vision {
    grid-template-columns: 1fr;
  }

  .values-grid {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .filters-bar {
    position: static;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .filters-wrapper {
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .filter-select {
    width: 100%;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .product-card-image {
    height: auto;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .categories-grid {
    grid-template-columns: 1fr;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .category-card {
    padding: 24px 20px;
  }

  .hero-stat h3 {
    font-size: 1.5rem;
  }

  .section-header {
    margin-bottom: 40px;
  }

  .contact-form {
    padding: 24px;
  }

  .whatsapp-float {
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    font-size: 1.4rem;
  }

  .back-to-top {
    bottom: 84px;
    right: 24px;
    width: 38px;
    height: 38px;
  }
}

/* ─── Book Detail Modal ─────────────────────────────────── */
.product-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow-y: auto;
}

.product-detail-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.product-detail-card {
  width: 100%;
  max-width: 720px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: bookDetailSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  margin: auto;
}

@keyframes bookDetailSlideIn {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.product-detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all var(--transition-fast);
}

.product-detail-close:hover {
  background: #E74C3C;
  color: #fff;
  border-color: #E74C3C;
  transform: rotate(90deg);
}

.product-detail-cover {
  width: 100%;
  height: auto;
  background: transparent;
  position: relative;
  padding: 0;
}

.product-detail-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.product-detail-cover .product-cover-art {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}

.product-detail-cover .product-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.product-detail-cover .product-cover-title {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  max-width: 280px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.product-detail-cover .product-cover-author {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  margin-top: 8px;
  font-family: var(--font-arabic);
}

.product-detail-body {
  padding: 32px;
}

.product-detail-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.product-detail-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-detail-badge-category {
  background: rgba(var(--accent-emerald-rgb), 0.12);
  color: var(--accent-emerald);
}

.product-detail-badge-featured {
  background: rgba(var(--accent-gold-rgb), 0.15);
  color: var(--accent-gold);
}

.product-detail-badge-stock {
  background: rgba(46, 204, 113, 0.12);
  color: #2ECC71;
}

.product-detail-badge-out {
  background: rgba(231, 76, 60, 0.12);
  color: #E74C3C;
}

.product-detail-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.product-detail-author {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.product-detail-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.product-detail-meta-item {
  display: flex;
  flex-direction: column;
}

.product-detail-meta-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.product-detail-meta-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.product-detail-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 28px;
}

.product-detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.product-detail-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-emerald);
}

.product-detail-price .currency {
  font-size: 1.1rem;
  font-weight: 600;
}

@media (max-width: 480px) {
  .product-detail-card {
    border-radius: 16px;
  }

  .product-detail-cover {
    width: 100%;
    height: auto;
    margin: 0;
    aspect-ratio: auto;
    background: transparent;
    padding: 0;
  }
  
  .product-detail-cover img {
    max-height: none;
  }
  
  .product-card-footer {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .product-detail-body {
    padding: 24px 20px;
  }

  .product-detail-title {
    font-size: 1.25rem;
  }

  .product-detail-price {
    font-size: 1.6rem;
  }

  .product-detail-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ─── Rich Text / WYSIWYG (the_content) ─────────────────── */
/*
 * Editor-authored content (pages, product descriptions, FAQ answers)
 * outputs raw HTML — h2/p/ul/ol/blockquote/img/table. The global reset
 * strips list bullets and paragraph spacing, so scope proper typography
 * back in wherever the_content() is rendered.
 */
.entry-content,
.product-detail-description,
.faq-answer-inner {
  color: var(--text-secondary);
  line-height: 1.85;
  font-size: 1rem;
}

.entry-content > *:first-child,
.product-detail-description > *:first-child,
.faq-answer-inner > *:first-child {
  margin-top: 0;
}

.entry-content > *:last-child,
.product-detail-description > *:last-child,
.faq-answer-inner > *:last-child {
  margin-bottom: 0;
}

.entry-content p,
.product-detail-description p,
.faq-answer-inner p {
  margin-bottom: 1.15em;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6,
.product-detail-description h2,
.product-detail-description h3,
.product-detail-description h4 {
  color: var(--text-primary);
  margin: 1.8em 0 0.6em;
}

.entry-content h2 { font-size: 1.6rem; }
.entry-content h3 { font-size: 1.3rem; }
.entry-content h4 { font-size: 1.1rem; }

/* Restore list markers that the global `ul,ol { list-style:none }` removes. */
.entry-content ul,
.entry-content ol,
.product-detail-description ul,
.product-detail-description ol,
.faq-answer-inner ul,
.faq-answer-inner ol {
  margin: 0 0 1.15em;
  padding-inline-start: 1.5em;
}

.entry-content ul,
.product-detail-description ul,
.faq-answer-inner ul { list-style: disc; }

.entry-content ol,
.product-detail-description ol,
.faq-answer-inner ol { list-style: decimal; }

.entry-content li,
.product-detail-description li,
.faq-answer-inner li {
  margin-bottom: 0.4em;
}

.entry-content li::marker,
.product-detail-description li::marker,
.faq-answer-inner li::marker {
  color: var(--accent-emerald);
}

.entry-content a,
.product-detail-description a,
.faq-answer-inner a {
  color: var(--accent-emerald);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.entry-content a:hover,
.product-detail-description a:hover,
.faq-answer-inner a:hover {
  color: var(--accent-gold);
}

.entry-content strong,
.product-detail-description strong { color: var(--text-primary); font-weight: 700; }

.entry-content blockquote,
.product-detail-description blockquote {
  margin: 1.5em 0;
  padding: 16px 24px;
  border-inline-start: 4px solid var(--accent-emerald);
  background: var(--bg-tertiary);
  border-radius: var(--btn-radius);
  color: var(--text-primary);
  font-style: italic;
}

.entry-content img,
.product-detail-description img {
  border-radius: var(--card-radius);
  margin: 1.2em 0;
}

.entry-content figure,
.product-detail-description figure { margin: 1.5em 0; }

.entry-content figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.entry-content table,
.product-detail-description table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95rem;
}

.entry-content th,
.entry-content td,
.product-detail-description th,
.product-detail-description td {
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  text-align: start;
}

.entry-content th,
.product-detail-description th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 700;
}

.entry-content code,
.product-detail-description code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.9em;
}

.entry-content pre,
.product-detail-description pre {
  background: var(--bg-tertiary);
  padding: 16px 20px;
  border-radius: var(--btn-radius);
  overflow-x: auto;
  margin: 1.5em 0;
}

.entry-content pre code {
  background: none;
  padding: 0;
}

.entry-content hr {
  border: 0;
  height: 1px;
  background: var(--border-subtle);
  margin: 2em 0;
}

/* ─── Print Styles ──────────────────────────────────────── */
@media print {
  .navbar, .whatsapp-float, .back-to-top, .theme-toggle, .mobile-toggle {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
}
