/* Ensure the container maintains its relative position */
.gallery_container {
    position: relative;
    margin-bottom: 15rem;
}

/* Ensure the section is positioned relative */
.threeD_gallery {
    position: relative;
    min-height: 85vh;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
    margin-bottom: 5rem;
}

/* Center the box horizontally */
.box {
    position: relative;
    width: 15vw;
    height: 15vw;
    margin: auto;
    transform-style: preserve-3d;
    transition: 1.5s;
    transform: perspective(550vw) rotateY(0deg);
}

/* Rotate and position each span */
.box span {
    position: absolute;
    top: 0;
    width: 175%;
    height: 100%;
    /* Style to be center */
    left: -4.8rem;
    transform-origin: center;
    transform-style: preserve-3d;
    transform: rotateY(calc(var(--i) * 16.3636364deg)) translateZ(105vw) !important;  /* Adjusted rotation angle and translateZ */
    -webkit-box-reflect: below 0px linear-gradient(transparent, transparent, #0004);
}

/* Ensure images fill their containers */
.box span img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 300px;
    object-fit: cover;
    user-select: none;
}

/* Position the navigation buttons */
.btns {
    position: absolute;
    bottom: 20px; /* Adjust bottom position as needed */
    width: 100%; /* Ensure buttons span full width */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    gap: 50px;
}

/* Style for navigation buttons */
.btns .btn {
    width: 60px;
    height: 60px;
    border: 3px solid black;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-top: -15rem;
}

/* Triangle shape for the buttons */
.btns .btn::before {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    border-top: 3px solid black;
    border-right: 3px solid black;
    transform: rotate(45deg) translate(-2.5px, 2.5px);
}

/* Adjust the rotation for previous button */
.btns .btn.prev::before {
    transform: rotate(225deg) translate(-2.5px, 2.5px);
}

/* Active state for buttons */
.btns .btn:active {
    background: lightblue;
}


@media (max-width: 768px){
    /* Center the box horizontally */
.box {
    position: relative;
    width: 15vw;
    height: 15vw;
    margin: auto;
    transform-style: preserve-3d;
    transition: 1.5s;
    transform: perspective(160vw) rotateY(0deg);
}

.box span{
    left: -1.5rem;
}
}