/* --- 1. إعدادات عامة ومتغيرات الألوان --- */
:root {
    --primary-color: #2C5E65;
    /* كحلي مخضر هادئ - يمنح شعوراً بالثقة والاستقرار */
    --accent-color: #61A4AD;
    /* أزرق سماوي ناعم - يرمز للأمل والتجدد */
    --bg-light: #F7F9FA;
    /* خلفية بيضاء مائلة للرمادي البارد المريح للعين */
    --text-dark: #2B383A;
    /* لون نصوص داكن ومريح للقراءة */
    --text-muted: #6E7E85;
    /* لون نصوص ثانوية */
    --white: #FFFFFF;
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-subtle: 0 4px 20px rgba(44, 94, 101, 0.08);
    --bg-dark: #0f1e22;       /* خلفية داكنة مريحة جداً للعين ومستوحاة من الليل والسكون */
    --primary-teal: #61a4ad;  /* لون السكون الأساسي */
    --primary-light: #e2f1f3; /* اللون الفاتح للنصوص */
    --white-pure: #ffffff;
    --text-muted: #a3b8bc;
    --transition-cubic: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* التعديل 1: تثبيت مساحة السكرول بار لمنع أي هزة أفقية في الموقع */
html {
    scrollbar-gutter: stable;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    overflow-x: hidden;
}

/* --- 2. الهيدر والشريط العلوي --- */
.main-header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    /* تأثير زجاجي عصري */
    -webkit-backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--shadow-subtle);
    transition: var(--transition-smooth);
}

/* لتصغير الهيدر بشكل احترافي عند سكرول الماوس */
.main-header.scrolled {
    padding: 5px 0;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 30px rgba(44, 94, 101, 0.12);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- 3. تصميم اللوجو الاحترافي --- */
.logo-text-link {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-main {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.logo-sub {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.logo-dot {
    color: var(--accent-color);
    display: inline-block;
    font-weight: bold;
}

/* لوجو الموبايل المخفي افتراضياً */
.mobile-menu-logo {
    display: none;
    margin-bottom: 40px;
}

/* --- 4. قائمة التنقل (Desktop) --- */
.nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 30px;
}

.nav-item {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1rem;
    padding: 8px 4px;
    position: relative;
    transition: var(--transition-smooth);
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-color);
}

/* خط تزييني ناعم يظهر تحت اللينك النشط وعند الحوم */
.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 2px;
    transition: var(--transition-smooth);
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 100%;
}

/* زر "تواصل معنا" المتميز داخل القائمة */
.nav-item.contact-btn {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 10px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(44, 94, 101, 0.2);
}

.nav-item.contact-btn:hover {
    background-color: var(--accent-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(97, 164, 173, 0.4);
}

.nav-item.contact-btn::after {
    display: none;
    /* إلغاء الخط السفلي للزر */
}


/* ==================== نظام الـ Mega Dropdown المطور للمقالات (فتح بالضغط) ==================== */

/* في الديسكتوب: إلغاء relative لتأخذ القائمة عرض الشاشة بالكامل بناءً على الهيدر */
@media (min-width: 769px) {
    .nav-item-dropdown {
        position: static;
    }
}

/* السهم الصغير بجانب كلمة المقالات */
.dropdown-icon {
    font-size: 0.7rem;
    margin-right: 5px;
    transition: var(--transition-smooth);
    display: inline-block;
    vertical-align: middle;
}

/* لوحة الميجا منيو المنسدلة (ستارة كاملة العرض) */
.dropdown-menu {
    position: absolute;
    top: 100%;
    /* تظهر أسفل الهيدر مباشرة */
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 25px 50px rgba(44, 94, 101, 0.12);
    border-bottom: 3px solid var(--primary-color);
    /* شريط سفلي جمالي بلون الهوية */
    z-index: 999;

    /* حشو داخلي متناسق يضمن بقاء العناصر في منتصف الشاشة مع الحواف */
    padding: 40px calc((100% - 1200px) / 2 + 20px);

    /* تأثير الستارة المبدئي (مغلق) */
    opacity: 0;
    visibility: hidden;
    transform: scaleY(0);
    /* مطوية */
    transform-origin: top;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

/* الكلاس الخاص بفتح الستارة عند الضغط (JS Triggered) */
.nav-item-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: scaleY(1);
    /* تفتح كستارة لأسفل */
}

/* تدوير السهم الصغير عند الفتح */
.nav-item-dropdown.open .dropdown-icon {
    transform: rotate(180deg);
    color: var(--accent-color);
}

/* تقسيم الشبكة الداخلي للمقالات (5 أعمدة) */
.dropdown-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 30px;
    direction: rtl;
    /* اتجاه الكتابة عربي */
}

/* العمود الفردي */
.dropdown-col {
    display: flex;
    flex-direction: column;
}

/* عنوان الكاتيجوري الرئيسي */
.col-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(97, 164, 173, 0.2);
    position: relative;
}

