/* ======================================= */
/* ====== 1. متغيرات CSS العامة ====== */
/* ======================================= */

:root {
    /* ألوان - الوضع الفاتح */
    --primary-bg: #FFFFFF;
    --secondary-bg: #F5F5F5;
    --header-bg: rgba(255, 255, 255, 0.85);
    --footer-bg: #0A2E4C;
    --card-bg: #FFFFFF;
    --text-primary: #333333;
    --text-secondary: #0A2E4C;
    --text-light: #F8F8F8;
    --accent-primary: #FF8C00; /* برتقالي */
    --accent-secondary: #1F7A8C; /* تركواز */
    --border-color: #DDDDDD;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --shadow-color-heavy: rgba(0, 0, 0, 0.12);
    --hero-overlay: rgba(10, 46, 76, 0.85);
    --contact-item-bg: rgba(255, 255, 255, 0.1);
    --contact-item-bg-hover: rgba(255, 255, 255, 0.2);
    --star-color: #FFC107; /* لون النجوم الذهبي */
}

:root[data-theme="dark"] {
    /* ألوان - الوضع الداكن */
    --primary-bg: #0f172a; /* Slate 900 */
    --secondary-bg: #1e293b; /* Slate 800 */
    --header-bg: rgba(15, 23, 42, 0.8);
    --footer-bg: #0f172a;
    --card-bg: #1e293b; /* Slate 800 */
    --text-primary: #e2e8f0; /* Slate 200 */
    --text-secondary: #FFFFFF;
    --text-light: #F8F8F8;
    --accent-primary: #FF8C00;
    --accent-secondary: #2DD4BF; /* تركواز أفتح للوضع الداكن */
    --border-color: #334155; /* Slate 700 */
    --shadow-color: rgba(0, 0, 0, 0.2);
    --shadow-color-heavy: rgba(0, 0, 0, 0.25);
    --hero-overlay: rgba(15, 23, 42, 0.8);
    --contact-item-bg: rgba(255, 255, 255, 0.05);
    --contact-item-bg-hover: rgba(255, 255, 255, 0.1);
}

/* ============================ */
/* ====== 2. الأنماط الأساسية ====== */
/* ============================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-primary);
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.4s ease, color 0.4s ease;
}

body.no-scroll {
    overflow: hidden;
}


h1, h2, h3, h4, h5, h6 {
    font-family: 'Cairo', sans-serif;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.2;
    font-weight: 700;
    transition: color 0.4s ease;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.75rem; }
h3 { font-size: 1.5rem; }

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-primary);
}

ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section-padding {
    padding: 6rem 1rem;
}

.bg-light-gray {
    background-color: var(--secondary-bg);
    transition: background-color 0.4s ease;
}

.text-light {
    color: var(--text-light);
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--accent-primary);
    border-radius: 2px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    border: none;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: #FFFFFF;
    box-shadow: 0 5px 15px var(--shadow-color);
}

.btn-primary:hover {
    background-color: #e67e00;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px var(--shadow-color-heavy);
}

.btn-secondary {
    background-color: var(--accent-secondary);
    color: #FFFFFF;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.btn-secondary:hover {
    background-color: #1a6a7a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.btn-small {
    padding: 8px 18px;
    font-size: 0.9rem;
}

.btn-large {
    padding: 15px 35px;
    font-size: 1.25rem;
}

/* ================================== */
/* ====== 3. مؤشر التمرير والثيم ====== */
/* ================================== */
.scroll-progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 5px;
    background-color: var(--accent-primary);
    z-index: 10000;
    transition: width 0.1s linear;
}

.theme-toggle-btn {
    background: none;
    border: 2px solid var(--text-light);
    color: var(--text-light);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.theme-toggle-btn:hover {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: scale(1.1) rotate(15deg);
}
.theme-toggle-btn i {
    position: absolute;
    transition: transform 0.4s ease, opacity 0.4s ease;
}
#theme-toggle-sun {
    transform: translateY(150%);
    opacity: 0;
}
:root[data-theme="dark"] #theme-toggle-moon {
    transform: translateY(-150%);
    opacity: 0;
}
:root[data-theme="dark"] #theme-toggle-sun {
    transform: translateY(0);
    opacity: 1;
}


