/* --- Global Styles & Color Variables --- */
:root {
    --main-bg: #F4F0EA;
    --secondary-bg: #A27A52;
    --text-color: #333333;
    --card-bg: #FFFFFF;
    --font-main: 'Cairo', sans-serif; 
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--main-bg);
    color: var(--text-color);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    overflow-x: hidden; 
    width: 100%;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
    text-align: center;
    min-height: 70vh;
}

h1, h2, h3 {
    margin-bottom: 1rem;
    color: var(--secondary-bg);
    font-weight: 700;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

img {
    max-width: 100%;
}

/* --- Navigation Bar --- */
.navbar {
    background-color: var(--card-bg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    direction: ltr; 
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px; 
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-bg);
    text-decoration: none;
}

.nav-logo-img {
    height: 60px;
    width: auto;
    display: block;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    gap: 2rem;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    border: 1px solid transparent;
    padding: 6px 12px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    color: var(--secondary-bg);
    border-color: #ddd;
    background-color: #f9f9f9;
}

.nav-cart {
    font-weight: bold;
    color: var(--secondary-bg);
    cursor: pointer;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    background-color: var(--secondary-bg);
    color: #ffffff;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s ease;
    font-family: var(--font-main);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}
.btn:hover::after {
    width: 300px;
    height: 300px;
}
.btn:hover {
    opacity: 0.85;
}

/* --- Home Section --- */
#home {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.home-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5rem;
    text-align: right; 
}

