/* ═══════════════════════════════════════════
   کتابیار - Main Stylesheet
   ═══════════════════════════════════════════ */

/* ─── CSS Variables ─── */
:root {
  --melon: #E8614D;
  --melon-light: #F28C7D;
  --melon-dark: #C94535;
  --melon-bg: #FFF0EE;
  --melon-gradient: linear-gradient(135deg, #E8614D 0%, #F28C7D 100%);
  --bg-primary: #FFFFFF;
  --bg-secondary: #F5F5F5;
  --bg-card: #FFFFFF;
  --text-primary: #1A1A2E;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --border-color: #E5E7EB;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-hover: 0 12px 40px rgba(232,97,77,0.15);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --header-height: 64px;
  --mega-menu-bg: #FFFFFF;
  --glass-bg: rgba(255,255,255,0.85);
  --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ─── Dark Theme ─── */
[data-theme="dark"] {
  --bg-primary: #0F0F1A;
  --bg-secondary: #1A1A2E;
  --bg-card: #1E1E32;
  --text-primary: #F0F0F5;
  --text-secondary: #A0A0B8;
  --text-muted: #6B6B80;
  --border-color: #2A2A40;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
  --shadow-hover: 0 12px 40px rgba(232,97,77,0.25);
  --mega-menu-bg: #1A1A2E;
  --glass-bg: rgba(15,15,26,0.85);
  --melon-bg: #2A1A18;
}

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

body {
  font-family: 'Vazirmatn', sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: background 0.4s, color 0.4s;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--melon-light); border-radius: 10px; }

/* ═══════════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════════ */
.top-bar {
  background: var(--melon);
  color: white;
  font-size: 12px;
  padding: 6px 0;
  text-align: center;
  letter-spacing: 0.2px;
}
.top-bar a { color: #FFE0DB; text-decoration: underline; margin-right: 6px; }

/* لینک اشتراک ویژه در منو — متمایز با تن طلایی */
.nav-link-premium { color: #B8860B !important; font-weight: 700; }
.nav-link-premium i { color: #D4A017; }
.nav-link-premium:hover { color: #8a6508 !important; }

/* ═══════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════ */
.main-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.main-header.scrolled { box-shadow: var(--shadow-md); }

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 16px;
  padding: 0 20px;
  max-width: 1320px;
  margin: 0 auto;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-icon {
  width: 40px; height: 40px;
  background: var(--melon-gradient);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 20px;
  box-shadow: 0 4px 12px rgba(232,97,77,0.3);
}
.logo-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--melon);
  letter-spacing: -0.5px;
  line-height: 1.3;
  white-space: nowrap;
}
/* عنوان + زیرعنوان سایت (ستونی، با فاصله مشخص از لوگو) */
.logo-text-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  margin-inline-start: 2px;
  min-width: 0;
}
.logo-subtitle {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-primary, #1a1a1a);
  line-height: 1.4;
  letter-spacing: 0;
  white-space: nowrap;   /* کامل و یک‌خطی — بدون سه‌نقطه */
}
[data-theme="dark"] .logo-subtitle { color: var(--text-secondary, #cfcfcf); }
/* کلاس‌های bootstrap د‌بل‌نشوند: ستون ماندن wrap تضمین شود */
.d-none.d-sm-flex.logo-text-wrap { flex-direction: column !important; }

/* Mobile sticky logo → replaced by inline search */
.header-mobile-logo {
  display: none;
}

/* Mobile inline search (inside header, hidden on desktop) */
.header-mobile-search {
  display: none;
  flex: 1;
  position: relative;
  min-width: 0;
  margin: 0 4px;
}
.header-mobile-search .mobile-search-input {
  width: 100%;
  height: 42px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 0 14px 0 14px;
  font-family: 'Vazirmatn';
  font-size: 15px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
  caret-color: var(--melon);
}
.header-mobile-search .mobile-search-input:focus {
  border-color: var(--melon);
  box-shadow: 0 0 0 3px rgba(232,97,77,0.1);
  background: var(--bg-primary);
}
/* Styled placeholder overlay */
.header-mobile-search .search-placeholder {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
  overflow: hidden;
}
.header-mobile-search .search-placeholder .ph-red {
  color: var(--melon);
  font-weight: 700;
}
.header-mobile-search .search-placeholder.hidden {
  opacity: 0;
}

/* Search */
.search-box {
  flex: 1;
  max-width: 520px;
  position: relative;
}
.search-box input {
  width: 100%;
  height: 44px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 0 48px 0 20px;
  font-family: 'Vazirmatn';
  font-size: 14px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}
.search-box input:focus {
  border-color: var(--melon);
  box-shadow: 0 0 0 4px rgba(232,97,77,0.1);
  background: var(--bg-primary);
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box .search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--melon);
  font-size: 18px;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.header-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.header-btn:hover {
  background: var(--melon-bg);
  color: var(--melon);
}
.header-btn .badge-dot {
  position: absolute;
  top: 6px; left: 6px;
  width: 8px; height: 8px;
  background: var(--melon);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}

.login-btn {
  height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-xl);
  border: 2px solid var(--melon);
  background: transparent;
  color: var(--melon);
  font-family: 'Vazirmatn';
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.login-btn:hover {
  background: var(--melon);
  color: white;
}

/* ═══════════════════════════════════════════
   MEGA MENU (Digikala-style)
   ═══════════════════════════════════════════ */
.mega-nav {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 900;
}
.mega-nav-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 0;
}

.mega-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  border: none;
  background: none;
  font-family: 'Vazirmatn';
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
}
.mega-trigger i { font-size: 18px; color: var(--melon); }
.mega-trigger:hover { color: var(--melon); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  margin-right: 8px;
  border-right: 1px solid var(--border-color);
  padding-right: 8px;
}
.nav-link-item {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav-link-item:hover { color: var(--melon); }
.nav-link-item.active { color: var(--melon); font-weight: 600; }

/* Mega Dropdown */
.mega-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: var(--mega-menu-bg);
  border-bottom: 3px solid var(--melon);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 999;
  animation: fadeSlideDown 0.25s ease;
}
.mega-dropdown.show { display: flex; }

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mega-sidebar {
  width: 240px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  padding: 12px 0;
  max-height: 420px;
  overflow-y: auto;
}
.mega-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  border-right: 3px solid transparent;
}
.mega-sidebar-item:hover,
.mega-sidebar-item.active {
  background: var(--bg-primary);
  color: var(--melon);
  border-right-color: var(--melon);
}
.mega-sidebar-item i { font-size: 18px; width: 24px; text-align: center; }

.mega-content {
  flex: 1;
  padding: 24px 30px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-height: 420px;
  overflow-y: auto;
}
.mega-col h6 {
  font-size: 14px;
  font-weight: 700;
  color: var(--melon);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--melon-bg);
}
.mega-col a {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 5px 0;
  transition: var(--transition);
}
.mega-col a:hover { color: var(--melon); padding-right: 6px; }

/* ═══════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════ */
.hero-section {
  background: var(--melon-gradient);
  position: relative;
  overflow: hidden;
  padding: 100px 0 130px;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-section::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 50px;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hero-text {
  flex: 1;
  color: white;
}
.hero-text h1 {
  font-size: 40px;
  font-weight: 900;
  margin-bottom: 16px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.15);
}
.hero-text p {
  font-size: 17px;
  opacity: 0.92;
  margin-bottom: 0;
  font-weight: 300;
}

