/* General Styles */
:root {
    --primary-color: #5F8D4E; /* Deep Cactus Green */
    --secondary-color: #E0C9A6; /* Warm Desert Sand */
    --accent-color: #B85C38; /* Terracotta Bloom */
    --text-color: #4A3F35; /* Rich Earth Brown */
    --light-bg: #FDFBF6; /* Soft Creamy White */
    --white: #fff;
    --dark-gray: #4A3F35; /* Rich Earth Brown for consistency */
    --border-radius: 8px;
    --transition-speed: 0.3s ease;
}

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

body {
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
    /* direction and text-align set by JS based on language */
}

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

a {
    text-decoration: none;
    color: var(--primary-color);
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: 'Cairo', sans-serif;
}

/* Header */
.header {
    /* Frosted glass header */
    background-color: rgba(255, 255, 255, 0.6); /* semi-transparent fallback */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); /* Safari support */
    padding: 15px 0;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

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

.logo img {
    max-height: 60px;
}

.navbar {
    display: flex;
    align-items: center;
    gap: 20px; /* Space between nav links and language switcher */
}

.navbar .nav-links {
    display: flex;
    gap: 30px;
}

.navbar .nav-links a {
    color: var(--text-color);
    font-weight: 600;
    padding: 5px 0;
    position: relative;
    transition: color var(--transition-speed);
}

.navbar .nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    /* Direction-aware positioning for underline */
    left: var(--underline-left, auto);
    right: var(--underline-right, 0);
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-speed);
}

/* Set initial underline direction for RTL */
html[dir="rtl"] .navbar .nav-links a::after {
    --underline-left: auto;
    --underline-right: 0;
}

/* Set initial underline direction for LTR */
html[dir="ltr"] .navbar .nav-links a::after {
    --underline-left: 0;
    --underline-right: auto;
}


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

.navbar .nav-links a:hover::after,
.navbar .nav-links a.active::after {
    width: 100%;
    /* Ensure it expands correctly regardless of direction */
    left: 0;
    right: 0;
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 5px;
    margin-left: 15px; /* Space from nav links */
}

.lang-btn {
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    font-size: 0.9em;
}

.lang-btn:hover,
.lang-btn.active {
    background-color: var(--primary-color);
    color: var(--white);
}


/* Hamburger Menu */
.hamburger-menu {
    display: none; /* Hidden on desktop */
    font-size: 28px;
    color: var(--text-color);
    cursor: pointer;
}

/* Favorites Link Specific Styling (Desktop) */
#nav-favorites-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-color); /* A distinct color for favorites */
    font-weight: 700;
    padding: 5px 10px;
    border-radius: var(--border-radius);
    background-color: var(--secondary-color);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

#nav-favorites-link i {
    color: var(--primary-color); /* Heart icon color */
    transition: color var(--transition-speed);
}

#nav-favorites-link:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

#nav-favorites-link:hover i {
    color: var(--white);
}

/* Sections */
section {
    padding: 80px 0;
    /* Removed opacity and transform to make sections visible by default */
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

section.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(to left, var(--light-bg), var(--secondary-color));
    padding: 100px 0;
    display: flex;
    align-items: center;
    min-height: 100vh; /* Fill the full viewport so homepage background is visible on device pages */
    background-size: cover;
}

.hero-section .container {
    display: flex;
    align-items: center;
    gap: 40px;
}

.hero-content {
    flex: 1;
    /* text-align set by JS */
}

.hero-content h1 {
    font-size: 3.2em;
    color: var(--primary-color);
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2em;
    color: var(--dark-gray);
    margin-bottom: 30px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 15px 30px;
    border-radius: var(--border-radius);
    font-weight: 700;
    font-size: 1.1em;
    transition: background-color var(--transition-speed), transform var(--transition-speed);
}

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