/* الروابط الفرعية داخل الكاتيجوري */
.col-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.col-links li a {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.6;
    transition: var(--transition-smooth);
    display: block;
}

.col-links li a:hover {
    color: var(--accent-color);
    transform: translateX(-6px);
    /* إزاحة ناعمة لليمين عند تمرير الماوس */
}


/* --- 5. زر الهامبرجر (شاشات الموبايل) --- */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1010;
}

.hamburger-btn .bar {
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 10px;
    transition: var(--transition-smooth);
    transform-origin: right;
}

/* --- 6. تأثيرات الخلفية المظلمة (Overlay) المعدلة لمنع التهنيج والهزة --- */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(44, 94, 101, 0.35);
    z-index: 990;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
    will-change: opacity, visibility;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}


/* --- 7. التجاوب مع الشاشات (Responsive Design) --- */
@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }

    /* تحويل القائمة الجانبية في الموبايل */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background-color: var(--white);
        z-index: 1000;
        padding: 40px 24px;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
        transition: var(--transition-smooth);
        display: flex;
        flex-direction: column;
        will-change: right;
        overflow-y: auto;
    }

    .nav-menu.active {
        right: 0;
    }

    .mobile-menu-logo {
        display: flex;
        flex-direction: column;
    }

    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 25px;
        width: 100%;
    }

    .nav-item {
        width: 100%;
        display: block;
        font-size: 1.1rem;
    }

    .contact-li {
        width: 100%;
        margin-top: 15px;
    }

    .nav-item.contact-btn {
        text-align: center;
    }

    /* حركة تحول زر الهامبرجر إلى علامة (X) عند الفتح */
    .hamburger-btn.active .bar:nth-child(1) {
        transform: rotate(-45deg);
    }

    .hamburger-btn.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger-btn.active .bar:nth-child(3) {
        transform: rotate(45deg);
    }

    /* ==================== الموبايل: إخفاء الدروب داون نهائياً والتحويل المباشر ==================== */
    .dropdown-menu {
        display: none !important;
    }

    .dropdown-icon {
        display: none !important;
    }
}


/* تنسيق عنصر المقالات ليحتوي على النقطة */
.nav-articles {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* النقطة الحمراء الأساسية */
.live-pulse {
    width: 8px;
    height: 8px;
    background-color: #ff4d4d;
    border-radius: 50%;
    position: relative;
    display: inline-block;
}

/* الحلقة اللي بتعمل تأثير النبض (Pulse) الخلفي باللون الأحمر */
.live-pulse::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #ff4d4d;
    animation: pulse-animation 1.8s infinite ease-in-out;
    opacity: 0.6;
}

/* حركة النبض المستمر */
@keyframes pulse-animation {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(2.8);
        opacity: 0;
    }
}
/* --- 8. قسم الهيرو الاحترافي (Hero Section) --- */
/* --- تصميم هيرو سكون الفاخر المطور (Premium Editorial Layout) --- */
.skoon-editorial-hero {
    position: relative;
    min-height: 100vh;
    width: 100%;
    background-color: #fcfbfa;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 140px 0 80px 0;
    direction: rtl;
    box-sizing: border-box;
}