/* ============================================================== */
/* ====== 4. الهيدر والقائمة (تصميم قائمة الهاتف الجديد) ====== */
/* ============================================================== */

#main-header {
    background-color: transparent; /* شفاف في البداية */
    padding: 15px 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#main-header.scrolled {
    background-color: var(--header-bg);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    max-width: 180px;
    height: auto;
    display: block;
}

.desktop-nav ul {
    display: flex;
    gap: 2.5rem;
}

.desktop-nav ul li a {
    color: var(--text-light);
    font-size: 1.125rem;
    font-weight: 600;
    padding: 10px 5px;
    position: relative;
    transition: color 0.3s ease;
}

.desktop-nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    background-color: var(--accent-primary);
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    transition: width 0.3s ease-out;
    border-radius: 2px;
}

.desktop-nav ul li a:hover::after,
.desktop-nav ul li a.active-link::after {
    width: 100%;
}

.desktop-nav ul li a:hover,
.desktop-nav ul li a.active-link {
    color: var(--accent-primary);
}

/* تعديل: تغيير لون روابط القائمة عند التمرير في الوضع الفاتح */
#main-header.scrolled .desktop-nav ul li a {
    color: var(--text-secondary);
}
#main-header.scrolled .desktop-nav ul li a:hover,
#main-header.scrolled .desktop-nav ul li a.active-link {
    color: var(--accent-primary);
}

/* تعديل: تغيير لون زر الثيم عند التمرير في الوضع الفاتح */
#main-header.scrolled .theme-toggle-btn {
    color: var(--text-secondary);
    border-color: var(--text-secondary);
}
#main-header.scrolled .theme-toggle-btn:hover {
    color: #FFFFFF;
    border-color: var(--accent-primary);
}

.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    position: relative;
    z-index: 1001;
    transition: all 0.4s ease;
}

.hamburger .bar {
    width: 100%;
    height: 3px;
    background-color: var(--text-light);
    border-radius: 2px;
    transition: transform 0.4s ease, opacity 0.4s ease, background-color 0.4s ease;
}

/* تعديل: تغيير لون أيقونة الهمبرجر عند التمرير في الوضع الفاتح */
#main-header.scrolled .hamburger .bar {
    background-color: var(--text-secondary);
}


.hamburger.active .bar {
    background-color: var(--text-secondary);
}

:root[data-theme="dark"] .hamburger.active .bar {
     background-color: var(--text-primary);
}

.hamburger.active .bar:nth-child(1) { transform: translateY(9.5px) rotate(45deg); }
.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(3) { transform: translateY(-9.5px) rotate(-45deg); }


/* تصميم قائمة الهاتف الجديدة (لوحة جانبية) */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -320px; /* تبدأ خارج الشاشة من اليمين */
    width: 300px; /* عرض ثابت */
    height: 100%;
    background-color: var(--primary-bg);
    z-index: 1000;
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 2rem;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.mobile-nav.active {
    transform: translateX(-320px); /* تنزلق إلى داخل الشاشة */
}

.mobile-nav-header {
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.mobile-nav-logo {
    max-width: 150px;
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
    width: 100%;
}

.mobile-nav ul li {
    margin: 0.5rem 0;
}

.mobile-nav ul li a {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    display: block;
    position: relative;
    text-decoration: none;
    transition: color 0.3s ease, background-color 0.3s ease;
    border-radius: 8px;
    margin: 0 1rem;
}

:root[data-theme="dark"] .mobile-nav ul li a {
    color: var(--text-light);
}

.mobile-nav ul li a:hover {
    background-color: var(--secondary-bg);
    color: var(--accent-primary);
}

.mobile-nav ul li a.active-link {
    background-color: var(--accent-primary);
    color: #FFFFFF !important;
}

:root[data-theme="dark"] .mobile-nav ul li a.active-link {
    color: var(--text-secondary) !important;
}

/* طبقة التعتيم الخلفية */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}


