
.carousel-3d-container {
    position: relative;
    width: 100%;
    height: 500px; /* Adjust height as needed */
    perspective: 1000px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel-3d-spinner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.carousel-3d-item {
    position: absolute;
    width: 400px; /* Increased width for better horizontal support */
    height: 400px; /* Square container */
    top: 50%;
    left: 50%;
    /* transform: translate(-50%, -50%); - This will be part of the dynamic transform */
    transform-origin: center center;
    transition: transform 0.5s ease, opacity 0.5s ease, filter 0.5s ease;
    border-radius: 15px;
    /* overflow: hidden; - Removed to allow image to be the shape */
    /* box-shadow: 0 10px 30px rgba(0,0,0,0.5); - Moved to img */
    background: transparent; /* Transparent background */
    cursor: pointer;
    /* Initial state hidden or centered */
    opacity: 0;
    z-index: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel-3d-item img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* Ensure full image is visible */
    display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); /* Shadow on image */
    border-radius: 8px;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
    text-align: center;
    opacity: 0; /* Hidden by default, shown on active */
    transition: opacity 0.3s ease 0.2s;
}

.carousel-3d-item.active .carousel-caption {
    opacity: 1;
}

.carousel-caption h3 {
    margin: 0 0 5px;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    color: white !important;
}

.carousel-caption p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
    color: white !important;
}

/* Controls */
.carousel-3d-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-3d-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}
