/* ================================
       BASE STYLES
       ================================ */
body {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #faf8f5;
    color: #6b5d52;
    overflow-x: hidden;
}

html,
body {
    height: 100%;
}

* {
    box-sizing: border-box;
}

/* ================================
       PAGE CONTAINER
       ================================ */
.page-container {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* ================================
       NAVIGATION
       ================================ */
nav {
    background: #d4b5a0;
    padding: 1.2rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Logo styling */
.logo {
    order: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.logo-image {
    width: 50px;
    height: 50px;
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: transform 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.logo-image:hover {
    transform: scale(1.05);
}

.logo-text {
    font-size: 1.8rem;
    font-weight: bold;
    color: #8b7355;
    cursor: pointer;
}

/* Navigation links */
.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    order: 2;
}

.lang-toggle {
    order: 3;
}

/* RTL (Arabic) layout adjustments */
[dir="rtl"] .logo {
    order: 3;
}

[dir="rtl"] .lang-toggle {
    order: 1;
}

.nav-links a {
    color: #faf8f5;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 0;
    cursor: pointer;
}

.nav-links a:hover {
    color: #8b7355;
}

/* Language toggle button */
.lang-toggle {
    background: #8b7355;
    color: #faf8f5;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.lang-toggle:hover {
    background: #a8956b;
}

/* ================================
       PAGE VISIBILITY CONTROL
       ================================ */
.page {
    display: none;
    flex: 1;
}

.page.active {
    display: flex;
    flex-direction: column;
}

/* ================================
       HERO SECTION
       ================================ */
.hero {
    background:
        linear-gradient(135deg, rgba(139, 115, 85, 0.4) 0%, rgba(107, 93, 82, 0.35) 100%),
        url('images/heroBackround.jpg');
    min-height: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5rem 2rem;
    width: 100%;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Hero overlay effects */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(168, 149, 107, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(139, 115, 85, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 80%, rgba(184, 153, 104, 0.15) 0%, transparent 40%);
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    color: #faf8f5;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.4rem;
    color: #faf8f5;
    margin-bottom: 2.5rem;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Call-to-action button */
.cta-button {
    background: #a8956b;
    color: #faf8f5;
    padding: 1.2rem 3rem;
    font-size: 1.3rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
    background: #8b7355;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* ================================
       SECTION CONTAINER
       ================================ */
.section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 2rem;
    width: 100%;
}

.section-title {
    font-size: 2.5rem;
    color: #8b7355;
    margin-bottom: 1rem;
    text-align: center;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #a8956b;
    text-align: center;
    margin-bottom: 3rem;
    line-height: 1.6;
}

/* ============================================ 
   PRODUCTS SECTION STYLES
   Product cards grid layout
   ============================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.product-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

/* show hand cursor to indicate cards are clickable */
.product-card,
.category-card {
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* FIXED IMAGE HEIGHT FOR ALL CARDS */
.product-image {
    width: 100%;
    height: 220px;
    /* adjust this height as you prefer */
    overflow: hidden;
    /* prevents image overflow */
    display: block;
}

/* MAKES ALL IMAGES FIT SAME SIZE */
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* crop images evenly to fit the 220px frame */
    display: block;
}

.product-content {
    padding: 2rem;
}

.product-title {
    font-size: 1.6rem;
    color: #8b7355;
    margin-bottom: 1rem;
}

.product-description {
    font-size: 1.1rem;
    color: #a8956b;
    line-height: 1.6;
}


/* ================================
       ABOUT SECTION
       ================================ */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

/* About image slideshow container */
.about-image {
    background: linear-gradient(135deg, #d4b5a0 0%, #c9b299 100%);
    height: 100%;
    min-height: 400px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    position: relative;
    overflow: hidden;
}

/* Individual slideshow slides */
.about-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.about-slide.active {
    opacity: 1;
}

.about-slide-placeholder {
    font-size: 5rem;
    background: linear-gradient(135deg, #d4b5a0 0%, #c9b299 100%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-text h3 {
    font-size: 1.8rem;
    color: #8b7355;
    margin-bottom: 1.5rem;
}

.about-text p {
    font-size: 1.2rem;
    color: #a8956b;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Feature items grid */
.about-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.feature-icon {
    font-size: 2rem;
}

.feature-text {
    font-size: 1.1rem;
    color: #8b7355;
    font-weight: 500;
}

/* ================================
       GALLERY SECTION
       ================================ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.gallery-item {
    background: linear-gradient(135deg, #d4b5a0 0%, #c9b299 50%, #e8d9c9 100%);
    height: 250px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease;
}

.gallery-item.zoomed {
    transform: scale(1.15);
    z-index: 100;
}

.gallery-item {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Lightbox / fullscreen zoom styles */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.open {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 95%;
    max-height: 95%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    font-size: 1.4rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
}

/* Ensure videos inside gallery items fill the card and their controls are visible */
.gallery-item video,
.gallery-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

/* ================================
       CONTACT SECTION
       ================================ */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
}

.contact-info {
    background: #ffffff;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.contact-icon {
    font-size: 2rem;
    color: #a8956b;
    min-width: 40px;
}

.contact-details h4 {
    font-size: 1.3rem;
    color: #8b7355;
    margin-bottom: 0.5rem;
}

.contact-details p {
    font-size: 1.1rem;
    color: #a8956b;
    line-height: 1.6;
}

.contact-details a {
    color: #a8956b;
    text-decoration: none;
    font-weight: 500;
}

.contact-details a:hover {
    text-decoration: underline;
}

.map-placeholder {
    background: linear-gradient(135deg, #d4b5a0 0%, #c9b299 100%);
    height: 100%;
    min-height: 400px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
}

/* ================================
       FOOTER
       ================================ */
footer {
    background: #d4b5a0;
    color: #faf8f5;
    text-align: center;
    padding: 3rem 2rem;
    margin-top: auto;
    width: 100%;
}

footer p {
    font-size: 1.1rem;
    margin: 0;
}

/* ================================
       RTL (RIGHT-TO-LEFT) SUPPORT
       ================================ */
[dir="rtl"] {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .contact-item,
[dir="rtl"] .feature-item {
    flex-direction: row-reverse;
    text-align: right;
}

[dir="rtl"] .about-content {
    direction: rtl;
}

[dir="rtl"] .hero {
    direction: rtl;
    text-align: center;
}

[dir="rtl"] .section {
    direction: rtl;
}

[dir="rtl"] .section-title,
[dir="rtl"] .section-subtitle {
    text-align: center;
    direction: rtl;
}

[dir="rtl"] .product-content,
[dir="rtl"] .about-text,
[dir="rtl"] .contact-details {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .contact-info {
    direction: rtl;
}

[dir="rtl"] footer {
    direction: rtl;
    text-align: center;
}

[dir="rtl"] .about-features {
    direction: rtl;
}

[dir="rtl"] .products-grid,
[dir="rtl"] .gallery-grid,
[dir="rtl"] .contact-grid {
    direction: rtl;
}

/* ============================================
   CATEGORY PAGE STYLES
   Intermediate page showing product subcategories
   ============================================ */

.category-header {
    text-align: center;
    margin-bottom: 3rem;
}

.category-title {
    font-size: 2.8rem;
    color: #8b7355;
    margin-bottom: 1rem;
}

.category-description {
    font-size: 1.3rem;
    color: #a8956b;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto 2rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.category-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* FIXED IMAGE HEIGHT FOR CATEGORY CARDS */
.category-card-image {
    width: 100%;
    height: 200px;
    /* Adjust this value if you want larger/smaller images */
    overflow: hidden;
    display: block;
    background: #e6d8c7;
    /* fallback if no image */
}

/* ENSURES IMAGE FITS UNIFORMLY */
.category-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* crops images evenly */
    display: block;
}

.category-card-content {
    padding: 1.5rem;
}

.category-card-title {
    font-size: 1.4rem;
    color: #8b7355;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.category-card-description {
    font-size: 1rem;
    color: #a8956b;
    line-height: 1.5;
}

/* ================================
       PRODUCT DETAIL PAGE
       ================================ */
.product-detail-header {
    text-align: center;
    margin-bottom: 3rem;
}

.product-detail-title {
    font-size: 2.8rem;
    color: #8b7355;
    margin-bottom: 1rem;
}

.product-detail-description {
    font-size: 1.3rem;
    color: #a8956b;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto 2rem;
}

/* Product detail layout with images and text */
.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
    margin-top: 2rem;
}

/* Portrait image gallery */
.product-images-portrait {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.portrait-image-box {
    background: linear-gradient(135deg, #d4b5a0 0%, #c9b299 100%);
    aspect-ratio: 3/4;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s;
    cursor: pointer;
    background-size: cover;
    background-position: center;
}

.portrait-image-box:hover {
    transform: scale(1.05);
}

/* Product detail text content */
.product-detail-text {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.product-detail-text h3 {
    font-size: 1.8rem;
    color: #8b7355;
    margin-bottom: 1.5rem;
}

.product-detail-text p {
    font-size: 1.1rem;
    color: #6b5d52;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Back button */
.back-button {
    background: #a8956b;
    color: #faf8f5;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 2rem;
}

.back-button:hover {
    background: #8b7355;
    transform: translateX(-3px);
}

[dir="rtl"] .back-button:hover {
    transform: translateX(3px);
}

/* Product image gallery */
.product-gallery-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.product-image-box {
    background: linear-gradient(135deg, #d4b5a0 0%, #c9b299 100%);
    height: 300px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.product-image-display {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.product-image-placeholder {
    font-size: 5rem;
    background: linear-gradient(135deg, #d4b5a0 0%, #c9b299 100%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Image navigation arrows */
.image-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(139, 115, 85, 0.8);
    color: #faf8f5;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    z-index: 10;
}

.image-nav-arrow:hover {
    background: rgba(139, 115, 85, 1);
}

.image-nav-arrow.left {
    left: 10px;
}

.image-nav-arrow.right {
    right: 10px;
}

/* Product detail content section */
.product-detail-content {
    background: #ffffff;
    padding: 3rem;
    border-radius: 12px;
    margin-top: 3rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.product-detail-content h3 {
    font-size: 1.8rem;
    color: #8b7355;
    margin-bottom: 1.5rem;
}

.product-detail-content p {
    font-size: 1.2rem;
    color: #a8956b;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* Image upload section */
.upload-section {
    margin-top: 2rem;
    text-align: center;
    padding: 2rem;
    background: #faf8f5;
    border-radius: 8px;
}

.upload-section h4 {
    color: #8b7355;
    margin-bottom: 1rem;
}

.upload-button {
    background: #d4b5a0;
    color: #faf8f5;
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    display: inline-block;
    font-size: 1rem;
    margin: 0.3rem;
    transition: background 0.3s;
}

.upload-button:hover {
    background: #c9b299;
}

/* ================================
       RESPONSIVE DESIGN
       ================================ */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.2rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.95rem;
    }

    .about-content,
    .contact-grid,
    .product-detail-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-features {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 2rem;
    }

    .products-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .nav-container {
        justify-content: center;
    }

    .logo {
        width: 100%;
        text-align: center;
    }

    .product-gallery-container {
        grid-template-columns: 1fr;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .product-images-portrait {
        grid-template-columns: 1fr;
    }
}

@view-transition {
    navigation: auto;
}