/* Hero Image - Phone Mockup with books */
.hero-image {
  flex: 0 0 320px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-img-stack {
  position: relative;
  width: 280px;
  height: 320px;
}

/* Floating book covers around the phone */
.hero-book {
  position: absolute;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  animation: heroFloat 6s ease-in-out infinite;
}
.hb-1 {
  width: 80px; height: 110px;
  background: linear-gradient(135deg, #F9A825, #FF8F00);
  top: 10px; right: -10px;
  animation-delay: 0s;
  transform: rotate(-8deg);
}
.hb-1::after {
  content: '';
  position: absolute;
  top: 14px; right: 12px; left: 12px;
  height: 30px;
  background: rgba(255,255,255,0.2);
  border-radius: 5px;
}
.hb-2 {
  width: 72px; height: 100px;
  background: linear-gradient(135deg, #5C6BC0, #3949AB);
  bottom: 30px; right: -20px;
  animation-delay: 1.5s;
  transform: rotate(6deg);
}
.hb-2::after {
  content: '';
  position: absolute;
  top: 12px; right: 10px; left: 10px;
  height: 25px;
  background: rgba(255,255,255,0.2);
  border-radius: 5px;
}
.hb-3 {
  width: 68px; height: 95px;
  background: linear-gradient(135deg, #26A69A, #00897B);
  top: 40px; left: -15px;
  animation-delay: 3s;
  transform: rotate(-4deg);
}
.hb-3::after {
  content: '';
  position: absolute;
  top: 10px; right: 8px; left: 8px;
  height: 22px;
  background: rgba(255,255,255,0.15);
  border-radius: 5px;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0) rotate(var(--rot, -8deg)); }
  50% { transform: translateY(-12px) rotate(var(--rot, -8deg)); }
}
.hb-1 { --rot: -8deg; }
.hb-2 { --rot: 6deg; }
.hb-3 { --rot: -4deg; }

/* Phone mockup */
.hero-phone {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 160px;
  height: 280px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(16px);
  border-radius: 24px;
  border: 2px solid rgba(255,255,255,0.25);
  padding: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.phone-screen {
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 12px 8px;
  overflow: hidden;
}
.phone-header-bar {
  height: 8px;
  background: rgba(255,255,255,0.3);
  border-radius: 4px;
  margin-bottom: 14px;
}
.phone-book-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.phone-mini-book {
  flex: 1;
  height: 60px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.pmb-1 { background: linear-gradient(135deg, #EF5350, #E53935); }
.pmb-2 { background: linear-gradient(135deg, #42A5F5, #1E88E5); }
.pmb-3 { background: linear-gradient(135deg, #66BB6A, #43A047); }
.pmb-4 { background: linear-gradient(135deg, #AB47BC, #8E24AA); }
.pmb-5 { background: linear-gradient(135deg, #FFA726, #FB8C00); }
.pmb-6 { background: linear-gradient(135deg, #26C6DA, #00ACC1); }
.phone-line {
  height: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.2);
  margin-bottom: 6px;
}
.pl-1 { width: 80%; }
.pl-2 { width: 55%; margin-bottom: 14px; }

/* Hero floating books */
.hero-floating-books {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1;
  pointer-events: none;
}
.floating-book {
  position: absolute;
  width: 60px; height: 80px;
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  backdrop-filter: blur(4px);
  animation: floatBook 8s ease-in-out infinite;
}
.floating-book:nth-child(1) { top: 15%; right: 8%; animation-delay: 0s; }
.floating-book:nth-child(2) { top: 25%; left: 12%; animation-delay: 2s; width: 50px; height: 65px; }
.floating-book:nth-child(3) { bottom: 25%; right: 15%; animation-delay: 4s; width: 45px; height: 60px; }
.floating-book:nth-child(4) { bottom: 20%; left: 8%; animation-delay: 1s; }
.floating-book:nth-child(5) { top: 10%; left: 30%; animation-delay: 3s; width: 40px; height: 55px; }

/* Floating Images */
.floating-img {
  position: absolute;
  width: 64px;
  height: 64px;
  animation: floatBook 8s ease-in-out infinite;
  z-index: 2;
}
.floating-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fi-1 { bottom: 18%; right: 10%; animation-delay: 3.5s; width: 72px; height: 72px; }

@keyframes floatBook {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-15px) rotate(3deg); }
  50% { transform: translateY(-8px) rotate(-2deg); }
  75% { transform: translateY(-20px) rotate(1deg); }
}

/* ─── Hero CTA Button (overlapping hero/categories border) ─── */
.hero-cta-wrapper {
  position: relative;
  z-index: 20;
  text-align: center;
  margin-top: -28px; /* half of button height → sits on border */
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  color: var(--melon);
  padding: 16px 40px;
  border-radius: var(--radius-xl);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 8px 30px rgba(232,97,77,0.25);
  transition: var(--transition);
  border: 2px solid var(--melon-bg);
}
.hero-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(232,97,77,0.3);
  color: var(--melon-dark);
}
.hero-cta i { font-size: 20px; }

/* ═══════════════════════════════════════════
   CATEGORY ICONS
   ═══════════════════════════════════════════ */
.category-icons {
  position: relative;
  z-index: 10;
  padding-top: 50px;
  padding-bottom: 40px;
}
.cat-icon-grid {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  max-width: 700px;
  margin: 0 auto;
}
.cat-icon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.cat-icon-card:hover { transform: translateY(-5px); }
.cat-icon-circle {
  width: 72px; height: 72px;
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--melon);
  transition: var(--transition);
  border: 2px solid transparent;
}
.cat-icon-card:hover .cat-icon-circle {
  border-color: var(--melon);
  box-shadow: var(--shadow-hover);
  background: var(--melon-bg);
}
.cat-icon-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

/* ═══════════════════════════════════════════
   SECTION BLOCKS
   ═══════════════════════════════════════════ */
.section-block {
  padding: 30px 0;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--melon-gradient);
  border-radius: 4px;
}
.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
  margin-right: 14px;
}
.section-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--melon);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
  white-space: nowrap;
}
.section-more:hover { gap: 8px; color: var(--melon-dark); }

/* Section Filter Chips (inside scroll sections on homepage) */
.section-chips-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
  padding-bottom: 2px;
}
.section-chips-scroll::-webkit-scrollbar { height: 0; }
.section-chips {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}
.section-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 18px;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-family: 'Vazirmatn';
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.section-chip:hover {
  border-color: var(--melon-light);
  color: var(--melon);
  background: var(--melon-bg);
}
.section-chip.active {
  background: var(--melon);
  color: white;
  border-color: var(--melon);
}

/* ═══════════════════════════════════════════
   BOOK CARDS & SCROLL
   ═══════════════════════════════════════════ */
.book-scroll-wrapper {
  position: relative;
}

.book-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.book-scroll::-webkit-scrollbar { height: 4px; }
.book-scroll::-webkit-scrollbar-track { background: transparent; }
.book-scroll::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
.book-scroll:hover::-webkit-scrollbar-thumb { background: var(--melon-light); }

/* Scroll Arrow Buttons */
.scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-60%);
  z-index: 10;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  opacity: 0;
  pointer-events: none;
}
.book-scroll-wrapper:hover .scroll-arrow {
  opacity: 1;
  pointer-events: auto;
}
.scroll-arrow:hover {
  background: var(--melon);
  color: white;
  border-color: var(--melon);
  box-shadow: var(--shadow-hover);
}
.scroll-arrow.arr-right { right: -6px; }
.scroll-arrow.arr-left { left: -6px; }
.scroll-arrow.disabled { opacity: 0.3 !important; pointer-events: none; }

.book-card {
  flex: 0 0 170px;
  scroll-snap-align: start;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  border: 1px solid var(--border-color);
  display: block;
  text-decoration: none;
  color: inherit;
}
.book-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--melon-light);
}

.book-cover {
  width: 100%;
  height: 220px;
  position: relative;
  overflow: hidden;
}
.book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.book-card:hover .book-cover-img { transform: scale(1.05); }

.book-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--melon);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.book-badge.free { background: #10B981; }
.book-badge.audio { background: #6366F1; }

.book-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14px;
}
.book-card:hover .book-overlay { opacity: 1; }
.book-overlay-btn {
  background: white;
  color: var(--melon);
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-xl);
  font-family: 'Vazirmatn';
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.book-overlay-btn:hover { background: var(--melon); color: white; }

.book-info { padding: 12px 14px 16px; }
.book-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book-author {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}
.book-meta i { font-size: 12px; color: var(--melon-light); }
.book-rating { display: flex; align-items: center; gap: 3px; }

/* ═══════════════════════════════════════════
   PROMO BANNERS
   ═══════════════════════════════════════════ */
.promo-banners { padding: 10px 0 30px; }
.promo-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  height: 180px;
  cursor: pointer;
  transition: var(--transition);
}
.promo-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.promo-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 28px;
  color: white;
}
.promo-card-overlay h3 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.promo-card-overlay p { font-size: 13px; opacity: 0.9; }
.promo-card-overlay .promo-btn {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  color: var(--melon);
  padding: 8px 20px;
  border-radius: var(--radius-xl);
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
  width: fit-content;
  transition: var(--transition);
}
.promo-card-overlay .promo-btn:hover { background: var(--melon); color: white; }

.promo-1 .promo-card-overlay { background: linear-gradient(135deg, rgba(232,97,77,0.92), rgba(199,69,55,0.85)); }
.promo-2 .promo-card-overlay { background: linear-gradient(135deg, rgba(99,102,241,0.92), rgba(79,70,229,0.85)); }
.promo-3 .promo-card-overlay { background: linear-gradient(135deg, rgba(16,185,129,0.92), rgba(5,150,105,0.85)); }

/* ═══════════════════════════════════════════
   POSTER BANNERS (image-only)
   ═══════════════════════════════════════════ */
.poster-banners { padding: 0 0 30px; }
.poster-card {
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}
.poster-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.poster-img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 400 / 240;
}

/* ═══════════════════════════════════════════
   AUDIO CARDS
   ═══════════════════════════════════════════ */
.audio-card .book-cover { height: 170px; border-radius: var(--radius-md); }
.audio-card .book-cover::after {
  content: '\F4C0';
  font-family: 'bootstrap-icons';
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 36px; height: 36px;
  background: var(--melon);
  border-radius: 50%;
  color: white;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(232,97,77,0.4);
  z-index: 2;
}

/* ═══════════════════════════════════════════
   DISCOVER SECTION
   ═══════════════════════════════════════════ */
.discover-box {
  background: var(--melon-gradient);
  border-radius: var(--radius-lg);
  padding: 44px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}
.discover-box::before {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  top: -50px; left: -50px;
}
.discover-box::after {
  content: '';
  position: absolute;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  bottom: -30px; right: -30px;
}
.discover-box h2 { font-size: 26px; font-weight: 800; margin-bottom: 10px; position: relative; z-index: 1; }
.discover-box p { font-size: 14px; opacity: 0.9; margin-bottom: 20px; position: relative; z-index: 1; }
.discover-tags {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.discover-tag {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  padding: 10px 22px;
  border-radius: var(--radius-xl);
  font-size: 13px;
  font-weight: 600;
  color: white;
  border: 1px solid rgba(255,255,255,0.25);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.discover-tag:hover { background: white; color: var(--melon); border-color: white; }

/* ═══════════════════════════════════════════
   AI CHAT CTA BOX
   ═══════════════════════════════════════════ */
.ai-cta-box {
  background: linear-gradient(135deg, #312E81 0%, #4338CA 40%, #6366F1 70%, #818CF8 100%);
  border-radius: var(--radius-xl);
  padding: 52px 40px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.ai-cta-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.ai-particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.ai-particle.p1 { width: 260px; height: 260px; top: -80px; left: -60px; }
.ai-particle.p2 { width: 180px; height: 180px; bottom: -50px; right: -40px; background: rgba(255,255,255,0.05); }
.ai-particle.p3 { width: 60px; height: 60px; top: 30%; left: 15%; background: rgba(255,255,255,0.08); animation: aiCtaFloat 6s ease-in-out infinite; }
.ai-particle.p4 { width: 40px; height: 40px; top: 20%; right: 20%; background: rgba(255,255,255,0.07); animation: aiCtaFloat 8s ease-in-out infinite reverse; }
.ai-particle.p5 { width: 24px; height: 24px; bottom: 25%; left: 30%; background: rgba(255,255,255,0.1); animation: aiCtaFloat 5s ease-in-out infinite; }

@keyframes aiCtaFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-14px) scale(1.1); }
}

.ai-cta-content {
  position: relative;
  z-index: 2;
}

.ai-cta-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 22px;
}

