/* ================================================== */
/* ========== GENERAL & COLOR PALETTE ========== */
/* ================================================== */
:root {
    --page-bg: #ffffff;
    --dark-text: #2c3e50;
    --highlight-green: #27ae60;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--dark-text);
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scroll */
    background-color: var(--page-bg);
}

/* Ensure fullpage styles only apply when enabled by the script */
.fp-enabled body {
    overflow: hidden;
}

/* ================================================== */
/* ========== PRELOADER STYLES ========== */
/* ================================================== */
#preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999; background-color: #ffffff; display: flex; justify-content: center; align-items: center; transition: opacity 0.8s ease, visibility 0.8s ease; }
#preloader.hidden { opacity: 0; visibility: hidden; }
.loader-container { text-align: center; }
.loader-logo { max-width: 850px; height: auto; margin-bottom: 30px; }
.progress-bar { width: 350px; height: 3px; background-color: #989393; border-radius: 5px; overflow: hidden; margin: 0 auto; }
.progress-bar::before { content: ''; display: block; width: 0; height: 100%; background-color: #000000; animation: loading-progress 2s ease-out forwards; }
@keyframes loading-progress { from { width: 0%; } to { width: 100%; } }

/* ================================================== */
/* ========== HEADER STYLES ========== */
/* ================================================== */
#header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
    padding: 15px 50px; background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); box-sizing: border-box;
    display: flex; justify-content: space-between; align-items: center;
    transition: opacity 0.4s ease, background-color 0.3s ease;
    opacity: 1;
}
body.fp-viewing-home #header { opacity: 0; pointer-events: none; }
.logo { height: 50px; transition: height 0.3s ease; }

#main-nav {
    display: flex;
}
#menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: row; }
#menu li { margin: 0 20px; }
#menu a { text-decoration: none; color: var(--dark-text); font-weight: bold; padding-bottom: 5px; transition: all 0.3s ease; border-bottom: 2px solid transparent; white-space: nowrap; }
#menu li.active a, #menu li a:hover { color: var(--highlight-green); border-bottom-color: var(--highlight-green); }

.language-switcher { display: flex; }
.language-switcher a { text-decoration: none; color: #888; margin: 0 5px; font-weight: bold; }
.language-switcher a.active { color: #000; }

#mobile-menu-toggle { display: none; } /* Hidden on desktop */


/* ================================================== */
/* ========== HOME SECTION STYLES ========== */
/* ================================================== */
#section-home {
    position: relative;
    background-color: var(--page-bg);
    overflow: hidden;
}
.home-language-switcher {
    position: absolute;
    top: 40px;
    right: 50px;
    z-index: 10;
}
.home-language-switcher a { color: var(--dark-text); text-decoration: none; margin-left: 15px; font-weight: bold; opacity: 0.7; transition: opacity 0.3s ease; }
.home-language-switcher a.active { opacity: 1; color: var(--highlight-green); }

.home-gallery {
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    clip-path: polygon(0 0, 100% 0, 75% 100%, 0 100%);
    z-index: 1;
}
.gallery-image { flex: 1; overflow: hidden; position: relative; border-bottom: 2px solid #fff; }
.gallery-image:last-child { border-bottom: none; }
.gallery-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.fp-viewing-home .gallery-image img { transform: scale(1.05); }

.home-info {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.home-info-content {
    text-align: center;
}
.home-logo-main {
    max-width: 550px;
    margin-bottom: 20px;
}
.home-company-details h1 {
    font-size: 3em;
    margin: 0 0 10px 0;
}
.home-company-details p {
    font-size: 1.1em;
    opacity: 0.7;
}
.home-menu {
    margin-top: 50px;
}
.home-menu ul { list-style: none; padding: 0; margin: 0; display: flex; justify-content: center; }
.home-menu li { margin: 0 20px; }
.home-menu a { text-decoration: none; color: var(--dark-text); font-weight: bold; padding: 10px 5px; transition: all 0.3s ease; white-space: nowrap; }
.home-menu li.active a, .home-menu li a:hover { color: var(--highlight-green); }

/* ================================================== */
/* ========== INNER PAGES - MAIN STRUCTURE ========== */
/* ================================================== */
#section-about, #section-contact, #section-products { 
    background-color: #f8f9fa; 
}
.section .content { 
    max-width: 1200px;
    margin: 0 auto; 
    padding: 20px; 
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}
.btn { 
    display: inline-block; 
    margin-top: 15px; 
    padding: 12px 25px; 
    background-color: var(--dark-text); 
    color: #fff; 
    text-decoration: none; 
    border-radius: 5px; 
    transition: background-color 0.3s; 
    font-weight: bold;
}
.btn:hover { 
    background-color: var(--highlight-green);
}


/* ================================================== */
/* ========== ABOUT US SECTION STYLES ========== */
/* ================================================== */
.about-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 50px;
    padding: 20px 0;
    width: 100%;
}
.about-text {
    flex-basis: 65%;
}
.about-text h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--highlight-green);
    display: inline-block;
}
.about-text p {
    font-size: 1em;
    line-height: 1.75;
    color: #555;
    margin-bottom: 15px;
    text-align: justify;
}
.about-image {
    flex-basis: 35%;
    text-align: center;
}
.about-image img {
    width: 100%;
    max-width: 350px;
    height: 420px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    object-fit: cover;
}
.ceo-caption {
    margin-top: 15px;
}
.ceo-caption h3 {
    margin: 0;
    font-size: 1.3em;
    color: var(--dark-text);
}
.ceo-caption p {
    margin: 4px 0 0;
    font-size: 1em;
    color: var(--highlight-green);
    font-weight: bold;
}


