:root {
    /* Base Variables (Light Mode) - Alsakra Almatina Brand */
    --primary-color: #F26522; /* Strong Orange */
    --primary-hover: #D95316; /* Darker Orange */
    --secondary-color: #1A1A1A; /* Solid Black/Charcoal */
    --secondary-hover: #333333; /* Lighter Charcoal */

    --bg-main: #F5F6F8;
    --bg-card: #FFFFFF;
    --bg-header: rgba(255, 255, 255, 0.95);

    --text-primary: #1A1A1A;
    --text-secondary: #6B6E83;
    --text-inverse: #FFFFFF;

    --border-color: #E2E8F0;

    /* Effects */
    --shadow-sm: 0 4px 6px rgba(26, 26, 26, 0.05);
    --shadow-md: 0 10px 20px rgba(26, 26, 26, 0.08);
    --shadow-lg: 0 20px 40px rgba(26, 26, 26, 0.12);

    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Layout */
    --max-width: 1280px;
    --border-radius: 6px;
}

[data-theme="dark"] {
    /* Dark Mode Overrides - Professional Graphite & Black */
    --bg-main: #121212; /* أسود رمادي عميق ومريح للعين خلفية رئيسية */
    --bg-card: #1E1E1E; /* رمادي داكن للبطاقات ليعطي إحساساً بالعمق */
    --bg-header: rgba(18, 18, 18, 0.95); /* ترويسة شفافة متناسبة */

    --text-primary: #F5F5F5; /* أبيض هادئ لعدم إرهاق العين */
    --text-secondary: #A0A0A0; /* رمادي محايد للنصوص الثانوية */
    --text-inverse: #121212;

    --border-color: #333333; /* فواصل رمادية أنيقة وغير مزعجة */

    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.9);
}

/* Image Mode Swapping */
.light-mode-img { display: block; }
.dark-mode-img { display: none; }

[data-theme="dark"] .light-mode-img { display: none; }
[data-theme="dark"] .dark-mode-img { display: block; }

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-secondary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Raleway', sans-serif;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Layout Classes */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 5rem 0;
}

/* Section Headers */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.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;
}

.section-title p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 1rem auto 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    padding: 12px 28px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #FFFFFF; /* Changed to white for better contrast with orange */
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: #FFFFFF; 
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(242, 101, 34, 0.4);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: #FFFFFF;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cta-header-btn {
    width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 12px 0;
}

/* Header & Nav */
.site-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    transition: var(--transition);
}

.site-header.scrolled {
    padding: 0.5rem 0;
    box-shadow: var(--shadow-md);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    direction: ltr !important; 
}