.ai-cta-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
  position: relative;
  z-index: 2;
  border: 1px solid rgba(255,255,255,0.2);
}

.ai-cta-ring {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 30px;
  border: 2px solid rgba(255,255,255,0.12);
  animation: aiRingPulse 3s ease-in-out infinite;
}

@keyframes aiRingPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 0.2; }
}

.ai-cta-box h2 {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.ai-cta-box p {
  font-size: 14px;
  opacity: 0.85;
  max-width: 520px;
  margin: 0 auto 24px;
  line-height: 1.8;
}

.ai-cta-features {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.ai-cta-feature {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: var(--radius-xl);
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.15);
}

.ai-cta-feature i {
  font-size: 14px;
}

.ai-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  background: white;
  color: #4338CA;
  border-radius: var(--radius-xl);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.ai-cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.2);
  gap: 14px;
  color: #4338CA;
}

[data-theme="dark"] .ai-cta-box {
  background: linear-gradient(135deg, #1E1B4B 0%, #312E81 40%, #3730A3 70%, #4338CA 100%);
}

@media (max-width: 768px) {
  .ai-cta-box { padding: 36px 20px; border-radius: var(--radius-lg); }
  .ai-cta-box h2 { font-size: 22px; }
  .ai-cta-box p { font-size: 13px; }
  .ai-cta-features { gap: 8px; }
  .ai-cta-feature { padding: 6px 12px; font-size: 11px; }
  .ai-cta-btn { padding: 12px 28px; font-size: 14px; }
  .ai-cta-icon { width: 60px; height: 60px; font-size: 26px; border-radius: 18px; }
  .ai-cta-ring { width: 84px; height: 84px; border-radius: 26px; }
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.site-footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: 50px 0 20px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand .logo { margin-bottom: 14px; }
.footer-brand p { font-size: 13px; color: var(--text-secondary); line-height: 1.8; }
.footer-col h6 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 0;
  transition: var(--transition);
}
.footer-col a:hover { color: var(--melon); padding-right: 4px; }

.footer-socials {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.footer-social-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
  text-decoration: none;
  transition: var(--transition);
}
.footer-social-btn:hover { background: var(--melon); color: white; border-color: var(--melon); }

.footer-apps {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.footer-app-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--text-primary);
  color: white;
  text-decoration: none;
  font-size: 11px;
  transition: var(--transition);
}
.footer-app-btn:hover { opacity: 0.85; color: white; }
.footer-app-btn i { font-size: 20px; }
.footer-app-btn span { font-weight: 600; font-size: 13px; }

/* Trust Badges */
.footer-trust {
  border-top: 1px solid var(--border-color);
  padding-top: 30px;
  margin-top: 10px;
  margin-bottom: 30px;
}
.footer-trust-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  text-align: center;
}
.trust-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.trust-badge {
  width: 100px; height: 110px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
}
.trust-badge:hover {
  border-color: var(--melon-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.trust-badge-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.trust-badge-icon.enamad { background: #E8F5E9; color: #2E7D32; }
.trust-badge-icon.samandehi { background: #E3F2FD; color: #1565C0; }
.trust-badge-icon.resaneh { background: #FFF3E0; color: #E65100; }
.trust-badge-icon.ssl { background: #F3E5F5; color: #7B1FA2; }
.trust-badge-icon.shaparak { background: #FFEBEE; color: #C62828; }
.trust-badge-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   MOBILE SIDEBAR (Glass)
   ═══════════════════════════════════════════ */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.sidebar-overlay.show { opacity: 1; visibility: visible; }

.mobile-sidebar {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100%;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  z-index: 2001;
  transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
  border-left: 1px solid rgba(255,255,255,0.2);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 50px rgba(0,0,0,0.12);
}
[data-theme="dark"] .mobile-sidebar {
  background: rgba(30,30,50,0.78);
  border-left-color: rgba(255,255,255,0.08);
}
.mobile-sidebar.show { right: 0; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
[data-theme="dark"] .sidebar-header { border-bottom-color: rgba(255,255,255,0.06); }
.sidebar-close {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: none;
  background: rgba(0,0,0,0.05);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
  border-right: 3px solid transparent;
}
.sidebar-nav-item:hover {
  background: rgba(232,97,77,0.08);
  color: var(--melon);
  border-right-color: var(--melon);
}
.sidebar-nav-item i { font-size: 18px; width: 24px; text-align: center; color: var(--melon-light); }

.sidebar-divider {
  height: 1px;
  background: rgba(0,0,0,0.06);
  margin: 10px 20px;
}
[data-theme="dark"] .sidebar-divider { background: rgba(255,255,255,0.06); }

/* Sidebar Accordion Categories */
.sidebar-mega-section { border-bottom: 1px solid rgba(0,0,0,0.04); }
[data-theme="dark"] .sidebar-mega-section { border-bottom-color: rgba(255,255,255,0.04); }

.sidebar-mega-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 20px;
  border: none;
  background: none;
  font-family: 'Vazirmatn';
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}
.sidebar-mega-toggle span { display: flex; align-items: center; gap: 10px; }
.sidebar-mega-toggle span i { font-size: 18px; color: var(--melon); width: 24px; text-align: center; }
.sidebar-mega-arrow {
  font-size: 13px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}
.sidebar-mega-section.open .sidebar-mega-arrow { transform: rotate(180deg); }
.sidebar-mega-toggle:hover { color: var(--melon); }

.sidebar-mega-sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1), padding 0.3s ease;
  padding: 0 20px 0 52px;
}
.sidebar-mega-section.open .sidebar-mega-sub {
  max-height: 400px;
  padding: 4px 20px 12px 52px;
}
.sidebar-mega-sub a {
  display: block;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  border-bottom: 1px dashed rgba(0,0,0,0.04);
}
[data-theme="dark"] .sidebar-mega-sub a { border-bottom-color: rgba(255,255,255,0.04); }
.sidebar-mega-sub a:last-child { border: none; }
.sidebar-mega-sub a:hover { color: var(--melon); padding-right: 6px; }

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 16px 20px 8px;
  letter-spacing: 0.5px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}
.sidebar-footer .login-btn {
  width: 100%;
  height: 46px;
  font-size: 14px;
}

/* ═══════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION (sticky)
   ═══════════════════════════════════════════ */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border-color);
  z-index: 1500;
  padding: 6px 0;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}
.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  transition: var(--transition);
}
.bottom-nav-item i { font-size: 22px; }
.bottom-nav-item.active { color: var(--melon); }
.bottom-nav-item:hover { color: var(--melon); }

/* ─── (mobile search is now inline in header) ─── */

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 991px) {
  .mega-nav { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .hero-text h1 { font-size: 30px; }
  .hero-image { flex: 0 0 260px; }
  .book-card { flex: 0 0 150px; }
  .book-cover { height: 195px; }
}

@media (max-width: 767px) {
  .mobile-bottom-nav { display: block; }
  body { padding-bottom: 72px; }
  .top-bar { display: none; }

  /* موبایل: لوگو کنار دکمهٔ منو نمایش داده شود (فقط تصویر/آیکون)، جستجوی دسکتاپ پنهان */
  .search-box { display: none; }
  .header-inner > .logo { display: flex; flex-shrink: 0; }
  .header-inner > .logo .logo-text-wrap { display: none !important; }
  .header-mobile-search { display: block; }
  .header-inner { gap: 8px; padding: 0 12px; }

  /* Hide all header actions except theme toggle */
  .header-actions .login-btn { display: none; }
  .header-actions .header-btn:not([onclick*="toggleTheme"]) { display: none !important; }
  .header-actions .header-btn[onclick*="toggleTheme"] { display: flex !important; }

  /* Below-header standalone search removed from HTML */

  .hero-section { padding: 50px 0 90px; }
  .hero-inner { flex-direction: column; text-align: center; gap: 24px; }
  .hero-text h1 { font-size: 24px; }
  .hero-text p { font-size: 13px; }
  .hero-image { flex: 0 0 auto; }
  .hero-img-stack { width: 220px; height: 250px; }
  .hero-phone { width: 130px; height: 225px; }
  .hb-1 { width: 60px; height: 85px; }
  .hb-2 { width: 55px; height: 78px; }
  .hb-3 { width: 52px; height: 72px; }
  .hero-cta { padding: 13px 30px; font-size: 13px; }

  .category-icons { padding-top: 40px; }
  .cat-icon-grid { gap: 14px; }
  .cat-icon-circle { width: 58px; height: 58px; font-size: 22px; border-radius: 16px; }
  .cat-icon-label { font-size: 10px; }

  .section-title { font-size: 16px; }
  .book-card { flex: 0 0 140px; }
  .book-cover { height: 180px; }
  .scroll-arrow { display: none !important; }

  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .discover-box { padding: 28px 20px; }
  .discover-box h2 { font-size: 20px; }
  .promo-card { height: 150px; }
  .trust-badge { width: 85px; height: 100px; }
  .trust-badge-icon { width: 40px; height: 40px; font-size: 20px; }

}

@media (max-width: 400px) {
  .cat-icon-grid { gap: 10px; }
  .cat-icon-circle { width: 52px; height: 52px; font-size: 20px; }
  .book-card { flex: 0 0 130px; }
  .book-cover { height: 165px; }
  .trust-badge { width: 75px; height: 90px; padding: 8px; }
  .trust-badge-icon { width: 36px; height: 36px; font-size: 18px; }
  .trust-badge-label { font-size: 9px; }
}

/* ═══════════════════════════════════════════
   INNER PAGES
   ═══════════════════════════════════════════ */

/* Page Header / Breadcrumb Banner */
.page-banner {
  background: var(--melon-gradient);
  padding: 48px 0 40px;
  position: relative;
  overflow: hidden;
}
.page-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.page-banner-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
}
.page-banner h1 {
  font-size: 30px;
  font-weight: 900;
  margin-bottom: 10px;
}
.page-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  opacity: 0.85;
}
.page-breadcrumb a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: var(--transition);
}
.page-breadcrumb a:hover { color: white; }
.page-breadcrumb span { opacity: 0.6; }