.hero-image {
    flex: 1;
    text-align: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Products Section */
.products-section h2 {
    text-align: center;
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 40px;
}

.search-bar {
    max-width: 600px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

.search-input-container {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: var(--search-icon-left, auto);
    right: var(--search-icon-right, 15px);
    color: var(--primary-color);
    font-size: 1.2em;
}

html[dir="rtl"] .search-icon {
    --search-icon-left: 15px;
    --search-icon-right: auto;
}

html[dir="ltr"] .search-icon {
    --search-icon-left: auto;
    --search-icon-right: 15px;
}

#search-input {
    width: 100%;
    padding: 15px 45px;
    font-size: 1.1em;
    border: 2px solid var(--secondary-color);
    border-radius: 50px;
    background-color: var(--white);
    transition: all var(--transition-speed);
    font-family: 'Cairo', sans-serif;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(95, 141, 78, 0.2);
}

#search-input::placeholder {
    color: #999;
}

.filters-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    padding: 20px;
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.search-filter {
    width: 100%;
    margin-bottom: 15px;
}

.search-filter input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--secondary-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.search-filter input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(95, 141, 78, 0.2);
}

.size-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.size-filter label {
    font-weight: 600;
    color: var(--dark-gray);
}

.size-filter select {
    padding: 10px 15px;
    border: 2px solid var(--secondary-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: var(--white);
    cursor: pointer;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.size-filter select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(95, 141, 78, 0.2);
}

.category-filter, .price-filter, .sort-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filters-container label {
    font-weight: 600;
    color: var(--dark-gray);
}

.filter-btn {
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: var(--border-radius);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    font-weight: 600;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--primary-color);
    color: var(--white);
}

.price-filter input[type="range"] {
    width: 150px;
    appearance: none;
    -webkit-appearance: none;
    height: 8px;
    background: var(--secondary-color);
    border-radius: 5px;
    outline: none;
    opacity: 0.7;
    transition: opacity var(--transition-speed);
}

.price-filter input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid var(--white);
}

.price-filter input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid var(--white);
}

#price-range-display {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 100px; /* Ensure consistent width */
    text-align: center;
}

.sort-filter select {
    padding: 10px 15px;
    border-radius: var(--border-radius);
    border: 1px solid var(--secondary-color);
    background-color: var(--white);
    font-family: 'Cairo', sans-serif;
    color: var(--text-color);
    cursor: pointer;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform var(--transition-speed), 
                box-shadow var(--transition-speed), 
                opacity var(--transition-speed);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Visible state applied by JS for reveal animations */
.product-card.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.product-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card-content h3 {
    font-size: 1.4em;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.product-card-content p {
    font-size: 1.2em; /* Slightly larger font for price */
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 0 5px rgba(184, 92, 56, 0.5); /* Subtle glow for product card prices */
    animation: subtlePriceMove 1.5s infinite alternate ease-in-out; /* Added subtle movement */
}

@keyframes subtlePriceMove {
    0% {
        transform: translateY(0);
        text-shadow: 0 0 5px rgba(184, 92, 56, 0.5);
    }
    50% {
        transform: translateY(-2px); /* Move up slightly */
        text-shadow: 0 0 8px rgba(184, 92, 56, 0.7); /* Enhance glow */
    }
    100% {
        transform: translateY(0);
        text-shadow: 0 0 5px rgba(184, 92, 56, 0.5);
    }
}

.product-card-actions {
    display: flex;
    /* Align to the right for RTL, left for LTR */
    justify-content: var(--product-actions-justify, flex-end);
    margin-top: auto; /* Push to bottom */
}

html[dir="rtl"] .product-card-actions {
    --product-actions-justify: flex-end;
}

html[dir="ltr"] .product-card-actions {
    --product-actions-justify: flex-start;
}

.favorite-btn {
    background-color: transparent;
    color: var(--text-color);
    padding: 10px 15px;
    border-radius: 50%; /* Make it circular */
    font-size: 1.2em;
    transition: background-color var(--transition-speed), color var(--transition-speed), transform var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px; /* Fixed width for circular button */
    height: 45px; /* Fixed height for circular button */
    
}

.favorite-btn i {
    color: var(--primary-color);
    transition: color var(--transition-speed);
}

.favorite-btn:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.438);
    transform: scale(1.1);
}