/* ================================================== */
/* ========== PRODUCTS SECTION STYLES ========== */
/* ================================================== */
#section-products .content {
    justify-content: center;
    padding-top: 80px; /* Space for header */
}
#section-products .content h2 {
    font-size: 2.5em;
    display: inline-block;
    border-bottom: 2px solid var(--highlight-green);
    padding-bottom: 10px;
    margin-bottom: 30px;
    align-self: flex-start;
}
.swiper {
    width: 100%;
    height: 60vh;
}
.swiper-slide { 
    position: relative; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    overflow: visible;
}
.swiper-slide img {
    display: block;
    width: 75%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.product-box {
    position: absolute;
    right: 8%;
    bottom: 10%;
    width: 340px;
    padding: 30px;
    background-color: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    text-align: left;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s ease;
}
.swiper-slide-active .product-box {
    transform: translateY(0);
    opacity: 1;
}
.product-box h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.6em;
}
.product-box p {
    font-size: 1em;
    line-height: 1.6;
}
.swiper-button-next, .swiper-button-prev {
    color: #333;
}


/* ================================================== */
/* ========== CONTACT & FOOTER SECTION STYLES ========== */
/* ================================================== */
#section-contact .fp-tableCell,
#section-contact .content {
    vertical-align: top;
}

#section-contact .content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    height: 100%;
    padding-top: max(10vh, 80px); /* Adjust top padding */   
    padding-bottom: 5vh; 
}
.contact-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
#section-contact h2 {
    font-size: 2.5em;
    margin-bottom: 15px;
}
.contact-subtitle {
    font-size: 1.1em;
    max-width: 600px;
    margin: 0 auto 40px auto;
    color: #666;
    line-height: 1.6;
}
.contact-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}
.contact-item {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: #fff;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    min-width: 300px;
}
.contact-icon {
    font-size: 1.8em;
    color: var(--highlight-green);
}
.contact-text {
    text-align: left;
}
:lang(fa) .contact-text, :lang(ar) .contact-text {
    text-align: right;
}
.contact-text h3 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
    color: var(--dark-text);
}
.contact-text a {
    text-decoration: none;
    color: #555;
    font-size: 1.1em;
    font-weight: bold;
    transition: color 0.3s ease;
}
.contact-text a:hover {
    color: var(--highlight-green);
}

.social-links {
    margin-top: 30px;
}
.social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    margin: 0 10px;
    border-radius: 50%;
    background-color: #e9e9e9;
    color: var(--dark-text);
    font-size: 1.5em;
    text-decoration: none;
    transition: all 0.3s ease;
}
.social-links a:hover {
    background-color: var(--highlight-green);
    color: #fff;
    transform: translateY(-5px);
}
.site-footer {
    width: 100%;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    font-size: 0.9em;
    color: #888;
}
.designer-credit {
    margin-top: 5px;
    font-weight: bold;
}


/* ================================================== */
/* ========== GLOBAL FIX FOR ALL PHONE NUMBERS IN RTL ========== */
/* ================================================== */
a[href^="tel:"] {
    direction: ltr;
    unicode-bidi: embed;
    display: inline-block; 
}


/* =================================================================== */
/* =================================================================== */
/* ==================      MOBILE RESPONSIVE STYLES     ================== */
/* =================================================================== */
/* =================================================================== */

