/* =========================================================
   0. MODERN TOKENS & SYSTEM DESIGN (The Source of Truth)
   ========================================================= */
   :root {
    /* Brand Palette - Deep & Premium */
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --accent-color: #f59e0b;
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-alt: #f1f5f9;
    --text-main: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    /* Shadows - Layered & Realistic */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

    /* Spacing & Radius */
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
}

/* =========================================================
   1. GLOBAL RESETS & FOUNDATION
   ========================================================= */
/* ============================================================
   Typography & Body Styles (مدرن‌سازی فونت با وزن‌های تفکیک‌شده)
   ============================================================ */
body {
    font-family: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400; /* وزن استاندارد متن بدنه */
    line-height: 1.75;
    background-color: var(--bg-main);
    color: var(--text-body);
    direction: rtl;
    text-align: right;
    margin: 0;
    
}

/* تیترهای بزرگ و جذاب با وزن فوق ضخیم */
h1, h2, h3, .hero-title {
    font-family: "Vazirmatn", sans-serif;
    font-weight: 800; /* بسیار ضخیم و خوانا برای عناوین اصلی */
    letter-spacing: -0.02em;
    color: var(--text-main);
}

/* تیترهای متوسط با وزن ضخیم */
h4, h5, h6, .card-title, .rail-header__title {
    font-family: "Vazirmatn", sans-serif;
    font-weight: 700; /* ضخیم برای زیرعنوان‌ها و کارت‌ها */
    color: var(--text-main);
}

/* دکمه‌ها، منوها و عناصر ناوبری با وزن متوسط و خوانا */
.btn, .nav-link, .badge, .category-chip, .tag-link {
    font-family: "Vazirmatn", sans-serif;
    font-weight: 500; /* وزن متوسط جهت برجستگی دکمه‌ها و منوها */
}

/* متن‌های کوچک یا فرعی با وزن سبک */
.text-muted, .book-sub, .small, footer p {
    font-weight: 300; /* وزن سبک برای خوانایی راحت در سایز کوچک */
}

img { max-width: 100%; height: auto; display: inline-block; }
svg { max-width: 100%; vertical-align: middle; width: 24px; height: 24px; }

/* =========================================================
   2. HERO SECTION - STOREFRONT STYLE
   ========================================================= */
.modern-hero {
    position: relative;
    padding: 100px 0;
    background: #0f172a; /* Dark base for contrast */
    overflow: hidden;
    color: white;
    margin-bottom: 3rem;
}

.modern-hero::before {
    content: "";
    position: absolute;
    top: -10%;
    left: -10%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    filter: blur(60px);
}

.hero-badge {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: linear-gradient(to bottom left, #fff 60%, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text; /* استاندارد اضافه شد */
    -webkit-text-fill-color: transparent;
}

.hero-subtitle,
.hero-tagline,
.hero-caption {
    color: #ffffff !important;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.floating-book {
    width: 300px;
    height: 420px;
    background: #fff;
    border-radius: 4px 12px 12px 4px;
    box-shadow: var(--shadow-xl);
    transform: rotateY(-20deg) rotateX(10deg);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotateY(-20deg) rotateX(10deg); }
    50% { transform: translateY(-20px) rotateY(-15deg) rotateX(5deg); }
}

/* =========================================================
   3. NAVBAR & NAVIGATION
   ========================================================= */
.air-navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.air-navbar .nav-link {
    font-size: 0.9rem !important;
    padding: 0.5rem 0.7rem !important;
}

.air-navbar .navbar-brand span {
    font-size: 1.1rem !important;
}

.air-navbar .btn {
    font-size: 0.85rem !important;
    padding: 0.4rem 1rem !important;
}

@media (max-width: 992px) {
    .air-navbar .nav-link {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.5rem !important;
    }
    .air-search-form {
        max-width: 180px !important;
    }
}
.air-search-form .input-group {
    width: 100%;
}
.air-search-form .form-control {
    height: 42px;
    border: 1px solid var(--airbook-border, #e2e8f0);
    border-radius: 8px 0 0 8px !important;
    padding: 0 16px;
    font-size: 0.95rem;
    background: var(--airbook-surface-2, #f9fbff);
}

.air-search-form .btn {
    height: 42px;
    border-radius: 0 8px 8px 0 !important;
    padding: 0 18px;
}
.air-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
    font-weight: 900;
    font-size: 1.5rem;
    text-decoration: none;
}

.air-search-form {
    flex: 1 1 auto;
    max-width: 500px;
    min-width: 160px;
    display: flex;
    background: var(--bg-main);
    border-radius: 50px;
    padding: 10px 20px;
    border: 2px solid transparent;
    transition: var(--transition-fast);
    
}

.air-search-form:focus-within {
    border-color: var(--primary-color);
    background: white;
    box-shadow: var(--shadow-md);
}

/* =========================================================
   4. DASHBOARD, BILLING & NOTIFICATIONS
   ========================================================= */
.billing-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: var(--transition-normal);
}

.billing-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 360px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    border: 1px solid var(--border-color);
}

/* =========================================================
   5. BOOK COMPONENTS (RATING, BADGES, ETC)
   ========================================================= */
.section-title {
    font-weight: 800;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.star-rating { display: flex; align-items: center; gap: 4px; }
.star.full { color: var(--accent-color); }
.star.empty { color: #d1d5db; }

.badge-trending {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 900;
    padding: 4px 10px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    background: white;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition-normal);
    border: 1px solid var(--border-color);
}

.category-card:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* =========================================================
   6. ENTERPRISE & ACTIVITY (Preserved)
   ========================================================= */
.metric-card {
    background: #fff;
    padding: 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.activity-item:hover { background: var(--bg-main); }

/* =========================================================
   7. ADVANCED BOOK CARD ARCHITECTURE
   ========================================================= */
   .book-card {
    background: var(--bg-surface);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    border-color: var(--primary-color);
}

.book-cover {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--bg-surface-alt);
    flex-shrink: 0; /* جلوگیری از کوچک شدن */
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* تغییر از cover به contain برای نمایش کامل */
    display: block;
}

.book-card:hover .book-cover img {
    transform: scale(1.05);
}


/* Overlay Actions on Cover */
.cover-actions {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    bottom: 10px;
    gap: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 10;
}

.book-card:hover .cover-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-blur-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
    cursor: pointer;
    
}

