:root {
    --bg-color: #ffffff;
    --text-color: #2a2927;
    --primary-color: #b81f45;
    --secondary-bg: #fbfbfb;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* يمنع الشاشات الصغيرة من الظهور بشريط تمرير أفقي */
    overflow-x: hidden; 
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Cairo', sans-serif;
    overflow-x: hidden;
    line-height: 1.8;
}

html[lang="fr"] body, body.lang-fr {
    direction: ltr;
    font-family: 'Montserrat', sans-serif;
}

/* NAVIGATION HEADER */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.03);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-color);
    text-decoration: none;
    letter-spacing: 1px;
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    position: relative;
    padding: 5px 0;
    transition: var(--transition);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

.lang-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 6px 18px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.lang-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

/* HERO SECTION */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 5% 60px;
    background: radial-gradient(circle at top right, rgba(184, 31, 69, 0.03), transparent 50%);
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.hero-subtitle {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 20px;
}

.hero-desc {
    font-size: 1.1rem;
    margin-bottom: 35px;
    opacity: 0.9;
}

.btn-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(184, 31, 69, 0.25);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(184, 31, 69, 0.4);
}

.btn-secondary {
    border: 2px solid var(--text-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: var(--text-color);
    color: #fff;
    transform: translateY(-3px);
}

.hero-image {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: var(--shadow);
    width: 100%;
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.hero-image:hover img {
    transform: scale(1.05);
}

/* SECTIONS COMMON */
.section-padding {
    padding: 80px 5%;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.2rem;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* FEATURE CARDS */
.grid-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    max-width: 1400px;
    margin: 0 auto;
}

.feature-card {
    background: #ffffff;
    padding: 35px 25px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

html[lang="fr"] .feature-card::before {
    transform-origin: left;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(184, 31, 69, 0.08);
}

.feature-icon-box {
    width: 65px;
    height: 65px;
    background: rgba(184, 31, 69, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 20px;
    transition: all 0.5s ease;
}

.feature-icon {
    font-size: 1.6rem;
    color: var(--primary-color);
    transition: all 0.4s ease;
}

.feature-card:hover .feature-icon-box {
    background: var(--primary-color);
    transform: rotate(360deg) scale(1.05);
}

.feature-card:hover .feature-icon-box i {
    color: #ffffff;
}

/* CONTACT SECTION & FOOTER */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-card {
    background: #fff;
    padding: 30px 20px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
    border-top: 5px solid var(--primary-color);
}

footer {
    background-color: #1a1918;
    color: #ffffff;
    padding: 50px 5% 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto 30px;
}

.footer-branch h4 {
    color: var(--primary-color);
    margin-bottom: 12px;
}

.footer-branch a, .footer-branch p {
    color: #ccc;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.footer-branch a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    opacity: 0.6;
    font-size: 0.9rem;
}

/* -------------------------------------------------------------------------- */
/* 📱 MEDIA QUERIES - للتجاوب مع الهواتف والأجهزة اللوحية                 */
/* -------------------------------------------------------------------------- */

/* شاشات الحواسيب المحمولة والأجهزة اللوحية (Tablet) */
@media (max-width: 992px) {
    .hero {
        padding-top: 110px;
        min-height: auto;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }

    .hero-title {
        font-size: 2.3rem;
    }

    .btn-group {
        justify-content: center;
    }

    .section-padding {
        padding: 60px 5%;
    }
}

/* شاشات الهواتف الذكية (Mobile) */
@media (max-width: 768px) {
    .navbar {
        padding: 12px 5%;
        flex-wrap: wrap;
    }

    .nav-links {
        gap: 15px;
        font-size: 0.9rem;
    }

    .logo {
        font-size: 20px;
    }

    .lang-btn {
        padding: 4px 12px;
        font-size: 0.85rem;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-desc {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .section-title h2 {
        font-size: 1.6rem;
    }

    .grid-features, .contact-grid {
        grid-template-columns: 1fr; /* عرض عنصر واحد في السطر للتناسق التام */
    }

    .feature-card {
        padding: 25px 20px;
    }
}

/* ==========================================
   تنسيق بطاقات المميزات لتكون في المنتصف وبشكل فاخر
   ========================================== */

/* الحاوية التي تجمع البطاقات (تنسيق شبكي مرن) */
.features-grid, .features-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px;
}

/* تنسيق البطاقة الأساسية - كل شيء في المنتصف */
.feature-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center; /* توسيط جميع النصوص */
    display: flex;
    flex-direction: column;
    align-items: center; /* توسيط الأيقونات والعناصر */
    justify-content: flex-start;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

/* تأثير التمرير الفاخر فوق البطاقة */
.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(184, 31, 69, 0.12);
    border-color: rgba(184, 31, 69, 0.25);
}

/* صندوق الأيقونة - متمركز تماماً في المنتصف */
.feature-icon-box {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(184, 31, 69, 0.1) 0%, rgba(184, 31, 69, 0.03) 100%);
    border-radius: 50%; /* شكل دائري أنيق */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px auto; /* توسيط هامش الصندوق */
    border: 1px solid rgba(184, 31, 69, 0.15);
    transition: all 0.4s ease;
}

/* الأيقونة نفسها */
.feature-icon {
    font-size: 2.2rem;
    color: #b81f45; /* اللون العنابي الخاص بـ VIVA Porcelain */
    transition: all 0.4s ease;
}

/* حركات تفاعلية للأيقونة عند التمرير */
.feature-card:hover .feature-icon-box {
    background: #b81f45;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 20px rgba(184, 31, 69, 0.3);
}

.feature-card:hover .feature-icon {
    color: #ffffff; /* يتحول لون الأيقونة للأبيض عند التمرير */
}

/* عنوان الميزة */
.feature-card h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #2a2927;
    margin-bottom: 15px;
    line-height: 1.4;
    text-align: center;
}

/* وصف الميزة */
.feature-card p {
    font-size: 0.98rem;
    color: #666666;
    line-height: 1.8;
    margin: 0;
    text-align: center;
}

/* ==========================================================================
   تعديلات وتنسيقات VIVA Porcelain الفاخرة
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. فيديو الخلفية في قسم الـ Hero
   -------------------------------------------------------------------------- */
.hero-video-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    background: #000000; /* لون احتياطي أثناء التحميل */
}

.bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 1;
    transform: translate(-50%, -50%);
    object-fit: cover;
    pointer-events: none;
}