.home-text {
    flex: 1; 
    animation: slideInRight 1s ease-out forwards;
}
.home-text p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.home-slideshow {
    flex: 1; 
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    max-width: 650px; 
    margin: 0 auto; 
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.slideshow-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dot {
    height: 12px;
    width: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot.active, .dot:hover {
    background-color: #fff;
    transform: scale(1.2);
}

/* --- Products Section --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    text-align: right;
}

.product-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
}

.product-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.product-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.product-card h3,
.product-card .product-desc,
.product-card .product-price {
    padding: 0 1.5rem;
}

.product-card .btn {
    margin: 1rem 1.5rem 1.5rem;
    width: calc(100% - 3rem);
    text-align: center;
    margin-top: auto;
}

.product-card h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.product-card .product-desc {
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--secondary-bg);
    margin-bottom: 1rem;
}

/* --- Hero Product Styles --- */
.hero-product {
    display: none; 
    width: 100%;
    margin-bottom: 3rem;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    text-align: right;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hero-product:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.hero-image {
    flex-basis: 50%;
}

.hero-image img {
    width: 100%;
    height: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.hero-info {
    flex-basis: 50%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-info h3 {
    font-size: 2rem;
    color: var(--text-color);
}
.hero-info .product-desc {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}
.hero-info .product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-bg);
    margin-bottom: 1.5rem;
}
.hero-info .btn {
    width: auto;
    align-self: flex-start;
}

/* --- Footer --- */
.footer {
    background-color: var(--secondary-bg);
    color: #ffffff;
    text-align: center;
    padding: 2.5rem 0;
    min-height: auto;
}

.footer h2, .footer p {
    color: #ffffff;
}

.footer .contact-info {
    font-size: 1.1rem;
    margin: 2rem 0;
}

.footer .copyright {
    margin-top: 2rem;
    font-size: 0.9rem;
    opacity: 0.8; 
}

.footer .social-links {
    margin: 1.5rem 0 2rem; 
}
.footer .social-links a {
    color: #ffffff;
    font-size: 1.5rem; 
    margin: 0 0.75rem;
    text-decoration: none;
    transition: opacity 0.3s ease;
}
.footer .social-links a:hover {
    opacity: 0.7;
}

/* --- Filter --- */
.filter-container {
    text-align: right; 
    margin-bottom: 2rem;
}
.filter-container label {
    font-weight: bold;
    color: var(--text-color);
    margin-left: 0.5rem;
}
.filter-container select {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    font-family: var(--font-main);
    cursor: pointer;
}

/* --- MODAL STYLES --- */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    direction: rtl; 
}

.modal-content {
    background-color: var(--main-bg);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: right; 
}

.product-modal-content {
    max-width: 800px; 
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    right: auto; 
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
}
.close-btn:hover { color: var(--text-color); }

.detail-flex {
    display: flex;
    gap: 2rem;
    align-items: start;
}
.detail-image {
    flex: 1;
}
.detail-image img {
    width: 100%;
    border-radius: 8px;
    aspect-ratio: 4/3;
    object-fit: cover;
}
.detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.detail-info h2 { font-size: 1.8rem; margin-top: 0; }
.detail-info .product-price { font-size: 1.4rem; color: var(--secondary-bg); margin-bottom: 1rem; font-weight: bold;}

.quantity-control {
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.qty-box {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
}
.qty-box button {
    background: #fff;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1.2rem;
    cursor: pointer;
}
.qty-box button:hover { background: #f0f0f0; }
.qty-box span {
    padding: 0 1rem;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #ddd;
}
.cart-item-name { flex-grow: 1; margin-left: 1rem; }
.cart-item-price { min-width: 70px; text-align: left; color: var(--secondary-bg); font-weight: bold; }
.cart-item-quantity { display: flex; align-items: center; margin: 0 0.5rem; }
.quantity-btn { background: #fff; border: 1px solid #ccc; cursor: pointer; padding: 2px 8px; border-radius: 4px; }
.quantity-display { padding: 0 0.75rem; font-weight: bold; }

.remove-btn { 
    background: #A27A52; 
    color: white; 
    border: none; 
    border-radius: 50%; 
    min-width: 25px; 
    height: 25px; 
    font-weight: bold; 
    cursor: pointer; 
    margin-right: 0.5rem; 
    line-height: 25px; 
    text-align: center;
    flex-shrink: 0;
}
.remove-btn:hover { background: #000000; }

.form-group label { display: block; margin-bottom: 0.5rem; font-weight: bold; }
.form-group input { width: 100%; padding: 0.75rem; border: 1px solid #ccc; border-radius: 5px; font-family: var(--font-main); }

.thanks-content { text-align: center; }

/* =========================================
   ANIMATIONS
   ========================================= */

.hidden-el {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.show-el {
    opacity: 1;
    transform: translateY(0);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-50px); 
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.product-card:nth-child(2) { transition-delay: 100ms; }
.product-card:nth-child(3) { transition-delay: 200ms; }
.product-card:nth-child(4) { transition-delay: 300ms; }
.product-card:nth-child(5) { transition-delay: 100ms; }
.product-card:nth-child(6) { transition-delay: 200ms; }


/* =========================================
   MOBILE MEDIA QUERY
   ========================================= */
@media (max-width: 768px) {
    
    /* Font Size Reductions */
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.3rem; }
    
    p, .product-desc, .home-text p {
        font-size: 1rem;
    }

    .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }

    .navbar .container { 
        padding: 0.5rem 1rem; 
        flex-wrap: wrap; 
        justify-content: space-between;
        height: auto;
    }
    .nav-logo-img { height: 50px; } 
    
    .nav-menu { 
        width: 100%; 
        justify-content: center; 
        padding-top: 0.5rem; 
        border-top: 1px solid #eee; 
        order: 3; 
        gap: 1rem;
    }
    .nav-cart { order: 2; }
    
    /* FIX: Mobile Slideshow First + 4:5 Ratio + Right Text */
    .home-container { 
        flex-direction: column-reverse; 
        text-align: right; 
        gap: 1.5rem;
    }

    .home-slideshow { 
        width: 100%; 
        height: auto; 
        aspect-ratio: 4 / 5; /* 4:5 Vertical */
        flex: none;
    }
    
    .hero-product { flex-direction: column; }
    
    .hero-info { text-align: right; } 
    .hero-info .btn { align-self: flex-start; } 
    
    .detail-flex { flex-direction: column; }
    .detail-image { width: 100%; }
    
    .close-btn { left: 1rem; } 

    .product-card:nth-child(n) { transition-delay: 0s; }
    /* ... (Existing styles) ... */

/* =========================================
   ZOOM / LIGHTBOX STYLES (SMALLER & CENTERED)
   ========================================= */

.zoom-modal-overlay {
    position: fixed !important; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9) !important;
    
    display: none; 
    z-index: 99999 !important; 
}

.zoom-modal-content {
    /* Absolute Centering */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    /* NEW: Reduced Sizes */
    max-width: 80vw;  /* Only 80% of screen width */
    max-height: 80vh; /* Only 80% of screen height */
    
    /* Cap the width for desktops so it doesn't get massive */
    width: auto;
    height: auto;
    
    object-fit: contain;
    margin: 0;
    padding: 0;
    
    animation: zoomAnim 0.3s ease-out;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    border-radius: 4px;
}

#close-zoom-btn {
    position: absolute;
    top: 30px;
    right: 30px; 
    left: auto;  
    font-size: 40px;
    font-weight: bold;
    color: #ffffff;
    z-index: 100000;
    cursor: pointer;
    opacity: 0.8;
}

#close-zoom-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

@keyframes zoomAnim {
    from { 
        transform: translate(-50%, -50%) scale(0.8); 
        opacity: 0; 
    } 
    to { 
        transform: translate(-50%, -50%) scale(1); 
        opacity: 1; 
    }
}

#detail-img {
    cursor: zoom-in;
    transition: transform 0.2s;
}
#detail-img:hover {
    transform: scale(1.02);
}
}