.favorite-btn.active i {
    color: var(#5F8D4E);
}

.no-products-message {
    text-align: center;
    font-size: 1.5em;
    color: var(--dark-gray);
    margin-top: 50px;
}

/* About Section */
.about-section {
    background-color: var(--white);
}

.about-section .container {
    display: flex;
    align-items: center;
    gap: 40px;
}

.about-content {
    flex: 1;
    /* text-align set by JS */
}

.about-content h2 {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--secondary-color); /* Added for elegance */
    padding-bottom: 10px; /* Added for spacing */
    display: inline-block; /* Shrink border to content */
}

.about-content p {
    font-size: 1.1em;
    color: var(--dark-gray);
    margin-bottom: 20px;
}

.about-content ul {
    list-style: none;
    padding: 0;
}

.about-content ul li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: var(--text-color);
    /* Adjust icon margin based on direction */
    flex-direction: var(--list-item-direction, row-reverse);
}

html[dir="rtl"] .about-content ul li {
    --list-item-direction: row-reverse;
}

html[dir="ltr"] .about-content ul li {
    --list-item-direction: row;
}

.about-content ul li i {
    color: var(--primary-color);
    font-size: 1.3em;
}

.about-image {
    flex: 1;
    text-align: center;
}

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

/* Contact Section */
.contact-section {
    background-color: var(--primary-color); /* Changed for richer look */
    color: var(--white); /* Changed for contrast */
    text-align: center;
}

.contact-section h2 {
    font-size: 2.5em;
    color: var(--secondary-color); /* Changed for contrast */
    margin-bottom: 40px;
}

.contact-info p {
    font-size: 1.2em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    /* Adjust icon margin based on direction */
    flex-direction: var(--contact-info-direction, row-reverse);
}

html[dir="rtl"] .contact-info p {
    --contact-info-direction: row-reverse;
}

html[dir="ltr"] .contact-info p {
    --contact-info-direction: row;
}

.contact-info p i {
    color: var(--secondary-color); /* Changed for contrast */
    font-size: 1.3em;
}

.contact-info a {
    color: var(--light-bg); /* Changed for contrast */
    font-weight: 600;
    transition: color var(--transition-speed);
}

.contact-info a:hover {
    color: var(--white); /* Changed for hover effect */
}

.social-media {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-media a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--secondary-color); /* Changed for contrast */
    color: var(--primary-color); /* Changed for contrast */
    font-size: 1.8em;
    transition: background-color var(--transition-speed), transform var(--transition-speed), color var(--transition-speed);
}

.social-media a:hover {
    background-color: var(--light-bg); /* Changed for hover effect */
    color: var(--primary-color); /* Changed for hover effect */
    transform: translateY(-3px);
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 40px 0 20px;
    /* text-align set by JS */
}

.footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
}

.footer-col {
    flex: 1;
    min-width: 250px;
}

.footer-logo {
    max-height: 60px;
    margin-bottom: 15px;
}

.footer-col h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.footer-col p, .footer-col ul li {
    font-size: 0.95em;
    line-height: 1.8;
}

.footer-col ul li a {
    color: var(--white);
    transition: color var(--transition-speed);
}

.footer-col ul li a:hover {
    color: var(--secondary-color);
}

.footer-col p i {
    /* Adjust icon margin based on direction */
    margin-left: var(--footer-icon-margin-left, 8px);
    margin-right: var(--footer-icon-margin-right, 0);
    color: var(--secondary-color);
}

html[dir="rtl"] .footer-col p i {
    --footer-icon-margin-left: 8px;
    --footer-icon-margin-right: 0;
}

