/* Products Gallery Styles */
.products-gallery {
    padding: 80px 0;
    background-color: #f9f9f9;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
    color: #333;
    font-weight: 600;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.product-item {
    width: 100%;
}

.product-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: 100%;
    transition: all 0.3s ease-in-out;
    cursor: pointer;
}

.product-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-5px);
}

.product-image {
    overflow: hidden;
    height: 250px;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 20px;
    text-align: center;
}

.product-info h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.product-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Modal Styles */
.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: 80%;
    max-width: 1000px;
    max-height: 90vh;
    top: 50%;
    transform: translateY(-50%);
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

#modal-image {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.modal-caption {
    padding: 15px 0;
    color: white;
    text-align: center;
    font-size: 18px;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 24px;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.prev-btn {
    left: -60px;
}

.next-btn {
    right: -60px;
}

/* RTL Styles for Arabic and Persian */
html[dir="rtl"] .prev-btn {
    left: auto;
    right: -60px;
}

html[dir="rtl"] .next-btn {
    right: auto;
    left: -60px;
}

html[dir="rtl"] .close-modal {
    right: auto;
    left: 0;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 0 20px;
    }
    
    .nav-btn {
        font-size: 20px;
        padding: 12px 15px;
    }
    
    .prev-btn {
        left: -50px;
    }
    
    .next-btn {
        right: -50px;
    }
}

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-image {
        height: 220px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .modal-content {
        width: 90%;
    }
    
    .nav-btn {
        padding: 10px 12px;
    }
    
    .prev-btn {
        left: -40px;
    }
    
    .next-btn {
        right: -40px;
    }
}

@media (max-width: 768px) {
    .products-gallery {
        padding: 50px 0;
    }
    
    .section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }
    
    .nav-btn {
        font-size: 18px;
        padding: 8px 10px;
    }
    
    .prev-btn {
        left: -30px;
    }
    
    .next-btn {
        right: -30px;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-image {
        height: 200px;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .nav-btn {
        top: auto;
        bottom: -60px;
        transform: translateY(0);
    }
    
    .prev-btn {
        left: 30%;
    }
    
    .next-btn {
        right: 30%;
    }
    
    html[dir="rtl"] .prev-btn {
        right: 30%;
    }
    
    html[dir="rtl"] .next-btn {
        left: 30%;
    }
    
    .modal-caption {
        padding-bottom: 60px;
    }
}
