/* Styles pour la fenêtre modale de détails de produit */
.product-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.product-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.product-modal-overlay.closing {
    opacity: 0;
    visibility: hidden;
}

.product-modal {
    position: relative;
    width: 90%;
    max-width: 950px;
    max-height: 90vh;
    background-color: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.product-modal-overlay.active .product-modal {
    transform: translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #6a5acd;
    color: white;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    font-size: 20px;
    transition: background-color 0.2s;
}

.modal-close-btn:hover {
    background-color: #5a4abf;
}

.product-modal-content {
    display: flex;
    flex-direction: row;
    min-height: 500px;
}

/* Styles pour la partie gauche (image) */
.product-modal-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5;
    padding: 0;
    position: relative;
    min-height: 400px;
    overflow: hidden;
}

.product-modal-image img {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    padding: 1rem;
}

/* Styles pour la partie droite (détails) */
.product-modal-details {
    flex: 1;
    padding: 40px;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 90vh;
}

.product-modal-title {
    font-size: 28px;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 5px;
    color: #333;
    text-transform: uppercase;
    font-family: 'Poppins', sans-serif;
}

.product-modal-ref {
    font-size: 16px;
    color: #333;
    margin-bottom: 30px;
    font-weight: 500;
}

.product-modal-description {
    margin-top: 10px;
    margin-bottom: 15px;
}

.product-modal-description h3 {
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: 600;
    color: #333;
}

.product-modal-desc-text {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-top: 0;
    font-weight: 400;
}

.product-modal-actions {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding-top: 20px;
}

.product-modal-actions .btn {
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 16px;
    text-transform: none;
    color: white;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-eshop {
    background-color: #6a5acd; /* Couleur par défaut, sera remplacée par la couleur de la catégorie */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-eshop:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    opacity: 0.9;
}

/* Boutons de navigation */
.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(106, 90, 205, 0.8);
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 24px;
    color: white;
    transition: all 0.3s ease;
    z-index: 1001; /* Augmenter le z-index pour être au-dessus de la modale */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.modal-nav-btn:hover {
    background-color: rgba(106, 90, 205, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Positionnement des boutons de navigation */
.modal-prev-btn {
    left: calc(50% - 475px - 30px); /* Positionner à gauche de la modale */
}

.modal-next-btn {
    right: calc(50% - 475px - 30px); /* Positionner à droite de la modale */
}

/* Responsive design pour les boutons de navigation */
@media (max-width: 1100px) {
    .modal-prev-btn {
        left: 20px;
    }
    
    .modal-next-btn {
        right: 20px;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .product-modal {
        height: auto;
        max-height: 90vh;
    }
    
    .product-modal-content {
        flex-direction: column;
    }
    
    .product-modal-image, 
    .product-modal-details {
        flex: none;
        padding: 20px;
    }
    
    .product-modal-image {
        height: 40vh;
    }
    
    .modal-nav-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}