html[dir="ltr"] .footer-col p i {
    --footer-icon-margin-left: 0;
    --footer-icon-margin-right: 8px;
}

.copyright {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9em;
}

/* Product Details Section Specific Styles */
.product-details-section {
    background-color: var(--white); /* Ensure a white background for the section */
}

.product-details-section .container {
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
    gap: 40px; /* Space between gallery and info */
    align-items: flex-start; /* Align items to the top */
}

.product-gallery {
    flex: 1 1 450px; /* flex-grow, flex-shrink, flex-basis. Allows it to grow, shrink, but prefers 450px */
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.product-gallery .main-image {
    width: 100%;
    max-height: 500px; /* Use max-height instead of fixed height */
    object-fit: contain; /* Use contain to show full image, or cover if cropping is acceptable */
    background-color: #eee; /* Placeholder background for images */
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    cursor: zoom-in; /* Indicate it's clickable for zoom */
}

.thumbnail-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto; /* Allow horizontal scrolling for many thumbnails */
    padding-bottom: 10px; /* Space for scrollbar */
    /* Align thumbnails based on direction */
    justify-content: var(--thumbnail-justify, flex-end);
}

html[dir="rtl"] .thumbnail-gallery {
    --thumbnail-justify: flex-end;
}

html[dir="ltr"] .thumbnail-gallery {
    --thumbnail-justify: flex-start;
}

.thumbnail-gallery img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius);
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--transition-speed);
}

.thumbnail-gallery img.active,
.thumbnail-gallery img:hover {
    border-color: var(--primary-color);
}

.product-info {
    flex: 2 1 500px; /* Give more space to info, prefers 500px */
    /* text-align set by JS */
}

.product-info h1 {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.product-info .product-price {
    font-size: 1.8em;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 20px;
    /* Glowing effect for the price */
    text-shadow: 0 0 8px rgba(184, 92, 56, 0.7), /* Terracotta Bloom with opacity */
                 0 0 15px rgba(184, 92, 56, 0.4);
    animation: pulseGlow 2s infinite alternate, subtlePriceMove 1.5s infinite alternate ease-in-out; /* Combined animations */
}

@keyframes pulseGlow {
    from {
        text-shadow: 0 0 8px rgba(184, 92, 56, 0.7), 0 0 15px rgba(184, 92, 56, 0.4);
    }
    to {
        text-shadow: 0 0 12px rgba(184, 92, 56, 0.9), 0 0 20px rgba(184, 92, 56, 0.6);
    }
}

.product-info .product-description {
    font-size: 1.1em;
    color: var(--dark-gray);
    margin-bottom: 30px;
    line-height: 1.8;
}

.product-info h3 {
    font-size: 1.5em;
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 5px;
    display: inline-block; /* Shrink border to content */
}

.product-info ul {
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
}

.product-info ul li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 1.05em;
    color: var(--text-color);
    /* Adjust icon margin based on direction */
    flex-direction: var(--list-item-direction, row-reverse);
}

html[dir="rtl"] .product-info ul li {
    --list-item-direction: row-reverse;
}

html[dir="ltr"] .product-info ul li {
    --list-item-direction: row;
}

.product-info ul li i {
    color: var(--primary-color);
    font-size: 1.2em;
}

.product-specifications {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    overflow: hidden; /* For border-radius on table */
}

.product-specifications th,
.product-specifications td {
    padding: 12px 15px;
    border: 1px solid var(--secondary-color);
    /* text-align set by JS */
}

.product-specifications th {
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: 600;
    width: 30%; /* Give more space to the label */
}

.product-specifications td {
    background-color: var(--white);
    color: var(--text-color);
}

.product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 30px;
    /* Align buttons based on direction */
    justify-content: var(--product-actions-justify, flex-end);
}

html[dir="rtl"] .product-actions {
    --product-actions-justify: flex-end;
}

html[dir="ltr"] .product-actions {
    --product-actions-justify: flex-start;
}

