/*
Theme Name: Abofares Factory Theme
Theme URI: https://factory-abofares.com
Author: Abofares Dev
Description: القالب الرسمي لمصنع أبوفارس - النسخة الكاملة الشاملة (V8.0 Ultimate). تدعم اللغة العربية، التصميم الصناعي، الخرائط، الـ 3D، ومحرر المكونات.
Version: 8.0
Text Domain: abofares
*/

/* =========================================
   1. استيراد الخطوط (Fonts Import)
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;500;600;700;800;900&family=Oswald:wght@200;300;400;500;600;700&display=swap');

/* =========================================
   2. إعدادات الجسم الأساسية (Base Body)
   ========================================= */
body {
    font-family: 'Cairo', sans-serif;
    background-color: #0f1215; /* لون خلفية داكن صناعي */
    color: #e2e8f0; /* لون نص فاتح */
    overflow-x: hidden; /* منع التمرير الأفقي */
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   3. دعم KADENCE & GUTENBERG (Full Width Support)
   ========================================= */
/* هذه الكلاسات ضرورية لكي تعمل خيارات "العرض الكامل" في المحرر */

.alignfull {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width: 100vw;
    width: 100vw;
}

.alignwide {
    margin-left: auto;
    margin-right: auto;
    max-width: 1200px;
    width: 100%;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* التأكد من أن الصور داخل المحتوى متجاوبة */
.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* منطقة المحتوى القابل للتعديل */
.editable-content-area {
    width: 100%;
    position: relative;
    z-index: 20;
    background: #0f1215;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* =========================================
   4. إصلاحات وردبريس (WordPress Admin Bar Fixes)
   ========================================= */
/* إصلاح تداخل شريط الأدوات العلوي مع الهيدر الثابت */
body.admin-bar header {
    top: 32px !important;
}

body.admin-bar nav.fixed-nav { 
    top: 32px !important; 
}

/* إزاحة شريط الأخبار للأسفل عند وجود شريط الأدمن */
body.admin-bar .ticker-wrap {
    margin-top: 32px;
}

/* للموبايل (شريط الأدوات يكون أكبر) */
@media screen and (max-width: 782px) { 
    body.admin-bar header { 
        top: 46px !important; 
    }
    body.admin-bar nav.fixed-nav {
        top: 46px !important;
    }
    body.admin-bar .ticker-wrap {
        margin-top: 46px;
    }
}

/* =========================================
   5. تنسيقات النصوص (Typography)
   ========================================= */
.font-oswald { 
    font-family: 'Oswald', sans-serif; 
}

/* تأثير النص المعدني (Metallic Text Effect) */
.metallic-text {
    background: linear-gradient(to bottom, #ffffff 0%, #a0a0a0 50%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 2px 4px rgba(0,0,0,0.3);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    line-height: 1.2;
}

/* =========================================
   6. تنسيقات القائمة والهيدر (Header & Nav)
   ========================================= */

/* إجبار الشعار المخصص على الحجم المناسب */
.site-logo img, 
.custom-logo-link img,
.custom-logo {
    max-height: 60px !important; /* ارتفاع ثابت للشعار */
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    transition: all 0.3s ease;
}

/* حالة الرابط النشط */
.nav-link.active {
    color: #ea580c; /* لون البرتقالي للمصنع */
    border-bottom: 2px solid #ea580c;
}

.nav-link {
    position: relative;
    transition: color 0.3s ease;
    padding-bottom: 4px;
    font-weight: 700;
    font-size: 0.95rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 0;
    height: 2px;
    background-color: #ea580c;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* الخلفية الزجاجية للقائمة */
.glass-nav {
    background: rgba(15, 23, 30, 0.98); /* شبه شفاف */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

/* =========================================
   7. القوائم المنسدلة (Dropdowns)
   ========================================= */
/* إظهار القائمة عند التحويم (Hover) أو إضافة كلاس عبر JS */
.group:hover .group-hover\:visible,
.mobile-open { 
    visibility: visible !important; 
}

.group:hover .group-hover\:opacity-100,
.mobile-open { 
    opacity: 1 !important; 
}

.group:hover .group-hover\:translate-y-0,
.mobile-open { 
    transform: translateY(0) !important; 
}

/* تنسيق عناصر القائمة المنسدلة */
.dropdown-menu {
    background-color: #1a1e23;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    min-width: 200px;
    z-index: 100;
}

/* =========================================
   8. شريط الأخبار المتحرك (News Ticker)
   ========================================= */
.ticker-wrap {
    width: 100%;
    overflow: hidden;
    background-color: #ea580c;
    color: white;
    white-space: nowrap;
    height: 40px; /* ارتفاع مريح للقراءة */
    line-height: 40px;
    font-size: 13px;
    font-weight: bold;
    position: relative;
    z-index: 60;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.ticker { 
    display: inline-block; 
    animation: ticker 45s linear infinite; 
    padding-right: 100%; /* يبدأ من خارج الشاشة */
}

@keyframes ticker { 
    0% { transform: translateX(0); } 
    100% { transform: translateX(-100%); } 
}

/* =========================================
   9. تنسيقات العناصر الصناعية (Industrial UI)
   ========================================= */
/* حدود الكروت الصناعية */
.industrial-border {
    border: 1px solid #333;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 0 10px rgba(234, 88, 12, 0.1); /* تأثير توهج خفيف */
    background: #1a1e23;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0.75rem;
}

.industrial-border:hover {
    border-color: #ea580c;
    transform: translateY(-8px);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 10px 30px rgba(234, 88, 12, 0.2);
}

/* حاوية الخلفية ثلاثية الأبعاد */
#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none; /* يسمح بالنقر على العناصر فوقه */
    opacity: 0.6; /* شفافية خفيفة */
}

/* شارات التميز (Badges) */
.badge-industrial {
    background-color: rgba(234, 88, 12, 0.1);
    border: 1px solid rgba(234, 88, 12, 0.3);
    color: #ea580c;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* =========================================
   10. تنسيقات الخرائط (Leaflet Map)
   ========================================= */
/* حاوية الخريطة */
#libya-map {
    width: 100%;
    height: 100%;
    min-height: 350px;
    z-index: 10;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid #333;
}

/* أيقونات الخريطة المخصصة */
.custom-div-icon {
    background: transparent;
    border: none;
}

/* تخصيص النوافذ المنبثقة في الخريطة لتناسب الثيم الداكن */
.leaflet-popup-content-wrapper, 
.leaflet-popup-tip {
    background: #1a1e23;
    color: #e2e8f0;
    border: 1px solid #ea580c;
    border-radius: 6px;
    font-family: 'Cairo', sans-serif;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

.leaflet-popup-content {
    margin: 12px 16px;
    text-align: right;
    font-weight: bold;
    font-size: 0.9rem;
}

.leaflet-popup-content strong {
    color: #ea580c;
}

/* إخفاء شعارات الخريطة الزائدة */
.leaflet-control-attribution {
    background: rgba(0,0,0,0.5) !important;
    color: #aaa !important;
    font-size: 10px;
}

/* =========================================
   11. تنسيقات إضافية للأقسام
   ========================================= */
/* تحسين ظهور المحتوى فوق الخلفيات */
.page-section {
    position: relative;
    z-index: 10;
}

/* فاصل الأقسام */
hr.industrial-divider {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    margin: 3rem 0;
}

/* تنسيقات خاصة للموبايل */
@media (max-width: 768px) {
    .ticker-wrap {
        font-size: 10px;
        height: 30px;
        line-height: 30px;
    }
    
    .site-logo img {
        max-height: 40px !important;
    }
    
    .glass-nav {
        height: 70px;
    }
    
    h1 {
        font-size: 2.5rem !important;
    }
}

/* تنسيقات الطباعة (Typography for Page Content) */
.prose {
    color: #cbd5e1;
    max-width: 65ch;
}
.prose h1, .prose h2, .prose h3 {
    color: white;
    margin-bottom: 1rem;
}
.prose p {
    margin-bottom: 1.5rem;
}
.prose ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}
.prose li {
    margin-bottom: 0.5rem;
}
.prose strong {
    color: #ea580c;
}

/* زر الواتساب العائم */
.whatsapp-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999; /* تأكدنا من أنه فوق كل شيء */
    transition: transform 0.3s ease;
}
.whatsapp-btn:hover {
    transform: scale(1.1);
}