/* Page Content Area */
.page-content {
  padding: 50px 0 60px;
}
.page-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 40px 48px;
  max-width: 900px;
  margin: 0 auto;
}
.page-card h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--melon-bg);
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-card h2 i { color: var(--melon); font-size: 24px; }
.page-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 28px 0 10px;
}
.page-card p, .page-card li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 2;
}
.page-card ul {
  padding-right: 20px;
  margin-bottom: 16px;
}
.page-card ul li {
  margin-bottom: 6px;
  position: relative;
}
.page-card ul li::marker { color: var(--melon); }

.page-card a:not(.btn) {
  color: var(--melon);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}
.page-card a:not(.btn):hover { color: var(--melon-dark); text-decoration: underline; }

/* Info Cards (for About page) */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.info-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}
.info-card:hover { border-color: var(--melon-light); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.info-card-icon {
  width: 52px; height: 52px;
  margin: 0 auto 12px;
  border-radius: var(--radius-sm);
  background: var(--melon-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--melon);
}
.info-card h4 { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.info-card p { font-size: 12px; color: var(--text-muted); margin: 0; line-height: 1.6; }

/* Contact Form */
.contact-form { margin-top: 24px; }
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: 'Vazirmatn';
  font-size: 14px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--melon);
  box-shadow: 0 0 0 4px rgba(232,97,77,0.1);
  background: var(--bg-primary);
}
.form-group textarea { min-height: 140px; resize: vertical; }

.form-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  background: var(--melon-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-xl);
  font-family: 'Vazirmatn';
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(232,97,77,0.3);
}
.form-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(232,97,77,0.4); }

/* Contact Info Boxes */
.contact-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.contact-info-box {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  border: 1px solid var(--border-color);
}
.contact-info-box i { font-size: 28px; color: var(--melon); margin-bottom: 10px; display: block; }
.contact-info-box h5 { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.contact-info-box p { font-size: 13px; color: var(--text-secondary); margin: 0; direction: ltr; }

/* Map placeholder */
.map-placeholder {
  width: 100%;
  height: 260px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 2px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 24px;
  gap: 8px;
}

/* Update Date */
.page-update-date {
  text-align: left;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

@media (max-width: 767px) {
  .page-banner { padding: 36px 0 30px; }
  .page-banner h1 { font-size: 22px; }
  .page-card { padding: 24px 20px; border-radius: var(--radius-md); }
  .page-card h2 { font-size: 18px; }
  .info-cards { grid-template-columns: 1fr 1fr; }
  .contact-info-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════
   BOOK DETAIL PAGE
   ═══════════════════════════════════════════ */
.book-detail-section { padding: 40px 0 60px; }

.book-detail-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  align-items: start;
}

/* Cover Column */
.detail-cover-col { position: sticky; top: 84px; }
.detail-cover-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  padding: 24px;
  text-align: center;
}
/* اصلاح قسمت detail-cover-wrap */
.detail-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;  /* ← این خط کلید حل مشکل است */
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}
.detail-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.detail-cover-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--melon);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: var(--melon-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Vazirmatn';
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(232,97,77,0.3);
  text-decoration: none;
}
.detail-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(232,97,77,0.4);
  color: white;
}
.detail-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: 'Vazirmatn';
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.detail-btn-secondary:hover {
  border-color: var(--melon);
  color: var(--melon);
  background: var(--melon-bg);
}
.detail-cover-wrap .fallback-cover {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-fallback, linear-gradient(135deg, #667eea, #764ba2));
}

.detail-cover-wrap .fallback-cover i {
  font-size: 48px;
  color: rgba(255,255,255,0.5);
}

/* برای موبایل */
@media (max-width: 767px) {
  .detail-cover-wrap {
    aspect-ratio: 2 / 3;
    max-width: 280px;
    margin: 0 auto 20px;
  }
}
.detail-btn-row {
  display: flex;
  gap: 10px;
}
.detail-btn-row .detail-btn-secondary { flex: 1; }

/* Info Column */
.detail-info-col {}
.detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.detail-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.detail-breadcrumb a:hover { color: var(--melon); }

.detail-title {
  font-size: 28px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}
.detail-author {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.detail-author a { color: var(--melon); text-decoration: none; font-weight: 600; }
.detail-author a:hover { text-decoration: underline; }

.detail-rating-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.detail-stars { display: flex; gap: 2px; color: #F59E0B; font-size: 18px; }
.detail-stars .empty { color: var(--border-color); }
.detail-rate-num { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.detail-rate-count { font-size: 12px; color: var(--text-muted); }
.detail-divider { width: 1px; height: 20px; background: var(--border-color); }

/* Meta Info Grid */
.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.detail-meta-item {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border: 1px solid var(--border-color);
}
.detail-meta-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.detail-meta-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Tabs */
.detail-tabs {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
}
.detail-tab-nav {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}
.detail-tab-btn {
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-family: 'Vazirmatn';
  white-space: nowrap;
  transition: var(--transition);
}
.detail-tab-btn:hover { color: var(--melon); }
.detail-tab-btn.active {
  color: var(--melon);
  border-bottom-color: var(--melon);
  background: var(--melon-bg);
}
.detail-tab-content {
  padding: 28px;
  display: none;
}
.detail-tab-content.active { display: block; }
.detail-tab-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 2;
  margin-bottom: 14px;
}
.detail-tab-content h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 20px 0 10px;
  color: var(--text-primary);
}

/* Specs Table */
.specs-table {
  width: 100%;
  border-collapse: collapse;
}
.specs-table tr { border-bottom: 1px solid var(--border-color); }
.specs-table tr:last-child { border: none; }
.specs-table td {
  padding: 12px 16px;
  font-size: 14px;
  vertical-align: top;
}
.specs-table td:first-child {
  font-weight: 600;
  color: var(--text-primary);
  width: 160px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.specs-table td:last-child { color: var(--text-secondary); }

/* Comments */
.comment-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
}
.comment-item:last-child { border: none; }
.comment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.comment-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--melon-bg);
  color: var(--melon);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}
.comment-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.comment-date { font-size: 11px; color: var(--text-muted); margin-right: auto; }
.comment-stars { display: flex; gap: 1px; font-size: 13px; color: #F59E0B; }
.comment-text { font-size: 13px; color: var(--text-secondary); line-height: 1.9; padding-right: 48px; }

/* Similar Books */
.similar-section { padding: 30px 0 40px; }

@media (max-width: 991px) {
  .book-detail-grid { grid-template-columns: 240px 1fr; gap: 28px; }
}
@media (max-width: 767px) {
  .book-detail-grid { grid-template-columns: 1fr; }
  .detail-cover-col { position: static; max-width: 280px; margin: 0 auto; }
  .detail-title { font-size: 22px; }
  .detail-meta-grid { grid-template-columns: 1fr 1fr; }
  .detail-tab-content { padding: 20px 16px; }
  .comment-text { padding-right: 0; }
  .specs-table td:first-child { width: 120px; }
}

/* ═══════════════════════════════════════════
   READER PAGE
   ═══════════════════════════════════════════ */
.reader-page { background: var(--bg-secondary); min-height: 100vh; }

/* Reader Toolbar (top) */
.reader-toolbar {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.reader-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.reader-toolbar-center {
  flex: 1;
  text-align: center;
}
.reader-toolbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.reader-book-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reader-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: 'Vazirmatn';
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}
.reader-back-btn:hover { background: var(--melon-bg); color: var(--melon); }

.reader-tool-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.reader-tool-btn:hover { background: var(--melon-bg); color: var(--melon); border-color: var(--melon-light); }
.reader-tool-btn.active { background: var(--melon); color: white; border-color: var(--melon); }

/* Font size panel */
.font-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 16px 20px;
  width: 220px;
  z-index: 600;
  display: none;
}
.font-panel.show { display: block; animation: fadeSlideDown 0.2s ease; }
.font-panel-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-align: center;
}
.font-size-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.font-size-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-family: 'Vazirmatn';
}
.font-size-btn:hover { border-color: var(--melon); color: var(--melon); }
.font-size-display {
  font-size: 18px;
  font-weight: 800;
  color: var(--melon);
  min-width: 40px;
  text-align: center;
}

/* Reader Content Area */
.reader-content-area {
  max-width: 780px;
  margin: 0 auto;
  padding: 30px 20px 120px;
}
.reader-paper {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  padding: 48px 56px;
  min-height: 600px;
  position: relative;
  transition: var(--transition);
  -webkit-user-select: text;
  user-select: text;
}
.reader-paper::before {
  content: '';
  position: absolute;
  top: 0; left: 30px; right: 30px;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--border-color) 0px, var(--border-color) 6px, transparent 6px, transparent 12px);
}

.reader-chapter-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--melon);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--melon-bg);
  text-align: center;
}

.reader-text {
  font-size: 16px;
  line-height: 2.2;
  color: var(--text-primary);
  text-align: justify;
  transition: font-size 0.3s ease;
}
.reader-text p { margin-bottom: 20px; text-indent: 24px; }
.reader-text p:first-child { text-indent: 0; }

.reader-page-indicator {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* Bottom Navigation Bar */
.reader-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  z-index: 500;
  padding: 10px 20px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}