.action-blur-btn:hover {
    background: var(--primary-color);
    color: white;
}

.book-meta {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.book-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8rem;
}

.book-title a {
    color: var(--text-main);
    text-decoration: none;
}
.book-title a:hover {
    color: var(--primary-color);
}

.book-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.rec-reason {
    font-size: 0.75rem;
    background: #eff6ff;
    color: #1e40af;
    padding: 4px 10px;
    border-radius: 50px;
    margin-top: 8px;
    border-right: 3px solid #3b82f6;
    text-align: right;
}

/* =========================================================
   9. STAR RATING COMPONENT
   ========================================================= */
   .star-rating {
    display: inline-flex;
    direction: ltr; /* جهت ستاره‌ها همیشه LTR است */
}
.star-rating .star {
    font-size: 1rem;
    color: var(--accent-color);
}
.star-rating .star.empty {
    color: var(--border-color);
}

/* Badge colors */
.badge-new { background: #3b82f6; color: white; }
.badge-hot {
    background: #ef4444;
}
/* Badge‌ها */
.book-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 5;
}

.badge-p2p {
    background: #8b5cf6;
    color: white;
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 50px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}
.badge-gold { background: #f59e0b; color: #1a1a1a; }
.badge-personal { background: #10b981; color: white; }
/* Autocomplete dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15);
    margin-top: 6px;
    padding: 8px 0;
    display: none;
    z-index: 999;
    max-height: 320px;
    overflow-y: auto;
}
.autocomplete-dropdown.active {
    display: block;
}
.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--home-text);
    transition: 0.15s;
}
.autocomplete-item:hover {
    background: var(--home-soft);
}
.autocomplete-item img {
    width: 36px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    background: #e2e8f0;
}
.autocomplete-item .info {
    flex: 1;
}
.autocomplete-item .title {
    font-weight: 800;
    font-size: 0.95rem;
}
.autocomplete-item .author {
    font-size: 0.85rem;
    color: var(--home-muted);
}
.no-result {
    padding: 14px 16px;
    color: var(--home-muted);
    text-align: center;
}

/* ============================================================
   Dark Mode Variables
   ============================================================ */
   body.dark-mode {
    --bg-main: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-alt: #334155;
    --text-main: #f1f5f9;
    --text-body: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);
    --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.6);
    --home-bg: #0f172a;
    --home-card: #1e293b;
    --home-text: #f1f5f9;
    --home-muted: #94a3b8;
    --home-border: #334155;
    --home-soft: #1e293b;
    --list-bg: #0f172a;
    --list-card: #1e293b;
    --list-text: #f1f5f9;
    --list-muted: #94a3b8;
    --list-border: #334155;
    --list-soft: #1e293b;
    --p2p-bg: #0f172a;
    --p2p-card: #1e293b;
    --p2p-text: #f1f5f9;
    --p2p-muted: #94a3b8;
    --p2p-border: #334155;
    --p2p-soft: #1e293b;
}

/* Navbar dark */
body.dark-mode .air-navbar {
    background: rgba(15, 23, 42, 0.95);
    border-bottom-color: #334155;
}
body.dark-mode .air-navbar .nav-link,
body.dark-mode .air-navbar .navbar-brand {
    color: #e2e8f0;
}
body.dark-mode .air-search-form {
    background: #1e293b;
    border-color: #334155;
}
body.dark-mode .air-search-form:focus-within {
    border-color: var(--primary-color);
    background: #1e293b;
}
body.dark-mode .dropdown-menu {
    background-color: #1e293b;
    border-color: #334155;
}
body.dark-mode .dropdown-item {
    color: #e2e8f0;
}
body.dark-mode .dropdown-item:hover {
    background-color: #334155;
}
body.dark-mode .btn-outline-secondary {
    color: #94a3b8;
    border-color: #475569;
}
body.dark-mode .btn-outline-secondary:hover {
    background-color: #334155;
    color: #f1f5f9;
}
body.dark-mode .alert,
body.dark-mode .card,
body.dark-mode .modal-content,
body.dark-mode .panel,
body.dark-mode .metric-card,
body.dark-mode .chart-card,
body.dark-mode .table-card,
body.dark-mode .health-card,
body.dark-mode .ai-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}
body.dark-mode .text-muted {
    color: #94a3b8 !important;
}
body.dark-mode .border-bottom,
body.dark-mode .border-top,
body.dark-mode .border-start,
body.dark-mode .border-end {
    border-color: #334155 !important;
}
body.dark-mode .modal-header,
body.dark-mode .modal-footer {
    border-color: #334155;
}
body.dark-mode .form-control,
body.dark-mode .input,
body.dark-mode .textarea,
body.dark-mode .select,
body.dark-mode .filter-input,
body.dark-mode .filter-select {
    background-color: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}
body.dark-mode .form-control:focus,
body.dark-mode .input:focus,
body.dark-mode .textarea:focus,
body.dark-mode .select:focus {
    background-color: #0f172a;
    border-color: var(--primary-color);
    color: #e2e8f0;
}
body.dark-mode .hero-search input {
    background: #0f172a;
    color: #e2e8f0;
}
body.dark-mode .hero-search input::placeholder {
    color: #64748b;
}

/* ============================================================
   Mobile / Touch Improvements
   ============================================================ */

/* دکمه‌ها و لینک‌های بزرگ‌تر برای لمس */
.btn, 
.nav-link,
.dropdown-item,
input[type="submit"],
input[type="button"],
button {
    min-height: 44px;
    min-width: 44px;
}

/* حذف هایلایت آبی در iOS */
* {
    -webkit-tap-highlight-color: transparent;
}