/* ================================= */
/* ====== 5. قسم الهيرو ====== */
/* ================================= */

.hero-section {
    background-image: linear-gradient(var(--hero-overlay), var(--hero-overlay)), url('image/door hero.jpg');
    background-size: cover; background-position: center;
    background-attachment: fixed; color: var(--text-light);
    text-align: center; min-height: 100vh;
    display: flex; justify-content: center; align-items: center;
    padding-top: 100px; position: relative;
    transition: background-image 0.4s ease;
}
.hero-section h1 {
    font-size: 2rem; /* صغّرنا الخط من 3.5rem إلى 2rem */
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero-section .highlight { color: var(--accent-primary); }
.hero-section p {
    font-size: 1.25rem; margin-bottom: 2.5rem;
    color: var(--text-light); opacity: 0.9;
    max-width: 700px; margin-left: auto; margin-right: auto;
}

/* انيميشن ظهور الأقسام */
.animate-fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
    transition-delay: var(--delay, 0s);
}
section.active .animate-fade-in-up,
.animate-fade-in-up.active {
    opacity: 1;
    transform: translateY(0);
}


/* ====================================== */
/* ====== 6. قسم من نحن ====== */
/* ====================================== */

.about-section { text-align: center; }
.about-cards {
    display: flex; justify-content: center;
    flex-wrap: wrap; gap: 2.5rem;
}
.about-card {
    background-color: var(--card-bg);
    padding: 2.5rem; width: 450px; max-width: 100%;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--shadow-color);
    perspective: 1000px;
    transition: all 0.4s ease;
}
.about-card:hover {
    transform: translateY(-10px) rotateY(3deg);
    box-shadow: 0 10px 30px var(--shadow-color-heavy);
}
.about-card i {
    font-size: 80px; margin-bottom: 1.5rem;
    color: var(--accent-primary);
    transition: transform 0.4s ease;
}
.about-card:hover i { transform: scale(1.1) rotate(5deg); }
.about-card h3 { font-size: 2rem; margin-bottom: 0.5rem; }
.about-card p { font-size: 1rem; line-height: 1.7; }

/* ================================= */
/* ====== 7. قسم المنتجات ====== */
/* ================================= */

