:root {
    --background-overlay-color: rgba(0, 0, 0, 0.8);
    --background_popup-color: rgba(255, 255, 255, 0.8);
    --close-button-color: red;
    --text-button: black;
}
@media (prefers-color-scheme: dark) {
    :root {
    --background-overlay-color: rgba(15, 12, 18, 0.85);
    --background_popup-color: rgba(40, 65, 55, 0.95);
    --close-button-color: #7a2a2a;
    --text-button: #ffffff;
    }
}

/* Principal overlay popup*/
#popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: none;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--background-overlay-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
}

/* Bouton close */
#popup-content #close-button {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: var(--close-button-color);
    color: var(--color-cart-button-text);
    border: none;
    border-radius : 5px;
    width: 28px;
    height:28px;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

/* Popup content */

#popup-content {
    position: relative;
    aspect-ratio:1;
    max-width: 90vw;
    max-height: 90vh;
    background: var(--background_popup-color);
    padding: 0;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}


.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    flex-shrink: 0;
    padding: 0 10px;
    position: relative;
}
#photo-index {
    color: var(--text-button);
    font-size: 0.9rem;
}


#popup-content #close-button:hover {
    background-color: darkred;
    transform: scale(1.1);
}

.photo-popup-content {
    max-width: 70vw;
    width:100%;
    height: 80vh;
    aspect-ratio:1;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    
}
/* Image */
#popup-content img {
    width: 100%;
    max-height: 80%;
    object-fit: contain;
    display: block;
    position: relative;
    aspect-ratio:1;
    background-color: black;
}

/* Boutons de navigation ← → */
#popup-content .prev,
#popup-content .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.8rem;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    z-index: 20;
    border-radius: 8px;
    backdrop-filter: blur(4px);
    opacity: 0.2; /* légèrement visibles par défaut */
    transition: opacity 0.25s ease, transform 0.15s ease;
}

#popup-content:hover .prev,
#popup-content:hover .next {
    opacity: 0.5;
}

#popup-content .prev:hover,
#popup-content .next:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.05);
}

.prev { left: 10px; }
.next { right: 10px; }


.cart-buttons{
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width:40%;
    height:10% !important;
    color : white;
}

/*----------------------MEDIA ADAPTIVES------------------------------*/

/*------------MOBILE-----------*/
@media (max-width: 500px) {


    .photo-popup-content {
    height: 90vh;
    max-width: 90vw;
  }

    #popup-content .prev,
    #popup-content .next {
        font-size: 2rem;
        padding: 10px 15px;
    }   
    #popup-content #close-button {
        width: 20px;
        height:20px;
        font-size: 1rem;
    }

    .prev, .next {
        display: none;
    }
}

@media (min-width: 500px) and (max-width: 980px) {
    .photo-popup-content {
    height: 90vh;
    max-width: 90vw;
  }


    #popup-content #close-button {
        width: 25px;
        height:25px;
        font-size: 1.2rem;
    }

    #popup-content .prev,
    #popup-content .next {
        font-size: 2rem;
        padding: 10px 15px;
    }   

}