/* اسکرول نرم */
html {
    scroll-behavior: smooth;
}

/* بهینه‌سازی برای صفحه‌های کوچک */
@media (max-width: 576px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .review-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 10px;
        align-items: stretch;
    }

    .book-card {
        border-radius: 12px;
    }
    
    .book-title {
        font-size: 0.85rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
}

/* Safe area برای نوتچ‌ها (iPhone) */
@supports (padding: max(0px)) {
    body {
        padding-left: min(0px, env(safe-area-inset-left));
        padding-right: min(0px, env(safe-area-inset-right));
        padding-bottom: min(0px, env(safe-area-inset-bottom));
    }
}

/* استایل بخش بنرهای تبلیغاتی */
.promo-banners-section .carousel-item {
    transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
}

.promo-sub-banner {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.promo-sub-banner:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

/* رنگ‌های پشتیبان */
.text-indigo-900 {
    color: #1e1b4b;
}
.text-purple-900 {
    color: #581c87;
}

/* =========================================================
   PROMO BANNER GRID - AIRBOOK HOMEPAGE
   ========================================================= */
.promo-banner-section {
    margin: 0 0 2.5rem;
}

.promo-banner-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 20px;
    align-items: stretch;
}

.promo-banner {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(99, 102, 241, 0.14);
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 30%),
        linear-gradient(135deg, #4f46e5 0%, #6366f1 45%, #7c3aed 100%);
    box-shadow: var(--shadow-lg);
}

.promo-banner-main {
    min-height: 320px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
    align-items: center;
}

.promo-banner-content {
    position: relative;
    z-index: 2;
    padding: 32px;
    color: #fff;
}

.promo-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #e0e7ff;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 18px;
    backdrop-filter: blur(8px);
}

.promo-title {
    color: #fff;
    font-size: 2rem;
    line-height: 1.35;
    margin-bottom: 14px;
}

.promo-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.9;
    max-width: 95%;
    margin-bottom: 20px;
}

.promo-feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.promo-feature-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #f8fafc;
    font-size: 0.82rem;
    font-weight: 600;
}

.promo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.promo-btn-primary,
.promo-btn-secondary {
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 700;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.promo-btn-primary {
    background: #fff;
    color: #312e81;
    border: 1px solid transparent;
}

.promo-btn-primary:hover {
    background: #eef2ff;
    color: #312e81;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.promo-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
}

.promo-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    transform: translateY(-2px);
}

.promo-banner-visual {
    position: relative;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.promo-banner-wrapper {
    position: relative;
    overflow: hidden; /* جلوگیری از بیرون زدن المان‌ها در موبایل */
}
/* توده کتاب‌ها در سمت چپ */
.promo-book-stack {
    position: relative;
    width: 220px;
    height: 220px;
    z-index: 2;
}

/* استایل پایه برای کارت‌های آماری شناور */
.promo-stat-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.9); /* پس‌زمینه شیشه‌ای شیک برای کنتراست با بنر بنفش */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 10px 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 3; /* مقدار بالاتر از کتاب‌ها تا متن هرگز زیر کتاب نرود */
    display: flex;
    flex-direction: column;
    pointer-events: none; /* جلوگیری از مزاحمت برای کلیک روی دکمه‌ها */
    transition: all 0.3s ease;
}

/* استایل متون داخل کارت */
.promo-stat-card strong {
    color: #1e1b4b; /* رنگ تیره و خوانا */
    font-size: 0.9rem;
    font-weight: bold;
}

.promo-stat-card small {
    color: #4f46e5;
    font-size: 0.75rem;
    margin-top: 4px;
}

/* --- موقعیت‌یابی هوشمند سازگار با RTL --- */

/* کارت بالایی (چالش‌ها): هدایت به سمت راست بالای توده کتاب‌ها */
.promo-stat-card-top {
    top: 20%;
    /* استفاده از ویژگی‌های منطقی (Logical Properties) برای سازگاری کامل با RTL/LTR */
    inset-inline-start: 15%; 
}

/* کارت پایینی (دستاوردها): هدایت به سمت چپ پایین توده کتاب‌ها */
.promo-stat-card-bottom {
    bottom: 15%;
    inset-inline-start: 5%;
}

/* غیرفعال کردن کارت‌های شناور در موبایل برای جلوگیری از شلوغی صفحه */
@media (max-width: 768px) {
    .promo-stat-card {
        display: none;
    }
}
.promo-book {
    position: absolute;
    bottom: 0;
    width: 84px;
    height: 150px;
    border-radius: 12px 10px 10px 12px;
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.promo-book::after {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    right: 10px;
    width: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
}

.promo-book-1 {
    right: 12px;
    transform: rotate(10deg);
    background: linear-gradient(180deg, #f59e0b 0%, #f97316 100%);
}

.promo-book-2 {
    right: 66px;
    bottom: 12px;
    transform: rotate(-2deg);
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

.promo-book-3 {
    right: 122px;
    bottom: 4px;
    transform: rotate(-14deg);
    background: linear-gradient(180deg, #38bdf8 0%, #2563eb 100%);
}

.promo-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(16px);
    opacity: 0.55;
}

.promo-glow-1 {
    width: 140px;
    height: 140px;
    background: rgba(255, 255, 255, 0.18);
    top: 38px;
    left: 24px;
}

.promo-glow-2 {
    width: 120px;
    height: 120px;
    background: rgba(245, 158, 11, 0.22);
    bottom: 24px;
    right: 30px;
}

.promo-side-cards {
    display: grid;
    gap: 20px;
}

.promo-side-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    min-height: 150px;
    padding: 24px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
    overflow: hidden;
}

.promo-side-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.28);
    color: var(--text-main);
}

.promo-side-card::before {
    content: "";
    position: absolute;
    inset: auto auto -35px -35px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    opacity: 0.16;
}

.promo-side-card-warm {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fed7aa;
}

.promo-side-card-warm::before {
    background: #fb923c;
}

.promo-side-card-soft {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border-color: #ddd6fe;
}

