@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&display=swap');

/* --- 1. المتغيرات الأساسية (CSS Variables) --- */

:root {
    --reflex-blue: #0B1F8F;
    --blue-bright: #0D52C1;
    --accent-red: #D91B24;
    --lemon-yellow: #FFD000;
    --bg-main: #DCE4EC;
    --card-bg: #FFFFFF;
    --text-dark: #1F2937;
    --text-muted: #6B7280;
    --radius: 16px;
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 12px 35px rgba(11, 31, 143, 0.2);
    --transition: all 0.3s ease;
}


/* --- 2. إعدادات الصفحة العامة --- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-wrapper,
.container {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}


/* --- 3. الهيدر العلوي وشريط التنقل --- */

.top-navbar {
    background-color: #FFFFFF;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid var(--accent-red);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.logo-container,
.logo {
    display: flex !important;
    align-items: center !important;
    max-height: 45px !important;
    width: auto !important;
}

.logo-container img,
.logo img,
.top-navbar .logo-container img {
    height: 45px !important;
    max-height: 45px !important;
    width: auto !important;
    max-width: 150px !important;
    object-fit: contain !important;
}


/* الناف بار والتنقل الرئيسي */

.main-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.2rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--reflex-blue);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links .active>a {
    color: var(--accent-red);
    background-color: rgba(11, 31, 143, 0.05);
}


/* القائمة المنسدلة (Dropdown) */

.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #FFFFFF;
    min-width: 200px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    border: 2px solid var(--reflex-blue);
    padding: 0.5rem 0;
    z-index: 1000;
    list-style: none;
}

.dropdown-menu li a {
    display: block;
    padding: 0.6rem 1.2rem;
    color: var(--text-dark);
    font-weight: 600;
    white-space: nowrap;
}

.dropdown-menu li a:hover {
    background-color: var(--reflex-blue);
    color: #FFFFFF;
}

.dropdown:hover .dropdown-menu {
    display: block;
}


/* حاوية البانر الرئيسي */


/* Container Box */

.swiper-button-next,
.swiper-button-prev {
    color: #ffffff !important;
}

.swiper-pagination-bullet-active {
    background: #FFD000 !important;
}

.swiper-button-next,
.swiper-button-prev {
    color: #ffffff !important;
    z-index: 10;
}

.swiper-pagination-bullet-active {
    background: #FFD000 !important;
}

.swiper-button-next,
.swiper-button-prev {
    color: #ffffff !important;
    z-index: 10;
}

.swiper-pagination-bullet-active {
    background: var(--lemon-yellow, #FFD000) !important;
}

.swiper-button-next,
.swiper-button-prev {
    color: #ffffff !important;
    z-index: 10;
}

.swiper-pagination-bullet-active {
    background: var(--lemon-yellow) !important;
}


/* --- 5. شبكة المنتجات --- */

.section-title {
    color: var(--reflex-blue);
    font-size: 1.5rem;
    font-weight: 800;
    margin: 2rem 0 1.5rem 0;
    border-right: 5px solid var(--accent-red);
    padding-right: 12px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
    justify-content: center;
    gap: 2rem;
    margin: 0 auto 3rem auto;
    width: 100%;
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 3px solid var(--reflex-blue);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.product-card img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    margin-bottom: 1rem;
    mix-blend-mode: multiply;
    border: 1px solid rgba(11, 31, 143, 0.2);
    border-radius: 10px;
    padding: 8px;
    background-color: #FFFFFF;
}

.product-title {
    font-size: 1.1rem;
    color: var(--reflex-blue);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent-red);
    margin-bottom: 1rem;
}

.btn-details {
    display: inline-block;
    background-color: #0B1F8F;
    /* لون الهوية الخاص بك */
    color: #ffffff !important;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: bold;
    font-size: 0.95rem;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}


/* تأثير عند مرور الماوس فوق الزر */

.btn-details:hover {
    background-color: #081666;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}


/* --- 6. النافذة المنبثقة Modal --- */

.modal {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.8) !important;
    z-index: 99999 !important;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(6px);
}

.modal-content {
    background: #FFFFFF;
    width: 90%;
    max-width: 850px;
    border-radius: var(--radius);
    padding: 2.5rem;
    position: relative;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    border: 3px solid var(--reflex-blue);
}