.products-section { text-align: center; }
.product-tabs {
    display: flex; justify-content: center;
    gap: 1.5rem; margin-bottom: 4rem; flex-wrap: wrap;
}
.tab-button {
    background-color: var(--accent-secondary); color: #FFFFFF;
    padding: 12px 30px; border-radius: 50px;
    font-size: 1.125rem; font-weight: 600;
    transition: all 0.3s ease; border: none; cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow-color);
}
.tab-button:hover {
    background-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-color);
}
.tab-button.active {
    background-color: var(--accent-primary);
    color: var(--text-secondary);
    box-shadow: 0 5px 15px var(--shadow-color);
    transform: translateY(-2px);
}
:root[data-theme="dark"] .tab-button.active { color: #FFFFFF; }

.product-content-wrapper { display: flex; justify-content: center; width: 100%; }
.tab-content {
    display: none; width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem; justify-items: center;
}
.tab-content.active { display: grid; }
.product-card {
    background-color: var(--card-bg); padding: 1.5rem;
    border-radius: 15px; box-shadow: 0 2px 8px var(--shadow-color);
    text-align: center;
    transition: all 0.4s ease;
    width: 100%; max-width: 380px;
    display: flex; flex-direction: column; justify-content: space-between;
}
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

/* --- تحسينات حاوية الصورة --- */
.product-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

/* طبقة الأيقونة الجديدة */
.product-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.product-image-container:hover .product-image-overlay {
    opacity: 1;
}

.product-image-overlay i {
    color: white;
    font-size: 2.5rem;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.product-image-container:hover .product-image-overlay i {
    transform: scale(1);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.product-image-container:hover .product-image {
    transform: scale(1.05);
}
/* --- نهاية تحسينات حاوية الصورة --- */

.product-card h3 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
.product-card p { font-size: 1rem; margin-bottom: 1.5rem; flex-grow: 1; }
.product-card .btn-small { margin-top: auto; }


/* ============================ */
/* ====== 8. قسم نموذج الطلب ====== */
/* ============================ */

.order-section { background-color: var(--secondary-bg); text-align: center; transition: background-color 0.4s ease; }
.order-form-card {
    background-color: var(--card-bg); padding: 2.5rem;
    border-radius: 15px; box-shadow: 0 5px 15px var(--shadow-color);
    max-width: 700px; margin: 0 auto; text-align: right;
    transition: background-color 0.4s ease;
}
.form-group { margin-bottom: 1.5rem; position: relative; }
.form-group label {
    display: block; margin-bottom: 0.5rem;
    font-size: 1.125rem; font-weight: 600;
    color: var(--text-secondary);
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px; font-size: 1rem;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.2);
    outline: none;
}
.form-group textarea { min-height: 120px; resize: vertical; }
.order-form-card .btn { margin-top: 1rem; width: auto; align-self: center; }


/* ========================================================== */
/* ====== 9. قسم الشركاء - التصميم الشبكي الاحترافي الجديد ====== */
/* ========================================================== */

.partners-section {
    background-color: var(--secondary-bg);
    text-align: center;
    transition: background-color 0.4s ease;
}

/* فقرة تقديمية للقسم */
.section-intro {
    max-width: 800px;
    margin: -2rem auto 4rem auto; /* تقليل المسافة العلوية لتكون أقرب للعنوان */
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-primary);
    opacity: 0.8;
}

/* الشبكة التي تحتوي على شعارات الشركاء */
.partners-grid {
    display: grid;
    /* إنشاء أعمدة متجاوبة: سيتم احتواء أكبر عدد ممكن من الأعمدة بعرض 160 بكسل على الأقل */
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 2.5rem; /* المسافة بين الشعارات */
    align-items: center;
    justify-content: center;
}

/* كل عنصر شريك داخل الشبكة */
.partner-item {
    position: relative; /* ضروري لتحديد موضع التلميح */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: var(--card-bg); /* خلفية لكل عنصر لتبرز أكثر */
    border-radius: 12px;
    box-shadow: 0 4px 10px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.partner-item:hover {
    transform: translateY(-8px); /* رفع العنصر للأعلى عند التمرير */
    box-shadow: 0 8px 25px var(--shadow-color-heavy);
}

/* تصميم شعار الشريك */
.partner-item img {
    max-width: 100%;
    height: 60px;
    object-fit: contain;
    filter: grayscale(100%); /* جعل الشعار رماديًا بشكل افتراضي */
    opacity: 0.75;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.partner-item:hover img {
    filter: grayscale(0%); /* إظهار الألوان الكاملة للشعار عند التمرير */
    opacity: 1;
}

/* **تحديث:** تصميم التلميح ليعمل في الوضعين */
.partner-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333; /* خلفية داكنة ثابتة */
    color: #fff; /* نص أبيض ثابت */
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    white-space: nowrap;
    z-index: 10;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.partner-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent; /* سهم داكن ثابت */
}

.partner-item:hover .partner-tooltip {
    visibility: visible;
    opacity: 1;
}


/* ======================================================= */
/* ====== 10. قسم آراء العملاء - التصميم المطور ====== */
/* ======================================================= */

.testimonials-section {
    text-align: center;
    position: relative;
    overflow: hidden;
    background-color: var(--primary-bg); /* تغيير الخلفية للون الأساسي */
    transition: background-color 0.4s ease;
}

.testimonial-carousel-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 4rem;
}

/* حاوية السلايدر */
.testimonial-carousel {
    display: grid;
    position: relative;
    min-height: 380px;
}

/* تصميم بطاقة الرأي الجديدة */
.testimonial-card {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow-color-heavy);
    border: 1px solid var(--border-color);
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
    opacity: 0;
    transform: scale(0.95);
    position: absolute;
    width: 100%;
    z-index: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.testimonial-card.active {
    opacity: 1;
    transform: scale(1);
    position: relative;
    z-index: 1;
}

/* تصميم أيقونة الاقتباس */
.testimonial-card::before {
    content: "\f10d";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 3rem;
    color: var(--accent-primary);
    opacity: 0.8;
    margin-bottom: 1rem;
}

/* تصميم تقييم النجوم */
.testimonial-rating {
    margin-bottom: 1.5rem;
    color: var(--star-color);
    font-size: 1.2rem;
}

.testimonial-rating .far {
    color: var(--border-color);
}

/* نص الرأي */
.testimonial-text {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    font-style: normal;
    line-height: 1.8;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-primary);
    opacity: 0.9;
}

