/* ============================================================
   Dar Al Ghuraba Books — 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;
}

/* ─── Base Reset & Typography ───────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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; /* Increased to be above mobile-nav-backdrop (1005) */
  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);
}

/* Fix CSS Stacking Context bug on mobile: 
   backdrop-filter creates a new containing block for position:fixed.
   This breaks the mobile menu overlay z-index. We must disable it when open. */
body.menu-open .navbar.scrolled {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--bg-secondary); /* Fallback to solid background so it still looks good */
  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: 70px;
  height: 70px;
  margin: -14px;
  clip-path: circle(21px at center);
  object-fit: cover;
  object-position: center;
}

.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;
}

/* Hero top state — white brand text */
.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: calc(var(--nav-height) + 16px);
  padding-bottom: 50px;
}

.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: 8px 0 16px;
}

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

.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;
}

/* ─── Hero Animated Glowing Bubbles ────────────────────── */
.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

.hero-bubble {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
  transform: translate3d(0, 0, 0);
}

.hero-bubble-gold {
  background: radial-gradient(circle at 35% 35%, rgba(245, 217, 138, 0.7) 0%, rgba(201, 151, 58, 0.38) 40%, rgba(201, 151, 58, 0.08) 70%, transparent 100%);
  box-shadow: 0 0 25px rgba(201, 151, 58, 0.25);
}

.hero-bubble-emerald {
  background: radial-gradient(circle at 35% 35%, rgba(88, 214, 141, 0.6) 0%, rgba(46, 204, 113, 0.32) 40%, rgba(27, 107, 58, 0.08) 70%, transparent 100%);
  box-shadow: 0 0 25px rgba(46, 204, 113, 0.2);
}

@keyframes bubble-float-1 {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.45;
  }
  50% {
    transform: translate3d(28px, -45px, 0) scale(1.15);
    opacity: 0.85;
  }
  100% {
    transform: translate3d(-20px, -80px, 0) scale(0.92);
    opacity: 0.5;
  }
}

@keyframes bubble-float-2 {
  0% {
    transform: translate3d(0, 0, 0) scale(0.95);
    opacity: 0.4;
  }
  50% {
    transform: translate3d(-35px, -55px, 0) scale(1.2);
    opacity: 0.8;
  }
  100% {
    transform: translate3d(25px, -95px, 0) scale(1.02);
    opacity: 0.45;
  }
}

@keyframes bubble-float-3 {
  0% {
    transform: translate3d(0, 0, 0) scale(1.05);
    opacity: 0.35;
  }
  50% {
    transform: translate3d(30px, -65px, 0) scale(0.88);
    opacity: 0.75;
  }
  100% {
    transform: translate3d(-30px, -115px, 0) scale(1.12);
    opacity: 0.4;
  }
}

/* ─── 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; /* Firefox */
}

.carousel-wrapper::-webkit-scrollbar {
  display: none; /* Safari/Chrome */
}

.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 ────────────────────────────────────────── */
.book-card {
  width: 280px;
  background: var(--bg-secondary);
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: relative;
  scroll-snap-align: start;
  will-change: transform;
  transform: translateZ(0);
}

.book-card:hover {
  transform: translateY(-4px) scale(1.01) translateZ(0);
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
  border-color: rgba(var(--accent-gold-rgb), 0.4);
}

.books-grid .book-card {
  animation: fadeInCard 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInCard {
  from { opacity: 0; transform: translateY(20px) translateZ(0); }
  to { opacity: 1; transform: translateY(0) translateZ(0); }
}

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

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

.book-card-image .book-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;
}

.book-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%);
}

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

.book-cover-art .book-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);
}

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

.badges-container {
  position: absolute;
  left: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  z-index: 2;
  pointer-events: none;
}

.badges-top {
  top: 12px;
}

.badges-bottom {
  bottom: 12px;
  right: auto;
}

.book-card-badge {
  position: relative;
  padding: 4px 10px;
  background: var(--accent-gold);
  color: #1A1A1A;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  pointer-events: auto;
  white-space: nowrap;
}

.badge-featured {
  background: var(--accent-gold);
}

.book-card-badge-demand {
  background: #F39C12 !important; /* Vibrant Orange/Amber */
  color: white !important;
}

.book-card-badge-stock {
  background: #2ECC71;
  color: white;
}

.book-card-badge-out {
  background: #E74C3C;
  color: white;
}

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

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

.book-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;
}

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

.book-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;
}

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

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

.book-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(4, 1fr);
  gap: 20px;
}