.modal-img-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #FAFAFA;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-img-container img {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.close-btn {
    position: absolute;
    top: 12px;
    left: 18px;
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--accent-red);
    cursor: pointer;
    line-height: 1;
}


/* --- 7. نماذج الإدخال والأزرار --- */

.form-container {
    max-width: 650px;
    margin: 3rem auto;
    background: #FFFFFF;
    padding: 2.5rem;
    border-radius: var(--radius);
    border: 3px solid var(--reflex-blue);
    box-shadow: var(--shadow-lg);
}

.form-title {
    color: var(--reflex-blue);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-align: center;
    border-bottom: 3px solid var(--accent-red);
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 700;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.btn-submit,
.btn-edit,
.btn-update,
button[type="submit"],
button[name="add_product"],
button[name="update_product"],
button[name="edit_product"] {
    display: block !important;
    width: 100%;
    background-color: var(--reflex-blue) !important;
    color: #FFFFFF !important;
    font-size: 1.1rem;
    font-weight: 800;
    padding: 0.9rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: var(--transition);
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: 0 4px 12px rgba(11, 31, 143, 0.3);
}

.btn-submit:hover,
.btn-edit:hover,
.btn-update:hover,
button[type="submit"]:hover,
button[name="add_product"]:hover,
button[name="update_product"]:hover,
button[name="edit_product"]:hover {
    background-color: var(--accent-red) !important;
    transform: translateY(-2px);
}


/* --- 8. جدول لوحة التحكم --- */

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #FFFFFF;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-top: 1.5rem;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: right;
    vertical-align: middle;
    border-bottom: 1px solid #E2E8F0;
}

.admin-table img,
.product-admin-thumb {
    width: 150px !important;
    height: 150px !important;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid #CBD5E1;
    padding: 6px;
    background-color: #FFFFFF;
}

.admin-table td:last-child,
td.action-cell {
    white-space: nowrap !important;
    width: 1% !important;
}

