@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Strict Color Palette */
    --color-white: #FFFFFF;
    --color-black: #111111;
    --color-red: #E3000F;
    --color-gray-light: #F9F9F9;
    --color-gray-dark: #333333;
    --color-gray-border: #EEEEEE;

    /* Typography */
    --font-en: 'Inter', sans-serif;
    --font-ar: 'Cairo', sans-serif;

    /* Spacing */
    --section-padding-y: 80px;
    --section-padding: var(--section-padding-y) 0;
    --container-width: 1200px;
    --border-radius: 4px;

    /* Diagonals - Standard Angle Source of Truth */
    --slant-depth: 4vw;
}

/* Default Slants (RTL/Arabic) */
html[dir="rtl"] {
    --diagonal-clip-bottom: polygon(0% 0%, 100% 0%, 100% calc(100% - var(--slant-depth)), 0% 100%);
    --diagonal-clip-both: polygon(0 var(--slant-depth), 100% 0, 100% calc(100% - var(--slant-depth)), 0 100%);
}

/* Mirrored Slants (LTR/English) */
html[dir="ltr"] {
    --diagonal-clip-bottom: polygon(0% 0%, 100% 0%, 100% 100%, 0% calc(100% - var(--slant-depth)));
    --diagonal-clip-both: polygon(0 0, 100% var(--slant-depth), 100% 100%, 0 calc(100% - var(--slant-depth)));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-en);
    background-color: var(--color-white);
    color: var(--color-black);
    line-height: 1.6;
    overflow-x: hidden;
}

html[dir="rtl"] body {
    font-family: var(--font-ar);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2; /* Keep above diagonal backgrounds */
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; text-align: center; margin-bottom: 3rem; }
h3 { font-size: 1.5rem; }
p { margin-bottom: 1rem; color: var(--color-gray-dark); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--color-red);
    color: var(--color-white);
}

.btn-primary:hover {
    background-color: #B3000C;
    color: var(--color-white);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--color-black);
    color: var(--color-black);
}

.btn-outline:hover {
    background-color: var(--color-black);
    color: var(--color-white);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.btn:active {
    transform: translateY(0);
}



/* Utility Classes */
.text-center { text-align: center; }
.text-red { color: var(--color-red); }
.text-white { color: var(--color-white); }
/* Background Utilities */
.bg-light { background-color: var(--color-gray-light); }
.bg-dark { background-color: var(--color-black); color: var(--color-white); }
.bg-red { background-color: var(--color-red); color: var(--color-white); }

.bg-image-overlay {
    position: relative;
    background-image: url('/hero_slide_1.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--color-white) !important;
}

.bg-image-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75); /* Darken for readability */
    z-index: 0;
}

.bg-image-overlay .container,
.bg-image-overlay .diagonal-both,
.bg-image-overlay .diagonal-bottom {
    position: relative;
    z-index: 1;
}

/* Override for cards inside dark overlay sections */
.bg-image-overlay .cert-card {
    color: var(--color-black) !important;
}
.bg-image-overlay .cert-name {
    color: var(--color-black) !important;
}

.bg-image-overlay h2, 
.bg-image-overlay h3, 
.bg-image-overlay p {
    color: var(--color-white) !important;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: transparent;
    z-index: 1000;
    padding: 15px 0 60px 0; 
    transition: all 0.3s ease;
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-white);
    -webkit-clip-path: var(--diagonal-clip-bottom);
    clip-path: var(--diagonal-clip-bottom);
    z-index: -1;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img, .header-logo-img {
    max-height: 90px; /* Reduced from 120px */
    width: auto;
    height: auto;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 24px;
}

.nav-links a {
    text-decoration: none;
    color: var(--color-black);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--color-red);
}

.header-company-name {
    font-weight: 800;
    font-size: 1.1rem;
    line-height: 1.3;
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .header-company-name {
        font-size: 0.9rem;
    }
    .nav-links {
        gap: 15px;
    }
}