.category-card {
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease;
  will-change: transform;
  transform: translateZ(0);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.category-card:hover {
  transform: translateY(-4px) scale(1.02) translateZ(0);
  box-shadow: 0 12px 24px rgba(0,0,0,0.06);
  border-color: rgba(var(--accent-gold-rgb), 0.4);
}

.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 0.25s ease;
}

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

.category-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
  display: inline-block;
  transition: transform 0.25s ease;
}

.category-card:hover .category-icon {
  transform: scale(1.12);
}

.category-card h3 {
  margin-bottom: 6px;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.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;
}

.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 */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  padding: 40px 0;
  justify-items: center;
}

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

.books-grid .book-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;
}

/* 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);
}

/* Error & Server Busy Notices */
.error-notice {
  text-align: center;
  padding: 60px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  max-width: 520px;
  margin: 40px auto;
}

.error-notice .error-notice-icon {
  font-size: 3.2rem;
  margin-bottom: 16px;
  display: inline-block;
  animation: pulseIcon 2s ease-in-out infinite;
}

.error-notice h3 {
  margin-bottom: 10px;
  color: var(--text-primary);
  font-size: 1.4rem;
}

.error-notice p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 440px;
  margin: 0 auto 20px;
}

.carousel-error-notice {
  text-align: center;
  padding: 40px 20px;
  width: 100%;
}

@keyframes pulseIcon {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.1); opacity: 1; }
}

/* ─── 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) translateZ(0);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0) translateZ(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; }
}

/* ─── Cart UI ───────────────────────────────────────────── */
.cart-toggle {
  position: relative;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-badge {
  position: absolute;
  top: 0px;
  right: 0px;
  background: #E74C3C;
  color: #FFF;
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: all var(--transition-fast);
}

.cart-badge.visible {
  opacity: 1;
  transform: scale(1);
}

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.cart-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 400px;
  background: var(--bg-secondary);
  z-index: 1060;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-base);
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-header h2 {
  font-size: 1.25rem;
  margin: 0;
}

.cart-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.cart-close:hover {
  color: var(--accent-emerald);
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
}

.cart-item {
  display: flex;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.cart-item-image {
  width: 70px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item-image-placeholder {
  width: 70px;
  height: 90px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-emerald), var(--accent-gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.cart-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cart-item-title {
  font-size: 0.95rem;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-item-price {
  font-weight: 700;
  color: var(--accent-emerald);
  margin-bottom: 8px;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 4px 12px;
}

.qty-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
}

.qty-display {
  font-size: 0.9rem;
  font-weight: 600;
}

.cart-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.6;
}

.cart-item-remove:hover {
  opacity: 1;
}

.cart-footer {
  padding: 24px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-primary);
}

.cart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
}

/* ─── Inner Page Shared Header ──────────────────────────── */
.page-header {
  padding: calc(var(--nav-height) + 60px) 0 50px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  text-align: center;
}

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

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

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

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

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

/* ─── 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; /* Prevent WhatsApp button from blocking UI */
  }

  /* Mobile nav — 70vw slide-out panel from right */
  .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 */
  .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;
  }

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

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

  /* Hero mobile spacing fix - removes empty gap between navbar and hero */
  .hero {
    padding-top: calc(var(--nav-height) + 12px) !important;
    padding-bottom: 36px !important;
    min-height: auto;
  }

  .hero-content {
    padding: 8px 0 16px 0 !important;
  }

  .hero-badge {
    margin-bottom: 14px;
    padding: 6px 14px;
    font-size: 0.76rem;
  }

  .hero-subtitle {
    font-size: 1.15rem;
    margin-bottom: 10px;
  }

  .hero h1 {
    font-size: 1.95rem;
    margin-bottom: 10px;
  }

  .hero-description {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 22px;
  }

  .hero-stats {
    flex-direction: column;
    gap: 16px;
    margin-top: 28px;
    padding-top: 20px;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 12px;
  }

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

  /* Disable heavy background particles on mobile for smooth 60fps scrolling */
  .login-particles {
    display: none !important;
  }

  /* Grids */
  .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 */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

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

  /* Un-sticky filters on mobile */
  .filters-bar {
    position: static;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

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

  .search-box {
    width: 100%;
  }

  .filter-select {
    width: 100%;
  }

  /* Cards */
  .books-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

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

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

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

  .books-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 ─────────────────────────────────── */
.book-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;
}

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

.book-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); }
}

.book-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);
}

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

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

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

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

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

.book-detail-cover .book-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);
}

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

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

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

.book-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;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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