@media (max-width: 900px) {
    
    /* --- General Adjustments --- */
    h1, h2, h3 {
        line-height: 1.3;
    }

    /* --- Header & Mobile Navigation --- */
    #header {
        padding: 10px 20px;
    }
    .logo {
        height: 40px;
        z-index: 1001; /* Ensure logo is above mobile nav background */
    }
    #main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 1000;
    }
    #header.mobile-nav-active #main-nav {
        transform: translateX(0);
    }
    #menu {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    #menu a {
        font-size: 2em;
    }
    .language-switcher {
        z-index: 1001;
    }

    /* Hamburger Toggle Button */
    #mobile-menu-toggle {
        display: block;
        width: 30px;
        height: 25px;
        position: relative;
        cursor: pointer;
        z-index: 1001;
    }
    #mobile-menu-toggle span {
        display: block;
        position: absolute;
        height: 3px;
        width: 100%;
        background: var(--dark-text);
        border-radius: 3px;
        opacity: 1;
        left: 0;
        transition: all 0.25s ease-in-out;
    }
    #mobile-menu-toggle span:nth-child(1) { top: 0px; }
    #mobile-menu-toggle span:nth-child(2) { top: 11px; }
    #mobile-menu-toggle span:nth-child(3) { top: 22px; }

    #header.mobile-nav-active #mobile-menu-toggle span:nth-child(1) {
        top: 11px;
        transform: rotate(135deg);
    }
    #header.mobile-nav-active #mobile-menu-toggle span:nth-child(2) {
        opacity: 0;
        left: -60px;
    }
    #header.mobile-nav-active #mobile-menu-toggle span:nth-child(3) {
        top: 11px;
        transform: rotate(-135deg);
    }
    
    /* --- Home Section --- */
    #section-home {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .home-gallery {
        width: 100%;
        height: 100%;
        position: absolute;
        clip-path: none; /* Remove diagonal cut */
        opacity: 0.15; /* Make it a background */
        z-index: 0;
    }
    .home-info {
        width: 100%;
        position: relative;
        height: auto;
        padding: 90px 20px 20px 20px; /* ** THE FIX IS HERE ** */
        box-sizing: border-box;
    }
    .home-logo-main {
        position: relative;
        max-width: 80%;
        transform: none;
        left: auto;
        top: auto;
    }
    .home-company-details {
        position: relative;
        width: 100%;
        transform: none;
        left: auto;
        top: auto;
    }
    .home-company-details h1 { font-size: 2em; }
    .home-company-details p { font-size: 1em; }

    .home-menu {
        margin-top: 30px;
    }
    .home-menu li { margin: 0 10px; }
    .home-menu a { font-size: 1em; }
    .home-language-switcher { top: 20px; right: 20px; }


    /* --- About Us Section --- */
    .section .content {
        padding: 80px 20px 20px 20px; /* Adjust padding for header */
        justify-content: flex-start;
        overflow-y: auto;
    }
    .about-container {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }
    .about-text {
        order: 2; /* Text comes after image on mobile */
    }
    .about-image {
        order: 1; /* Image comes first */
        max-width: 280px;
        margin: 0 auto;
    }
    .about-image img {
        height: 350px;
    }
    .about-text h2 {
        font-size: 2em;
        margin-top: 0;
    }

    /* --- Products Section (REBUILT FOR MOBILE CARDS) --- */
    #section-products .content h2 {
        font-size: 2em;
        align-self: center;
        margin-bottom: 20px;
    }
    .swiper {
        height: 70vh; /* Adjusted height */
        max-height: 550px;
    }
    .swiper-slide {
        display: flex;
        flex-direction: column;
        width: 80% !important; /* Set explicit width for 'slide' effect */
        max-width: 350px;
        height: 100%;
        background-color: #fff;
        border-radius: 20px;
        box-shadow: 0 8px 25px rgba(0,0,0,0.07);
        overflow: hidden; /* Hide overflow from the card */
    }
    .swiper-slide img {
        width: 100%;
        height: 50%;
        object-fit: cover;
        flex-shrink: 0;
    }
    .product-box {
        /* Reset positioning and setup flex */
        position: relative; 
        bottom: auto; left: auto; right: auto; transform: none;
        flex-grow: 1; /* Key change: makes the box fill remaining space */
        display: flex;
        flex-direction: column;
        justify-content: space-around; /* Distribute content evenly */
        
        /* Sizing and layout */
        width: 100%;
        padding: 20px;
        box-sizing: border-box;
        text-align: center;

        /* Reset desktop styles */
        background-color: transparent; 
        box-shadow: none;
        opacity: 1;
        transition: none;
    }
    .product-box h3 { font-size: 1.4em; margin-top:0; margin-bottom: 8px; line-height: 1.2; }
    .product-box p { font-size: 0.9em; line-height: 1.5; margin-bottom: 15px; flex-grow: 1; }
    .product-box .btn { margin-top: auto; }

    /* Reset active slide styles for mobile */
    .swiper-slide-active .product-box {
        transform: none;
        opacity: 1;
    }
    /* Hide desktop navigation buttons */
    .swiper-button-next, .swiper-button-prev {
        display: none;
    }


    /* --- Contact Section --- */
    #section-contact .content {
         padding-top: 80px;
         justify-content: space-between;
    }
    .contact-main {
        margin-top: 0;
    }
    #section-contact h2 {
        font-size: 2em;
    }
    .contact-subtitle { font-size: 1em; }
    .contact-container {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    .contact-item {
        width: 100%;
        max-width: 320px;
        min-width: 0;
        box-sizing: border-box;
    }
    .social-links a {
        width: 45px;
        height: 45px;
        font-size: 1.3em;
    }
}

@media (max-width: 480px) {
    /* --- Fine-tuning for smaller phones --- */
    .loader-logo { max-width: 90%; }
    .progress-bar { width: 90%; }

    .home-logo-main {
        max-width: 90%;
    }
    .home-company-details h1 {
        font-size: 1.8em;
    }
    .home-menu ul {
        flex-wrap: wrap;
        gap: 5px;
        justify-content: center;
    }
    .home-menu li {
        margin: 0 5px;
    }

    .about-text h2, #section-products .content h2, #section-contact h2 {
        font-size: 1.8em;
    }

    .about-text p {
        font-size: 0.95em;
    }

    .contact-item {
        padding: 15px 20px;
    }
}