/* اسم العميل */
.testimonial-author {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: auto;
}

/* تصميم أسهم التنقل */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--card-bg);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px var(--shadow-color);
}

.carousel-arrow:hover {
    background-color: var(--accent-primary);
    color: #FFFFFF;
    border-color: var(--accent-primary);
    transform: translateY(-50%) scale(1.1);
}

.carousel-arrow.prev {
    right: 0;
}

.carousel-arrow.next {
    left: 0;
}

/* تصميم نقاط التنقل */
.carousel-dots {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    gap: 0.75rem;
}

.dot {
    width: 10px;
    height: 10px;
    background-color: var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dot.active {
    background-color: var(--accent-primary);
    transform: scale(1.3);
    width: 25px;
    border-radius: 10px;
}


/* =========================== */
/* ====== 11. قسم التواصل ====== */
/* =========================== */

.contact-section {
    background-color: var(--footer-bg);
    color: var(--text-light); text-align: center;
    transition: background-color 0.4s ease;
}
.contact-intro {
    font-size: 1.25rem; margin-bottom: 4rem;
    max-width: 800px; margin-left: auto; margin-right: auto;
    opacity: 0.9;
}
.contact-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem; justify-content: center;
}
.contact-item {
    background-color: var(--contact-item-bg);
    padding: 2.5rem; border-radius: 10px;
    transition: all 0.3s ease;
    text-align: center; position: relative; overflow: hidden;
}
.contact-item::before {
    content: ""; position: absolute; left: 0; top: 0;
    width: 100%; height: 100%;
    border-radius: 10px;
    background: radial-gradient(
        400px circle at var(--x) var(--y),
        rgba(255, 140, 0, 0.4),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}
.contact-item:hover::before { opacity: 1; }
.contact-item > * { position: relative; z-index: 2; }
.contact-item:hover {
    background-color: var(--contact-item-bg-hover);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px var(--shadow-color);
}
.contact-item i {
    font-size: 50px; color: var(--accent-primary);
    margin-bottom: 1rem;
}
.contact-item h3 {
    font-size: 1.5rem; color: var(--text-light);
    margin-bottom: 0.5rem;
}
.contact-item a, .contact-item span {
    display: block; font-size: 1rem;
    color: var(--text-light); opacity: 0.9;
    word-break: break-word;
}
.contact-item a { color: var(--accent-primary); font-weight: 600; }
.contact-item a:hover { text-decoration: underline; }

/* ======================== */
/* ====== 12. الفوتر ====== */
/* ======================== */

.footer {
    background-color: var(--footer-bg);
    color: var(--text-light); text-align: center;
    padding: 1.5rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.4s ease;
}
.footer p { font-size: 0.9rem; margin: 0; opacity: 0.7; }

/* ================================== */
/* ====== 13. زر العودة للأعلى ====== */
/* ================================== */
.back-to-top-btn {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    z-index: 999; width: 55px; height: 55px;
    border-radius: 50%; display: flex;
    justify-content: center; align-items: center;
    font-size: 1.5rem; background-color: var(--text-secondary);
    color: var(--primary-bg);
    box-shadow: 0 5px 15px var(--shadow-color);
    border: 2px solid var(--accent-primary); cursor: pointer;
    opacity: 0; visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s ease;
}
.back-to-top-btn.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.back-to-top-btn:hover {
    background-color: var(--accent-primary);
    color: var(--text-secondary);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 20px var(--shadow-color-heavy);
}

/* =================================================== */
/* ====== 14. نافذة عرض الصور (Lightbox) الاحترافية ====== */
/* =================================================== */
.lightbox-modal {
    display: none; /* مخفية بشكل افتراضي */
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.9); /* خلفية داكنة احترافية */
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    padding: 20px;
    cursor: pointer;
}