.reader-bottom-inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.reader-page-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.reader-nav-btn {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.reader-nav-btn:hover { background: var(--melon); color: white; border-color: var(--melon); }
.reader-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.reader-nav-btn:disabled:hover { background: var(--bg-primary); color: var(--text-primary); border-color: var(--border-color); }

.reader-progress {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.reader-progress-bar {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.reader-progress-fill {
  height: 100%;
  background: var(--melon-gradient);
  border-radius: 10px;
  transition: width 0.4s ease;
}
.reader-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── Custom Selection / Dictionary Popup ─── */
.dict-popup {
  position: fixed;
  z-index: 9999;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0;
  display: none;
  animation: fadeSlideDown 0.2s ease;
  overflow: hidden;
  min-width: 180px;
}
.dict-popup.show { display: block; }
.dict-popup-word {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--melon);
  background: var(--melon-bg);
  border-bottom: 1px solid var(--border-color);
  text-align: center;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dict-popup-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border-color);
}
.dict-popup-item:last-child { border: none; }
.dict-popup-item:hover { background: var(--melon-bg); color: var(--melon); }
.dict-popup-item i { font-size: 16px; color: var(--melon); width: 20px; text-align: center; }

@media (max-width: 767px) {
  .reader-toolbar { height: 50px; gap: 8px; }
  .reader-back-btn span { display: none; }
  .reader-back-btn { padding: 8px 10px; }
  .reader-book-title { font-size: 13px; }
  .reader-paper { padding: 28px 22px; border-radius: var(--radius-md); }
  .reader-chapter-title { font-size: 20px; }
  .reader-text { font-size: 15px; }
  .reader-content-area { padding: 16px 12px 110px; }
  .reader-bottom-bar { padding: 8px 12px; }
}

/* ═══════════════════════════════════════════
   CATEGORY PAGES
   ═══════════════════════════════════════════ */
.cat-page-content { padding: 30px 0 60px; }

/* Subcategory Filter Chips */
.cat-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.cat-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-xl);
  border: 2px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-family: 'Vazirmatn';
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.cat-filter-chip:hover {
  border-color: var(--melon-light);
  color: var(--melon);
  background: var(--melon-bg);
}
.cat-filter-chip.active {
  background: var(--melon);
  color: white;
  border-color: var(--melon);
}
.cat-filter-chip i { font-size: 15px; }

/* Scrollable filter row on mobile */
.cat-filters-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  margin-bottom: 24px;
}
.cat-filters-scroll::-webkit-scrollbar { height: 0; }
.cat-filters-scroll .cat-filters { flex-wrap: nowrap; }

/* Items Grid */
.cat-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}
.cat-item-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  display: block;
}
.cat-item-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--melon-light);
  color: inherit;
}
.cat-item-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  position: relative;
  overflow: hidden;
}
.cat-item-cover img, .cat-item-cover svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.cat-item-card:hover .cat-item-cover img,
.cat-item-card:hover .cat-item-cover svg { transform: scale(1.05); }
.cat-item-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--melon);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
}
.cat-item-badge.audio { background: #6366F1; }
.cat-item-badge.gallery { background: #0D9488; }
.cat-item-badge.article { background: #D97706; }
.cat-item-info { padding: 14px; }
.cat-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.cat-item-meta i { color: var(--melon-light); font-size: 13px; }

/* Play Icon Overlay (for audio) */
.cat-item-cover .play-overlay {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--melon);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 14px rgba(232,97,77,0.4);
  opacity: 0.9;
  transition: var(--transition);
}
.cat-item-card:hover .play-overlay { opacity: 1; transform: scale(1.1); }

/* Results Count */
.cat-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.cat-results-count {
  font-size: 14px;
  color: var(--text-secondary);
}
.cat-results-count strong { color: var(--text-primary); }
.cat-sort-select {
  padding: 8px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: 'Vazirmatn';
  font-size: 13px;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}
.cat-sort-select:focus { border-color: var(--melon); }

/* Load More */
.cat-load-more {
  text-align: center;
  margin-top: 36px;
}
.cat-load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 40px;
  border-radius: var(--radius-xl);
  border: 2px solid var(--melon);
  background: transparent;
  color: var(--melon);
  font-family: 'Vazirmatn';
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.cat-load-more-btn:hover { background: var(--melon); color: white; }

/* Gallery aspect ratio override */
.cat-items-grid.gallery-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.gallery-grid .cat-item-cover { aspect-ratio: 4 / 3; }

/* Article aspect ratio */
.cat-items-grid.article-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.article-grid .cat-item-cover { aspect-ratio: 16 / 9; }
.article-grid .cat-item-info { padding: 16px; }
.article-grid .cat-item-title { white-space: normal; line-height: 1.6; }
.article-grid .cat-item-excerpt {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 767px) {
  .cat-items-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-items-grid.gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-items-grid.article-grid { grid-template-columns: 1fr; }
  .cat-item-info { padding: 10px 12px; }
  .cat-item-title { font-size: 13px; }
  .page-banner h1 { font-size: 20px; }
}

/* ═══ Register Page Styles ═══ */
.register-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}
.register-page::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,97,77,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.register-page::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -15%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,97,77,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.register-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-primary);
  border-radius: 24px;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 60px rgba(0,0,0,0.08);
  padding: 40px 36px;
  position: relative;
  z-index: 2;
}

.register-logo {
  text-align: center;
  margin-bottom: 28px;
}
.register-logo .logo-icon {
  width: 56px;
  height: 56px;
  font-size: 24px;
  margin: 0 auto 12px;
}
.register-logo h1 {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.register-logo p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Step Indicator */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
}
.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-secondary);
  transition: all 0.4s ease;
  position: relative;
  z-index: 2;
}
.step-dot.active {
  background: var(--melon);
  border-color: var(--melon);
  color: white;
  box-shadow: 0 4px 14px rgba(232,97,77,0.3);
}
.step-dot.done {
  background: #10B981;
  border-color: #10B981;
  color: white;
}
.step-line {
  width: 60px;
  height: 2px;
  background: var(--border-color);
  transition: background 0.4s ease;
}
.step-line.active { background: var(--melon); }

/* Phone Input */
.phone-input-wrap {
  position: relative;
  margin-bottom: 20px;
}
.phone-input {
  width: 100%;
  height: 56px;
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 0 20px;
  font-family: 'Vazirmatn';
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 3px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-align: center;
  outline: none;
  transition: all 0.3s ease;
}
.phone-input:focus {
  border-color: var(--melon);
  background: var(--bg-primary);
  box-shadow: 0 0 0 4px rgba(232,97,77,0.1);
}
.phone-input::placeholder { letter-spacing: 1px; font-weight: 400; color: var(--text-muted); font-size: 14px; }