.promo-side-card-soft::before {
    background: #8b5cf6;
}

.promo-side-kicker {
    position: relative;
    z-index: 2;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--primary-color);
}

.promo-side-card strong {
    position: relative;
    z-index: 2;
    font-size: 1.05rem;
    line-height: 1.7;
}

.promo-side-card small {
    position: relative;
    z-index: 2;
    font-size: 0.88rem;
    line-height: 1.8;
    color: var(--text-muted);
}

body.dark-mode .promo-side-card {
    border-color: var(--border-color);
    color: var(--text-main);
}

body.dark-mode .promo-side-card:hover {
    border-color: rgba(129, 140, 248, 0.45);
}

body.dark-mode .promo-side-card-warm {
    background: linear-gradient(135deg, rgba(124, 45, 18, 0.38) 0%, rgba(154, 52, 18, 0.24) 100%);
    border-color: rgba(251, 146, 60, 0.22);
}

body.dark-mode .promo-side-card-soft {
    background: linear-gradient(135deg, rgba(76, 29, 149, 0.32) 0%, rgba(91, 33, 182, 0.2) 100%);
    border-color: rgba(167, 139, 250, 0.2);
}

body.dark-mode .promo-side-card small {
    color: #cbd5e1;
}

@media (max-width: 991.98px) {
    .promo-banner-grid {
        grid-template-columns: 1fr;
    }

    .promo-banner-main {
        grid-template-columns: 1fr;
    }

    .promo-banner-visual {
        min-height: 220px;
        padding-top: 0;
    }

    .promo-side-cards {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767.98px) {
    .promo-banner-content {
        padding: 24px 20px;
    }

    .promo-title {
        font-size: 1.55rem;
    }

    .promo-text {
        max-width: 100%;
        font-size: 0.95rem;
    }

    .promo-side-cards {
        grid-template-columns: 1fr;
    }

    .promo-book-stack {
        transform: scale(0.92);
    }
}

@media (max-width: 575.98px) {
    .promo-banner-main {
        min-height: auto;
    }

    .promo-badge {
        font-size: 0.75rem;
    }

    .promo-feature-chip {
        width: 100%;
        justify-content: center;
    }

    .promo-actions {
        flex-direction: column;
    }

    .promo-btn-primary,
    .promo-btn-secondary {
        width: 100%;
    }

    .promo-banner-visual {
        min-height: 180px;
        padding: 8px 20px 24px;
    }
}

.airbook-footer {
    direction: rtl;
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
    color: #e5e7eb;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.12);
}

.airbook-footer a {
    color: #3b82f6;
    text-decoration: none;
}

.airbook-footer a:hover {
    text-decoration: underline;
}
.navbar-brand img {
      width: 40px;
      height: 40px;
      object-fit: contain;
}
.footer-logo {
    height: 56px;
    width: 56px;
    object-fit: contain;
    display: block;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.footer-brand-title {
    font-weight: 800;
    color: #f9fafb;
    font-size: 1.15rem;
}

.footer-brand-text,
.footer-text,
.footer-copy,
.footer-meta {
    color: #cbd5e1;
}
.footer-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.footer-heading {
    color: #f8fafc;
    font-weight: 800;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-links li {
    margin-bottom: 0.65rem;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s ease;
}

.footer-links a:hover {
    color: #ffffff;
    padding-right: 4px;
}

.footer-divider {
    border-color: rgba(255, 255, 255, 0.12);
}

.social-btn {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.social-btn:hover {
    background: #f59e0b;
    color: #111827;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(245, 158, 11, 0.25);
}

.home-categories-section {
    direction: rtl;
}

.section-title {
    font-weight: 900;
    color: #111827;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
}

.section-subtitle {
    color: #6b7280;
    font-size: 0.95rem;
}

/* --- بخش دسته‌ها (Category Chips) --- */
.category-grid {
    display: flex;
    flex-wrap: nowrap;          /* جلوگیری از شکستن خط */
    overflow-x: auto;          /* فعال کردن اسکرول افقی */
    gap: 12px;                 /* فاصله بین چیپ‌ها */
    padding: 10px 0;
    scrollbar-width: none;     /* مخفی کردن اسکرول‌بار در فایرفاکس */
    -ms-overflow-style: none;  /* مخفی کردن اسکرول‌بار در IE/Edge */
}

/* مخفی کردن اسکرول‌بار در کروم/سافاری */
.category-grid::-webkit-scrollbar {
    display: none;
}

.category-chip {
    flex: 0 0 auto;            /* جلوگیری از فشرده شدن کارت‌ها */
    white-space: nowrap;       /* متن داخل چیپ در یک خط بماند */
    padding: 8px 16px;
}
.category-grid .category-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    background: #f5f7ff;
    border: 1px solid #d9e2ff;
    text-decoration: none;
    transition: all 0.2s ease;
}

.category-grid .category-chip:hover {
    background: #e8efff;
    transform: translateY(-1px);
}

.category-promo-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
    border-radius: 24px;
    overflow: hidden;
    min-height: 240px;
    border: 1px solid rgba(37, 99, 235, 0.08);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    transition: all 0.25s ease;
}

.category-promo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.10);
}

.category-promo-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.25rem 1.25rem 1rem;
    min-height: 240px;
    direction: rtl;
}

.category-promo-text {
    flex: 1 1 58%;
    text-align: right;
}

.category-promo-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: #111827;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.category-promo-desc {
    color: #475569;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.8;
}

.category-promo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #facc15;
    color: #111827;
    font-weight: 800;
    padding: 0.65rem 1.1rem;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(250, 204, 21, 0.25);
}

.category-promo-image {
    flex: 1 1 42%;
    display: flex;
    align-items: end;
    justify-content: center;
}

.category-promo-image img {
    max-width: 100%;
    height: 190px;
    object-fit: contain;
}
.home-feature-cards { direction: rtl; }

