/* --- Global & Variables --- */
:root {
    --brand-color: #D34827;
    --brand-hover: #A9351A;
    --text-dark: #1a1a1a;
    --text-muted: #777;
    --bg-light: #f4f6f8;
    --card-border: #eaeaea;
}

@font-face {
    font-family: 'Rawasi';
    src: url('../fonts/RawasiArabic-Black.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body, input, button, select, textarea {
    background-color: var(--bg-light);
    font-family: 'Rawasi', system-ui, sans-serif !important;
}

html {
    /* تفعيل الانتقال السلس عند النقر على أي رابط داخلي في الموقع */
    scroll-behavior: smooth;
}

#about-contact {
    /* إجبار المتصفح على ترك مسافة علوية عند الانتقال لهذا القسم حتى لا يغطيه النافبار */
    scroll-margin-top: 100px; 
}
body {
    background-color: var(--bg-light);
}
/* --- Modern Glassmorphism Navbar --- */
.modern-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 12px 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

.brand-title {
    font-family: 'Rawasi', sans-serif !important;
    font-size: 1.8rem; /* يمكنك تعديل الحجم بما يتناسب مع الخط الجديد */
    color: var(--brand-color);
    line-height: 1.3;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(211, 72, 39, 0.15);
}
.brand-subtitle {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    margin-top: 2px;
}

/* --- Premium Auth Buttons (إصلاح مشكلة الأزرار المشوهة) --- */
.auth-buttons a {
    padding: 10px 28px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-premium-login {
    background: transparent;
    color: var(--brand-color);
    border: 2px solid var(--brand-color);
}

.btn-premium-login:hover {
    background: var(--brand-color);
    color: #fff;
    box-shadow: 0 8px 20px rgba(211, 72, 39, 0.2);
    transform: translateY(-3px);
}

.btn-premium-register {
    background: var(--brand-color);
    color: #fff;
    border: 2px solid var(--brand-color);
    box-shadow: 0 4px 15px rgba(211, 72, 39, 0.25);
}

.btn-premium-register:hover {
    background: var(--text-dark); /* يتغير للون الداكن الفاخر عند المرور */
    border-color: var(--text-dark);
    color: #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-3px);
}
/* --- Fix: Perfect Search Box --- */
.search-box {
    position: relative;
    max-width: 500px;
    width: 100%;
    display: flex; /* هذا السطر يجبر الإدخال والأيقونة على البقاء معاً */
    align-items: center;
}

.search-box input {
    width: 100%;
    border-radius: 30px;
    background: #f4f6f8;
    border: 1px solid #eaeaea;
    transition: all 0.3s ease;
    padding: 12px 45px 12px 20px; 
    font-size: 0.95rem;
}

.search-box input:focus {
    background: #fff;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 4px rgba(211, 72, 39, 0.15);
    outline: none;
}

.search-box .fa-search {
    position: absolute;
    right: 18px; 
    color: #888;
    z-index: 10;
    pointer-events: none;
}
/* --- Fix 1: Premium Navbar Icons --- */
.nav-icons {
    gap: 15px;
}

.nav-icons a {
    width: 45px;
    height: 45px;
    background: #f4f6f8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid transparent;
}

.nav-icons a:hover {
    background: var(--brand-color);
    color: white;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 15px rgba(211, 72, 39, 0.25);
    border-color: rgba(255,255,255,0.2);
}

.cart-icon-wrapper {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #111; /* لون فخم للشارة */
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid white;
}
        /* --- Slider Styles --- */
.hero-slider {
    width: 100%;
    margin-top: 0;
    border-radius: 0; /* إزالة الحواف ليمتد بالكامل */
    height: 65vh; /* ارتفاع ديناميكي */
    min-height: 400px;
    position: relative;
}

.swiper-slide {
    position: relative;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- تعديل بسيط لطبقة الظلام (Overlay) لضمان وضوح النص --- */
.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* تعتيم إضافي في المنتصف لبروز النص */
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.7) 100%);
    z-index: 1;
    pointer-events: none;
}

/* --- تنسيقات نصوص السلايدر (Slider Content) --- */
.slide-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    text-align: center;
    width: 100%;
    padding: 0 20px;
}

.slide-title {
    font-size: 4rem;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 15px;
    text-shadow: 2px 4px 15px rgba(0,0,0,0.6);
    /* إعدادات الحركة (Animation) */
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.slide-quote {
    font-size: 1.8rem;
    font-weight: 500;
    color: #f4f6f8;
    margin-bottom: 35px;
    text-shadow: 1px 2px 10px rgba(0,0,0,0.6);
    /* إعدادات الحركة (Animation) بتأخير بسيط */
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) 0.2s; 
}

/* زر المتجر داخل السلايدر */
.btn-brand-slider {
    background-color: var(--brand-color);
    color: white;
    padding: 12px 40px;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 800;
    text-decoration: none;
    border: 2px solid var(--brand-color);
    box-shadow: 0 10px 20px rgba(211, 72, 39, 0.3);
    /* إعدادات الحركة (Animation) بتأخير أكبر */
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) 0.4s, background-color 0.3s, transform 0.3s;
}

.btn-brand-slider:hover {
    background-color: transparent;
    color: white;
    border-color: white;
    transform: translateY(35px) scale(1.05); /* حركة عند مرور الماوس */
}

/* --- السر البرمجي: تشغيل الحركات عند تنقل السلايد --- */
.swiper-slide-active .slide-title,
.swiper-slide-active .slide-quote {
    opacity: 1;
    transform: translateY(0);
}

/* حل لزر المتجر ليتفاعل مع كلاس الـ active و الـ hover بشكل سليم */
.swiper-slide-active .btn-brand-slider {
    opacity: 1;
    transform: translateY(0);
}
.swiper-slide-active .btn-brand-slider:hover {
    transform: translateY(-5px);
}