/* طبقة تظليل داكنة لضمان وضوح النصوص فوق الفيديو */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.55) 100%);
    z-index: 2;
}

.hero {
    position: relative;
    z-index: 3;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 140px 8% 80px;
    background: transparent !important;
    color: #ffffff;
}

.hero-subtitle {
    color: #ff4d73;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    color: #ffffff;
}

.hero-desc {
    font-size: 1.15rem;
    margin-bottom: 35px;
    color: #e0e0e0;
    opacity: 0.95;
}


/* --------------------------------------------------------------------------
   2. الفاصل الفاخر بين الأقسام (Luxury Divider)
   -------------------------------------------------------------------------- */
.luxury-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 40px auto;
    max-width: 80%;
    padding: 10px 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(184, 31, 69, 0.4), transparent);
}

.divider-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid rgba(184, 31, 69, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b81f45;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(184, 31, 69, 0.1);
    position: relative;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.divider-icon:hover {
    transform: rotate(45deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(184, 31, 69, 0.25);
}


/* --------------------------------------------------------------------------
   3. توسيط بطاقات المميزات وتنسيق الأيقونات (Feature Cards & Icons)
   -------------------------------------------------------------------------- */
.grid-features, 
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px;
}

/* تنسيق البطاقة الفردية وتوسيط عناصرها */
.feature-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center; /* توسيط النص */
    display: flex;
    flex-direction: column;
    align-items: center; /* توسيط الأيقونة */
    justify-content: flex-start;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(184, 31, 69, 0.12);
    border-color: rgba(184, 31, 69, 0.25);
}

/* صندوق الأيقونة الدائري */
.feature-icon-box {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(184, 31, 69, 0.1) 0%, rgba(184, 31, 69, 0.03) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px auto;
    border: 1px solid rgba(184, 31, 69, 0.15);
    transition: all 0.4s ease;
}

/* الأيقونة نفسها */
.feature-icon {
    font-size: 2.2rem;
    color: #b81f45; /* لون العلامة التجاريه */
    transition: all 0.4s ease;
}

/* حركة التفاعل عند مرور الماوس فوق البطاقة */
.feature-card:hover .feature-icon-box {
    background: #b81f45;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 20px rgba(184, 31, 69, 0.3);
}

.feature-card:hover .feature-icon {
    color: #ffffff;
}

/* عناوين البطاقات والأوصاف */
.feature-card h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #2a2927;
    margin-bottom: 15px;
    line-height: 1.4;
    text-align: center;
}

.feature-card p {
    font-size: 0.98rem;
    color: #666666;
    line-height: 1.8;
    margin: 0;
    text-align: center;
}


/* --------------------------------------------------------------------------
   4. تجاوب التصميم مع الهواتف الذكية (Responsive Design)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }
    .feature-card {
        padding: 30px 20px;
    }
    .luxury-divider {
        max-width: 95%;
    }
}

/* ==========================================================================
   تحسين خط وتحسين نص الخبرة + زر الشهادة
   ========================================================================== */

/* تحسين النص السفلّي تحت العنوان */
.expertise-subtitle {
    font-size: 1.15rem;
    font-weight: 500;
    color: #555555;
    line-height: 1.9;
    max-width: 850px;
    margin: 18px auto 25px auto;
    letter-spacing: 0.2px;
}

/* تنسيق زر شهادة الخبرة الأنيق */
.cert-btn-wrapper {
    margin-top: 20px;
}

.btn-certificate {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
    color: var(--primary-color, #b81f45);
    border: 2px solid var(--primary-color, #b81f45);
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(184, 31, 69, 0.12);
    transition: all 0.4s ease;
}

.btn-certificate .cert-icon {
    font-size: 1.3rem;
    transition: transform 0.4s ease;
}

.btn-certificate:hover {
    background: var(--primary-color, #b81f45);
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(184, 31, 69, 0.3);
    transform: translateY(-3px);
}

.btn-certificate:hover .cert-icon {
    transform: scale(1.2) rotate(10deg);
}

/* ==========================================================================
   تنسيق النافذة المنبثقة (Modal) لشهادة الخبرة
   ========================================================================== */
.cert-modal {
    display: none; /* مخفي افتراضياً */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cert-modal.active {
    display: flex;
    opacity: 1;
}

.cert-modal-content {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 16px;
    max-width: 650px;
    width: 90%;
    position: relative;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.cert-modal.active .cert-modal-content {
    transform: scale(1);
}

.cert-close {
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #888888;
    cursor: pointer;
    transition: color 0.3s;
}

html[lang="fr"] .cert-close,
body.lang-fr .cert-close {
    left: auto;
    right: 20px;
}

.cert-close:hover {
    color: var(--primary-color, #b81f45);
}

.cert-modal-title {
    font-size: 1.4rem;
    color: var(--text-color, #2a2927);
    margin-bottom: 20px;
    font-weight: 800;
}

.cert-image {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #eee;
}