.home-feature-cards .section-title{
  font-weight: 900;
  color: #0f172a;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
}
.home-feature-cards .section-subtitle{
  color: #64748b;
  font-size: .95rem;
}
/* --- بخش کارت‌های ویژگی (Feature Cards) --- */
.feature-cards-container {
    display: flex;
    flex-wrap: nowrap;         /* کارت‌ها در یک خط بمانند */
    overflow-x: auto;          /* اسکرول افقی */
    gap: 20px;                 /* فاصله بین کارت‌ها */
    padding: 20px 0;
    scrollbar-width: none;
}
.feature-cards-container::-webkit-scrollbar {
    display: none;
}
.feature-card{
  display:block;
  flex: 0 0 280px;           /* عرض ثابت هر کارت (قابل تغییر) */
  display: block;
  text-decoration:none;
  color:inherit;
  background: #eaf4ff;
  border-radius: 26px;
  overflow:hidden;
  border: 1px solid rgba(15, 23, 42, .06);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
  transition: transform .2s ease, box-shadow .2s ease;
  min-height: 210px;
}
.feature-card:hover{
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .10);
}

.feature-card-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem;
  min-height: 210px;
}

.feature-card-media{
  flex: 0 0 42%;
  display:flex;
  align-items:center;
  justify-content:center;
}
.feature-card-media img{
  width: 100%;
  max-width: 260px;
  height: 170px;
  object-fit: contain;
}
.feature-card:hover .feature-card-media img {
    transform: scale(1.04);
}   

.feature-card-body{
  flex: 1 1 auto;
}

.feature-card-title{
  font-weight: 900;
  color: #0f172a;
  font-size: 1.35rem;
  line-height: 1.5;
  margin-bottom: .75rem;
}
.feature-card-subtitle{
  color: #475569;
  line-height: 1.9;
  font-size: .95rem;
  margin-bottom: 1rem;
}

.feature-card-cta{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#facc15;
  color:#111827;
  font-weight:900;
  padding:.6rem 1.2rem;
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(250, 204, 21, .28);
}
.feature-card-cta::after {
    content: "←";
    transition: transform 0.2s ease;
}

.feature-card:hover .feature-card-cta::after {
    transform: translateX(-4px);
}

/* حالت تاریک */
body.dark-mode .feature-card {
    background: var(--bg-surface, #1e293b);
    border-color: var(--border-color, #334155);
}

body.dark-mode .feature-card-title {
    color: var(--text-main, #f1f5f9);
}

body.dark-mode .feature-card-subtitle {
    color: var(--text-muted, #94a3b8);
}
/* ریسپانسیو */
@media (max-width: 576px) {
    .feature-card-title {
        font-size: 0.95rem;
    }
    .feature-card-subtitle {
        font-size: 0.82rem;
    }
    .feature-card-body {
        padding: 14px 16px 16px;
    }
}

.book-rail {
  margin-bottom: 2.5rem;
}

.rail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.rail-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #222;
}

.rail-scroll {
    display: flex;             /* استفاده از فلکس برای اسکرول افقی راحت‌تر */
    flex-wrap: nowrap;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    padding: 8px 4px 12px;
    padding-bottom: 1rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-surface-alt);
    -ms-overflow-style: none;
}
.rail-scroll::-webkit-scrollbar {
  height: 6px;
}

.rail-scroll::-webkit-scrollbar-track {
    background: var(--bg-surface-alt);
    border-radius: 10px;
}
.rail-scroll::-webkit-scrollbar-thumb {
  background: #f4a62a;
  border-radius: 10px;
}

.book-rail .book-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 190px;
  height: 100%;
  width: 190px;
  scroll-snap-align: start;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.book-author {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* اندازه کارت‌های ریل در تبلت */
@media (max-width: 768px) {
  .book-rail .book-card {
    flex-basis: 165px;
    width: 165px;
  }

  .rail-scroll {
    gap: 0.75rem;
  }
  .rail-item {
        flex: 0 0 180px;
        width: 180px;
  }

  .rail-nav {
        display: none; /* در موبایل دکمه‌ها مخفی شوند و اسکرول لمسی جایگزین شود */
   }

   .rail-container {
        padding: 0 4px;
   }

   .book-title {
        font-size: 0.9rem;
   }

   

}

/* اندازه کارت‌های ریل در موبایل */
@media (max-width: 480px) {
  .book-rail .book-card {
    flex-basis: 145px;
    width: 145px;
  }

  .rail-scroll {
    gap: 0.625rem;
    padding-bottom: 0.625rem;
  }
}

@media (max-width: 576px) {
    .review-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.12);
}

.book-card .cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: #f5f5f5;
}

.book-card .body {
  padding: 0.9rem;
}

.book-card .title {
  font-size: 1rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 0.4rem;
  line-height: 1.5;
}

.book-card .author {
  font-size: 0.9rem;
  color: #666;
}

.book-card .badge {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #ff6b5a;
  color: #fff;
  font-size: 0.75rem;
  margin-bottom: 0.6rem;
}


.books-page {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.07), transparent 20%),
        radial-gradient(circle at top left, rgba(139, 92, 246, 0.06), transparent 20%),
        #f8fafc;
}

.books-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    border-radius: 24px;
    padding: 2rem 1.25rem;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
}

.books-hero__eyebrow {
    display: inline-block;
    font-size: 0.85rem;
    background: rgba(255,255,255,0.12);
    color: #e2e8f0;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    margin-bottom: 0.9rem;
}

.books-hero__title {
    font-size: clamp(1.8rem, 2.8vw, 2.7rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.books-hero__subtitle {
    color: #cbd5e1;
    max-width: 680px;
    margin-bottom: 0;
}

.book-rail {
    position: relative;
}

.rail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-radius: 22px;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
    color: #0f172a;
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.08);
}

.rail-header__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(255,255,255,0.72);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 0.55rem;
}

.rail-header__title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
}

.rail-header__subtitle {
    font-size: 0.95rem;
    color: rgba(15, 23, 42, 0.72);
}

.rail-header__link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    background: rgba(255,255,255,0.75);
    color: #0f172a;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.rail-header__link:hover {
    background: #fff;
    color: #0f172a;
    transform: translateY(-1px);
}