.product-actions .cta-button,
.product-actions .secondary-btn {
    flex: 1;
    min-width: 150px;
    padding: 15px 20px;
    font-size: 1em;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: background-color var(--transition-speed), transform var(--transition-speed), color var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.product-actions .cta-button {
    background-color: var(--primary-color);
    color: var(--white);
}

.product-actions .cta-button:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
}

.product-actions .secondary-btn {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--primary-color);
}

.product-actions .secondary-btn:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-3px);
}

/* Modals */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1001; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
    justify-content: center; /* Center content */
    align-items: center; /* Center content */
    padding: 20px;
    box-sizing: border-box;
}

/* Apply frosted blur only to the Share modal overlay */
#share-modal {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); /* Safari */
    /* Slightly less dark so blur shows through */
    background-color: rgba(0, 0, 0, 0.45);
}

/* Apply frosted blur to Order modal and Email form modal */
#order-modal,
#email-form-modal {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background-color: rgba(0, 0, 0, 0.45);
}

.modal-content {
    background-color: var(--white);
    margin: auto;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    max-width: 500px;
    width: 90%;
    /* text-align set by JS */
    animation: fadeInScale 0.3s ease-out forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close-button {
    color: var(--dark-gray);
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 15px;
    /* Position based on direction */
    left: var(--close-btn-left, 20px);
    right: var(--close-btn-right, auto);
    cursor: pointer;
    transition: color var(--transition-speed);
}

html[dir="rtl"] .close-button {
    --close-btn-left: 20px;
    --close-btn-right: auto;
}

html[dir="ltr"] .close-button {
    --close-btn-left: auto;
    --close-btn-right: 20px;
}

.close-button:hover,
.close-button:focus {
    color: var(--primary-color);
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 25px;
    justify-content: center;
}

.modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 12px 25px;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: background-color var(--transition-speed), transform var(--transition-speed);
}

.modal-btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
}

.whatsapp-btn {
    background-color: #25D366; /* WhatsApp green */
}

.whatsapp-btn:hover {
    background-color: #1DA851;
}

.share-whatsapp {
    background-color: #25D366;
}

.share-whatsapp:hover {
    background-color: #1DA851;
}

.share-facebook {
    background-color: #1877F2; /* Facebook blue */
}

.share-facebook:hover {
    background-color: #145CB3;
}

.copy-link {
    background-color: var(--dark-gray);
}

.copy-link:hover {
    background-color: #333;
}

/* Lightbox Modal - Enhanced Styles */
.lightbox-modal .modal-content {
    max-width: 95vw; /* Wider for images */
    max-height: 95vh; /* Taller for images */
    width: auto; /* Adjust width based on content */
    height: auto; /* Adjust height based on content */
    padding: 0; /* No padding for image */
    background: rgba(0, 0, 0, 0.8); /* Darker background for image focus */
    box-shadow: none; /* No shadow */
    animation: none; /* No fade in scale */
    display: flex;
    flex-direction: column; /* Stack image and thumbnails */
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden; /* Hide overflow from zoomed image */
}

.lightbox-modal .close-button {
    color: var(--white);
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 5px 10px;
    top: 20px;
    /* Position based on direction */
    left: var(--lightbox-close-btn-left, 20px);
    right: var(--lightbox-close-btn-right, auto);
    z-index: 10;
    font-size: 2em;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

html[dir="rtl"] .lightbox-modal .close-button {
    --lightbox-close-btn-left: 20px;
    --lightbox-close-btn-right: auto;
}

html[dir="ltr"] .lightbox-modal .close-button {
    --lightbox-close-btn-left: auto;
    --lightbox-close-btn-right: 20px;
}

.lightbox-modal .close-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.lightbox-image-container {
    width: 100%;
    height: calc(100% - 100px); /* Allocate space for thumbnails at bottom */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Crucial for clipping zoomed image */
    cursor: grab; /* Indicate draggable when zoomed */
}

.lightbox-image-container.grabbing {
    cursor: grabbing;
}

.lightbox-modal #lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Ensure image fits initially */
    display: block;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s ease-out; /* Smooth transform for zoom/pan */
    will-change: transform; /* Optimize for animation */
    cursor: zoom-in; /* Default cursor */
}