@media (max-width: 992px) {
    .header-company-name {
        display: none; /* Hide long name on mobile/tablet to save space */
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-switch {
    text-decoration: none;
    color: var(--color-black);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 4px 8px;
    border: 1px solid var(--color-gray-border);
    border-radius: var(--border-radius);
    transition: all 0.3s;
}

.lang-switch:hover {
    border-color: var(--color-black);
}

/* Sections Base */
section {
    padding: var(--section-padding);
    position: relative;
    z-index: 1;
}

.page-header {
    margin-top: 0; 
    padding: 220px 0 60px 0; /* Padding-top to clear the slanted header */
}

/* Diagonals */
.diagonal-bottom {
    padding-bottom: calc(var(--section-padding-y) + var(--slant-depth));
    -webkit-clip-path: var(--diagonal-clip-bottom);
    clip-path: var(--diagonal-clip-bottom);
    margin-bottom: calc(-1 * var(--slant-depth) - 1.5px); /* Extra 1.5px to hide sub-pixel gaps */
    z-index: 5;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.diagonal-both {
    padding-top: calc(var(--section-padding-y) + var(--slant-depth));
    padding-bottom: calc(var(--section-padding-y) + var(--slant-depth));
    -webkit-clip-path: var(--diagonal-clip-both);
    clip-path: var(--diagonal-clip-both);
    margin-top: calc(-1 * var(--slant-depth) - 1.5px);
    margin-bottom: calc(-1 * var(--slant-depth) - 1.5px);
    z-index: 5;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Hero Section */
.hero {
    margin-top: 0;
    padding-top: 180px; /* Padding-top to clear the slanted header */
    min-height: 80vh;
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--color-black);
    color: var(--color-white);
    overflow: hidden;
}

.hero-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero-video-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translate(-50%, -50%);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 17, 17, 0.6); /* Black overlay */
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
}

.hero h1 {
    color: var(--color-white);
    margin-bottom: 1.5rem;
    font-size: 4rem;
}

.hero p {
    color: #E0E0E0;
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
}

html[dir="rtl"] .hero p {
    margin-left: auto;
}

/* About Section */
.about-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Products Section */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.product-card {
    background: var(--color-white);
    border: 1px solid var(--color-gray-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
}

.product-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-bottom: 1px solid var(--color-gray-border);
}

.product-info {
    padding: 25px;
}

.product-card .product-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: var(--color-black) !important;
}

.product-card p {
    color: var(--color-gray-dark) !important;
}

/* Features (Why Choose Us) */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    text-align: center;
    padding: 40px 20px;
    background: var(--color-white);
    border: 1px solid var(--color-gray-border);
    border-radius: var(--border-radius);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--color-red);
    margin-bottom: 20px;
}

/* Certificates */
.certs-section {
    position: relative;
    z-index: 10 !important; /* Ensure it stays above the next section */
}

.certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    align-items: center;
}

.cert-card {
    background: var(--color-white);
    padding: 15px;
    border: 1px solid var(--color-gray-border);
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.cert-card img {
    max-width: 100%;
    height: auto;
}

.cert-name {
    margin-top: 15px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-black); /* Dark text because card is white */
}

/* Statistics Section */
.bg-dark.diagonal-both {
    z-index: 9 !important;
    position: relative;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
}

.stat-number {
    font-size: 4rem;
    font-weight: 800;
    color: var(--color-red);
    line-height: 1;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Factory Video */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--border-radius);
    background: var(--color-black);
}

.video-wrapper iframe, .video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.contact-info {
    padding: 40px;
    background: var(--color-gray-light);
    border-radius: var(--border-radius);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 30px;
}

.contact-icon {
    font-size: 1.5rem;
    color: var(--color-red);
}

.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--color-gray-border);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-red);
}

textarea.form-control {
    height: 120px;
    resize: vertical;
}

/* Footer CTA Banner (Diagonal Both) */
.footer-cta {
    background-color: var(--color-red);
    color: var(--color-white);
    padding: 80px 0; 
    margin-top: calc(-1 * var(--slant-depth));
    margin-bottom: calc(-1 * var(--slant-depth));
    position: relative;
    z-index: 10;
    -webkit-clip-path: var(--diagonal-clip-both);
    clip-path: var(--diagonal-clip-both);
}

.footer-cta-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.cta-text h2 {
    color: var(--color-white);
    margin-bottom: 10px;
    font-size: 1.8rem;
    text-align: right;
}

html[dir="ltr"] .cta-text h2 {
    text-align: left;
}

.cta-text p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 1.1rem;
}

.cta-button .btn-white {
    background-color: var(--color-white);
    color: var(--color-red);
    font-weight: bold;
    padding: 12px 30px;
    font-size: 1.1rem;
}

.cta-button .btn-white:hover {
    background-color: var(--color-black);
    color: var(--color-white);
}