/* OTP Code Inputs */
.otp-wrap {
  display: flex;
  gap: 10px;
  justify-content: center;
  direction: ltr;
  margin-bottom: 20px;
}
.otp-input {
  width: 54px;
  height: 60px;
  border: 2px solid var(--border-color);
  border-radius: 14px;
  text-align: center;
  font-family: 'Vazirmatn';
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  background: var(--bg-secondary);
  outline: none;
  transition: all 0.3s ease;
  caret-color: var(--melon);
}
.otp-input:focus {
  border-color: var(--melon);
  background: var(--bg-primary);
  box-shadow: 0 0 0 4px rgba(232,97,77,0.1);
  transform: scale(1.05);
}
.otp-input.filled {
  border-color: var(--melon);
  background: var(--melon-bg);
}
.otp-input.error {
  border-color: #EF4444;
  background: #FEF2F2;
  animation: shake 0.4s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Timer & Resend */
.otp-info {
  text-align: center;
  margin-bottom: 24px;
}
.otp-phone-display {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.otp-phone-display strong { color: var(--text-primary); display: inline-block; }
.otp-timer {
  font-size: 14px;
  color: var(--melon);
  font-weight: 700;
  display: inline-block;
}
.otp-resend {
  font-size: 13px;
  color: var(--text-muted);
  cursor: default;
}
.otp-resend.active {
  color: var(--melon);
  cursor: pointer;
  font-weight: 600;
}
.otp-resend.active:hover { text-decoration: underline; }

.otp-edit-phone {
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  transition: var(--transition);
}
.otp-edit-phone:hover { color: var(--melon); }

/* Submit Button */
.register-btn {
  width: 100%;
  height: 54px;
  background: var(--melon-gradient);
  color: white;
  border: none;
  border-radius: 16px;
  font-family: 'Vazirmatn';
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(232,97,77,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.register-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(232,97,77,0.4); }
.register-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.register-btn .spinner {
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.register-btn.loading .spinner { display: block; }
.register-btn.loading span { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Success state */
.register-success {
  text-align: center;
  display: none;
}
.register-success.show { display: block; }
.success-icon {
  width: 80px; height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: white;
  box-shadow: 0 8px 30px rgba(16,185,129,0.3);
  animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes popIn {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}
.success-title { font-size: 20px; font-weight: 800; color: var(--text-primary); margin-bottom: 8px; }
.success-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.success-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  background: var(--melon-gradient);
  color: white;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(232,97,77,0.3);
}
.success-home-btn:hover { color: white; transform: translateY(-2px); }

/* Terms link */
.register-terms {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 20px;
  line-height: 1.8;
}
.register-terms a { color: var(--melon); text-decoration: none; font-weight: 600; }
.register-terms a:hover { text-decoration: underline; }

/* Back to home */
.register-back {
  text-align: center;
  margin-top: 20px;
}
.register-back a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}
.register-back a:hover { color: var(--melon); }

/* Theme toggle for register */
.register-theme-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.register-theme-btn:hover { color: var(--melon); border-color: var(--melon); }

@media (max-width: 480px) {
  .register-card { padding: 30px 24px; border-radius: 20px; }
  .otp-input { width: 48px; height: 54px; font-size: 20px; }
  .otp-wrap { gap: 8px; }
}

/* ═══════════════════════════════════════════
   MAHBOOB - Fixes & Improvements v2
   Include AFTER styles.css
   ═══════════════════════════════════════════ */

/* ─── FIX 1: Header + Mega Nav BOTH sticky on scroll ─── */
.main-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  will-change: transform;
}
.main-header.scrolled {
  box-shadow: var(--shadow-md);
}

/* Align header content with Bootstrap container */
.header-inner {
  padding: 0 calc(var(--bs-gutter-x, 1.5rem) * 0.5);
  max-width: 1320px;
  margin: 0 auto;
}

/* ★ Mega nav STICKY — sticks right below header on scroll ★ */
.mega-nav {
  position: sticky !important;
  top: var(--header-height, 64px) !important;
  z-index: 999 !important;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  will-change: transform;
}
.mega-nav-inner {
  padding: 0 calc(var(--bs-gutter-x, 1.5rem) * 0.5);
  max-width: 1320px;
  margin: 0 auto;
}

/* ─── FIX 2: Mega nav link hover underline ─── */
.nav-link-item {
  padding: 14px 14px;
  position: relative;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.nav-link-item:hover {
  color: var(--melon);
  border-bottom-color: var(--melon);
}
.nav-link-item.active {
  color: var(--melon);
  font-weight: 600;
  border-bottom-color: var(--melon);
}

/* ─── FIX 3: Hero — shorter + rounded bottom edge RESTORED ─── */
.hero-section {
  padding: 36px 0 0 !important;
  position: relative;
  overflow: visible !important; /* allow ::after to show */
}

/* ★ Rounded transition between hero and body content — RESTORED ★ */
.hero-section::after {
  content: '' !important;
  display: block !important;
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 36px;
  background: var(--bg-secondary, #f5f5f5);
  border-radius: 28px 28px 0 0;
  z-index: 5;
}

/* Smaller hero inner layout */
.hero-inner {
  gap: 24px;
}
.hero-text h1 {
  font-size: 32px;
}
.hero-text p {
  font-size: 14px;
}

/* Smaller phone + books stack */
.hero-image {
  flex: 0 0 260px;
}
.hero-img-stack {
  width: 240px;
  height: 260px;
}

/* ★ Hide 3 of 5 floating SVG decorations to reduce noise ★ */
.hero-floating-books .floating-book:nth-child(3),
.hero-floating-books .floating-book:nth-child(4),
.hero-floating-books .floating-book:nth-child(5) {
  display: none !important;
}

/* ─── FIX 4: Category icons inside hero — aligned with container ─── */
.category-icons {
  position: relative;
  z-index: 10;
  padding-top: 20px;
  padding-bottom: 48px; /* space for the ::after rounded edge */
}
.cat-icon-grid {
  max-width: 720px;
  gap: 18px;
}
.cat-icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.2);
  font-size: 24px;
  color: white;
  border: 1.5px solid rgba(255,255,255,0.22);
}
.cat-icon-card:hover .cat-icon-circle {
  background: rgba(255,255,255,0.28);
  border-color: rgba(255,255,255,0.45);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.3);
  transform: scale(1.06);
}
.cat-icon-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
}

/* ─── FIX 5: Filter chips — less rounded ─── */
.section-chip {
  border-radius: 8px;
  padding: 8px 18px;
}
.section-chip.active {
  box-shadow: 0 2px 10px rgba(232,97,77,0.25);
}
.cat-filter-chip {
  border-radius: 10px;
}
.cat-filter-chip.active {
  box-shadow: 0 2px 10px rgba(232,97,77,0.25);
}

/* ─── FIX 6: First section after hero ─── */
.hero-section + .section-block {
  padding-top: 32px;
}

/* ─── FIX 7: Hide install app button ─── */
.hero-cta-wrapper {
  display: none !important;
}

/* ─── FIX 8: Reader mobile optimization ─── */


/* ─── FIX 9: Hero + categories responsive ─── */
@media (max-width: 991px) {
  .hero-text h1 { font-size: 26px; }
  .hero-image { flex: 0 0 220px; }
  .hero-img-stack { width: 200px; height: 230px; }
}

@media (max-width: 767px) {
  .hero-section {
    padding: 24px 0 0 !important;
  }
  .hero-section::after {
    height: 28px;
    border-radius: 22px 22px 0 0;
  }
  .hero-inner {
    flex-direction: column;
    text-align: center;
    gap: 14px;
  }
  .hero-text h1 { font-size: 20px; }
  .hero-text p { font-size: 12px; }
  .hero-image { flex: 0 0 auto; }
  .hero-img-stack { width: 180px; height: 210px; }
  .hero-phone { width: 110px; height: 195px; }
  .hb-1 { width: 52px; height: 72px; }
  .hb-3 { width: 44px; height: 64px; }

  .category-icons {
    padding-top: 12px;
    padding-bottom: 40px;
  }
  .cat-icon-grid {
    gap: 10px;
    padding: 0 8px;
    max-width: 100%;
  }
  .cat-icon-circle {
    width: 48px;
    height: 48px;
    font-size: 20px;
    border-radius: 14px;
  }
  .cat-icon-label { font-size: 9.5px; }
}

@media (max-width: 400px) {
  .cat-icon-grid { gap: 8px; }
  .cat-icon-circle {
    width: 44px;
    height: 44px;
    font-size: 18px;
    border-radius: 12px;
  }
  .cat-icon-label { font-size: 9px; }
}

/* ─── FIX 10: Book detail mobile ─── */
@media (max-width: 767px) {
  .book-detail-section {
    padding-bottom: 80px;
  }
}
/* ═══════════════════════════════════════════
   FIXES: login-btn & sidebar-footer compatibility
   ═══════════════════════════════════════════ */
.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}
.sidebar-footer .login-btn {
  display: flex;
}
/* ═══════════════════════════════════════════
   PROFILE / ACCOUNT PAGES
   Uses existing CSS variables & design system
   ═══════════════════════════════════════════ */

/* ─── Profile Layout ─── */
.profile-section {
  padding: 30px 0 60px;
}
.profile-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

/* ─── Sidebar Card ─── */
.profile-sidebar {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: sticky;
  top: calc(var(--header-height, 64px) + 56px + 16px);
}
.profile-avatar-area {
  background: var(--melon-gradient);
  padding: 28px 20px 22px;
  text-align: center;
  position: relative;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 3px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
  margin: 0 auto 12px;
  backdrop-filter: blur(10px);
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.profile-display-name {
  font-size: 16px;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}
.profile-phone {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  direction: ltr;
  display: inline-block;
  letter-spacing: 1px;
}

/* Sidebar Navigation */
.profile-nav {
  padding: 8px 0;
}
.profile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
  border-right: 3px solid transparent;
}
.profile-nav-item:hover {
  background: var(--melon-bg);
  color: var(--melon);
  border-right-color: var(--melon);
}
.profile-nav-item.active {
  background: var(--melon-bg);
  color: var(--melon);
  border-right-color: var(--melon);
  font-weight: 600;
}
.profile-nav-item i {
  font-size: 18px;
  width: 24px;
  text-align: center;
  color: var(--text-muted);
  transition: var(--transition);
}
.profile-nav-item:hover i,
.profile-nav-item.active i {
  color: var(--melon);
}
.profile-nav-divider {
  height: 1px;
  background: var(--border-color);
  margin: 6px 16px;
}
.profile-nav-item.logout-item {
  color: #EF4444;
}
.profile-nav-item.logout-item i {
  color: #EF4444;
}
.profile-nav-item.logout-item:hover {
  background: #FEF2F2;
  border-right-color: #EF4444;
}
.profile-nav-badge {
  margin-right: auto;
  background: var(--melon);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  min-width: 22px;
  text-align: center;
}

/* ─── Main Content Area ─── */
.profile-content {
  min-height: 400px;
}
.profile-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px;
  margin-bottom: 20px;
}
.profile-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--melon-bg);
}
.profile-card-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.profile-card-title i {
  color: var(--melon);
  font-size: 20px;
}
.profile-card-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--melon);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--melon);
  transition: var(--transition);
}
.profile-card-action:hover {
  background: var(--melon);
  color: white;
}

/* ─── Info Rows ─── */
.profile-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.profile-info-item {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  border: 1px solid var(--border-color);
}
.profile-info-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-info-label i {
  font-size: 14px;
  color: var(--melon-light);
}
.profile-info-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.profile-info-value.ltr {
  direction: ltr;
  display: inline-block;
  letter-spacing: 1px;
}

/* ─── Stats Row ─── */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.profile-stat-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 20px 16px;
  text-align: center;
  transition: var(--transition);
}
.profile-stat-card:hover {
  border-color: var(--melon-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.profile-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin: 0 auto 10px;
}
.profile-stat-icon.books { background: #EEF2FF; color: #6366F1; }
.profile-stat-icon.podcasts { background: #FFF7ED; color: #F59E0B; }
.profile-stat-icon.courses { background: #F0FDF4; color: #22C55E; }
.profile-stat-icon.bookmarks { background: #FEF2F2; color: #EF4444; }
.profile-stat-number {
  font-size: 24px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.profile-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── Edit Form ─── */
.profile-form-group {
  margin-bottom: 18px;
}
.profile-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.profile-form-group label i {
  color: var(--melon-light);
  margin-left: 4px;
}
.profile-form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: 'Vazirmatn';
  font-size: 14px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}
.profile-form-input:focus {
  border-color: var(--melon);
  box-shadow: 0 0 0 4px rgba(232,97,77,0.1);
  background: var(--bg-primary);
}
.profile-form-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.profile-form-input.ltr {
  direction: ltr;
  text-align: left;
  letter-spacing: 1px;
}
.profile-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.profile-form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.profile-form-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: var(--melon-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-xl);
  font-family: 'Vazirmatn';
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(232,97,77,0.3);
}
.profile-form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(232,97,77,0.4);
}

/* ─── Purchase / Bookmark List ─── */
.profile-list-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.profile-list-empty i {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
  color: var(--border-color);
}
.profile-list-empty p {
  font-size: 14px;
  margin-bottom: 16px;
}
.profile-list-empty a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--melon-gradient);
  color: white;
  border-radius: var(--radius-xl);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}
.profile-list-empty a:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(232,97,77,0.3);
}

