/* ========= Global Styles & Fonts ========= */
:root {
    --primary-color: #2a6e3f;
    --secondary-color: #1d4e2c;
    --accent-color: #d4af37;
    --text-color: #333333;
    --bg-color: #ffffff;
    --light-bg-color: #f9f9f9;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    transition: background-color 0.3s;
    /* For menu overlay effect */
}

body.rtl {
    direction: rtl;
}

body.menu-open {
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========= Reusable Components ========= */
.page-section {
    display: none;
    /* Hidden by default, shown by JS */
    padding-bottom: 3rem;

    animation: fadeIn 0.8s ease-in-out;
}

.page-section.active {
    display: block;
}

.section-title,
.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after,
.page-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--accent-color);
}

.cta-button {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: var(--bg-color);
    text-decoration: none;
    font-weight: bold;
    border-radius: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(42, 110, 63, 0.2);
}

.cta-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(42, 110, 63, 0.4);
}

.cta-button-secondary {
    display: inline-block;
    padding: 12px 30px;
    background-color: transparent;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    border-radius: 30px;
    border: 2px solid var(--primary-color);
    transition: all 0.3s ease;
}

.cta-button-secondary:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
    transform: translateY(-3px);
}


/* ========= HEADER ========= */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: transparent;
    background-color: #dddddd8a;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.header.scrolled {
    background: var(--bg-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 60px;
    width: 60px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.1);
}

.nav-links ul {
    list-style: none;
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 1rem;
    padding-bottom: 0.5rem;
    position: relative;
    transition: color 0.3s;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#lang-select {
    padding: 8px 12px;
    border-radius: 20px;
    background: #f8f8f8;
    color: var(--primary-color);
    border: 1px solid #ddd;
    font-weight: bold;
    cursor: pointer;
    outline: none;
    transition: all 0.3s;
}

#lang-select:hover {
    background-color: #e8f5e9;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0s 0.4s;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease;
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    z-index: 1001;
    /* Above other header content */
}

/* Mobile Contact Info Styles */
.mobile-contact-info {
    display: none;
    padding: 1rem 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    width: 100%;
}

.mobile-contact-info h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    text-align: center;
}

.mobile-social-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-social-link {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    text-decoration: none;
    color: #fff;
    border-radius: 6px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-size: 0.9rem;
}

.mobile-social-link i {
    font-size: 1.5rem;
    margin-right: 1rem;
    width: 24px;
    text-align: center;
}

.mobile-social-link span {
    font-weight: 600;
}

.mobile-social-link.whatsapp {
    background-color: #25D366;
}

.mobile-social-link.facebook {
    background-color: #1877F2;
}

.mobile-social-link.email {
    background-color: #EA4335;
}

.mobile-social-link.phone {
    background-color: var(--primary-color);
}

.mobile-social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ========= HERO SECTION (Home Page) ========= */
.hero {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
    text-align: center;
    max-width: 800px;
    padding: 0 20px;
    animation: fadeInUp 1.5s ease-out;
}

.hero-content h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

/* ========= FEATURED PRODUCTS & PRODUCTS PAGE ========= */
.featured-products,
.products-page {
    background-color: var(--light-bg-color);
    padding-top: 6rem; /* Increased padding to avoid overlap with fixed header */
}

#home .featured-products {
    padding-top: 0; /* Reset for home page view */
}

.products-page h2.category-title {
    font-family: 'Playfair Display', serif;
    color: var(--secondary-color);
    font-size: 2rem;
    text-align: center;
    margin-top: 4rem;
    margin-bottom: 2rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-card {
    background: var(--bg-color);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    height: fit-content;
    position: relative;
}

.product-card:not(.expanded):hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

.product-card.expanded {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.product-image {
    height: 220px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 1.5rem;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-info h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    min-height: 3rem; /* Ensures alignment */
}

.product-info p.short-desc {
    color: #666;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.product-info .product-desc {
    display: none;
    text-align: left;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    animation: fadeIn 0.5s;
    background: var(--bg-color);
}

.product-info button.learn-more {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: auto;
}

.product-info button.learn-more:hover {
    background: var(--secondary-color);
}

.view-all-container {
    text-align: center;
    margin-top: 2rem;
}

/* ========= ABOUT US SECTION ========= */
.about-preview, .about-page, .contact-preview, .contact-page {
    padding-top: 8rem; /* Add padding to avoid overlap with fixed header */
}

#home .about-preview, #home .contact-preview {
    padding-top: 6rem; /* Increased padding for better spacing */
}

.about-page .about-content,
.about-preview .about-content {
    display: flex;
    gap: 3rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: #555;
    line-height: 1.8;
}

.about-image {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 45%;
}

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

/* ========= CONTACT SECTION ========= */
.contact-page .contact-container,
.contact-preview .contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: stretch;
}

.contact-info-block {
    background: var(--light-bg-color);
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.contact-form-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-form {
    background: var(--light-bg-color);
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.contact-details-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
    flex: 1;
}

.contact-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.contact-section h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-section h4 i {
    color: var(--accent-color);
    font-size: 1.2rem;
}

.contact-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.contact-section ul li {
    margin-bottom: 1rem;
}

.contact-section ul li:last-child {
    margin-bottom: 0;
}

.contact-section ul li a {
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    transition: color 0.3s;
}

.contact-section ul li a:hover {
    color: var(--primary-color);
}

.contact-section ul li a span {
    font-weight: 600;
}

.contact-section ul li a small {
    color: #666;
    font-size: 0.9rem;
}

.map-container {
    width: 100%;
    height: 250px;
    /* Adjusted height */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Form Styles */
.contact-form h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(42, 110, 63, 0.1);
}

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

.contact-map iframe {
    border-radius: 10px;
    width: 100%;
    height: 100%;
    min-height: 400px;
    border: 0;
}

#home-form-message, #main-form-message, .form-message {
    margin-top: 1rem;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    display: none;
}
#home-form-message.success, #main-form-message.success, .form-message.success {
    background-color: #e8f5e9;
    color: var(--primary-color);
    display: block;
}
#home-form-message.error, #main-form-message.error, .form-message.error {
    background-color: #fce8e6;
    color: #c53929;
    display: block;
}
.hidden {
    display: none !important;
}


