* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f0e8 0%, #e8ddd4 100%);
    color: #2d1b3d;
    line-height: 1.6;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 0;
    box-shadow: 0 2px 10px rgba(45, 27, 61, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2d1b3d;
    text-decoration: none;
}

.logo-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon img {
    width: 200PX;
    height: 100PX;
    object-fit: contain;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.language-switcher {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lang-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 2px solid #2d1b3d;
    border-radius: 8px;
    color: #2d1b3d;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: #2d1b3d;
    color: white;
}

.lang-btn.active {
    background: #2d1b3d;
    color: white;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f5f0e8 0%, #e8ddd4 100%);
}

.hero h1 {
    font-size: 3.5rem;
    color: #2d1b3d;
    margin-bottom: 1rem;
    font-weight: 300;
    letter-spacing: 2px;
}

.hero p {
    font-size: 1.3rem;
    color: #4a2c5a;
    margin-bottom: 2rem;
}

/* Products Section */
.products-section {
    padding: 4rem 2rem;
    background: #f5f0e8;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: #2d1b3d;
    margin-bottom: 3rem;
    font-weight: 300;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(45, 27, 61, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(45, 27, 61, 0.25);
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
    background: #f5f0e8;
    min-height: 200px;
    direction: ltr; /* Keep image container direction LTR even in RTL mode */
}

/* Fix for RTL mode - ensure image container works correctly */
[dir="rtl"] .product-image-container {
    direction: ltr !important;
}

.product-image-slider {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 200px;
    direction: ltr; /* Keep slider direction LTR even in RTL mode */
    overflow: hidden;
}

/* Fix for RTL mode - ensure slider container works correctly */
[dir="rtl"] .product-image-slider {
    direction: ltr !important;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    background: #f5f0e8;
    pointer-events: none !important; /* Prevent any clicks on images - they should not trigger any actions */
    user-select: none; /* Prevent image selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Show active image - use opacity instead of display - STRONG rules */
.product-image.active {
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 1 !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* Only show first image if it's active - don't force it */
.product-image-slider > .product-image:first-child.active {
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 1 !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* Fix for RTL mode - ensure images work correctly in Arabic */
[dir="rtl"] .product-image {
    direction: ltr !important; /* Keep image direction LTR even in RTL mode */
}

/* Ensure active images are always visible in RTL - use opacity */
[dir="rtl"] .product-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 100% !important;
    direction: ltr !important;
}

[dir="rtl"] .product-image.active {
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 1 !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* Only show first image if it's active in RTL mode - don't force it */
[dir="rtl"] .product-image-slider > .product-image:first-child.active {
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 1 !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.slider-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(45, 27, 61, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100 !important;
    pointer-events: auto !important;
    user-select: none;
}

.slider-controls:hover {
    background: rgba(45, 27, 61, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.slider-prev {
    right: 10px;
}

.slider-next {
    left: 10px;
}

.slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(45, 27, 61, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dot.active {
    background: #2d1b3d;
    border-color: #2d1b3d;
    transform: scale(1.2);
}

.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-name {
    font-size: 1.2rem;
    color: #2d1b3d;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.product-price {
    font-size: 1.5rem;
    color: #4a2c5a;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.product-size {
    font-size: 0.95rem;
    color: #4a2c5a;
    margin-bottom: 0.5rem;
}

.product-sizes {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.size-badge {
    padding: 0.4rem 0.8rem;
    background: #f5f0e8;
    border: 2px solid #2d1b3d;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d1b3d;
}

.buy-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #2d1b3d 0%, #4a2c5a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.buy-button:hover {
    background: linear-gradient(135deg, #4a2c5a 0%, #2d1b3d 100%);
    transform: scale(1.02);
}

.buy-button:active {
    transform: scale(0.98);
}

/* Footer */
footer {
    background: #2d1b3d;
    color: #f5f0e8;
    padding: 2rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

/* Modal for checkout */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    overflow-y: auto;
    padding: 2rem 0;
}

.modal-content {
    background: white;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.close {
    color: #aaa;
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}

.close:hover {
    color: #2d1b3d;
}

.modal-title {
    font-size: 1.8rem;
    color: #2d1b3d;
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2d1b3d;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e8ddd4;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #2d1b3d;
}

.submit-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #2d1b3d 0%, #4a2c5a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.submit-button:hover {
    background: linear-gradient(135deg, #4a2c5a 0%, #2d1b3d 100%);
}

/* PayPal Button Container */
#paypal-button-container {
    margin-top: 1rem;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#paypal-button-container > div {
    width: 100%;
    max-width: 500px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    .product-image-container {
        height: 280px;
    }

    .product-image {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    .product-image.active {
        opacity: 1 !important;
        visibility: visible !important;
        z-index: 1 !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }

    /* Fix for RTL mode on mobile - STRONG rules */
    [dir="rtl"] .product-image {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 100% !important;
        direction: ltr !important;
    }
    
    [dir="rtl"] .product-image.active {
        opacity: 1 !important;
        visibility: visible !important;
        z-index: 1 !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }

    /* Only show first image if it's active on mobile RTL - don't force it */
    [dir="rtl"] .product-image-slider > .product-image:first-child.active {
        opacity: 1 !important;
        visibility: visible !important;
        z-index: 1 !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    /* Ensure image containers work in RTL on mobile */
    [dir="rtl"] .product-image-container,
    [dir="rtl"] .product-image-slider {
        direction: ltr !important;
    }

    .modal {
        padding: 1rem 0;
    }

    .modal-content {
        margin: 1rem auto;
        padding: 1.5rem;
        max-height: 95vh;
        width: 95%;
    }

    .modal-title {
        font-size: 1.5rem;
    }
}

.loading {
    display: none;
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    border: 4px solid #f5f0e8;
    border-top: 4px solid #2d1b3d;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