.action-buttons {
    display: inline-flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

.action-buttons a,
.action-buttons button,
.btn-edit-sm,
.btn-delete-sm,
td a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    padding: 0.5rem 1.2rem !important;
    font-size: 0.95rem !important;
    font-weight: 700;
    border-radius: 6px;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-edit-sm,
a[href*="edit"] {
    background-color: var(--reflex-blue, #0B1F8F) !important;
    color: #FFFFFF !important;
}

.btn-edit-sm:hover,
a[href*="edit"]:hover {
    background-color: var(--blue-bright, #0D52C1) !important;
    transform: translateY(-2px);
}

.btn-delete-sm,
a[href*="delete"] {
    background-color: var(--accent-red, #D91B24) !important;
    color: #FFFFFF !important;
}

.btn-delete-sm:hover,
a[href*="delete"]:hover {
    background-color: #B91C1C !important;
    transform: translateY(-2px);
}


/* --- 9. التذييل (Footer) --- */

.site-footer {
    background-color: var(--reflex-blue);
    color: #FFFFFF;
    margin-top: auto;
    border-top: 4px solid var(--accent-red);
    width: 100%;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 1.5rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-col h3 {
    color: var(--lemon-yellow);
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.footer-col p {
    color: #E0E7FF;
    line-height: 1.6;
    font-size: 0.95rem;
}

.footer-bottom {
    background-color: rgba(0, 0, 0, 0.25);
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
    color: #CBD5E1;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}


/* --- 10. زر الأشرطة الثلاثة والتجاوب مع الشاشات الصغرى --- */

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--reflex-blue);
    border-radius: 3px;
    transition: all 0.3s ease;
}

@media (max-width: 991px) {
    .menu-toggle {
        display: flex;
    }
    .main-nav {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background-color: #FFFFFF;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
        border-bottom: 3px solid var(--reflex-blue);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
        width: 100%;
    }
    .main-nav.active {
        max-height: 500px;
        overflow-y: auto;
    }
    .nav-links {
        flex-direction: column;
        width: 100%;
        padding: 1rem 0;
        gap: 0;
    }
    .nav-links li {
        width: 100%;
        text-align: right;
    }
    .nav-links a {
        display: block;
        padding: 0.8rem 1.5rem;
        border-radius: 0;
        border-bottom: 1px solid #F1F5F9;
    }
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background-color: #F8FAFC;
        padding-right: 1rem;
        display: none;
    }
    .dropdown.active .dropdown-menu {
        display: block;
    }
    .modal-content {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
    .modal-img-container img {
        max-height: 280px;
    }
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .product-main-card {
        padding: 18px;
        gap: 20px;
    }
    .product-image-box {
        min-height: 250px;
    }
    .product-title {
        font-size: 1.4rem;
    }
    .review-form-box,
    .reviews-list-box {
        padding: 20px;
    }
}


/* ==========================================================================
   تنسيقات صفحة تفاصيل المنتج (product-details.php)
   ========================================================================== */


/* الحاوية الرئيسية */

.product-details-wrapper {
    max-width: 1150px;
    margin: 40px auto;
    padding: 0 20px;
}


/* الكارت الرئيسي للمنتج */

.product-main-card {
    display: flex;
    flex-wrap: wrap;
    gap: 35px;
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    margin-bottom: 40px;
    align-items: flex-start;
}


/* إطار الصورة */

.product-image-box {
    flex: 1 1 350px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
}

.product-image-box img {
    max-width: 100%;
    max-height: 320px;
    width: auto;
    height: auto;
    object-fit: contain;
}


/* قسم البيانات النصية للمنتج */

.product-info-box {
    flex: 2 1 450px;
}

.product-title {
    color: #0B1F8F;
    /* Reflex Blue */
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 15px;
    line-height: 1.3;
}


/* شارة التقييم بالنجوم */

.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: bold;
    color: #555;
    margin-bottom: 25px;
}

.stars-yellow {
    color: #FFD000;
    font-size: 1.1rem;
    letter-spacing: 2px;
}


/* أقسام (الوصف، دواعي الاستعمال، آلية الاستخدام) */

.info-section {
    background: #f8f9fa;
    border-right: 5px solid #0B1F8F;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}


/* الاتجاه الأجنبي LTR */

html[dir="ltr"] .info-section {
    border-right: none;
    border-left: 5px solid #0B1F8F;
}

.info-section h3 {
    margin: 0 0 8px 0;
    color: #0B1F8F;
    font-size: 1.15rem;
    font-weight: 700;
}

.info-section p {
    margin: 0;
    color: #444444;
    line-height: 1.7;
    font-size: 0.95rem;
}


/* ==========================================================================
   قسم التقييمات ورسائل المستخدمين
   ========================================================================== */

.reviews-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.review-form-box,
.reviews-list-box {
    flex: 1 1 450px;
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.review-form-box h3,
.reviews-list-box h3 {
    color: #0B1F8F;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}


/* النماذج المدخلة */

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333333;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cccccc;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #0B1F8F;
    box-shadow: 0 0 0 3px rgba(11, 31, 143, 0.1);
}


/* زر إرسال التقييم */

.btn-submit {
    background-color: #0B1F8F;
    color: #ffffff;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    width: 100%;
    transition: background-color 0.3s;
}

.btn-submit:hover {
    background-color: #081666;
}


/* قائمة التقييمات المضافة */

.review-item {
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.review-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.review-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.review-user {
    font-weight: bold;
    color: #0B1F8F;
    font-size: 1rem;
}

.review-date {
    font-size: 0.8rem;
    color: #888888;
}


/* رسائل التنبيه والنجاح */

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


/* --- تنسيق قسم الفيديو البطولي ليتناسب مع الشاشة تماماً --- */

html,
body {
    overflow-x: hidden !important;
}

.hero-video-section {
    position: relative;
    width: 100%;
    /* 68px هو الارتفاع التقريبي للهيدر، يمكنك ضبط الرقم إن احتاج للتوازن */
    height: calc(100vh - 68px);
    max-height: calc(100vh - 68px);
    overflow: hidden;
    background-color: #000000;
}

.hero-video-section .hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #ffffff;
    pointer-events: none;
    z-index: 2;
}

.hero-video-content a {
    pointer-events: auto;
}