.lightbox-modal.show {
    display: flex; /* استخدام flex لتوسيط المحتوى */
    animation: lightboxFadeIn 0.4s ease forwards;
}

.lightbox-wrapper {
    position: relative;
    width: auto;
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.8);
    opacity: 0;
    animation: lightboxZoomIn 0.4s ease 0.1s forwards;
    cursor: default;
}

.lightbox-content {
    display: block;
    max-width: 100%;
    max-height: 85vh; /* لضمان أن الصورة لا تتجاوز ارتفاع الشاشة */
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 3px solid #fff;
}

#lightbox-caption {
    color: #fff;
    text-align: center;
    margin-top: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(10px);
    animation: captionFadeIn 0.4s ease 0.2s forwards;
}

.lightbox-close {
    position: absolute;
    top: -45px;
    right: -15px;
    color: #FFFFFF;
    font-size: 2.75rem;
    font-weight: normal;
    transition: all 0.3s ease;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
}

.lightbox-close:hover {
    color: var(--accent-primary);
    transform: rotate(90deg);
}


/* نافذة رسالة النجاح (بدون تغيير) */
.success-modal {
    display: none; position: fixed; z-index: 10001;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s forwards;
    justify-content: center; align-items: center;
}
.success-modal-content {
    background-color: var(--card-bg); margin: auto;
    padding: 2.5rem; border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-color-heavy);
    text-align: center; position: relative; max-width: 450px;
    width: 90%; transform: translateY(-50px); opacity: 0;
    animation: slideInFromTop 0.4s forwards 0.2s;
    transition: background-color 0.4s ease;
}
.success-close-btn {
    position: absolute; color: var(--text-primary); top: 1rem; right: 1.5rem; font-size: 1.5rem;
    transition: all 0.3s ease; cursor: pointer;
}
.success-close-btn:hover { color: var(--accent-primary); }
.success-icon {
    font-size: 80px; color: #28a745; margin-bottom: 1.5rem;
    animation: bounceIn 0.6s forwards;
}
.success-modal-content h2 { margin-bottom: 1rem; font-size: 1.5rem; }
.success-modal-content p { font-size: 1rem; margin-bottom: 2.5rem; }

/* ================================== */
/* ====== 15. انيميشن عامة ====== */
/* ================================== */
@keyframes lightboxFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes lightboxZoomIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes captionFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInFromTop { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes bounceIn {
    0% { transform: scale(0.1); opacity: 0; }
    60% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); }
}

/* ================================= */
/* ====== 16. التصميم المتجاوب ====== */
/* ================================= */

@media (max-width: 992px) {
    h1 { font-size: 2.75rem; }
    h2 { font-size: 2rem; }
    .desktop-nav { display: none; }
    .hamburger { display: flex; }
    .theme-toggle-btn { margin-left: 1rem; }
    .testimonial-carousel-container { padding: 0 3.5rem; }
    .carousel-arrow.prev { right: -0.5rem; }
    .carousel-arrow.next { left: -0.5rem; }
}