.logo {
    font-family: 'Raleway', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.logo span {
    color: var(--primary-color);
    margin-left: 5px;
}

[dir="rtl"] .logo span {
    margin-left: 0;
    margin-right: 5px;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.nav-links {
    display: flex;
    gap: 2rem;
    margin: 0 auto;
}

.nav-links a {
    color: var(--text-primary);
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

[dir="rtl"] .nav-links a::after {
    left: auto;
    right: 0;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Theme & Lang Controls */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.switches-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.control-btn:hover {
    background-color: rgba(128, 128, 128, 0.1);
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section Base */
.hero {
    height: 100vh;
    height: 100svh;
    min-height: 600px;
    display: flex;
    align-items: center;
    position: relative;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

@media screen and (max-width: 992px) {
    .hero {
        background-attachment: scroll !important;
    }
}

@supports (-webkit-touch-callout: none) {
    .hero {
        background-attachment: scroll !important;
    }
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(26, 26, 26, 0.7), rgba(26, 26, 26, 0.8)); /* Updated to blackish overlay */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    color: #FFFFFF;
    font-size: 4rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    color: #E2E8F0;
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Footer */
.site-footer {
    background-color: var(--secondary-color);
    color: #94A3B8;
    padding-top: 4rem;
}

[data-theme="dark"] .site-footer {
    background-color: #050505; /* أسود شبه خالص لتذييل الموقع */
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h3 {
    color: #FFFFFF;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.footer-col h4 {
    color: #FFFFFF;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

[dir="rtl"] .footer-col h4::after {
    left: auto;
    right: 0;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
}

.social-links a:hover {
    background-color: var(--primary-color);
    color: #FFFFFF;
    transform: translateY(-3px);
}

.footer-nav li,
.footer-contact li {
    margin-bottom: 0.8rem;
}

.footer-nav a {
    color: #94A3B8;
}

.footer-nav a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

[dir="rtl"] .footer-nav a:hover {
    padding-left: 0;
    padding-right: 5px;
}

.footer-contact li {
    display: flex;
    align-items: center;
    gap: 15px;
}

[dir="rtl"] .footer-contact li {
    flex-direction: row;
    justify-content: flex-start;
}

.footer-contact i {
    color: var(--primary-color);
    font-size: 1.1rem;
    min-width: 20px;
    text-align: center;
}

/* RTL Helpers for Footer Elements */
[dir="rtl"] .footer-align {
    text-align: right;
}

[dir="rtl"] .footer-logo-container {
    justify-content: flex-start;
}

.footer-bottom {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.9rem;
}

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Accordion Categories */
.accordion-container {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 3rem;
    box-shadow: var(--shadow-sm);
}

.accordion-item {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.accordion-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    cursor: pointer;
    background: transparent;
    transition: var(--transition);
}

.accordion-header h2 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
    transition: color 0.3s ease;
}

.accordion-header .icon {
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
    transition: transform 0.3s ease, color 0.3s ease;
    color: var(--text-primary);
}

.accordion-item.active .accordion-header h2,
.accordion-header:hover h2 {
    color: var(--primary-color);
}

.accordion-item.active .accordion-header .icon,
.accordion-header:hover .icon {
    color: var(--primary-color);
}

.accordion-item.active .accordion-header .icon {
    transform: rotate(45deg);
}

.accordion-content {
    display: none;
    padding: 1rem 0 3rem;
}

.accordion-item.active .accordion-content {
    display: block;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.accordion-content .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Responsive */
@media (max-width: 992px) {
    .nav-wrapper {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 80px;
    }

    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
        z-index: 5;
    }
    
    .logo img {
       height: 50px !important;
    }

    [dir="rtl"] .logo {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    .mobile-menu-btn {
        display: block;
        order: -1;
        z-index: 10;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-controls {
        order: 1;
        z-index: 10;
        margin: 0;
    }

    .switches-container {
        flex-direction: column;
        gap: 2px;
    }

    .control-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .site-logo-img {
        height: 50px !important;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-header);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 2rem;
        box-shadow: var(--shadow-lg);
        text-align: center;
        border-bottom-left-radius: 20px;
        border-bottom-right-radius: 20px;
        border-top: 1px solid var(--border-color);
    }

    .nav-links.active {
        display: flex;
    }

    .cta-header-btn {
        display: none !important;
    }

    .mobile-wa-btn {
        display: inline-block !important;
    }

    .mobile-menu-btn {
        display: block;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-content h1 {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}

/* Arabic Typography Overrides */
[dir="rtl"] body,
[dir="rtl"] p,
[dir="rtl"] span,
[dir="rtl"] a,
[dir="rtl"] li,
[dir="rtl"] div {
    font-family: 'Tajawal', sans-serif !important;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6,
[dir="rtl"] .btn {
    font-family: 'Cairo', sans-serif !important;
}

/* Mobile UX Enhancements */
@media (max-width: 768px) {
    .accordion-content .products-grid {
        grid-template-columns: 1fr;
        justify-content: center;
    }

    .social-links {
        justify-content: center;
    }
}

/* Floating WhatsApp Button */
.floating-wa-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: white !important;
    border-radius: 50%;
    text-align: center;
    font-size: 35px;
    line-height: 60px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

[dir="rtl"] .floating-wa-btn {
    right: auto;
    left: 30px;
}

.floating-wa-btn:hover {
    background-color: #1EBEA5;
    transform: scale(1.1);
}

/* Button Loading Animation */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.85;
    animation: btn-pulse 1.5s infinite;
}

@keyframes btn-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(242, 101, 34, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(242, 101, 34, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(242, 101, 34, 0);
    }
}

/* ============================================
   Projects Dark Carousel Section
   ============================================ */
.projects-swiper {
    padding: 20px 10px !important;
    margin: -20px -10px !important;
}

.proj-link-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
}

.proj-card {
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03); /* Glass base */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

[data-theme="light"] .proj-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.proj-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

[data-theme="dark"] .proj-card:hover {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.proj-card-img {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.proj-card-body {
    padding: 1.25rem 1.25rem 1.5rem;
}

.proj-card-body h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    line-height: 1.4;
    text-align: center;
}

.proj-card-body p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.6;
    text-align: center;
}

/* Native Swiper Navigation Arrows Override */
.proj-nav-prev, .proj-nav-next {
    background: var(--primary-color);
    width: 46px !important;
    height: 46px !important;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    transition: background 0.25s ease, transform 0.25s ease;
    margin-top: -23px !important;
}

.proj-nav-prev:after, .proj-nav-next:after {
    font-size: 1.2rem !important;
    font-weight: bold;
    color: #fff;
}

.proj-nav-prev:hover, .proj-nav-next:hover {
    background: #c0451a;
    transform: scale(1.08);
}

.proj-nav-prev:active, .proj-nav-next:active {
    transform: scale(0.96);
}

/* Because the elements are static in a flex container, we reverse the flex direction in RTL so the right arrow stays visually right */
[dir="rtl"] .projects-section > div:last-child {
    flex-direction: row-reverse;
}

/* Proj cards equal height structural rules */
.projects-swiper .swiper-slide {
    height: auto;
    display: flex;
    flex-direction: column;
}

.proj-card-body {
    flex: 1;
    padding: 1.25rem 1.25rem 1.5rem;
}

/* Swiper pagination dots for projects */
.projects-pagination .swiper-pagination-bullet {
    background: rgba(255,255,255,0.3);
    opacity: 1;
}
.projects-pagination .swiper-pagination-bullet-active {
    background: var(--primary-color);
}

/* Theme-aware Projects section */
.projects-section {
    background-color: #f1f2f4;
}

[data-theme="dark"] .projects-section {
    background-color: #111;
}

.projects-title {
    color: var(--text-primary);
}

.projects-subtitle {
    color: var(--text-secondary);
}

[data-theme="dark"] .projects-title {
    color: #ffffff;
}

[data-theme="dark"] .projects-subtitle {
    color: #adb5bd;
}

/* RTL alignment for proj-card-body */
[dir="rtl"] .proj-card-body {
    text-align: right;
}

[dir="rtl"] .proj-card-body h3,
[dir="rtl"] .proj-card-body p {
    direction: rtl;
}