.rail-shell {
    position: relative;
    padding: 0 20px;   /* فضا برای دکمه‌ها */
}


.rail-scroll::-webkit-scrollbar {
    display: none; /* مخفی کردن اسکرول‌بار در کروم و سافاری */
}
/* کارت‌های داخل ریل */
.rail-item {
    flex: 0 0 200px;
    max-width: 190px;
    transition: transform 0.25s ease;
    -webkit-transition: transform 0.25s ease;
    -moz-transition: transform 0.25s ease;
    -ms-transition: transform 0.25s ease;
    -o-transition: transform 0.25s ease;
}

.rail-item:hover {
    transform: translateY(-4px);
    -webkit-transform: translateY(-4px);
    -moz-transform: translateY(-4px);
    -ms-transform: translateY(-4px);
    -o-transform: translateY(-4px);
}

/* هر کارت کتاب در ریل */
.book-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.15);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    flex: 0 0 240px;           /* عرض ثابت برای هر کارت که فشرده نشود */
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.13);
}

.book-card__cover-link {
    display: block;
    text-decoration: none;
}

.book-card__cover {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    background: #e2e8f0;
}

.book-card__cover--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #64748b;
}

.book-card__body {
    padding: 1rem;
}

.book-card__top {
    margin-bottom: 0.7rem;
}

.book-card__badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #334155;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
}

.book-card__title {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.7;
    margin-bottom: 0.45rem;
    min-height: 3.4em;
}

.book-card__title a {
    color: #0f172a;
    text-decoration: none;
}

.book-card__title a:hover {
    color: #2563eb;
}

.book-card__meta {
    min-height: 2rem;
    margin-bottom: 0.9rem;
}

.book-card__author {
    color: #64748b;
    font-size: 0.92rem;
}

.book-card__actions {
    display: flex;
    justify-content: flex-start;
}

.rail-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.95);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 1.2rem;
}

.rail-nav:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 6px 16px rgba(47, 111, 237, 0.25);
    transform: translateY(-50%) scale(1.05);
}

.rail-nav--right {
    right: -6px;
}

.rail-nav--left {
    left: -6px;
}

.rail-container {
    position: relative;
    padding: 0 20px;
}

/* افکت محو شدگی در کناره‌ها (Optional) */
.rail-container::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 50px;
    background: linear-gradient(to left, rgba(255,255,255,0.8), transparent);
    pointer-events: none;
}

@media (max-width: 991.98px) {
    .rail-nav {
        display: none;
    }

    .rail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .rail-scroll {
        grid-auto-columns: minmax(180px, 210px);
    }

    .book-card__cover {
        height: 260px;
    }
}
/* --- بخش دسته‌ها (Category Chips) --- */
.category-grid {
    display: flex;
    flex-wrap: nowrap;          /* جلوگیری از شکستن خط */
    overflow-x: auto;          /* فعال کردن اسکرول افقی */
    gap: 12px;                 /* فاصله بین چیپ‌ها */
    padding: 1rem 0;
    scrollbar-width: none;     /* مخفی کردن اسکرول‌بار در فایرفاکس */
    -ms-overflow-style: none;  /* مخفی کردن اسکرول‌بار در IE/Edge */
}

/* مخفی کردن اسکرول‌بار در کروم/سافاری */
.category-grid::-webkit-scrollbar {
    display: none;
}

/* --- بخش کارت‌های ویژگی (Feature Cards) --- */
.feature-cards-container {
    display: flex;
    flex-wrap: nowrap;         /* کارت‌ها در یک خط بمانند */
    overflow-x: auto;          /* اسکرول افقی */
    gap: 20px;                 /* فاصله بین کارت‌ها */
    padding: 20px 0;
    scrollbar-width: none;
}

.feature-cards-container::-webkit-scrollbar {
    display: none;
}

.feature-card {
    flex: 0 0 280px;           /* عرض ثابت هر کارت (قابل تغییر) */
    display: block;
    text-decoration: none;
}

.book-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag-badge {
  border: 1px solid rgba(244, 166, 42, 0.22);
  background: rgba(244, 166, 42, 0.10);
  color: #7a4b00;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}


.tag-badge:hover {
  background: #e5e7eb;
  color: #111827;
  transform: translateY(-1px);
}

.tag-badge:focus-visible {
  outline: 2px solid #f4a62a;
  outline-offset: 2px;
}
/* انیمیشن ورود نرم برای نتایج HTMX */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* اصلاح موقعیت دکمه بستن در حالت RTL بوت‌استرپ */
.tag-results-panel .btn-close {
    left: 0;
    right: auto;
}

/* هاور زیباتر روی کارت‌های نتایج */
.tag-results-panel .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tag-results-panel .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important;
}
/* ============================================================
   DARK MODE - کامل
   ============================================================ */
body.dark-mode {
    --bg-main: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-alt: #334155;
    --text-main: #f1f5f9;
    --text-body: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);
    --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.6);
    --card-bg: #1e293b;
    --input-bg: #0f172a;
}

body.dark-mode .navbar {
    background: rgba(15, 23, 42, 0.95) !important;
    border-bottom: 1px solid #334155;
}

body.dark-mode .navbar .nav-link,
body.dark-mode .navbar .navbar-brand {
    color: #e2e8f0 !important;
}

body.dark-mode .dropdown-menu {
    background-color: #1e293b;
    border-color: #334155;
}

body.dark-mode .dropdown-item {
    color: #e2e8f0;
}

body.dark-mode .dropdown-item:hover {
    background-color: #334155;
}