/* --- تعديلات الموبايل لنصوص السلايدر --- */
@media (max-width: 768px) {
    .slide-title {
        font-size: 2.2rem;
        margin-bottom: 10px;
    }
    .slide-quote {
        font-size: 1.2rem;
        margin-bottom: 25px;
    }
    .btn-brand-slider {
        padding: 10px 30px;
        font-size: 1rem;
    }
}

/* تأثير سينمائي يغطي الصور */
.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.4) 100%);
    z-index: 1;
    pointer-events: none;
}

/* تخصيص أزرار السلايدر لتصبح عصرية */
.swiper-button-next, .swiper-button-prev {
    color: #fff !important;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
    width: 50px !important;
    height: 50px !important;
    border-radius: 50%;
    transition: 0.3s;
}
.swiper-button-next:hover, .swiper-button-prev:hover {
    background: var(--brand-color);
    transform: scale(1.1);
}
/* --- Tags Styles --- */
        .tags-container {
            display: flex;
            overflow-x: auto;
            white-space: nowrap;
            padding-bottom: 10px;
            margin-bottom: 20px;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none; /* Firefox */
        }
        .tags-container::-webkit-scrollbar { display: none; } /* Chrome */
        
        .tag-btn {
            background: white;
            border: 1px solid #ddd;
            border-radius: 25px;
            padding: 8px 20px;
            margin-left: 10px;
            color: var(--text-dark);
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 500;
        }
        
        .tag-btn.active, .tag-btn:hover {
            background: var(--brand-color);
            color: white;
            border-color: var(--brand-color);
        }



        .modern-categories {
    display: flex;
    height: 350px;
    gap: 12px;
    margin: 40px 0;
    overflow: hidden;
}

.cat-panel {
    flex: 0.5; /* الحجم المغلق */
    border-radius: 30px;
    position: relative;
    cursor: pointer;
    transition: flex 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #fff;
    border: 1px solid var(--card-border);
}

.cat-panel:hover, .cat-panel.active {
    flex: 3; /* الحجم المفتوح */
    border-color: transparent;
}

