/*
Theme Name: سريع كود برو
Theme URI: https://codprotheme.com
Author: COD Developer
Description: قالب ووردبريس متجاوب بالكامل مع الدفع عند الاستلام، يدعم القائمة الجانبية للهاتف، السلايدرات، ومعرض الصور المخصص مع السكرول الذكي.
Version: 4.9.0
License: GNU GPLv2 or later
Text Domain: cod-fast-theme
*/

/* ==========================================
   1. المتغيرات والقواعد الأساسية (Variables & Reset)
   ========================================== */
:root {
    --primary-color: #2ecc71; 
    --primary-hover: #27ae60;
    --dark-slate: #0f172a;
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --danger-color: #ef4444;
    --text-muted: #64748b;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-slate);
    direction: rtl;
    text-align: right;
    line-height: 1.6;
    overflow-x: hidden;
}

a { 
    text-decoration: none; 
    color: inherit; 
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================
   2. الهيدر والقوائم (Header & Navigation)
   ========================================== */
.top-bar {
    background-color: var(--danger-color);
    color: #ffffff;
    text-align: center;
    padding: 8px 15px;
    font-size: 13px;
    font-weight: 700;
}

.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    direction: rtl;
}

.site-logo img {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}

.site-logo a {
    font-size: 20px;
    font-weight: 900;
    color: var(--dark-slate);
}

/* القائمة الرئيسية على أجهزة الحاسوب (Desktop Menu) */
.desktop-menu {
    display: block;
}

.desktop-menu ul,
.desktop-menu div > ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 22px;
    margin: 0;
    padding: 0;
}

.desktop-menu li {
    position: relative;
}

.desktop-menu a {
    font-weight: 700;
    font-size: 15px;
    color: var(--dark-slate);
    padding: 8px 0;
    transition: color 0.2s;
    display: inline-block;
}

.desktop-menu a:hover {
    color: var(--primary-color);
}

/* زر القائمة للهواتف الذكية */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--dark-slate);
    cursor: pointer;
    padding: 5px;
}

/* ==========================================
   3. القائمة الجانبية المنزلقة للهاتف (Mobile Drawer)
   ========================================== */
.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 290px;
    height: 100%;
    background: #ffffff;
    z-index: 9999;
    box-shadow: -5px 0 25px rgba(0,0,0,0.15);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    direction: rtl;
    text-align: right;
}

.mobile-drawer.active {
    right: 0;
}

.drawer-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--light-bg);
}

.drawer-header h3 {
    font-size: 16px;
    font-weight: 800;
    margin: 0;
    color: var(--dark-slate);
}

.drawer-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.mobile-navigation {
    padding: 10px 0;
    overflow-y: auto;
}

.mobile-navigation ul,
.mobile-navigation div > ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-navigation li {
    border-bottom: 1px solid var(--border-color);
}

.mobile-navigation a {
    display: block;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 700;
    color: var(--dark-slate);
    transition: background 0.2s, color 0.2s;
}

.mobile-navigation a:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

/* ==========================================
   4. صفحة المنتج ومعرض الصور والسكرول الذكي (COD Product & Gallery)
   ========================================== */
.custom-cod-product-wrapper {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
    direction: rtl;
    font-family: 'Cairo', sans-serif;
}

.custom-cod-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

/* تثبيت معرض الصور أثناء التمرير في شاشات الكمبيوتر */
.custom-cod-gallery-section {
    position: sticky;
    top: 90px;
}

.custom-cod-gallery-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.custom-main-image {
    width: 100%;
    height: 420px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.custom-main-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

.custom-gallery-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.thumb-item {
    width: 75px;
    height: 75px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-item.active,
.thumb-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.custom-cod-details {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
}

.custom-cod-title {
    font-size: 26px;
    font-weight: 900;
    color: var(--dark-slate);
    line-height: 1.3;
}

.custom-cod-price-box {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary-color);
}

.custom-cod-price-box del {
    color: var(--text-muted);
    font-size: 16px;
    margin-left: 10px;
    font-weight: 400;
}

.custom-cod-short-desc {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.7;
}

.custom-cod-content {
    font-size: 15px;
    color: var(--dark-slate);
    line-height: 1.8;
}

/* ==========================================
   5. الفوتر (Footer)
   ========================================== */
.site-footer {
    background-color: #0f172a;
    color: #94a3b8;
    padding-top: 50px;
    margin-top: 60px;
    border-top: 3px solid var(--primary-color);
    font-size: 14px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 30px;
    direction: rtl;
}

.footer-column h4 {
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 8px;
}

.footer-column h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 35px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.footer-about .footer-logo {
    font-size: 22px;
    font-weight: 900;
    color: #ffffff;
    display: inline-block;
    margin-bottom: 12px;
}

.footer-about p {
    line-height: 1.8;
    margin-bottom: 20px;
    color: #cbd5e1;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #cbd5e1;
    transition: all 0.2s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--primary-color);
    transform: translateX(-5px);
}

.footer-bottom {
    background-color: #020617;
    padding: 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
    color: #64748b;
}

/* ==========================================
   6. التوافق والاستجابة التامة مع الهواتف (Responsive Media Queries)
   ========================================== */

/* للأجهزة اللوحية والشاشات المتوسطة (أقل من 992px) */
@media (max-width: 992px) {
    .footer-container { 
        grid-template-columns: 1fr 1fr; 
        gap: 25px;
    }
    .custom-cod-container {
        grid-template-columns: 1fr !important;
        gap: 25px !important;
    }
}

/* للهواتف الذكية (أقل من 768px) */
@media (max-width: 768px) {
    .desktop-menu { 
        display: none !important; 
    }
    .mobile-menu-toggle { 
        display: block !important; 
    }
    
    .header-container {
        padding: 10px 15px;
    }
    .site-logo img { 
        max-height: 32px; 
    }

    /* صفحة المنتج ومعرض الصور في الموبايل */
    .custom-cod-product-wrapper {
        padding: 0 12px !important;
        margin: 15px auto !important;
    }
    .custom-cod-gallery-section {
        position: static !important; /* إلغاء التثبيت في الهاتف لتجنب تداخل السكرول تماماً */
        top: auto !important;
    }
    .custom-main-image {
        height: 300px;
    }
    .custom-cod-title {
        font-size: 20px !important;
    }
    .custom-cod-price-box {
        font-size: 20px !important;
    }

    /* الفوتر */
    .site-footer {
        padding-top: 35px;
        margin-top: 35px;
    }
}

/* للهواتف الصغيرة جداً (أقل من 480px) */
@media (max-width: 480px) {
    .footer-container { 
        grid-template-columns: 1fr; 
        gap: 25px;
    }
    .custom-main-image {
        height: 250px;
    }
}