@media (max-width: 767px) {
    .section-padding { padding: 4rem 1rem; }
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.75rem; }
    .logo img { max-width: 150px; }
    .hero-section { min-height: 70vh; padding-top: 80px; }
    .about-cards { gap: 1.5rem; }
    .about-card { width: 100%; max-width: 350px; padding: 1.5rem; }
    .product-tabs { gap: 0.5rem; margin-bottom: 2.5rem; }
    .tab-button { padding: 10px 15px; font-size: 0.9rem; }
    
    /* --- تعديل شبكة المنتجات للهاتف (عمودين) --- */
    .tab-content {
        /* تغيير الشبكة إلى عمودين ثابتين */
        grid-template-columns: repeat(2, 1fr);
        /* تقليل المسافة بين البطاقات */
        gap: 1rem;
    }

    .product-card {
        /* تقليل الحشو الداخلي للبطاقة */
        padding: 1rem;
    }

    .product-card h3 {
        /* تصغير حجم الخط لاسم المنتج */
        font-size: 1.1rem;
    }

    .product-card p {
        /* تصغير حجم الخط للوصف */
        font-size: 0.9rem;
    }
    .product-image-container {
        margin-bottom: 1rem;
    }
    .product-image {
        height: 160px; /* تقليل ارتفاع الصورة في الهاتف */
    }
    /* --- نهاية تعديل شبكة المنتجات --- */
    
    /* تعديلات قسم آراء العملاء للهاتف */
    .testimonial-carousel-container { padding: 0; }
    .testimonial-card { padding: 2rem 1.5rem; }
    .testimonial-text { font-size: 1rem; }
    .carousel-arrow { display: none; /* إخفاء الأسهم والاعتماد على السحب أو النقاط */ }
    .testimonial-carousel { min-height: 420px; }
    
    .contact-info-grid { grid-template-columns: 1fr; }
    
    /* تعديل شبكة الشركاء للشاشات الصغيرة */
    .partners-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1.5rem;
    }

    .lightbox-close {
        top: 0px;
        right: 5px;
        background-color: rgba(0,0,0,0.3);
        border-radius: 50%;
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}




/* --- قسم معرض الأعمال الاحترافي --- */
.portfolio-section {
    background-color: var(--primary-bg);
}
.portfolio-grid {
    display: grid;
    /* 5 أعمدة على الشاشات الكبيرة */
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}
.portfolio-item {
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: all 0.3s ease-in-out;
    overflow: hidden;
}
.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px var(--shadow-color-heavy);
}
.portfolio-item.hidden {
    display: none;
}
.portfolio-image-wrapper {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    height: 220px; /* ارتفاع ثابت للصور */
}
.portfolio-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.portfolio-image-wrapper:hover .portfolio-image {
    transform: scale(1.1);
}
.portfolio-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.portfolio-image-wrapper:hover .portfolio-overlay {
    opacity: 1;
}
.portfolio-overlay i {
    color: #fff;
    font-size: 2.5rem;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}
.portfolio-image-wrapper:hover .portfolio-overlay i {
    transform: scale(1);
}
.portfolio-item-caption {
    padding: 1rem;
    text-align: center;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
}
.portfolio-item-caption h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 600;
}
.load-more-container {
    text-align: center;
    margin-top: 3rem;
}
.empty-category-msg {
    text-align: center;
    width: 100%;
    grid-column: 1 / -1;
    padding: 2rem;
    color: var(--text-primary);
    opacity: 0.7;
}

/* --- تعديلات التصميم المتجاوب لمعرض الأعمال --- */
@media (max-width: 1200px) {
    .portfolio-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 992px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 767px) {
    .portfolio-grid {
        /* 3 أعمدة على الهاتف */
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
    .portfolio-image-wrapper {
        height: 150px;
    }
    .portfolio-item-caption {
        padding: 0.75rem;
    }
    .portfolio-item-caption h3 {
        font-size: 0.9rem;
    }
}
@media (max-width: 480px) {
    .portfolio-grid {
        /* عمودان على الشاشات الصغيرة جداً */
        grid-template-columns: repeat(2, 1fr);
    }
}