.lightbox-modal #lightbox-image.zoomable {
    cursor: grab; /* Cursor when zoomed in and pannable */
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--white);
    border: none;
    padding: 15px;
    font-size: 2em;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color var(--transition-speed);
    z-index: 5;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Navigation buttons based on direction */
html[dir="rtl"] .lightbox-nav.prev-btn {
    right: 20px; /* "Previous" button on the right for RTL */
    left: auto;
}
html[dir="rtl"] .lightbox-nav.next-btn {
    left: 20px; /* "Next" button on the left for RTL */
    right: auto;
}

html[dir="ltr"] .lightbox-nav.prev-btn {
    left: 20px; /* "Previous" button on the left for LTR */
    right: auto;
}
html[dir="ltr"] .lightbox-nav.next-btn {
    right: 20px; /* "Next" button on the right for LTR */
    left: auto;
}


.lightbox-thumbnails {
    width: 100%;
    height: 100px; /* Fixed height for thumbnails */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    overflow-x: auto; /* Scrollable for many thumbnails */
    background-color: rgba(0, 0, 0, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0; /* Prevent shrinking */
}

.lightbox-thumbnails img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--border-radius);
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--transition-speed), transform 0.2s ease;
}

.lightbox-thumbnails img.active,
.lightbox-thumbnails img:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* EmailJS Form Styles */
.order-form {
    max-width: 400px;
    margin: 20px auto 0; /* Adjust margin to fit modal content */
    padding: 20px;
    background: var(--light-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    /* text-align set by JS */
}

.order-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--dark-gray);
}

.order-form input[type="text"],
.order-form input[type="tel"],
.order-form input[type="email"],
.order-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--secondary-color);
    border-radius: 5px;
    font-family: 'Cairo', sans-serif;
    font-size: 1em;
    color: var(--text-color);
    background-color: var(--white);
}

.order-form input[type="text"]:focus,
.order-form input[type="tel"]:focus,
.order-form input[type="email"]:focus,
.order-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(95, 141, 78, 0.2); /* Using primary color for focus shadow */
}

.order-form input[readonly] {
    background-color: #e9e9e9;
    cursor: not-allowed;
}

.submit-order-btn {
    background-color: #25D366; /* WhatsApp green for submission */
    color: var(--white);
    border: none;
    padding: 12px 20px;
    width: 100%;
    font-size: 1.1em;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color var(--transition-speed), transform var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-order-btn:hover {
    background-color: #1DA851;
    transform: translateY(-2px);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 20px;
    /* Position based on direction */
    right: var(--toast-right, 20px);
    left: var(--toast-left, auto);
    z-index: 1002;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

html[dir="rtl"] #toast-container {
    --toast-right: 20px;
    --toast-left: auto;
}

html[dir="ltr"] #toast-container {
    --toast-right: auto;
    --toast-left: 20px;
}

.toast-message {
    background-color: var(--dark-gray);
    color: var(--white);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 1;
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    transform: translateX(0);
    min-width: 250px;
    /* text-align set by JS */
}

.toast-message.success {
    background-color: #28a745; /* Green */
}

.toast-message.error {
    background-color: #dc3545; /* Red */
}

.toast-message.hide {
    opacity: 0;
    /* Slide out based on direction */
    transform: var(--toast-hide-transform, translateX(100%));
}

html[dir="rtl"] .toast-message.hide {
    --toast-hide-transform: translateX(100%); /* Slide out to the right for RTL */
}

html[dir="ltr"] .toast-message.hide {
    --toast-hide-transform: translateX(-100%); /* Slide out to the left for LTR */
}