/* خلفية الموبايل والتابلت */
.responsive-bg-image {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

/* العازل الأسود السينمائي لزيادة وضوح النصوص في الموبايل */
.responsive-bg-image::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(15, 23, 25, 0.78) 0%, rgba(15, 23, 25, 0.94) 100%);
    z-index: 2;
}

/* الهالات الضوئية للشاشات الكبيرة */
.interactive-aura {
    position: absolute;
    border-radius: 50%;
    filter: blur(160px);
    opacity: 0.4;
    pointer-events: none;
    z-index: 1;
}

.aura-primary {
    top: -10%;
    left: 10%;
    width: 500px;
    height: 500px;
    background-color: #e0eff1;
}

.aura-secondary {
    bottom: 5%;
    right: 5%;
    width: 450px;
    height: 450px;
    background-color: #f3eae1;
}

/* الحاوية الرئيسية */
.editorial-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 60px;
    align-items: center;
}

/* الجانب النصي */
.editorial-text-side {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: all 0.4s ease;
}

.minimal-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(61, 111, 117, 0.05);
    border: 1px solid rgba(61, 111, 117, 0.1);
    padding: 6px 14px;
    border-radius: 100px;
    margin-bottom: 24px;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background-color: #3d6f75;
    border-radius: 50%;
}

.badge-text {
    color: #3d6f75;
    font-size: 0.85rem;
    font-weight: 600;
}

.editorial-title {
    font-size: clamp(2.3rem, 4vw + 1rem, 4.2rem);
    color: #1a2b2d;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 20px;
    letter-spacing: -1px;
    transition: color 0.4s ease;
}

.editorial-gradient {
    color: #3d6f75;
    transition: color 0.4s ease;
}

.editorial-description {
    font-size: clamp(1rem, 0.3vw + 0.9rem, 1.15rem);
    color: #4a5759;
    line-height: 1.9;
    max-width: 560px;
    margin-bottom: 35px;
    transition: color 0.4s ease;
}

/* حاوية الأزرار - عمودية دائماً */
.editorial-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 45px;
    width: 100%;
    max-width: 400px;
}

