:root {
    /* Base Variables (Light Mode) */
    --primary-color: #F4BE37;
    /* Industrial Yellow */
    --primary-hover: #DDAA2A;
    --secondary-color: #2F314D;
    /* Dark Navy Blue */
    --secondary-hover: #3A3D60;

    --bg-main: #F5F6F8;
    --bg-card: #FFFFFF;
    --bg-header: rgba(255, 255, 255, 0.85);

    --text-primary: #2F314D;
    --text-secondary: #6B6E83;
    --text-inverse: #FFFFFF;

    --border-color: #E2E8F0;

    /* Effects */
    --shadow-sm: 0 4px 6px rgba(47, 49, 77, 0.05);
    --shadow-md: 0 10px 20px rgba(47, 49, 77, 0.08);
    --shadow-lg: 0 20px 40px rgba(47, 49, 77, 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 */
    --bg-main: #0F172A;
    /* Deep slate */
    --bg-card: #1E293B;
    --bg-header: rgba(15, 23, 42, 0.85);

    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-inverse: #0F172A;

    --border-color: #334155;

    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* 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: var(--secondary-color);
}

.btn-primary:hover {
    background-color: #E5AC18;
    /* Slightly darker richer yellow */
    color: var(--secondary-color);
    /* Ensure text remains visible */
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(244, 190, 55, 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;
    /* Fixed width to prevent shifting when text length changes */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 12px 0;
    /* Remove horizontal padding so the text can center naturally within the fixed width */
}

/* 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; /* Always Logo Left, Links/Menu Center, Controls Right */
}

.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;
}

/* Physical Layout: Header elements maintain their positions (Logo Left, Controls Right) 
   regardless of language direction to ensure UI consistency */
[dir="rtl"] .logo span {
    margin-left: 0;
    margin-right: 5px;
}

/* RTL Support for Logo */
[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;
}

/* Fix for iOS Safari and Mobile background-attachment: fixed bug */
@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(15, 23, 42, 0.7), rgba(15, 23, 42, 0.8));
    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: #0B1120;
}

.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: var(--secondary-color);
    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: flex-start;
    gap: 10px;
}

.footer-contact i {
    color: var(--primary-color);
    margin-top: 5px;
}

.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);
}

/* Active State matches Reference Image */
.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);
    /* turns '+' into 'x' */
}

.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);
    }
}

/* Update products grid to fit inside accordion */
.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;
    }

    [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(246, 178, 41, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(246, 178, 41, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(246, 178, 41, 0);
    }
}