/* Responsive Design */
@media (max-width: 992px) {
    .hero-section .container,
    .about-section .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-content, .about-content {
        text-align: center;
    }

    .hero-image, .about-image {
        margin-top: 30px;
    }

    .hero-content h1 {
        font-size: 2.5em;
    }

    .hero-content p {
        font-size: 1em;
    }

    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }

    .category-filter, .price-filter, .sort-filter {
        justify-content: center;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .footer .container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-col {
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap; /* Allow items to wrap */
        justify-content: space-between;
    }

    .navbar .nav-links {
        display: none; /* Hide by default on mobile */
        flex-direction: column;
        position: absolute;
        top: 80px; /* Adjust based on header height */
        /* Position based on direction */
        right: var(--nav-links-right, 0);
        left: var(--nav-links-left, auto);
        width: 100%;
        background-color: var(--white);
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        padding: 20px 0;
        border-top: 1px solid var(--secondary-color);
        z-index: 999;
        text-align: center;
    }

    html[dir="rtl"] .navbar .nav-links {
        --nav-links-right: 0;
        --nav-links-left: auto;
    }

    html[dir="ltr"] .navbar .nav-links {
        --nav-links-right: auto;
        --nav-links-left: 0;
    }

    .navbar .nav-links.active {
        display: flex; /* Show when active */
    }

    .navbar .nav-links li {
        margin: 10px 0;
    }

    .navbar .nav-links a {
        padding: 10px 20px;
        display: block;
        width: 100%;
        color: var(--text-color);
        font-size: 1.1em;
    }

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

    .navbar .nav-links a::after {
        display: none; /* Hide underline on mobile menu items */
    }

    .language-switcher {
        order: -1; /* Move language switcher to the left/right of logo */
        margin-left: 0;
        margin-right: 15px; /* Adjust margin for mobile layout */
    }

    html[dir="rtl"] .language-switcher {
        margin-right: 15px;
        margin-left: 0;
    }

    html[dir="ltr"] .language-switcher {
        margin-left: 15px;
        margin-right: 0;
    }

    .hamburger-menu {
        display: block; /* Show hamburger on mobile */
    }

    /* Modern and elegant styling for Favorites link on mobile */
    #nav-favorites-link {
        background-color: var(--primary-color); /* Darker background */
        color: var(--white); /* White text */
        padding: 12px 25px; /* More padding */
        border-radius: 50px; /* Pill shape */
        margin: 15px auto; /* Center it and add vertical space */
        width: fit-content; /* Shrink to content */
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* Subtle shadow */
        transition: all var(--transition-speed);
    }

    #nav-favorites-link i {
        color: var(--white); /* White heart icon */
    }

    #nav-favorites-link:hover {
        background-color: var(--accent-color); /* Darker on hover */
        transform: scale(1.05); /* Slight scale effect */
    }

    #nav-favorites-link:hover i {
        color: var(--white);
    }

    .hero-section {
        padding: 80px 0;
    }

    .hero-content h1 {
        font-size: 2em;
    }

    .cta-button {
        padding: 12px 25px;
        font-size: 1em;
    }

    .filters-container {
        padding: 15px;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }

    .price-filter input[type="range"] {
        width: 120px;
    }

    #price-range-display {
        font-size: 0.9em;
    }

    .modal-content {
        padding: 20px;
    }

    .modal-content h3 {
        font-size: 1.5em;
    }

    .modal-content p {
        font-size: 1em;
    }

    .modal-btn {
        font-size: 1em;
        padding: 10px 15px;
    }

    /* Product Details Section Specific Styles for Mobile */
    .product-details-section .container {
        flex-direction: column;
        gap: 30px;
    }

    .product-gallery, .product-info {
        flex-basis: auto; /* Reset flex-basis on small screens */
        width: 100%;
    }

    .product-gallery .main-image {
        max-height: 300px; /* Adjust height for mobile */
    }

    .thumbnail-gallery {
        justify-content: center; /* Center thumbnails on mobile */
    }

    .product-info h1 {
        font-size: 2em;
    }

    .product-info .product-price {
        font-size: 1.5em;
    }

    .product-actions {
        flex-direction: column; /* Stack buttons on mobile */
    }

    .product-actions .cta-button,
    .product-actions .secondary-btn {
        width: 100%;
    }

    .lightbox-nav {
        padding: 10px;
        font-size: 1.5em;
        width: 50px;
        height: 50px;
    }

    html[dir="rtl"] .lightbox-nav.prev-btn {
        right: 10px;
    }

    html[dir="rtl"] .lightbox-nav.next-btn {
        left: 10px;
    }

    html[dir="ltr"] .lightbox-nav.prev-btn {
        left: 10px;
    }

    html[dir="ltr"] .lightbox-nav.next-btn {
        right: 10px;
    }

    .lightbox-modal .modal-content {
        max-width: 98vw;
        max-height: 98vh;
    }

    .lightbox-image-container {
        height: calc(100% - 80px); /* Adjust for smaller thumbnails */
    }

    .lightbox-thumbnails {
        height: 80px;
        padding: 5px 10px;
    }

    .lightbox-thumbnails img {
        width: 60px;
        height: 60px;
    }
}