/* ========= FOOTER ========= */
.footer {
    background: var(--primary-color);
    color: #ffffff;
    padding: 4rem 0 2rem 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    align-self: start;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.footer-logo img {
    height: 115px;
    width: 80px;
    object-fit: cover;

    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.footer-logo img:hover {
    transform: scale(1.1);
}

.footer-logo p {
    color: #e0e0e0;
    line-height: 1.6;
    max-width: 300px;
}

.footer h3 {
    color: #ffffff;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 10px;
    font-size: 1.2rem;
}

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

.rtl .footer h3::after {
    left: auto;
    right: 0;
}

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

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: #e0e0e0;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: #ffffff;
    transform: translateX(5px);
}

.rtl .footer-links a:hover {
    transform: translateX(-5px);
}

.footer-contact-list {
    display: flex;
    gap: 1.5rem;
}

.footer-contact-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
}

.footer-contact-section h4 {
    color: var(--accent-color);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-contact-section ul {
    list-style: none;
    padding: 0;
}

.footer-contact-section ul li {
    margin-bottom: 0.5rem;
}

.footer-contact-section a,
.footer-contact-section p {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.footer-contact-section a:hover {
    color: #ffffff;
}

.footer-contact-section span {
    font-weight: normal;
}

.footer-bottom {
    padding: 1.5rem 0 0 0;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-copy {
    color: #e0e0e0;
    font-size: 0.9rem;
}


/* ========= ANIMATIONS ========= */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ========= RESPONSIVE DESIGN ========= */
@media (max-width: 992px) {
    .about-preview .about-content,
    .about-page .about-content {
        flex-direction: column;
        gap: 2rem;
    }

    .about-preview .about-image,
    .about-page .about-image {
        max-width: 100%;
        order: -1; /* Moves image to top on mobile */
    }

    .about-preview .about-image img,
    .about-page .about-image img {
        height: 300px;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        max-width: 85%;
        background: var(--bg-color);
        flex-direction: column;
        justify-content: flex-start;
        padding: 4.5rem 1rem 1rem;
        align-items: center;
        z-index: 999;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.7, 0, 0.3, 1);
        height: 100%;
        display: flex;
    }

    .rtl .nav-links {
        right: auto;
        left: 0;
        transform: translateX(-100%);
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-links ul {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        width: 100%;
    }

    .nav-links a {
        font-size: 1.1rem;
        display: block;
        padding: 0.75rem;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .mobile-contact-info {
        display: block;
    }

    .about-page .about-content,
    .about-preview .about-content {
        flex-direction: column;
    }

    .contact-page .contact-container,
    .contact-preview .contact-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 90%;
    }

    .section-title,
    .page-title {
        font-size: 2.2rem;
    }

    .hero-content h1 {
        font-size: 2.8rem;
    }

    .hero-content p {
        font-size: 1.2rem;
    }

    .footer {
        padding: 2.5rem 0 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
        padding: 0 1rem;
    }

    .footer-logo {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-logo p {
        margin: 0 auto;
    }

    .footer h3::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .rtl .footer h3::after {
        right: 50%;
        transform: translateX(50%);
    }

    .footer-contact-list {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-links ul {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-contact-section {
        text-align: center;
    }
    
    .footer-contact-section h4 {
        justify-content: center;
    }
}

/* Added for very small screens like 320px */
@media (max-width: 480px) {
    html {
        font-size: 85%;
    }

    .container {
        padding: 0 15px;
    }

    .header {
        padding: 0.8rem 4%;
    }

    .footer {
        padding: 2rem 0 1rem;
    }

    .footer-content {
        gap: 2rem;
        padding: 0 0.75rem;
    }

    .footer-logo img {
        height: 70px;
        width: 70px;
    }

    .footer h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .footer-contact-section {
        padding: 0.75rem;
    }

    .footer-contact-section h4 {
        font-size: 1rem;
    }

    .footer-contact-section a,
    .footer-contact-section p {
        font-size: 0.9rem;
    }

    .footer-bottom {
        padding-top: 1rem;
        margin-top: 1.5rem;
    }

    #lang-select {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .section-title,
    .page-title {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }

    .section-title::after,
    .page-title::after {
        width: 60px;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .product-card {
        min-height: auto;
    }

    .product-info h3 {
        min-height: auto;
    }
    
    .cta-button,
    .cta-button-secondary {
        padding: 10px 24px;
        font-size: 0.95rem;
    }

    .contact-info-block,
    .contact-form {
        padding: 1.5rem;
    }
}

/* Extra small screens (360px and below) */
@media (max-width: 360px) {
    .footer-content {
        padding: 0 0.5rem;
    }

    .footer-logo img {
        height: 110px;
        width: 60px;
    }

    .footer h3 {
        font-size: 1rem;
    }

    .footer-contact-section {
        padding: 0.5rem;
    }

    .footer-contact-section a,
    .footer-contact-section p,
    .footer-copy {
        font-size: 0.85rem;
    }

    .footer-links li {
        margin-bottom: 0.5rem;
    }

    .footer-content {
        gap: 2rem;
    }

    .footer {
        padding-top: 3rem;
    }
}