/* Purchase Item */
.purchase-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
  transition: var(--transition);
}
.purchase-item:hover {
  border-color: var(--melon-light);
  box-shadow: var(--shadow-sm);
}
.purchase-cover {
  width: 60px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--border-color);
}
.purchase-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.purchase-info {
  flex: 1;
  min-width: 0;
}
.purchase-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.purchase-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
}
.purchase-meta i {
  font-size: 13px;
}
.purchase-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--melon);
  white-space: nowrap;
}
.purchase-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.purchase-status.success {
  background: #F0FDF4;
  color: #16A34A;
}
.purchase-status.pending {
  background: #FFFBEB;
  color: #D97706;
}
.purchase-status.failed {
  background: #FEF2F2;
  color: #DC2626;
}
[data-theme="dark"] .purchase-status.success { background: rgba(22,163,106,0.15); }
[data-theme="dark"] .purchase-status.pending { background: rgba(217,119,6,0.15); }
[data-theme="dark"] .purchase-status.failed { background: rgba(220,38,38,0.15); }

/* Bookmark Item */
.bookmark-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 10px;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}
.bookmark-item:hover {
  border-color: var(--melon-light);
  box-shadow: var(--shadow-sm);
  color: inherit;
}
.bookmark-cover {
  width: 50px;
  height: 66px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--border-color);
}
.bookmark-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bookmark-info { flex: 1; min-width: 0; }
.bookmark-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bookmark-author {
  font-size: 12px;
  color: var(--text-muted);
}
.bookmark-remove {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.bookmark-remove:hover {
  background: #FEF2F2;
  color: #EF4444;
}

/* ─── Responsive ─── */
@media (max-width: 991px) {
  .profile-grid {
    grid-template-columns: 220px 1fr;
    gap: 16px;
  }
  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 767px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .profile-sidebar {
    position: static;
  }
  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .profile-stat-card {
    padding: 14px 12px;
  }
  .profile-stat-number {
    font-size: 20px;
  }
  .profile-card {
    padding: 20px 16px;
    border-radius: var(--radius-md);
  }
  .profile-info-grid {
    grid-template-columns: 1fr;
  }
  .profile-form-row {
    grid-template-columns: 1fr;
  }
  .purchase-item {
    flex-wrap: wrap;
    gap: 10px;
  }
  .purchase-price {
    width: 100%;
    text-align: left;
  }
}
/* ═══════════════════════════════════════════
   PROFILE / ACCOUNT PAGES
   Uses existing CSS variables & design system
   ═══════════════════════════════════════════ */

/* ─── Profile Layout ─── */
.profile-section {
  padding: 30px 0 60px;
}
.profile-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

/* ─── Sidebar Card ─── */
.profile-sidebar {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: sticky;
  top: calc(var(--header-height, 64px) + 56px + 16px);
}
.profile-avatar-area {
  background: var(--melon-gradient);
  padding: 28px 20px 22px;
  text-align: center;
  position: relative;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 3px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
  margin: 0 auto 12px;
  backdrop-filter: blur(10px);
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.profile-display-name {
  font-size: 16px;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}
.profile-phone {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  direction: ltr;
  display: inline-block;
  letter-spacing: 1px;
}

/* Sidebar Navigation */
.profile-nav {
  padding: 8px 0;
}
.profile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
  border-right: 3px solid transparent;
}
.profile-nav-item:hover {
  background: var(--melon-bg);
  color: var(--melon);
  border-right-color: var(--melon);
}
.profile-nav-item.active {
  background: var(--melon-bg);
  color: var(--melon);
  border-right-color: var(--melon);
  font-weight: 600;
}
.profile-nav-item i {
  font-size: 18px;
  width: 24px;
  text-align: center;
  color: var(--text-muted);
  transition: var(--transition);
}
.profile-nav-item:hover i,
.profile-nav-item.active i {
  color: var(--melon);
}
.profile-nav-divider {
  height: 1px;
  background: var(--border-color);
  margin: 6px 16px;
}
.profile-nav-item.logout-item {
  color: #EF4444;
}
.profile-nav-item.logout-item i {
  color: #EF4444;
}
.profile-nav-item.logout-item:hover {
  background: #FEF2F2;
  border-right-color: #EF4444;
}
.profile-nav-badge {
  margin-right: auto;
  background: var(--melon);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  min-width: 22px;
  text-align: center;
}

/* ─── Main Content Area ─── */
.profile-content {
  min-height: 400px;
}
.profile-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px;
  margin-bottom: 20px;
}
.profile-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--melon-bg);
}
.profile-card-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.profile-card-title i {
  color: var(--melon);
  font-size: 20px;
}
.profile-card-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--melon);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--melon);
  transition: var(--transition);
}
.profile-card-action:hover {
  background: var(--melon);
  color: white;
}

/* ─── Info Rows ─── */
.profile-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.profile-info-item {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  border: 1px solid var(--border-color);
}
.profile-info-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-info-label i {
  font-size: 14px;
  color: var(--melon-light);
}
.profile-info-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.profile-info-value.ltr {
  direction: ltr;
  display: inline-block;
  letter-spacing: 1px;
}

/* ─── Stats Row ─── */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.profile-stat-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 20px 16px;
  text-align: center;
  transition: var(--transition);
}
.profile-stat-card:hover {
  border-color: var(--melon-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.profile-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin: 0 auto 10px;
}
.profile-stat-icon.books { background: #EEF2FF; color: #6366F1; }
.profile-stat-icon.podcasts { background: #FFF7ED; color: #F59E0B; }
.profile-stat-icon.courses { background: #F0FDF4; color: #22C55E; }
.profile-stat-icon.bookmarks { background: #FEF2F2; color: #EF4444; }
.profile-stat-number {
  font-size: 24px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.profile-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── Edit Form ─── */
.profile-form-group {
  margin-bottom: 18px;
}
.profile-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.profile-form-group label i {
  color: var(--melon-light);
  margin-left: 4px;
}
.profile-form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: 'Vazirmatn';
  font-size: 14px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}
.profile-form-input:focus {
  border-color: var(--melon);
  box-shadow: 0 0 0 4px rgba(232,97,77,0.1);
  background: var(--bg-primary);
}
.profile-form-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.profile-form-input.ltr {
  direction: ltr;
  text-align: left;
  letter-spacing: 1px;
}
.profile-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.profile-form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.profile-form-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: var(--melon-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-xl);
  font-family: 'Vazirmatn';
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(232,97,77,0.3);
}
.profile-form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(232,97,77,0.4);
}

/* ─── Purchase / Bookmark List ─── */
.profile-list-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.profile-list-empty i {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
  color: var(--border-color);
}
.profile-list-empty p {
  font-size: 14px;
  margin-bottom: 16px;
}
.profile-list-empty a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--melon-gradient);
  color: white;
  border-radius: var(--radius-xl);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}
.profile-list-empty a:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(232,97,77,0.3);
}

/* Purchase Item */
.purchase-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
  transition: var(--transition);
}
.purchase-item:hover {
  border-color: var(--melon-light);
  box-shadow: var(--shadow-sm);
}
.purchase-cover {
  width: 60px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--border-color);
}
.purchase-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.purchase-info {
  flex: 1;
  min-width: 0;
}
.purchase-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.purchase-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
}
.purchase-meta i {
  font-size: 13px;
}
.purchase-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--melon);
  white-space: nowrap;
}
.purchase-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.purchase-status.success {
  background: #F0FDF4;
  color: #16A34A;
}
.purchase-status.pending {
  background: #FFFBEB;
  color: #D97706;
}
.purchase-status.failed {
  background: #FEF2F2;
  color: #DC2626;
}
[data-theme="dark"] .purchase-status.success { background: rgba(22,163,106,0.15); }
[data-theme="dark"] .purchase-status.pending { background: rgba(217,119,6,0.15); }
[data-theme="dark"] .purchase-status.failed { background: rgba(220,38,38,0.15); }