/* Custom cursor styles */
/* Added: custom circular cursor that expands on hover/click. */
/* Custom cursor using provided image. Fallback to circular dot if image fails. */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 50px;
    height: 50px;
    transform: translate(-50%, -50%);
    pointer-events: none; /* Let mouse events pass through */
    background-color: rgba(74,63,53,0.0); /* transparent base */
    background-image: url('https://i.postimg.cc/4NbznscZ/Generated-image-3-removebg-preview.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: width 150ms ease, height 150ms ease, transform 150ms ease, opacity 200ms ease, filter 120ms ease;
    z-index: 9999;
}

.custom-cursor.hidden { opacity: 0; }

/* Hover/active states slightly enlarge the image and add a subtle filter */
.custom-cursor.cursor-hover { width: 56px; height: 56px; transform: translate(-50%, -50%) scale(1.02); filter: drop-shadow(0 6px 10px rgba(0,0,0,0.25)); }
.custom-cursor.cursor-down { transform: translate(-50%, -50%) scale(0.95); filter: brightness(0.95); }

/* Pointer-specific cursor image (used for links/buttons) */
.custom-cursor.cursor-pointer {
    width: 56px;
    height: 56px;
    background-image: url('https://i.postimg.cc/bJz8NXw7/Generated-image-1-removebg-preview.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform: translate(-50%, -50%) scale(1.02);
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.28));
}

/* When enabled, hide native cursor except for form controls */
/* Hide native cursor site-wide when custom cursor is enabled, but keep text cursor for inputs */
body.custom-cursor-enabled { cursor: none !important; }
/* Explicitly hide native cursor on common interactive elements to prevent the OS/browser pointer from showing */
body.custom-cursor-enabled a,
body.custom-cursor-enabled button,
body.custom-cursor-enabled label,
body.custom-cursor-enabled .favorite-btn,
body.custom-cursor-enabled .cta-button,
body.custom-cursor-enabled .modal-btn,
body.custom-cursor-enabled .filter-btn,
body.custom-cursor-enabled .product-card,
body.custom-cursor-enabled [role="button"] {
    cursor: none !important;
}

/* Keep text cursor for form controls */
body.custom-cursor-enabled input,
body.custom-cursor-enabled textarea,
body.custom-cursor-enabled select { cursor: text !important; }


.shipping-video-section {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin: 30px 0;
        }

        .shipping-text {
            font-family: 'Cairo', sans-serif;
            font-size: 1.4rem;
            font-weight: 700;
            color: #4a6741;
            margin: 0;
        }

        .video-container {
            width: 200px;
            max-width: 45%;
        }

        .video-container video {
            width: 100%;
            height: auto;
            display: block;
}