body.dark-mode .form-control {
    background-color: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .form-control:focus {
    background-color: #0f172a;
    border-color: #6366f1;
    color: #e2e8f0;
}

body.dark-mode .card,
body.dark-mode .list-group-item,
body.dark-mode .alert {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

body.dark-mode .text-muted {
    color: #94a3b8 !important;
}

body.dark-mode .border-bottom,
body.dark-mode .border-top,
body.dark-mode .border-start,
body.dark-mode .border-end {
    border-color: #334155 !important;
}

body.dark-mode .bg-light {
    background-color: #1e293b !important;
}

body.dark-mode .bg-white {
    background-color: #1e293b !important;
}

body.dark-mode .table {
    color: #e2e8f0;
}

body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #1e293b;
}

/* ============================================================
   MEGA MENU - منوی کشویی پیشرفته
   ============================================================ */
.mega-dropdown .dropdown-menu {
    padding: 1.5rem 1rem;
    min-width: 600px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.mega-dropdown .dropdown-header {
    font-size: 0.85rem;
    font-weight: 800;
    color: #6366f1;
    padding: 0.5rem 0;
    border-bottom: 2px solid rgba(99, 102, 241, 0.15);
    margin-bottom: 0.5rem;
}

.mega-dropdown .dropdown-item {
    padding: 0.45rem 0;
    font-size: 0.92rem;
    color: #334155;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.mega-dropdown .dropdown-item:hover {
    color: #4f46e5;
    padding-right: 8px;
    background: none;
}

/* حالت شب برای Mega Menu */
body.dark-mode .mega-dropdown .dropdown-menu {
    background-color: #1e293b;
    border-color: #334155;
}

body.dark-mode .mega-dropdown .dropdown-item {
    color: #cbd5e1;
}

body.dark-mode .mega-dropdown .dropdown-item:hover {
    color: #818cf8;
}

/* ============================================================
   انیمیشن‌های ورود (Fade-in)
   ============================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* ============================================================
   بهبود دسترس‌پذیری (Accessibility)
   ============================================================ */
:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    padding: 1rem;
    background: #6366f1;
    color: white;
    z-index: 9999;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* ============================================================
   بهبود عملکرد (Performance)
   ============================================================ */
img[loading="lazy"] {
    background: #e2e8f0;
}

/* ============================================================
   استایل‌های اضافی برای Toast و Notification
   ============================================================ */
#toast-container .toast {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    min-width: 280px;
}

.notification-item {
    transition: all 0.3s ease;
}

.notification-item:hover {
    background-color: #f8fafc;
}

body.dark-mode .notification-item:hover {
    background-color: #334155 !important;
}

/* Hero Main Container */

.main-hero-section {
    position: relative !important; 
    overflow: visible;
    margin-bottom: 80px; 
}
.hero-container {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    position: relative;
    overflow: visible;
}
/* ظرف عکس که اجازه می‌دهد عکس عریض شود اما دفرمه نشود */
.hero-bg-wrapper {
    width: 100%;
    height: 380px;
    border-radius: 40px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}

.hero-bg-image {
    width: 1663px;
    height: 100%;
    background-size: cover; /* عکس را طوری پخش می‌کند که کادر را پر کند بدون تغییر تناسب */
    background-position: center 20%; /* کمی تمرکز را بالاتر می‌برد تا سرها قطع نشوند */
    background-repeat: no-repeat;
}

/* حذف کامل لایه تیره */
.hero-overlay-clean {
    position: absolute;
    inset: 0;
    background: transparent; /* بدون هیچ رنگ سیاه */
    display: flex;
    align-items: center;
    justify-content: center;
}
/* اصلاح نمایش تصویر برای حذف نشدن چهره‌ها */
.hero-bg {
    position: relative;
    width: 100%;
    height: 320px; /* ارتفاع ثابت که چهره‌ها در کادر بمانند */
    background-size: 100% 100%; /* اجبار به نمایش کامل طول و عرض */
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 40px; /* لبه ها گرد */
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}


.hero-overlay {
    position: absolute;
    inset: 0;
    background: transparent; /* حذف لایه سیاه */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 40px;
}


/* Search Box Style */
.hero-search-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 600px;
    padding: 0 20px;
    z-index: 5;
}

.hero-search-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 8px;
    border-radius: 50px;
    display: flex;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
}

.hero-search-form input {
    flex: 1;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    outline: none;
    background: transparent;
    font-family: inherit;
}

.hero-search-form button {
    background: transparent;
    border: none;
    color: #6c757d;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 10px;
}

/* Circular Categories Style */
.hero-categories-grid {
    position: absolute;
    left: 50%;
    bottom: -80px; /* دایره‌ها نصف داخل، نصف خارج */
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    z-index: 9999;
    width: 100%;
    padding: 0 16px;
}

.category-circle-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    width: 110px;
    min-height: 132px;
    position: relative;
}

.category-circle-item:hover {
    transform: translateY(-6px);
}

.circle-icon {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: #ffffff !important;
    /*کاملاًکدربرایدیدهشدندربخشبیرونکادر*/border: 4px solid #ffffff;
    box-shadow: 0 14px 30px rgba(0,0,0,0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;

}

.category-circle-item:hover .circle-icon {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 18px 34px rgba(0,0,0,0.2);
}

.circle-icon img {
    width: 60%;
    height: 60%;
    object-fit: contain;
    display: block;
}

.circle-icon i {
    font-size: 30px;
    color: #2c3e50;
}

.circle-label {
    display: block;
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #111827;
    text-align: center;
    line-height: 1.25;
    white-space: normal;
    max-width: 110px;
    text-shadow: 0 1px 2px rgba(255,255,255,0.85);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-categories-grid {
        bottom: -40px;
        gap: 12px;
    }

    .category-circle-item {
        width: 78px;
        min-height: 102px;
    }

    .circle-icon {
        width: 58px;
        height: 58px;
        border-width: 3px;
    }

    .circle-icon i {
        font-size: 20px;
    }

    .circle-label {
        font-size: 0.72rem;
        max-width: 78px;
        margin-top: 8px;
    }

    .hero-container {
        margin-bottom: 72px;
    }
}
.hero-section .hero-title {
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: #1f2937 !important;
    color: #1f2937 !important;
}

.hero-section .hero-subtitle {
    color: #374151 !important;
}
.hero-section .hero-title-accent {
    color: #2563eb !important;
    -webkit-text-fill-color: #2563eb !important;
}

/* --- Author / Translator Knowledge Card --- */
.author-knowledge-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 24px;
  direction: rtl;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
  margin-top: 20px;
  font-family: inherit;
}