/* Bookmark Item */
.bookmark-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 10px;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}
.bookmark-item:hover {
  border-color: var(--melon-light);
  box-shadow: var(--shadow-sm);
  color: inherit;
}
.bookmark-cover {
  width: 50px;
  height: 66px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--border-color);
}
.bookmark-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bookmark-info { flex: 1; min-width: 0; }
.bookmark-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bookmark-author {
  font-size: 12px;
  color: var(--text-muted);
}
.bookmark-remove {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.bookmark-remove:hover {
  background: #FEF2F2;
  color: #EF4444;
}

/* ─── Responsive ─── */
@media (max-width: 991px) {
  .profile-grid {
    grid-template-columns: 220px 1fr;
    gap: 16px;
  }
  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 767px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .profile-sidebar {
    position: static;
  }
  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .profile-stat-card {
    padding: 14px 12px;
  }
  .profile-stat-number {
    font-size: 20px;
  }
  .profile-card {
    padding: 20px 16px;
    border-radius: var(--radius-md);
  }
  .profile-info-grid {
    grid-template-columns: 1fr;
  }
  .profile-form-row {
    grid-template-columns: 1fr;
  }
  .purchase-item {
    flex-wrap: wrap;
    gap: 10px;
  }
  .purchase-price {
    width: 100%;
    text-align: left;
  }
}

/* ═══════════════════════════════════════════
   PROFILE / ACCOUNT PAGES
   Uses existing CSS variables & design system
   ═══════════════════════════════════════════ */

/* ─── Profile Layout ─── */
.profile-section {
  padding: 30px 0 60px;
}
.profile-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

/* ─── Sidebar Card ─── */
.profile-sidebar {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: sticky;
  top: calc(var(--header-height, 64px) + 56px + 16px);
}
.profile-avatar-area {
  background: var(--melon-gradient);
  padding: 28px 20px 22px;
  text-align: center;
  position: relative;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 3px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
  margin: 0 auto 12px;
  backdrop-filter: blur(10px);
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.profile-display-name {
  font-size: 16px;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}
.profile-phone {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  direction: ltr;
  display: inline-block;
  letter-spacing: 1px;
}

/* Sidebar Navigation */
.profile-nav {
  padding: 8px 0;
}
.profile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
  border-right: 3px solid transparent;
}
.profile-nav-item:hover {
  background: var(--melon-bg);
  color: var(--melon);
  border-right-color: var(--melon);
}
.profile-nav-item.active {
  background: var(--melon-bg);
  color: var(--melon);
  border-right-color: var(--melon);
  font-weight: 600;
}
.profile-nav-item i {
  font-size: 18px;
  width: 24px;
  text-align: center;
  color: var(--text-muted);
  transition: var(--transition);
}
.profile-nav-item:hover i,
.profile-nav-item.active i {
  color: var(--melon);
}
.profile-nav-divider {
  height: 1px;
  background: var(--border-color);
  margin: 6px 16px;
}
.profile-nav-item.logout-item {
  color: #EF4444;
}
.profile-nav-item.logout-item i {
  color: #EF4444;
}
.profile-nav-item.logout-item:hover {
  background: #FEF2F2;
  border-right-color: #EF4444;
}
.profile-nav-badge {
  margin-right: auto;
  background: var(--melon);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  min-width: 22px;
  text-align: center;
}

/* ─── Main Content Area ─── */
.profile-content {
  min-height: 400px;
}
.profile-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px;
  margin-bottom: 20px;
}
.profile-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--melon-bg);
}
.profile-card-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.profile-card-title i {
  color: var(--melon);
  font-size: 20px;
}
.profile-card-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--melon);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--melon);
  transition: var(--transition);
}
.profile-card-action:hover {
  background: var(--melon);
  color: white;
}

/* ─── Info Rows ─── */
.profile-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.profile-info-item {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  border: 1px solid var(--border-color);
}
.profile-info-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-info-label i {
  font-size: 14px;
  color: var(--melon-light);
}
.profile-info-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.profile-info-value.ltr {
  direction: ltr;
  display: inline-block;
  letter-spacing: 1px;
}

/* ─── Stats Row ─── */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.profile-stat-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 20px 16px;
  text-align: center;
  transition: var(--transition);
}
.profile-stat-card:hover {
  border-color: var(--melon-light);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.profile-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin: 0 auto 10px;
}
.profile-stat-icon.books { background: #EEF2FF; color: #6366F1; }
.profile-stat-icon.podcasts { background: #FFF7ED; color: #F59E0B; }
.profile-stat-icon.courses { background: #F0FDF4; color: #22C55E; }
.profile-stat-icon.bookmarks { background: #FEF2F2; color: #EF4444; }
.profile-stat-number {
  font-size: 24px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.profile-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── Edit Form ─── */
.profile-form-group {
  margin-bottom: 18px;
}
.profile-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.profile-form-group label i {
  color: var(--melon-light);
  margin-left: 4px;
}
.profile-form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: 'Vazirmatn';
  font-size: 14px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}
.profile-form-input:focus {
  border-color: var(--melon);
  box-shadow: 0 0 0 4px rgba(232,97,77,0.1);
  background: var(--bg-primary);
}
.profile-form-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.profile-form-input.ltr {
  direction: ltr;
  text-align: left;
  letter-spacing: 1px;
}
.profile-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.profile-form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.profile-form-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: var(--melon-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-xl);
  font-family: 'Vazirmatn';
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(232,97,77,0.3);
}
.profile-form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(232,97,77,0.4);
}

/* ─── Purchase / Bookmark List ─── */
.profile-list-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.profile-list-empty i {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
  color: var(--border-color);
}
.profile-list-empty p {
  font-size: 14px;
  margin-bottom: 16px;
}
.profile-list-empty a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--melon-gradient);
  color: white;
  border-radius: var(--radius-xl);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}
.profile-list-empty a:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(232,97,77,0.3);
}

/* Purchase Item */
.purchase-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
  transition: var(--transition);
}
.purchase-item:hover {
  border-color: var(--melon-light);
  box-shadow: var(--shadow-sm);
}
.purchase-cover {
  width: 60px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--border-color);
}
.purchase-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.purchase-info {
  flex: 1;
  min-width: 0;
}
.purchase-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.purchase-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
}
.purchase-meta i {
  font-size: 13px;
}
.purchase-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--melon);
  white-space: nowrap;
}
.purchase-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.purchase-status.success {
  background: #F0FDF4;
  color: #16A34A;
}
.purchase-status.pending {
  background: #FFFBEB;
  color: #D97706;
}
.purchase-status.failed {
  background: #FEF2F2;
  color: #DC2626;
}
[data-theme="dark"] .purchase-status.success { background: rgba(22,163,106,0.15); }
[data-theme="dark"] .purchase-status.pending { background: rgba(217,119,6,0.15); }
[data-theme="dark"] .purchase-status.failed { background: rgba(220,38,38,0.15); }

/* Bookmark Item */
.bookmark-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 10px;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}
.bookmark-item:hover {
  border-color: var(--melon-light);
  box-shadow: var(--shadow-sm);
  color: inherit;
}
.bookmark-cover {
  width: 50px;
  height: 66px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--border-color);
}
.bookmark-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bookmark-info { flex: 1; min-width: 0; }
.bookmark-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bookmark-author {
  font-size: 12px;
  color: var(--text-muted);
}
.bookmark-remove {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.bookmark-remove:hover {
  background: #FEF2F2;
  color: #EF4444;
}

/* Purchase Cover Placeholder */
.purchase-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 22px;
  background: var(--bg-secondary);
}

/* Purchase Status: Refunded */
.purchase-status.refunded {
  background: #F5F3FF;
  color: #7C3AED;
}
[data-theme="dark"] .purchase-status.refunded { background: rgba(124,58,237,0.15); }

/* ─── Support / Ticket ─── */
.support-alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.support-alert-success { background: #F0FDF4; color: #16A34A; border: 1px solid #BBF7D0; }
.support-alert-error   { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
.support-alert-info    { background: var(--melon-bg); color: var(--melon); border: 1px solid var(--melon-light); }
[data-theme="dark"] .support-alert-success { background: rgba(22,163,106,0.1); border-color: rgba(22,163,106,0.3); }
[data-theme="dark"] .support-alert-error   { background: rgba(220,38,38,0.1); border-color: rgba(220,38,38,0.3); }

/* Ticket List Item */
.ticket-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}
.ticket-item:hover {
  border-color: var(--melon-light);
  box-shadow: var(--shadow-sm);
  color: inherit;
}
.ticket-status-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.ticket-answered   { background: #F0FDF4; color: #16A34A; }
.ticket-processing { background: #EEF2FF; color: #6366F1; }
.ticket-pending    { background: #FFFBEB; color: #D97706; }
.ticket-closed     { background: var(--bg-secondary); color: var(--text-muted); }
[data-theme="dark"] .ticket-answered   { background: rgba(22,163,106,0.15); }
[data-theme="dark"] .ticket-processing { background: rgba(99,102,241,0.15); }
[data-theme="dark"] .ticket-pending    { background: rgba(217,119,6,0.15); }

.ticket-info { flex: 1; min-width: 0; }
.ticket-subject {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ticket-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ticket-meta i { font-size: 12px; }

.ticket-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ticket-badge-success { background: #F0FDF4; color: #16A34A; }
.ticket-badge-info    { background: #EEF2FF; color: #6366F1; }
.ticket-badge-warning { background: #FFFBEB; color: #D97706; }
.ticket-badge-muted   { background: var(--bg-secondary); color: var(--text-muted); }
[data-theme="dark"] .ticket-badge-success { background: rgba(22,163,106,0.15); }
[data-theme="dark"] .ticket-badge-info    { background: rgba(99,102,241,0.15); }
[data-theme="dark"] .ticket-badge-warning { background: rgba(217,119,6,0.15); }

.ticket-arrow {
  color: var(--text-muted);
  font-size: 14px;
  flex-shrink: 0;
}

/* Ticket Detail Meta */
.ticket-detail-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}
.ticket-detail-meta i {
  color: var(--melon-light);
  margin-left: 4px;
}

/* Ticket Message Bubble */
.ticket-message {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  border: 1px solid var(--border-color);
}
.ticket-message-user {
  background: var(--bg-secondary);
}
.ticket-message-staff {
  background: var(--melon-bg);
  border-color: var(--melon-light);
}
.ticket-message-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.ticket-message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}
.ticket-message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ticket-message-avatar.staff-avatar {
  background: var(--melon);
  color: white;
}
.ticket-message-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.ticket-message-time {
  font-size: 11px;
  color: var(--text-muted);
}
.ticket-message-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 2;
}

/* ─── Responsive ─── */
@media (max-width: 991px) {
  .profile-grid {
    grid-template-columns: 220px 1fr;
    gap: 16px;
  }
  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 767px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .profile-sidebar {
    position: static;
  }
  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .profile-stat-card {
    padding: 14px 12px;
  }
  .profile-stat-number {
    font-size: 20px;
  }
  .profile-card {
    padding: 20px 16px;
    border-radius: var(--radius-md);
  }
  .profile-info-grid {
    grid-template-columns: 1fr;
  }
  .profile-form-row {
    grid-template-columns: 1fr;
  }
  .purchase-item {
    flex-wrap: wrap;
    gap: 10px;
  }
  .purchase-price {
    width: 100%;
    text-align: left;
  }
}