/* Advanced Footer */
.advanced-footer {
    background-color: #0b0f19; /* Very dark blue/black similar to the image */
    color: var(--color-white);
    padding: 60px 0 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.footer-logo img {
    max-height: 150px;
    width: auto;
    height: auto;
    background-color: var(--color-white);
    padding: 10px;
    border-radius: 4px;
}

.footer-logo h3 {
    color: var(--color-white);
    margin: 0;
    font-size: 1.5rem;
}

.company-col p {
    color: #a0aabf;
    margin-bottom: 25px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: var(--color-red);
}

.footer-heading {
    color: var(--color-white);
    font-size: 1.2rem;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 2px;
    background-color: var(--color-red);
}

html[dir="ltr"] .footer-heading::after {
    right: auto;
    left: 0;
}

.links-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.links-col ul li {
    margin-bottom: 12px;
}

.links-col ul li a {
    color: #a0aabf;
    text-decoration: none;
    transition: color 0.3s;
}

.links-col ul li a:hover {
    color: var(--color-white);
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    color: #a0aabf;
}

.footer-contact-item i {
    color: var(--color-red);
    color: var(--color-red);
    font-size: 1.2rem;
    margin-top: 3px;
}

/* Success Partners Section */
.partners-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
}

.partner-logo {
    width: 180px;
    height: 100px;
    background: var(--color-white);
    border: 1px solid var(--color-gray-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.partner-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    border-color: var(--color-red);
}

.partner-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.footer-bottom {
    background-color: #06090f;
    padding: 20px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 992px) {
    .about-section, .contact-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .hero h1 { font-size: 3rem; }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 992px) {
    .main-nav {
        display: none;
    }
    .hero h1 { font-size: 2.5rem; }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .footer-cta-container {
        flex-direction: column;
        text-align: center;
    }
    .cta-text h2 {
        text-align: center;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* Advanced Enhancements */

/* Sticky Header Scroll State */
.site-header.scrolled {
    padding: 10px 0 45px 0;
}

.site-header.scrolled::before {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.site-header.scrolled .logo img {
    max-height: 80px;
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
    display: none !important; /* Force hide on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1100;
}

.hamburger {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--color-black);
    position: relative;
    transition: background 0.3s;
}

.hamburger::before, .hamburger::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background: var(--color-black);
    left: 0;
    transition: all 0.3s;
}

.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }

/* Mobile Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-white);
    z-index: 2000;
    transform: translateX(100%);
    visibility: hidden; /* Prevent interaction and layout issues when hidden */
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1), visibility 0.5s;
    display: none; /* Hide on desktop completely */
    flex-direction: column;
}

html[dir="rtl"] .mobile-nav-overlay {
    transform: translateX(-100%);
}

.mobile-nav-overlay.active,
html[dir="rtl"] .mobile-nav-overlay.active {
    transform: translateX(0);
    visibility: visible;
}


.mobile-nav-content {
    padding: 40px 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mobile-nav-close {
    align-self: flex-end;
    font-size: 3rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-black);
    line-height: 1;
}

.mobile-logo {
    text-align: center;
    margin-bottom: 40px;
}

.mobile-logo img {
    max-height: 100px;
}

.mobile-nav-links {
    list-style: none;
    padding: 0;
    margin-bottom: 40px;
}

.mobile-nav-links li {
    margin-bottom: 20px;
    text-align: center;
}

.mobile-nav-links a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-black);
    text-decoration: none;
}

.mobile-nav-footer {
    margin-top: auto;
    text-align: center;
}

.mobile-lang {
    margin-top: 20px;
}

/* WhatsApp Float */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    text-decoration: none;
}

html[dir="rtl"] .whatsapp-float {
    right: auto;
    left: 30px;
}

.whatsapp-float:hover {
    transform: scale(1.1) rotate(10deg);
    color: #fff;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

/* Reveal on Scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: none !important; /* Restores parallax background-attachment: fixed */
}


/* Specific Section Adjustments */
.btn-request-header {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Responsive Overrides */
@media (max-width: 992px) { /* Changed from 768 to 992 for tablet support */
    .mobile-nav-toggle {
        display: block !important;
    }
    
    .mobile-nav-overlay {
        display: flex; /* Show only on mobile/tablet */
    }
    
    .btn-request-header {
        display: none; /* Hide on mobile to save space, it's in the menu */
    }

    .site-header {
        padding: 10px 0 45px 0;
    }

    .header-container {
        padding: 0 10px;
    }

    .logo img, .header-logo-img {
        max-height: 60px; /* Even smaller for mobile */
    }
    
    .hero h1 {
        font-size: 2rem;
    }
}

/* Form Feedback */
.form-success-msg {
    display: none;
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
    text-align: center;
    font-weight: 600;
}