.author-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.author-avatar-wrapper {
  position: relative;
  width: 75px;
  height: 75px;
  flex-shrink: 0;
}

.author-avatar, .author-avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #3b82f6;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #64748b;
}

.verified-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  color: #0284c7;
  background: #fff;
  border-radius: 50%;
  font-size: 16px;
}

.author-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
}

.author-era {
  font-size: 0.75rem;
  background: #f1f5f9;
  color: #475569;
  padding: 3px 8px;
  border-radius: 6px;
}

.author-role {
  color: #64748b;
  font-size: 0.9rem;
  margin: 4px 0;
}

.author-cluster-badge {
  display: inline-block;
  font-size: 0.75rem;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  direction: ltr;
}

.author-bio {
  color: #334155;
  line-height: 1.8;
  font-size: 0.95rem;
  margin-bottom: 16px;
  text-align: justify;
}

.author-signature {
  background: #f8fafc;
  border-right: 4px solid #3b82f6;
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 18px;
  font-size: 0.9rem;
  color: #475569;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.focus-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
}

.focus-list li {
  font-size: 0.88rem;
  color: #475569;
}

.bullet-icon {
  font-size: 10px;
  color: #3b82f6;
  margin-left: 6px;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.work-chip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
}

.work-fa {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  color: #0f172a;
}

.work-orig {
  display: block;
  font-size: 0.75rem;
  color: #94a3b8;
  direction: ltr;
  text-align: right;
  margin-bottom: 6px;
}

.work-meta {
  font-size: 0.75rem;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  border-top: 1px dashed #cbd5e1;
  padding-top: 4px;
}


/* ═══════════════════════════════════════════════════════════════
   MODERN PRODUCT CARDS - Airbook Store (v2)
   Loaded globally via site.css, overrides any inline styles
   ═══════════════════════════════════════════════════════════════ */

body .p-card {
    background: #ffffff !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    border: 1px solid #f1f5f9 !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    position: relative !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04) !important;
}
body .p-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 20px 40px rgba(124,58,237,0.18) !important;
    border-color: #c4b5fd !important;
}
body .p-card .p-cover {
    position: relative !important;
    aspect-ratio: 4/5.5 !important;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0) !important;
    overflow: hidden !important;
}
body .p-card .p-cover img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.6s ease !important;
}
body .p-card:hover .p-cover img { transform: scale(1.08) !important; }
body .p-card .p-badge {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    padding: 6px 12px !important;
    border-radius: 50px !important;
    font-size: 0.75rem !important;
    font-weight: 900 !important;
    color: white !important;
    z-index: 2 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
}
body .p-card .p-badge.discount { background: linear-gradient(135deg, #ef4444, #b91c1c) !important; }
body .p-card .p-badge.new { background: linear-gradient(135deg, #10b981, #059669) !important; }
body .p-card .p-badge.bestseller { background: linear-gradient(135deg, #f59e0b, #d97706) !important; }
body .p-card .p-wish {
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    width: 36px !important; height: 36px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,0.95) !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 2 !important;
    color: #64748b !important;
    transition: all 0.2s !important;
    font-size: 1rem !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15) !important;
}
body .p-card .p-wish:hover { background: #fee2e2 !important; color: #ef4444 !important; transform: scale(1.15) !important; }
body .p-card .p-wish.active { background: #ef4444 !important; color: white !important; }
body .p-card .p-stock-badge {
    position: absolute !important;
    bottom: 12px !important;
    right: 12px !important;
    padding: 5px 12px !important;
    border-radius: 10px !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    z-index: 2 !important;
    color: white !important;
}
body .p-card .p-stock-badge.ok { background: rgba(16, 185, 129, 0.95) !important; }
body .p-card .p-stock-badge.low { background: rgba(245, 158, 11, 0.95) !important; }
body .p-card .p-body {
    padding: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
}
body .p-card .p-title {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    color: #1e293b !important;
    margin-bottom: 6px !important;
    line-height: 1.5 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-decoration: none !important;
}
body .p-card .p-title:hover { color: #7c3aed !important; }
body .p-card .p-author {
    font-size: 0.8rem !important;
    color: #64748b !important;
    margin-bottom: 10px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
body .p-card .p-rating {
    font-size: 0.8rem !important;
    color: #f59e0b !important;
    font-weight: 700 !important;
    margin-bottom: 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
}
body .p-card .p-price-wrap {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
    margin-top: auto !important;
    padding-top: 12px !important;
    border-top: 1px dashed #e2e8f0 !important;
}
body .p-card .p-price { display: flex !important; flex-direction: column !important; }
body .p-card .p-price .old {
    font-size: 0.75rem !important;
    color: #94a3b8 !important;
    text-decoration: line-through !important;
    margin-bottom: 2px !important;
}
body .p-card .p-price .final {
    font-size: 1.1rem !important;
    font-weight: 900 !important;
    color: #7c3aed !important;
}
body .p-card .p-price .currency {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    color: #64748b !important;
}
body .p-card .p-cart-btn {
    width: 42px !important;
    height: 42px !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #7c3aed, #6d28d9) !important;
    color: white !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.15rem !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    box-shadow: 0 4px 12px rgba(124,58,237,0.35) !important;
}
body .p-card .p-cart-btn:hover {
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 8px 20px rgba(124,58,237,0.5) !important;
}

/* Dark mode */
html.dark-mode body .p-card { background: #1e293b !important; border-color: #334155 !important; }
html.dark-mode body .p-card .p-title { color: #e2e8f0 !important; }
html.dark-mode body .p-card .p-price-wrap { border-color: #334155 !important; }


/* ═══ Z-index Fix for Dropdowns (Above Store Search) ═══ */
.navbar {
    z-index: 10500 !important;
}
.navbar .dropdown-menu.show {
    z-index: 10600 !important;
}