/* الأزرار بالأسود الشفاف (Dark Glassmorphism) */
.editorial-btn.btn-dark-glass {
    position: relative;
    width: 100%;
    text-decoration: none;
    padding: 18px 28px;
    font-weight: 600;
    font-size: 0.98rem;
    color: #ffffff;
    background: rgba(26, 43, 45, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    z-index: 1;
    transition: background 0.4s ease, border-color 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    box-sizing: border-box;
}

.arrow-icon {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.editorial-btn.btn-dark-glass:hover {
    background: #1a2b2d;
    border-color: rgba(61, 111, 117, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(26, 43, 45, 0.15);
}

.editorial-btn.btn-dark-glass:hover .arrow-icon {
    transform: translateX(-6px);
}

/* الإحصائيات (تظل بجانب بعضها مع توزيع مرن ومتناسق) */
.editorial-stats {
    display: flex;
    align-items: center;
    gap: 32px;
    border-top: 1px solid rgba(61, 111, 117, 0.1);
    padding-top: 24px;
    width: 100%;
    transition: border-color 0.4s ease;
}

.editorial-stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a2b2d;
    transition: color 0.4s ease;
}

.stat-desc {
    font-size: 0.85rem;
    color: #657577;
    transition: color 0.4s ease;
    line-height: 1.4;
}

.editorial-stat-divider {
    width: 1px;
    height: 40px;
    background-color: rgba(61, 111, 117, 0.15);
    transition: background-color 0.4s ease;
}

/* الجانب البصري */
.editorial-visual-side {
    display: flex;
    justify-content: center;
    align-items: center;
}

.glass-layers-composition {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 0.82;
}

.glass-backdrop-plate {
    position: absolute;
    top: -16px;
    left: -16px;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    z-index: 1;
}

.editorial-image-frame {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 24px;
    overflow: hidden;
    z-index: 2;
    border: 6px solid #ffffff;
    box-shadow: 0 30px 60px rgba(26, 43, 45, 0.08);
}

.editorial-target-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

/* الكارت الشفاف العائم */
.glass-floating-badge {
    position: absolute;
    bottom: 25px;
    right: -30px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    padding: 14px 20px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 3;
    box-shadow: 0 20px 40px rgba(26, 43, 45, 0.05);
    animation: editorialFloat 6s ease-in-out infinite;
}

.glass-badge-icon {
    background: rgba(61, 111, 117, 0.08);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.glass-badge-content h4 {
    color: #1a2b2d;
    font-size: 0.9rem;
    margin-bottom: 2px;
    font-weight: 700;
}

.glass-badge-content p {
    color: #566668;
    font-size: 0.75rem;
    white-space: nowrap;
}

@keyframes editorialFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* ==================== الـ Responsive الاحترافي الذكي والمطور ==================== */
@media (max-width: 992px) {
    .editorial-visual-side {
        display: none;
    }

    /* تفعيل الخلفية المظلمة */
    .responsive-bg-image {
        display: block;
    }

    .skoon-editorial-hero {
        padding-top: 150px;
        padding-bottom: 60px;
    }

    .editorial-container {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* سنترة المحتوى بالكامل في الموبايل */
    .editorial-text-side {
        align-items: center;
        text-align: center;
        width: 100%;
    }

    /* تحويل ألوان النصوص للأبيض لضمان أعلى وضوح فوق العازل الأسود */
    .editorial-title {
        color: #ffffff;
    }

    .editorial-gradient {
        color: #64b5be;
        /* درجة تيال مضيئة تتناسب مع الخلفية الغامقة */
    }

    .editorial-description {
        color: #dae3e4;
        /* رمادي فاتح مريح للقراءة */
    }

    .editorial-description strong {
        color: #ffffff;
    }

    /* تعديل شارة البراند لتناسب الخلفية السوداء */
    .minimal-badge {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
    }

    .badge-text {
        color: #64b5be;
    }

    .badge-dot {
        background-color: #64b5be;
    }

    /* تعديل الأزرار لتتناسب مع التباين الجديد */
    .editorial-btn.btn-dark-glass {
        border-color: rgba(255, 255, 255, 0.15);
        background: rgba(255, 255, 255, 0.07);
    }

    .editorial-btn.btn-dark-glass:hover {
        background: rgba(255, 255, 255, 0.15);
        border-color: #64b5be;
    }

    .editorial-actions {
        margin-left: auto;
        margin-right: auto;
    }

    /* 🚨 الحفاظ على الإحصائيات بجانب بعضها بشكل متقن في وضع الموبايل والتابلت */
    .editorial-stats {
        justify-content: center;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        max-width: 500px;
        margin: 0 auto;
        gap: 24px;
        /* مسافة متناسقة للموبايل */
    }

    .stat-number {
        color: #ffffff;
        font-size: 1.6rem;
        /* تصغير طفيف ليناسب الشاشات الصغيرة */
    }

    .stat-desc {
        color: #a3b2b5;
        font-size: 0.8rem;
    }

    .editorial-stat-divider {
        background-color: rgba(255, 255, 255, 0.15);
        height: 35px;
    }
}

@media (max-width: 480px) {

    /* تحسينات إضافية لشاشات الموبايل الصغيرة جداً لمنع أي تكدس */
    .editorial-stats {
        gap: 16px;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    .stat-desc {
        font-size: 0.75rem;
    }
}








        /* --- تصميم قسم المقالات --- */
        .articles-section {
            background-color: var(--bg-light);
            padding: 80px 20px;
            text-align: center;
        }

        .section-title {
            color: var(--primary-color);
            font-size: 2.2rem;
            margin: 0 0 10px 0;
            font-weight: 700;
        }

        .section-subtitle {
            color: var(--text-muted);
            font-size: 1.1rem;
            margin-bottom: 40px;
        }

        /* الحاوية الأساسية للكروت */
        .articles-container {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 30px;
            max-width: 1200px;
            margin: 0 auto 50px auto;
        }

        /* تصميم الكارت الفردي (تم إزالة البوردر راديوس والظلال) */
        .article-card {
            background-color: var(--white);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            text-align: right;
            /* تم إلغاء الـ border-radius والـ box-shadow والـ hover من هنا */
        }

        .article-image {
            width: 100%;
            height: 220px;
            background-color: #e0e6e8;
            background-size: cover;
            background-position: center;
        }

        .article-content {
            padding: 24px;
            display: flex;
            flex-direction: column;
            flex-grow: 1;
        }

        .article-tag {
            color: var(--accent-color);
            font-size: 0.85rem;
            font-weight: 600;
            margin-bottom: 12px;
            display: inline-block;
        }

        .article-card-title {
            color: var(--primary-color);
            font-size: 1.25rem;
            margin: 0 0 12px 0;
            line-height: 1.5;
            font-weight: 600;
        }

        .article-excerpt {
            color: var(--text-muted);
            font-size: 0.95rem;
            line-height: 1.6;
            margin-bottom: 24px;
            flex-grow: 1;
        }

        .read-more {
            color: var(--primary-color);
            text-decoration: none;
            font-weight: 700;
            font-size: 0.95rem;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            transition: var(--transition-smooth);
        }

        .read-more:hover {
            color: var(--accent-color);
            padding-right: 5px; /* حركة سهم بسيطة ومريحة */
        }

        /* زر عرض المزيد المربوط بصفحة كل المقالات */
        .view-all-btn {
            display: inline-block;
            background-color: var(--primary-color);
            color: var(--white);
            text-decoration: none;
            padding: 14px 40px;
            border-radius: 50px;
            font-weight: 600;
            font-size: 1rem;
            box-shadow: var(--shadow-subtle);
            transition: var(--transition-smooth);
        }

        .view-all-btn:hover {
            background-color: var(--accent-color);
            transform: translateY(-3px);
            box-shadow: var(--shadow-hover);
        }

        /* --- الشاشات الموبايل والتابلت (Responsive Slider) --- */
        @media (max-width: 1024px) {
            .articles-container {
                display: flex;
                overflow-x: auto;
                scroll-snap-type: x mandatory;
                padding: 10px 20px 30px 20px;
                margin-right: -20px;
                margin-left: -20px;
                gap: 20px;
                scroll-behavior: smooth;
                -webkit-overflow-scrolling: touch;
            }

            .articles-container::-webkit-scrollbar {
                height: 5px;
            }
            .articles-container::-webkit-scrollbar-thumb {
                background: var(--accent-color);
                border-radius: 10px;
            }

            .article-card {
                flex: 0 0 290px;
                scroll-snap-align: start;
            }
        }




/* لضمان عدم خروج أي عنصر أو ضغط المحتوى داخلياً */
.books-section * {
    box-sizing: border-box;
}

/* --- 2. حاوية قسم الكتب الأساسي --- */
.books-section {
    background-color: var(--bg-light);
    padding: 80px 0; 
    direction: rtl; 
    overflow: hidden; 
}

.section-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* رأس القسم */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-badge {
    background: rgba(44, 94, 101, 0.06);
    color: var(--primary-color);
    padding: 6px 18px;
    border-radius: 0px; 
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.section-title {
    color: var(--text-dark);
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 14px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    max-width: 550px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ==========================================================================
   3. الـ Grid المتجاوب (سكرول حر 100% للموبايل والـ Grid للكمبيوتر)
   ========================================================================== */
.books-grid-container {
    display: flex;
    overflow-x: auto; 
    scroll-snap-type: x mandatory; 
    scroll-behavior: smooth;
    gap: 20px;
    padding: 10px 20px 30px 20px; 
    margin: 0 -20px; 
    scrollbar-width: none; 
}

.books-grid-container::-webkit-scrollbar {
    display: none;
}

/* الكرت الفلات المتجاوب بأريحية كاملة وبدون أي قيود عرض */
.book-product-card {
    background: var(--white);
    border-radius: 0px; 
    overflow: hidden;
    display: flex;
    flex-direction: column; 
    border: var(--border-flat);
    transition: var(--transition-smooth);
    
    /* الكرت يأخذ مساحة الشاشة كاملة تقريباً ليرتاح النص والأزرار تماماً */
    flex: 0 0 88vw; 
    scroll-snap-align: center; 
}

.book-product-card:hover {
    border-color: var(--primary-color);
}

/* حاوية الصورة المتجاوبة بدقة */
.card-image-wrapper {
    position: relative;
    background: #FDFCF9; 
    padding: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 280px; 
    border-bottom: 1px solid rgba(44, 94, 101, 0.06);
    overflow: hidden;
}

.book-card-img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: var(--transition-smooth);
}

.book-product-card:hover .book-card-img {
    transform: scale(1.03);
}

/* شارات الخصم الحادة */
.card-badge-discount {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #E74C3C;
    color: var(--white);
    padding: 4px 10px;
    border-radius: 0px; 
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
}

/* محتوى تفاصيل الكرت */
.card-content-wrapper {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    width: 100%;
}

.card-author {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 8px;
    font-weight: 600;
}

.card-book-title {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 12px;
    font-weight: 700;
    line-height: 1.5;
}

.card-book-brief {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* الأسعار */
.card-price-row {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-current-price {
    font-size: 22px;
    font-weight: 850;
    color: var(--primary-color);
}

.card-old-price {
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.8;
}

/* صف الأزرار الحادة */
.card-actions-row {
    display: flex;
    gap: 12px;
    width: 100%;
}

.btn-card-buy, .btn-card-preview {
    padding: 14px 16px; /* زيادة البادينج لتصبح مريحة جداً للمس في الموبايل */
    border-radius: 0px; 
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.btn-card-buy {
    background: var(--primary-color);
    color: var(--white);
    flex: 1.4; 
}

.btn-card-buy:hover {
    background: var(--text-dark);
}

.btn-card-preview {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--accent-color);
    flex: 1; 
    cursor: pointer;
}

.btn-card-preview:hover {
    background: rgba(97, 164, 173, 0.08);
    border-color: var(--primary-color);
}

/* ==========================================================================
   4. استايل السلايد والـ Modal للفهرس (Ultra Clean Slide-Up)
   ========================================================================== */
.index-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: flex-end; 
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.index-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 39, 41, 0.4); 
    backdrop-filter: blur(4px);
}

.modal-wrapper {
    position: relative;
    background: var(--white);
    width: 100%;
    max-width: 500px;
    border-radius: 0px; 
    padding: 30px 24px;
    z-index: 10;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.05);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.index-modal.active .modal-wrapper {
    transform: translateY(0);
}

.close-modal-btn {
    position: absolute;
    top: 20px;
    left: 24px;
    background: var(--bg-light);
    border: none;
    font-size: 20px;
    color: var(--text-dark);
    width: 36px;
    height: 36px;
    border-radius: 0px; 
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.close-modal-btn:hover {
    background: #E74C3C;
    color: var(--white);
}

.modal-title {
    font-size: 18px;
    color: var(--text-dark);
    font-weight: 700;
    margin-bottom: 24px;
    text-align: right;
    padding-left: 45px;
}

.modal-scroll-container {
    overflow-y: auto;
    flex-grow: 1;
}

.modal-scroll-container img {
    width: 100%;
    height: auto;
    border-radius: 0px;
    margin-top: 8px;
    display: block;
}

/* ==========================================================================
   5. شاشات التابلت والكمبيوتر (Responsive Breakpoints)
   ========================================================================== */
@media (max-width: 767px) {
    .section-title {
        font-size: 26px;
    }
}

@media (min-width: 768px) {
    /* إلغاء السكرول والتحول إلى كروت مرنة تأخذ راحتها في الـ Grid */
    .books-grid-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
        gap: 30px; 
        padding: 0;
        margin: 0;
        overflow-x: visible; 
    }

    .book-product-card {
        flex: unset; /* إلغاء الـ 88vw الخاصة بالموبايل فوراً */
    }

    /* النوافذ المنبثقة تظهر في السنتر في الشاشات الكبيرة */
    .index-modal {
        align-items: center;
    }
    .modal-wrapper {
        transform: scale(0.95) translateY(20px);
        border: var(--border-flat);
    }
    .index-modal.active .modal-wrapper {
        transform: scale(1) translateY(0);
    }
}

/* --- 10. قسم الفوتر الاحترافي (Footer Section) --- */
.main-footer {
    background-color: #1b2b2e;
    /* اللون الداكن المشتق من هوية العيادة ليعطي عمق وفخامة */
    color: #e2ebeb;
    padding-top: 60px;
    font-family: inherit;
    position: relative;
    border-top: 2px solid rgba(97, 164, 173, 0.15);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* توزيع الأعمدة بنظام الجريد */
.footer-top .footer-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 40px;
    padding-bottom: 50px;
}

/* عمود الهوية والشعار */
.brand-col .logo-text-link {
    text-decoration: none;
    display: inline-block;
    margin-bottom: 20px;
}

.brand-col .logo-main {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
}

.brand-col .logo-sub {
    font-size: 0.9rem;
    color: var(--accent-color);
    display: block;
    margin-top: -5px;
}

.brand-col .logo-dot {
    color: var(--accent-color);
    font-size: 2rem;
}

.brand-desc {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #b1c4c6;
    margin-bottom: 25px;
}

/* أيقونات السوشيال ميديا التفاعلية */
.social-links {
    display: flex;
    gap: 12px;
}

.social-icon {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.05);
    color: #e2ebeb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.social-icon:hover {
    background: var(--accent-color);
    color: var(--white);
    transform: translateY(-4px);
    box-shadow: 0 5px 15px rgba(97, 164, 173, 0.3);
}

/* عناوين الأعمدة */
.footer-title {
    font-size: 1.15rem;
    color: #fff;
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

/* خط تجميلي صغير تحت عنوان كل عمود */
.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 35px;
    height: 2px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

/* قوائم اللنكات */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #b1c4c6;
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    display: inline-block;
}

/* تأثير أنيق عند تمرير الماوس على اللينك */
.footer-links a:hover {
    color: var(--accent-color);
    transform: translateX(-5px);
    /* يتحرك قليلاً لليمين في الأنظمة العربية rtl */
}

/* عمود بيانات الاتصال */
.contact-info {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-info li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    color: #b1c4c6;
    font-size: 0.95rem;
    line-height: 1.5;
}

.contact-info i {
    color: var(--accent-color);
    margin-top: 4px;
    font-size: 1rem;
}

/* الجزء السفلي: حقوق الملكية */
.footer-bottom {
    background-color: #142022;
    /* أغمق بقليل ليفصل الجزء السفلي */
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    text-align: center;
}

.copyrights {
    font-size: 0.88rem;
    color: #8fa4a6;
    margin: 0;
}

.copyrights strong {
    color: var(--accent-color);
    font-weight: 600;
}

/* --- توافق الفوتر مع الشاشات المختلفة (Responsive) --- */
@media (max-width: 992px) {
    .footer-top .footer-container {
        grid-template-columns: 1fr 1fr;
        /* عمودين بجانب بعضهما في الشاشات المتوسطة */
        gap: 40px;
    }
}

@media (max-width: 576px) {
    .footer-top .footer-container {
        grid-template-columns: 1fr;
        /* عمود واحد مفرود على الموبايل لشاشات مريحة */
        gap: 35px;
        text-align: center;
    }

    .footer-title::after {
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        /* توسيط الخط التجميلي على الموبايل */
    }

    .social-links {
        justify-content: center;
    }

    .contact-info li {
        justify-content: center;
    }

    .footer-links a:hover {
        transform: translateY(-2px);
        /* تغيير الحركة للأعلى بدلاً من اليمين لتناسب التوسيط */
    }
}