/* ألوان باستيل ديناميكية للتصنيفات */
/* --- Modern Brand Colors for Categories Accordion --- */
.cat-panel:nth-child(1).active { background-color: var(--brand-color); color: #fff; } 
.cat-panel:nth-child(2) { background-color: #f8f9fa; border: 1px solid #eaeaea; } 
.cat-panel:nth-child(3) { background-color: #1a1a1a; color: #fff; } /* لون داكن فاخر */
.cat-panel:nth-child(4) { background-color: #fcece8; } /* درجة خفيفة جداً من البرتقالي */
.cat-panel:nth-child(5) { background-color: #2c3e50; color: #fff; } /* كحلي داكن */
.cat-panel:nth-child(6) { background-color: #ffffff; border: 1px solid #ddd; }
.cat-panel:nth-child(7) { background-color: #f4f6f8; }

/* ضبط ألوان النصوص داخل البطاقات الداكنة */
.cat-panel:nth-child(3) .cat-title-vertical,
.cat-panel:nth-child(5) .cat-title-vertical { color: #fff; }

.cat-panel:nth-child(3) .cat-content,
.cat-panel:nth-child(5) .cat-content { color: #fff !important; }
.cat-panel:nth-child(3) .cat-content h3,
.cat-panel:nth-child(5) .cat-content h3,
.cat-panel:nth-child(3) .cat-content p,
.cat-panel:nth-child(5) .cat-content p { color: #fff !important; opacity: 0.9; }

.cat-content {
    position: absolute;
    opacity: 0;
    visibility: hidden; /* إخفاء فعلي لمنع تشوه النص عند الانكماش */
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
    padding: 20px;
    text-align: center;
    width: 100%;
    pointer-events: none;
}

.cat-panel:hover .cat-content, 
.cat-panel.active .cat-content {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0.25s; /* تأخير بسيط جداً ليسمح للبطاقة بالفتح أولاً */
}

.cat-content h3 { 
    font-weight: 800; 
    font-size: 1.5rem; 
    margin-bottom: 5px; 
    white-space: nowrap; /* يمنع نزول العنوان لسطرين */
}

.cat-content p { 
    font-size: 0.9rem; 
    margin: 0; 
    /* تقليم النص في حال كان طويلاً جداً */
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    line-clamp: 2;
    -webkit-box-orient: vertical; 
    overflow: hidden; 
}
/* تنسيق النص الجانبي بشكل عصري */
.cat-title-vertical {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-dark);
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

/* هذا هو السطر السحري الذي يخفي النص الجانبي عند فتح البطاقة */
.cat-panel.active .cat-title-vertical, 
.cat-panel:hover .cat-title-vertical {
    opacity: 0;
    display: none;
}/* --- Premium Book Cards --- */
.book-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid var(--card-border);
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 15px;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.06);
    border-color: var(--brand-color);
}

.book-badge {
    position: absolute;
    top: 25px;
    right: 25px;
    background: #111;
    color: #fff;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 2;
}

.fav-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    cursor: pointer;
    transition: 0.3s;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.fav-btn:hover, .fav-btn.active { color: var(--brand-color); }

.book-image-container {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.book-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.5s;
}

.book-card:hover .book-image { transform: scale(1.05); }

.book-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 4px;
    text-align: center;
}

.book-author {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 15px;
}

.price-container {
    text-align: center;
    margin-bottom: 15px;
}

.book-price {
    font-weight: 800;
    color: var(--text-dark);
    font-size: 1.3rem;
}

/* الأزرار المفرغة العصرية */
.btn-premium-outline {
    background: transparent;
    color: var(--text-dark);
    border: 2px solid #ddd;
    width: 100%;
    padding: 10px;
    border-radius: 30px;
    font-weight: 700;
    transition: all 0.3s;
    margin-top: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-premium-outline:hover {
    background: var(--brand-color);
    border-color: var(--brand-color);
    color: white;
}
        /* --- Footer --- */
/* --- Ultra Modern Footer --- */
footer {
    background: #ffffff;
    padding: 70px 0 30px;
    border-top: none;
    box-shadow: 0 -15px 40px rgba(0,0,0,0.02); /* ظل علوي ناعم جداً */
    position: relative;
    z-index: 10;
    border-radius: 40px 40px 0 0; /* حواف علوية دائرية */
    margin-top: 60px;
}

.footer-logo {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--brand-color);
    margin-bottom: 15px;
    display: inline-block;
}

.newsletter-input {
    padding: 15px 20px;
    border-radius: 0 30px 30px 0; /* زوايا يمنى دائرية للـ RTL */
    background: #f4f6f8;
    border: 1px solid transparent;
    transition: 0.3s;
}

.newsletter-input:focus {
    background: #fff;
    border-color: var(--brand-color);
    box-shadow: none;
}

.newsletter-btn {
    padding: 15px 30px;
    border-radius: 30px 0 0 30px; /* زوايا يسرى دائرية للـ RTL */
    background: var(--brand-color);
    color: white;
    font-weight: 700;
    border: none;
    transition: 0.3s;
}

.newsletter-btn:hover { 
    background: #111; /* تغيير لون الزر للأسود عند المرور يعطي طابع فخم */
    color: white;
}

.social-icons a {
    display: inline-flex;
    width: 45px;
    height: 45px;
    background: #f4f6f8;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    margin-left: 10px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-icons a:hover { 
    background: var(--brand-color); 
    color: white; 
    transform: translateY(-5px); 
}

.hover-brand:hover {
    color: var(--brand-color) !important;
    padding-right: 8px; /* حركة لطيفة للروابط */
    transition: 0.3s;
}
        /* Mobile Bottom Nav (Optional for App-like feel) */
        .mobile-bottom-nav {
            display: none;
        }

        @media (max-width: 768px) {
            .book-image { height: 180px; }
            .book-title { font-size: 1rem; }
            .swiper-slide img { height: 200px; }
            
            /* App-like bottom nav for mobile */
            .mobile-bottom-nav {
                display: flex;
                justify-content: space-around;
                position: fixed;
                bottom: 0;
                left: 0;
                width: 100%;
                background: white;
                box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
                padding: 10px 0;
                z-index: 1000;
            }
            .mobile-bottom-nav a {
                color: #666;
                text-align: center;
                text-decoration: none;
                font-size: 0.8rem;
                display: flex;
                flex-direction: column;
                align-items: center;
            }
            .mobile-bottom-nav a i { font-size: 1.3rem; margin-bottom: 3px; }
            .mobile-bottom-nav a.active { color: var(--brand-color); }
        }
/* --- Fix 4: Mobile Responsiveness (Navbar & Slider) --- */
@media (max-width: 768px) {
    body {
        padding-bottom: 60px;
    }
    .modern-header {
        padding: 10px 0;
    }
    
    .search-box {
        order: 3;
        margin-top: 10px;
    }
    
    .hero-slider {
        height: 40vh; /* تقليل الارتفاع في الموبايل لتظهر الصورة كاملة */
        min-height: 250px;
    }
    
    .brand-title {
        font-size: 1.5rem;
    }
    
    .nav-icons {
        gap: 8px;
    }
    
    .nav-icons a {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    /* --- Premium Mobile Login Button --- */
.mobile-nav-login {
    color: var(--brand-color) !important;
    font-weight: 800 !important;
    position: relative;
    transition: all 0.3s ease;
}

.mobile-nav-login i {
    background: rgba(211, 72, 39, 0.1);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 4px !important;
    font-size: 1.1rem !important;
    border: 1px solid rgba(211, 72, 39, 0.2);
    color: var(--brand-color);
}

/* تأثير نبض خفيف لزر الدخول في الهاتف لجذب الانتباه */
.mobile-nav-login i {
    animation: pulseMobileLogin 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pulseMobileLogin {
    0% { box-shadow: 0 0 0 0 rgba(211, 72, 39, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(211, 72, 39, 0); }
    100% { box-shadow: 0 0 0 0 rgba(211, 72, 39, 0); }
}
}

/* loading... */
/* --- Premium Preloader & 3D Book Animation --- */
body.no-scroll {
    overflow: hidden; /* يمنع التمرير أثناء التحميل */
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff; /* خلفية بيضاء نقية */
    z-index: 99999; /* أعلى طبقة في الموقع */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.8s;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

/* 3D Book Animation */
.book-loader {
    width: 60px;
    height: 40px;
    position: relative;
    perspective: 150px;
}

.book-loader .page {
    width: 30px;
    height: 40px;
    background: var(--brand-color);
    position: absolute;
    top: 0;
    right: 50%;
    transform-origin: 100% 50%;
    border-radius: 3px 0 0 3px;
    box-shadow: inset 0px 0px 5px rgba(0,0,0,0.1);
    animation: flipPage 1.2s infinite linear;
    transform-style: preserve-3d;
}

/* تدرج في حركة الصفحات لتعطي تأثير الكتاب */
.book-loader .page:nth-child(1) { animation-delay: 0s; }
.book-loader .page:nth-child(2) { animation-delay: 0.4s; }
.book-loader .page:nth-child(3) { animation-delay: 0.8s; }

@keyframes flipPage {
    0% { transform: rotateY(0deg); background: var(--brand-color); opacity: 1; }
    50% { transform: rotateY(-90deg); background: var(--brand-hover); }
    100% { transform: rotateY(-180deg); opacity: 0; }
}

/* Text Pulse Animation (تأثير نبض الوتين) */
.loader-text {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.loader-text .brand-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--brand-color);
    letter-spacing: 1px;
    animation: pulseHeartbeat 1.2s infinite alternate cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes pulseHeartbeat {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.08); opacity: 1; text-shadow: 0 5px 15px rgba(211, 72, 39, 0.3); }
}

/* Loading Dots Animation */
.loading-dots {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
}

.loading-dots span {
    animation: blinkDots 1.4s infinite both;
    font-size: 1.2rem;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blinkDots {
    0% { opacity: 0.2; transform: translateY(0); }
    20% { opacity: 1; transform: translateY(-3px); }
    100% { opacity: 0.2; transform: translateY(0); }
}

/* welcome popup */
/* --- Premium Welcome Pop-up --- */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 999999; /* ليكون فوق كل شيء */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.welcome-overlay.show {
    opacity: 1;
    visibility: visible;
}

.welcome-card {
    background: #ffffff;
    border-radius: 30px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    transform: scale(0.8) translateY(50px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* حركة ارتدادية (Bounce) */
}

.welcome-overlay.show .welcome-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.welcome-icon {
    font-size: 3.5rem;
    color: var(--brand-color);
    margin-bottom: 20px;
    animation: floatPopup 3s ease-in-out infinite;
}

.welcome-card h2 { font-weight: 900; margin-bottom: 15px; font-size: 2rem;}
.welcome-card p { color: #555; line-height: 1.6; margin-bottom: 20px;}
.welcome-terms { font-size: 0.85rem; color: #888; background: #f8f9fa; padding: 15px; border-radius: 15px; margin-bottom: 20px;}
.welcome-terms a { color: var(--brand-color); text-decoration: none; font-weight: 700;}

@keyframes floatPopup {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* --- Premium Book Details Page --- */
.book-cover-large-container {
    position: relative;
    display: inline-block;
    padding: 15px;
}

.book-cover-large {
    width: 100%;
    max-width: 400px;
    border-radius: 20px;
    box-shadow: -15px 15px 40px rgba(0,0,0,0.15); /* ظل ثلاثي الأبعاد يعطي إيحاء بأن الكتاب بارز */
    transition: transform 0.5s ease;
}

.book-cover-large:hover {
    transform: perspective(1000px) rotateY(-5deg) scale(1.02);
}

.badge-premium {
    position: absolute;
    top: 30px;
    right: 0;
    background: #111;
    color: #fff;
    padding: 8px 20px;
    border-radius: 30px 0 0 30px;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 2;
}

.book-main-title {
    font-size: 2.5rem;
    letter-spacing: -0.5px;
}

.fav-btn-large {
    background: #f4f6f8;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #888;
    transition: 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.fav-btn-large:hover, .fav-btn-large.active {
    background: var(--brand-color);
    color: white;
}

/* Glassmorphism Meta Info */
.book-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.meta-item {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s;
}

.meta-item:hover {
    background: #fff;
    box-shadow: 0 10px 20px rgba(0,0,0,0.04);
    transform: translateY(-3px);
}

.meta-item i {
    font-size: 1.5rem;
    color: var(--brand-color);
    margin-bottom: 8px;
    opacity: 0.8;
}

.meta-item span {
    font-size: 0.8rem;
    color: #888;
}

.meta-item strong {
    font-size: 0.95rem;
    color: var(--text-dark);
}

@media (max-width: 768px) {
    .book-meta-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .book-main-title {
        font-size: 1.8rem;
    }
}

/* --- Entrance Animations (حركات الدخول المسرحية) --- */
.animate-fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUpAnim 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes fadeUpAnim {
    to { opacity: 1; transform: translateY(0); }
}

/* --- Perfect Book Cover & Magnifier Container --- */
.img-magnifier-container {
    position: relative;
    display: inline-block;
    border-radius: 20px;
    box-shadow: -15px 15px 40px rgba(0,0,0,0.15);
    background: #fff;
    padding: 10px; /* إطار أبيض أنيق حول الصورة */
}

.book-cover-perfect {
    width: 100%;
    max-width: 380px;
    aspect-ratio: 2 / 3; /* إجبار الصورة على حجم الكتاب المثالي */
    object-fit: cover; /* تكبير وملء الفراغ بدون تشوه */
    border-radius: 12px;
    display: block;
}

/* --- The Magic Magnifying Glass (مربع التكبير) --- */
.img-magnifier-glass {
    position: absolute;
    border: 4px solid rgba(255, 255, 255, 0.9);
    border-radius: 15px; /* مربع بزوايا ناعمة كما طلبت */
    cursor: none;
    width: 130px; /* حجم المربع */
    height: 130px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4), inset 0 0 10px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* مهم جداً لكي لا يعيق حركة الماوس */
    z-index: 10;
    background-color: #fff; 
}

/* --- Premium Add to Cart Button (الزر الخرافي) --- */
.btn-add-to-cart-premium {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--brand-color), #ff6b4a); /* تدرج لوني */
    color: white !important;
    border: none;
    border-radius: 30px;
    font-weight: 800;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 20px rgba(211, 72, 39, 0.3);
}

/* تأثير اللمعان (Shine Sweep) الذي يعبر فوق الزر */
.btn-add-to-cart-premium::before {
    content: '';
    position: absolute;
    top: 0; 
    left: -100%; /* يبدأ من خارج الزر */
    width: 50%; 
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    z-index: -1;
    transition: left 0.7s ease;
}

.btn-add-to-cart-premium:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(211, 72, 39, 0.4);
}

/* تحريك اللمعان عند مرور الماوس */
.btn-add-to-cart-premium:hover::before {
    left: 150%; 
}
/* --- حل مشكلة مقاسات الصور نهائياً (للصفحة الرئيسية وصفحة الكتاب) --- */
.img-magnifier-container {
    position: relative;
    display: inline-block;
    border-radius: 20px;
    box-shadow: -15px 15px 40px rgba(0,0,0,0.15);
    background: #fff;
    padding: 10px; 
    width: 100%;
    max-width: 320px; /* التحكم بحجم غلاف الكتاب في صفحة التفاصيل */
    margin: 0 auto;
}

/* هذا الكلاس يضمن أن الصورة تأخذ شكل الكتاب المثالي 2:3 */
.book-cover-perfect {
    width: 100%;
    aspect-ratio: 2 / 3; 
    object-fit: cover; /* تكبير وتوسيط بدون تشوه */
    border-radius: 12px;
    display: block;
    transition: transform 0.5s ease;
}

.img-magnifier-container:hover .book-cover-perfect {
    transform: perspective(1000px) rotateY(-5deg) scale(1.02);
}

/* --- تصميم الصناديق الزجاجية (Glassmorphism) الفاخرة --- */
.glass-box {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
}
/* --- نظام تقييم النجوم التفاعلي (عند إضافة مراجعة) --- */
.star-rating-input {
    display: inline-flex;
    flex-direction: row-reverse; /* لعكس الترتيب بسبب الـ RTL */
    font-size: 1.5rem;
}
.star-rating-input input { display: none; }
.star-rating-input label {
    color: #ddd;
    cursor: pointer;
    padding: 0 5px;
    transition: color 0.2s ease-in-out;
}
.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input:checked ~ label {
    color: #ffc107; /* اللون الأصفر الذهبي */
}

/* --- تنسيقات بطاقة المراجعة (Review Card) --- */
.review-card {
    transition: transform 0.3s;
}
.review-card:hover {
    transform: translateX(-5px);
    border-right: 4px solid var(--brand-color);
}
.avatar-circle {
    width: 45px;
    height: 45px;
    background: #f4f6f8;
    color: var(--brand-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* تنسيق النص المبرر (Justify) للوصف */
.text-justify { text-align: justify; }

/* --- Premium Submit Review Button --- */
/* --- Premium Submit Review Button (With Shine Effect) --- */
.btn-submit-review {
    position: relative; /* ضروري لتأثير اللمعان */
    overflow: hidden;   /* لإخفاء اللمعة خارج الزر */
    z-index: 1;
    background: linear-gradient(135deg, var(--brand-color), #ff6b4a); /* تدرج لوني */
    color: white !important;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 15px rgba(211, 72, 39, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* شريط اللمعان السحري (Shine Sweep) */
.btn-submit-review::before {
    content: '';
    position: absolute;
    top: 0; 
    left: -100%; /* يبدأ من خارج الزر */
    width: 50%; 
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    z-index: -1;
    transition: left 0.7s ease;
}

/* التأثيرات عند مرور الماوس */
.btn-submit-review:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 25px rgba(211, 72, 39, 0.4);
}

/* تحريك اللمعان ليعبر فوق الزر */
.btn-submit-review:hover::before {
    left: 150%; 
}

/* حركة أيقونة الطائرة الورقية */
.btn-submit-review i {
    transition: transform 0.3s ease;
}

.btn-submit-review:hover i {
    transform: translateX(-5px) translateY(-2px); /* حركة انطلاق */
}

/* --- Premium Pagination (أزرار التنقل بين الصفحات) --- */
.custom-pagination .page-link {
    border: none;
    color: var(--text-muted);
    margin: 0 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    background: #fff;
}

.custom-pagination .page-item.active .page-link,
.custom-pagination .page-link:hover {
    background: var(--brand-color);
    color: #fff;
    box-shadow: 0 5px 15px rgba(211, 72, 39, 0.3);
    transform: translateY(-2px);
}

/* حالة الزر المعطل (عندما تكون في الصفحة الأولى أو الأخيرة) */
.custom-pagination .page-item.disabled .page-link {
    background: #f4f6f8;
    color: #ccc;
    box-shadow: none;
    transform: none;
    pointer-events: none;
}

/* --- Store Page: Scrollable Category Pills --- */
.category-pills-wrapper {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding: 15px 5px;
    -ms-overflow-style: none;  /* إخفاء شريط التمرير في IE و Edge */
    scrollbar-width: none;  /* إخفاء شريط التمرير في Firefox */
    scroll-behavior: smooth;
    text-align: right; /* لأننا في بيئة RTL */
}

.category-pills-wrapper::-webkit-scrollbar {
    display: none; /* إخفاء شريط التمرير في Chrome و Safari */
}

.cat-pill {
    display: inline-block;
    padding: 10px 28px;
    margin-left: 12px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 30px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.cat-pill:hover, .cat-pill.active {
    background: var(--brand-color);
    color: #fff;
    border-color: var(--brand-color);
    box-shadow: 0 8px 20px rgba(211, 72, 39, 0.25);
    transform: translateY(-3px);
}

/* --- Store Page: Locomotive Scroll Animations --- */
.store-book-item {
    opacity: 0;
    transform: translateY(80px) scale(0.9);
    transition: all 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* هذا الكلاس يضاف تلقائياً بواسطة Locomotive عندما يدخل العنصر في الشاشة */
.store-book-item.reveal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* --- Profile Page Styles --- */
.profile-avatar {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--brand-color), #ff6b4a);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 10px 25px rgba(211, 72, 39, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.profile-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 30px rgba(211, 72, 39, 0.4);
    border-color: var(--brand-color);
    background: #fff;
    color: var(--brand-color);
    text-shadow: 0 5px 15px rgba(211, 72, 39, 0.2);
    border: 2px solid var(--brand-color);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.profile-info-list li {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed rgba(0,0,0,0.05);
}

.profile-info-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.info-icon {
    width: 45px;
    height: 45px;
    background: rgba(211, 72, 39, 0.1);
    color: var(--brand-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-left: 15px; /* RTL */
}

.info-text span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.info-text strong {
    font-size: 1rem;
    color: var(--text-dark);
}

/* Custom Profile Tabs */
.custom-profile-tabs {
    background: #f4f6f8;
    padding: 5px;
    border-radius: 30px;
    display: inline-flex;
}

.custom-profile-tabs .nav-link {
    border-radius: 30px;
    color: var(--text-muted);
    font-weight: 700;
    padding: 10px 25px;
    transition: all 0.3s ease;
}

.custom-profile-tabs .nav-link.active {
    background: var(--brand-color);
    color: #fff;
    box-shadow: 0 5px 15px rgba(211, 72, 39, 0.25);
}

.order-card {
    transition: transform 0.3s ease, box-shadow 0.3s;
}

.order-card:hover {
    transform: translateX(-5px); /* حركة خفيفة لليسار بسبب الـ RTL */
    box-shadow: 0 10px 20px rgba(0,0,0,0.05) !important;
    border-color: var(--brand-color) !important;
}

.logout-btn {
    transition: all 0.3s dease;
}

.logout-btn:hover {
    color: var(--text-dark);
}

/* --- Premium Shopping Cart Styles --- */

/* بطاقة المنتج الفردية في السلة */
.cart-item-card {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-radius: 20px !important;
    position: relative;
    overflow: hidden;
}

.cart-item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.05) !important;
    border-color: rgba(213, 72, 39, 0.15) !important;
}

/* حاوية صورة غلاف الكتاب بالسلة */
/* حاوية صورة غلاف الكتاب بالسلة (تقييد صارم للمقاس) */
.cart-item-img-container {
    width: 80px !important;
    height: 120px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: -5px 5px 15px rgba(0,0,0,0.08);
    background: #fff;
    flex-shrink: 0;
}

.cart-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* تحكم الكمية الدائري الفاخر */
.cart-qty-control {
    border: 1px solid rgba(0,0,0,0.04);
}

.cart-qty-control .qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.2s;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.cart-qty-control .qty-btn:hover {
    background: var(--brand-color);
    color: #fff !important;
}

/* زر الحذف الفاخر */
.btn-delete-cart-item {
    background: rgba(220, 53, 69, 0.06);
    border: none;
    color: #dc3545;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-delete-cart-item:hover {
    background: #dc3545;
    color: #fff;
    transform: scale(1.1) rotate(8deg);
}

/* تثبيت كرت الملخص الإجمالي عند نزول الصفحة */
@media (min-width: 992px) {
    .sticky-summary-card {
        position: sticky;
        top: 110px; /* يتناسب مع ارتفاع الهيدر الثابت Glassmorphism Navbar */
        z-index: 10;
    }
}

/* تجميل حقل كود الخصم */
.promo-code-group input {
    font-size: 0.9rem;
}
.promo-code-group button {
    border-radius: 0 15px 15px 0 !important; /* حواف ناعمة متناسقة مع الـ RTL */
    font-weight: bold;
}

/* زر إتمام الشراء الفاخر (مع تأثير اللمعان Shine Sweep المتناسق) */
.btn-checkout-premium {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--brand-color), #ff6b4a);
    color: white !important;
    border: none;
    border-radius: 30px;
    font-weight: 800;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 22px rgba(211, 72, 39, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-checkout-premium::before {
    content: '';
    position: absolute;
    top: 0; 
    left: -100%;
    width: 50%; 
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    z-index: -1;
    transition: left 0.7s ease;
}

.btn-checkout-premium:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(211, 72, 39, 0.4);
}

.btn-checkout-premium:hover::before {
    left: 150%; 
}

/* دائرة أيقونة السلة الفارغة */
.empty-cart-icon-circle {
    width: 100px;
    height: 100px;
    background: rgba(213, 72, 39, 0.08);
    color: var(--brand-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    animation: bounceEmptyCart 2s infinite ease-in-out;
}

@keyframes bounceEmptyCart {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* --- Live Search Styles --- */
.search-wrapper {
    z-index: 1050;
}

.live-search-results {
    position: absolute;
    top: 110%;
    right: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(15px);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    max-height: 350px;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 5px;
    padding: 10px 0;
    text-align: right; /* للغة العربية */
}

.search-result-item {
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(211, 72, 39, 0.08); /* لون براند الوتين شفاف */
}

.search-item-img {
    width: 45px;
    height: 65px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: -2px 2px 8px rgba(0,0,0,0.1);
}

/* سكرول بار مخصص لقائمة البحث */
.live-search-results::-webkit-scrollbar {
    width: 6px;
}
.live-search-results::-webkit-scrollbar-thumb {
    background-color: var(--brand-color);
    border-radius: 10px;
}

/* ========================================= */
/* --- Ultra Premium Search Box (الوتين) --- */
/* ========================================= */

.premium-search-wrapper {
    position: relative;
    min-width: 380px;
    max-width: 550px;
    width: 100%;
    z-index: 1060;
}

/* حاوية البحث الرئيسية (تأثير الزجاج والتظليل) */
.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: #f4f6f8;
    border-radius: 40px;
    padding: 6px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    border: 2px solid #f4f6f8;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* الحركة عند الضغط على مربع البحث */
.search-input-container:focus-within {
    border-color: rgba(211, 72, 39, 0.3); /* لون براند الوتين شفاف */
    box-shadow: 0 12px 35px rgba(211, 72, 39, 0.15);
    transform: translateY(-2px);
    background: #fff;
}

/* أيقونة البحث العائمة */
.search-icon {
    position: absolute;
    right: 22px;
    color: #a0a0a0;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

/* تلوين الأيقونة عند الكتابة */
.search-input-container:focus-within .search-icon {
    color: var(--brand-color);
    transform: scale(1.1);
}

/* حقل إدخال النص */
.search-input-live {
    width: 100%;
    border: none;
    background: #f4f6f8;
    padding: 12px 15px 12px 15px;
    padding-right: 48px; /* مسافة لحماية النص من التداخل مع الأيقونة */
    font-size: 1.05rem;
    color: var(--text-dark);
    outline: none;
    font-weight: 600;
    border-radius: 40px;
}

.search-input-live::placeholder {
    color: #bbb;
    font-weight: 500;
    transition: opacity 0.3s;
}

.search-input-live:focus::placeholder {
    opacity: 0.4; /* تخفيف لون النص التوضيحي عند الكتابة */
}

/* زر البحث الأنيق */
.search-btn-premium {
    background: linear-gradient(135deg, var(--brand-color), #ff6b4a);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 10px 28px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(211, 72, 39, 0.2);
    flex-shrink: 0;
}

.search-btn-premium:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(211, 72, 39, 0.35);
}

/* تحسين شكل القائمة المنسدلة للبحث الحي لتتناسب مع التصميم الجديد */
.premium-search-wrapper .live-search-results {
    border-radius: 25px;
    border: 1px solid rgba(211, 72, 39, 0.1);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
    padding: 15px 0;
    top: 110%; 
}

/* توافق ممتاز مع شاشات الهواتف */
@media (max-width: 991px) {
    .premium-search-wrapper {
        min-width: 100%;
        order: 3;
        margin-top: 15px;
    }
    .search-input-live {
        font-size: 0.95rem;
        padding-right: 42px;
    }
    .search-icon {
        right: 18px;
        font-size: 1rem;
    }
    .search-btn-premium {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
}

/* ========================================= */
/* --- Newsletter Success Animation --- */
/* ========================================= */

.newsletter-success-toast {
    position: fixed;
    bottom: 90px; /* مرفوع قليلاً لكي لا يغطيه شريط الموبايل السفلي */
    right: 30px;
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    border-radius: 20px;
    border-right: 4px solid var(--brand-color);
    background: rgba(255, 255, 255, 0.95);
    /* نقطة البداية خارج الشاشة مع صغر الحجم */
    transform: translateX(120%) scale(0.8);
    opacity: 0;
    /* حركة ارتدادية (Bounce) سريعة ومرنة */
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.newsletter-success-toast.show {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.toast-icon-wrapper {
    width: 50px;
    height: 50px;
    background: rgba(211, 72, 39, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--brand-color);
}

/* حركة طيران الرسالة من داخل الدائرة */
.newsletter-success-toast.show .toast-icon-wrapper i {
    animation: envelopeFly 1.5s ease-out forwards;
}

@keyframes envelopeFly {
    0% { transform: translateY(15px) scale(0.5); opacity: 0; }
    50% { transform: translateY(-5px) scale(1.1); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* توافق الشاشات الصغيرة */
@media (max-width: 768px) {
    .newsletter-success-toast {
        right: 15px;
        left: 15px; /* تمدد على عرض الشاشة مع هوامش */
        bottom: 80px; 
    }
}

/* ========================================= */
/* --- Unified Premium About & Contact --- */
/* ========================================= */

.premium-split-container {
    background: #fff;
    border-radius: 40px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.06);
    overflow: hidden; /* يبقي الجوانب داخل الحواف الدائرية */
    border: 1px solid rgba(0,0,0,0.03);
}

/* --- الجانب الأيمن: من نحن (إبداعي ومظلم) --- */
.creative-about-side {
    background: linear-gradient(135deg, #A9351A 0%, var(--brand-color) 100%);
    overflow: hidden;
}

.badge-modern {
    display: inline-block;
    padding: 6px 15px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: bold;
}

/* دوائر مضيئة عائمة في الخلفية (تأثير Glassmorphism داخلي) */
.blur-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    z-index: 1;
    animation: floatCircle 8s infinite alternate ease-in-out;
}
.circle-1 {
    width: 200px; height: 200px;
    background: rgba(255, 208, 123, 0.4);
    top: -50px; right: -50px;
}
.circle-2 {
    width: 250px; height: 250px;
    background: rgba(255, 255, 255, 0.15);
    bottom: -100px; left: -50px;
    animation-delay: -4s;
}

@keyframes floatCircle {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 30px) scale(1.2); }
}

/* --- الجانب الأيسر: اتصل بنا (الزجاجي الذكي) --- */
.interactive-contact-side {
    position: relative;
    z-index: 5;
}

.icon-pulse-wrapper {
    width: 50px; height: 50px;
    background: rgba(211, 72, 39, 0.1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.icon-pulse-wrapper::after {
    content: ''; position: absolute;
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 2px solid var(--brand-color);
    animation: pulseRing 2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}
@keyframes pulseRing {
    0% { transform: scale(0.9); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* --- حقول الإدخال الذكية (Floating Labels) --- */
.floating-input-group {
    position: relative;
    margin-bottom: 5px;
}

.smart-input {
    width: 100%;
    padding: 16px 20px;
    padding-left: 45px; /* مساحة للأيقونة اليسرى */
    background: #f8f9fa;
    border: 2px solid #eee;
    border-radius: 18px;
    font-size: 1rem;
    color: var(--text-dark);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.01);
}

.floating-input-group label {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 0.95rem;
    pointer-events: none;
    transition: all 0.3s ease;
    background: transparent;
    padding: 0 5px;
    z-index: 2;
}

/* استثناء لمربع النص (Textarea) */
.floating-input-group textarea.smart-input ~ label {
    top: 20px; transform: none;
}

/* الأيقونة داخل الحقل */
.floating-input-group .input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
    font-size: 1.1rem;
    transition: 0.3s;
    z-index: 2;
}
.floating-input-group textarea.smart-input ~ .top-icon {
    top: 25px; transform: none;
}

/* تأثيرات التركيز (Focus Hover) الخرافية */
.smart-input:focus,
.smart-input:not(:placeholder-shown) {
    background: #fff;
    border-color: var(--brand-color);
    box-shadow: 0 8px 25px rgba(211, 72, 39, 0.1);
    outline: none;
}

/* صعود النص (Label) للأعلى عند الكتابة أو التركيز */
.smart-input:focus ~ label,
.smart-input:not(:placeholder-shown) ~ label {
    top: -12px;
    right: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--brand-color);
    background: #fff;
    transform: none;
    border-radius: 5px;
}

.smart-input:focus ~ .input-icon {
    color: var(--brand-color);
    transform: translateY(-50%) scale(1.1);
}
.floating-input-group textarea.smart-input:focus ~ .top-icon {
    transform: scale(1.1);
}

/* تغيير لون الـ Select عند اختيار قيمة */
.smart-input option { color: var(--text-dark); }
.smart-input:valid { color: var(--text-dark) !important; }

/* --- زر الإرسال السحري --- */
.btn-magic-send {
    background: var(--text-dark); /* لون داكن فخم جداً */
    color: #fff !important;
    border: none;
    border-radius: 18px;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
}

.btn-magic-send::before {
    content: ''; position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, var(--brand-color), #ff6b4a);
    opacity: 0; z-index: 1; transition: opacity 0.4s ease;
}

.btn-magic-send .btn-text, .btn-magic-send .arrow-icon {
    position: relative; z-index: 2; transition: transform 0.3s ease;
}

.btn-magic-send:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(211, 72, 39, 0.3);
}

.btn-magic-send:hover::before { opacity: 1; }

/* حركة السهم عند الهوفر */
.btn-magic-send:hover .arrow-icon {
    transform: translateX(-8px);
}

/* توافق الهواتف للقسم الجديد */
@media (max-width: 991px) {
    .premium-split-container { border-radius: 25px; }
    .creative-about-side { border-radius: 25px 25px 0 0; text-align: center !important; }
    .creative-about-side .d-flex { justify-content: center !important; }
}

/* ========================================= */
/* --- Terms & Privacy Page Styles --- */
/* ========================================= */

.custom-policy-tabs {
    gap: 10px;
}

.custom-policy-tabs .nav-link {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1.1rem;
    padding: 15px 25px;
    border-radius: 20px;
    text-align: right;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: transparent;
    border: 1px solid transparent;
}

.custom-policy-tabs .nav-link:hover {
    background: rgba(211, 72, 39, 0.05);
    transform: translateX(-5px); /* حركة لليسار متوافقة مع الـ RTL */
}

.custom-policy-tabs .nav-link.active {
    background: var(--brand-color);
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(211, 72, 39, 0.25);
    border-color: var(--brand-color);
    transform: translateX(-5px);
}

.custom-policy-tabs .nav-link.active i {
    color: #fff !important;
}

/* تنسيق فقرات السياسة */
.policy-item p {
    font-size: 1rem;
    background: #fdfdfd;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #f0f0f0;
}

/* ========================================= */
/* --- Premium Read Book Button --- */
/* ========================================= */
.btn-read-premium {
    position: relative;
    background: transparent;
    color: var(--text-dark);
    border: 2px solid var(--text-dark);
    border-radius: 30px;
    font-weight: 800;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    overflow: hidden;
    z-index: 1;
}

/* خلفية تظهر من الأسفل عند الهوفر */
.btn-read-premium::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--text-dark);
    z-index: -1;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-read-premium:hover {
    color: #fff !important;
    border-color: var(--text-dark);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.btn-read-premium:hover::before {
    transform: scaleY(1);
}

/* ========================================= */
/* --- View All Books Card (Index Page) --- */
/* ========================================= */

.view-all-books-card {
    background: linear-gradient(135deg, var(--brand-color), #ff6b4a);
    border: none;
    border-radius: 20px;
    height: 100%;
    min-height: 380px; /* لتتناسب مع طول بطاقات الكتب الأخرى */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(211, 72, 39, 0.15);
}

/* علامة مائية شفافة لأيقونة كتاب تظهر في الخلفية */
.view-all-books-card::before {
    content: '\f02d'; /* كود أيقونة fa-book في FontAwesome */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    font-size: 14rem;
    color: rgba(255, 255, 255, 0.04);
    bottom: -30px;
    left: -40px;
    transform: rotate(-15deg);
    transition: all 0.6s ease;
    pointer-events: none;
}

/* تأثيرات الهوفر (Hover) للبطاقة بالكامل */
.view-all-books-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(211, 72, 39, 0.35);
}

.view-all-books-card:hover::before {
    transform: rotate(0deg) scale(1.1);
    color: rgba(255, 255, 255, 0.08);
}

/* تصميم دائرة الأيقونة الزجاجية */
.view-all-icon-wrapper {
    width: 75px;
    height: 75px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #fff;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: 0 auto;
}

/* حركة السهم عند الهوفر */
.view-all-books-card:hover .view-all-icon-wrapper {
    background: #fff;
    color: var(--brand-color);
    transform: scale(1.15) translateX(-5px); /* تكبير وحركة خفيفة للسهم باتجاه اليسار */
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* ========================================= */
/* --- Checkout & Success Page Styles --- */
/* ========================================= */

.invoice-row {
    padding-bottom: 5px;
}

/* أنميشن علامة الصح الفاخرة */
.success-checkmark {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    font-size: 3.5rem;
    position: relative;
    z-index: 2;
    animation: popInSuccess 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform: scale(0);
}

@keyframes popInSuccess {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    80% { transform: scale(1.2) rotate(10deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* تأثير احتفالي خفيف في الخلفية */
.confetti-bg {
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(211,72,39,0.05) 0%, rgba(255,255,255,0) 60%);
    z-index: 1;
    animation: rotateBg 15s linear infinite;
    pointer-events: none;
}

@keyframes rotateBg {
    100% { transform: rotate(360deg); }
}

/* ========================================= */
/* --- Admin Dashboard Button (VIP Style) --- */
/* ========================================= */
.btn-premium-admin {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: var(--text-dark) !important; /* لون ذهبي أنيق */
    border: 1px solid rgba(255, 208, 123, 0.15);
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

/* لمعة متحركة داخل الزر لتعطيه طابعاً فخماً جداً */
.btn-premium-admin::after {
    content: 'لوحه التحكم';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,208,123,0.15) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    animation: shineAdmin 4s infinite; /* تتكرر كل 4 ثواني */
}

@keyframes shineAdmin {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

/* تأثير الهوفر (Hover) */
.btn-premium-admin:hover {
    background: #000;
    color: #fff !important;
    border-color: #ffd07b;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 208, 123, 0.25);
}

.btn-premium-admin i {
    color: inherit;
    transition: transform 0.3s ease;
}

/* حركة خفيفة للأيقونة عند الهوفر */
.btn-premium-admin:hover i {
    transform: scale(1.15);
}