/*
Theme Name: TA Alrahwan Ultimate Pro
Theme URI: https://www.alrahwan.com
Author: Alrahwan Dev Team
Description: الإصدار الذهبي - حل مشاكل اللمس + الجداول + العناوين + تحسينات السرعة + إصلاح الفوتر.
Version: 15.1.0
Text Domain: ta-alrahwan
*/

:root {
    --primary: #003366;       /* أزرق */
    --primary-dark: #001a33;
    --accent: #d32f2f;        /* أحمر */
    --gold: #c5a059;          /* ذهبي */
    --text-main: #333;
    --bg-body: #fdfdfd;
    --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }
body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    direction: rtl;
    text-align: right;
    line-height: 1.6;
    overflow-x: hidden;
}
a { text-decoration: none; transition: 0.3s; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; position: relative; }

/* ================= 1. الهيدر (مع إصلاح زر اللمس) ================= */
.site-header {
    background: #ffffff;
    position: relative;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-bottom: 4px solid var(--gold);
}

@media (min-width: 901px) {
    body.home .site-header {
        position: absolute;
        top: 0; left: 0;
        background: rgba(255, 255, 255, 0.95);
        border-bottom: none;
    }
}

.header-flex { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; }
.logo-area .main-logo { height: 75px; width: auto; }
.main-menu { display: flex; gap: 5px; }
.main-menu li a { font-weight: 700; color: var(--primary); font-size: 14px; padding: 10px 15px; border-radius: 5px; display: block; }
.main-menu li a:hover { color: #fff; background: var(--primary); }

/* --- تعديل زر القائمة (Touch Target Fix) --- */
.mobile-toggle { 
    display: none; 
    background: none; 
    border: none; 
    font-size: 26px; 
    color: var(--primary); 
    cursor: pointer;
    
    /* إصلاح جوجل: زيادة مساحة اللمس */
    padding: 10px;
    min-width: 48px;  /* الحد الأدنى المقبول */
    min-height: 48px; /* الحد الأدنى المقبول */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
}

/* ================= 2. تنسيق العناوين (H2 & H3) ================= */

/* H2: صندوق كامل مميز */
.entry-content h2, 
.content-box h2,
h2.wp-block-heading {
    background-color: #f0f7ff !important;
    border: 2px solid var(--primary) !important;
    border-right: 10px solid var(--gold) !important;
    color: var(--primary) !important;
    padding: 15px 20px !important;
    border-radius: 8px !important;
    margin-top: 40px !important;
    margin-bottom: 20px !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* H3: خط سفلي أنيق (الإضافة الجديدة) */
.entry-content h3, 
.content-box h3 {
    color: var(--primary-dark);
    font-size: 20px;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    display: inline-block;
}

/* ================= 3. إصلاح الجداول (Scrollable) ================= */
.entry-content table, 
.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    background: #fff;
    border: 1px solid #ccc;
    font-size: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.entry-content table thead tr, 
.entry-content table tr:first-child { 
    background-color: var(--primary) !important;
    color: #fff !important;
    font-weight: bold;
}

.entry-content table th, 
.entry-content table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: center;
    vertical-align: middle;
}
.entry-content table tr:nth-child(even) { background-color: #f9f9f9; }

/* ================= 4. إصلاحات الجوال الحاسمة ================= */
@media (max-width: 768px) {
    .container { padding: 0 10px !important; }
    .content-box { padding: 20px 10px !important; border-radius: 0 0 15px 15px !important; }

    /* جدول قابل للسحب */
    .entry-content table, .wp-block-table, figure.wp-block-table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    .entry-content table tbody, .entry-content table thead {
        display: table;
        width: 100%;
        min-width: 600px; /* ضمان العرض */
    }
    .entry-content table th, .entry-content table td {
        white-space: nowrap !important;
        padding: 10px !important;
        font-size: 14px !important;
    }
    
    /* إظهار زر القائمة في الجوال */
    .mobile-toggle { display: flex !important; }
}

@media (min-width: 901px) {
    .mobile-toggle { display: none !important; }
}

/* ================= 5. الهيرو وباقي الأقسام ================= */
.hero-section {
    position: relative;
    height: 750px;
    background-image: url('https://www.alrahwan.com/wp-content/uploads/2026/01/1.webp');
    background-size: cover;
    background-position: 25% top;
    display: flex;
    align-items: center;
    padding-top: 80px;
    border-bottom: 5px solid var(--gold);
}
.hero-section .container { display: flex; width: 100%; justify-content: flex-start; }
.hero-content { width: 50%; text-align: right; padding-left: 20px; }
.hero-title { font-size: 52px; color: #fff; font-weight: 900; margin-bottom: 20px; text-shadow: 0 4px 10px rgba(0,0,0,0.6); }
.hero-desc { color: #fff; font-size: 19px; font-weight: 600; margin-bottom: 30px; text-shadow: 0 2px 5px rgba(0,0,0,0.8); }
.hero-btns { display: flex; gap: 15px; }
.btn { padding: 12px 35px; border-radius: 50px; font-weight: bold; font-size: 16px; display: inline-block; text-align: center; }
.btn-primary { background: var(--accent); color: #fff; border: 2px solid var(--accent); }
.btn-secondary { background: transparent; color: #fff; border: 2px solid #fff; }

/* تنسيق عام للمحتوى */
.content-box {
    background: #fff; padding: 50px; border-radius: 15px; margin-bottom: 60px;
    border: 1px solid #e0e0e0; border-top: 5px solid var(--accent);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.entry-content ul { background: #fdfdfd; padding: 20px 30px 20px 20px; border: 1px solid #eee; border-radius: 8px; margin-bottom: 25px; }
.entry-content ul li::before { content: '✔'; color: var(--accent); font-weight: bold; margin-left: 10px; }

/* تنسيق الجوال (MEDIA QUERY - MOBILE) */
@media (max-width: 900px) {
    .site-header { position: relative !important; background: #fff !important; border-bottom: 3px solid var(--gold) !important; }
    .header-flex { display: flex; justify-content: space-between; align-items: center; width: 100%; }
    .logo-area { text-align: right; flex-grow: 1; }
    .logo-area img { height: 50px; }
    .menu-area { text-align: left; }
    
    .main-menu { display: none; flex-direction: column; width: 100%; background: #f9f9f9; padding: 10px; margin-top: 10px; border-radius: 10px; position: absolute; top: 70px; left: 0; z-index: 999; box-shadow: 0 5px 20px rgba(0,0,0,0.1); }
    .main-menu.active { display: flex; }

    .hero-section {
        background-image: url('https://www.alrahwan.com/wp-content/uploads/2026/01/00.webp') !important;
        background-position: top center !important;
        background-size: 100% auto !important;
        background-repeat: no-repeat !important;
        background-color: #f4f8fb;
        height: auto;
        min-height: auto;
        display: block;
        padding: 0;
        padding-top: 55vh;
        border-bottom: 5px solid var(--gold);
    }
    .hero-section .container { padding: 0; display: block; }
    .hero-content {
        width: 100%;
        background: #ffffff;
        padding: 30px 15px 40px 15px;
        text-align: center;
        border-radius: 25px 25px 0 0;
        box-shadow: 0 -5px 30px rgba(0,0,0,0.1);
        margin-top: -60px;
        position: relative;
        z-index: 2;
        margin-bottom: 0;
    }
    .hero-title { font-size: 24px; color: var(--primary); font-weight: 900; margin-bottom: 15px; text-shadow: none; line-height: 1.4; }
    .hero-desc { font-size: 15px; color: #444; margin-bottom: 20px; line-height: 1.8; text-shadow: none; }
    .hero-btns { justify-content: center; flex-direction: column; gap: 12px; }
    .btn { width: 100%; }
    .btn-secondary { color: var(--primary); border-color: var(--primary); }
    
    .split-container, .split-container.reverse, .track-order-grid { flex-direction: column; }
    .contact-bar { flex-direction: column; text-align: center; }

    /* ============ إصلاح الفوتر في الجوال ============ */
    /* تحويل الشبكة إلى بلوك لتنزل القوائم تحت بعضها */
    .seo-grid { 
        display: block !important; 
    }
    
    /* جعل كل عمود يأخذ العرض الكامل مع مسافة سفلية */
    .seo-col, 
    .footer-widget,
    .site-footer .widget {
        width: 100% !important;
        margin-bottom: 40px !important;
        display: block !important;
    }
    
    /* تحسين شكل النصوص داخل الفوتر */
    .seo-col h3, 
    .seo-col h4 {
        margin-bottom: 20px !important;
    }
}

/* الأقسام الأخرى (مختصرة للحفاظ على الملف) */
.features-section { padding: 80px 0; background: #f4f8fb; border-top: 4px solid var(--primary); border-bottom: 4px solid var(--primary); }
.split-section { padding: 80px 0; background: #fff; margin: 40px 0; border: 1px solid #ddd; border-right: 5px solid var(--gold); box-shadow: 0 5px 20px rgba(0,0,0,0.03); }
.services-grid-section { padding: 80px 0; background: #fff; border-top: 3px dashed var(--gold); border-bottom: 3px dashed var(--gold); }
.quote-section { margin-top: -60px; position: relative; z-index: 10; margin-bottom: 60px; }
.quote-box { background: #fff; padding: 40px; border-radius: 15px; box-shadow: 0 15px 40px rgba(0,0,0,0.1); border: 2px solid var(--gold); }
.quote-title { text-align: center; color: var(--primary); font-size: 26px; font-weight: 800; margin-bottom: 25px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.input-group label { display: block; margin-bottom: 5px; color: var(--primary); font-weight: bold; }
.input-group input, .input-group select { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 5px; background: #fafafa; }
.btn-submit { width: 100%; background: var(--primary); color: #fff; padding: 12px; border: none; border-radius: 5px; font-weight: bold; margin-top: 15px; cursor: pointer; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.feature-card { background: #fff; padding: 30px; border-radius: 10px; text-align: center; box-shadow: 0 5px 15px rgba(0,0,0,0.05); border: 1px solid #eee; }
.feature-icon { font-size: 40px; margin-bottom: 15px; display: block; }
.split-container { display: flex; align-items: center; gap: 40px; }
.split-container.reverse { flex-direction: row-reverse; }
.split-text { flex: 1; }
.split-img { flex: 1; }
.split-img img { border-radius: 10px; box-shadow: 0 5px 20px rgba(0,0,0,0.1); border: 5px solid #fff; }
.services-box-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; }
.service-item { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1/1; border: 1px solid #eee; }
.service-item img { width: 100%; height: 100%; object-fit: cover; transition: 0.3s; }
.service-title { position: absolute; bottom: 0; width: 100%; background: rgba(0,51,102,0.85); color: #fff; text-align: center; padding: 8px; font-weight: bold; font-size: 13px; }
.contact-bar { background: var(--primary); color: #fff; padding: 30px; border-radius: 15px; display: flex; justify-content: space-around; flex-wrap: wrap; gap: 20px; margin-top: 40px; border: 2px solid var(--gold); }
.contact-info-item a { color: var(--gold); font-size: 20px; font-weight: bold; text-decoration: none; display: block; }
.track-order-section { padding: 80px 0; background: #fff; border-top: 1px solid #ddd; }
.track-order-grid { display: flex; gap: 30px; }
.track-box { flex: 1; background: #e3f2fd; padding: 30px; border-radius: 15px; border: 1px solid #bbdefb; }
.order-box { flex: 1; background: #ffebee; padding: 30px; border-radius: 15px; border: 1px solid #ffcdd2; }
.track-btn { background: var(--primary); color: #fff; width: 100%; padding: 12px; border:none; border-radius:5px; cursor:pointer; font-weight:bold; margin-top: 10px; }

/* الفوتر */
.seo-footer { background: #1a1a1a; color: #ccc; padding: 60px 0; border-top: 5px solid var(--gold); }
.seo-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 20px; }
.seo-col h3, .seo-col h4 { color: #fff; border-bottom: 2px solid var(--accent); display: inline-block; margin-bottom: 15px; }
.seo-col ul li a { font-size: 13px; color: #aaa; }
.copyright { background: #000; color: #fff; text-align: center; padding: 15px; font-size: 13px; }
.floating-btns { position: fixed; bottom: 30px; left: 30px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.float-icon { width: 55px; height: 55px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 26px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); border: 2px solid #fff; }
.float-whatsapp { background: #25D366; }
.float-call { background: #d32f2f; }