/* ==================== 3D CAROUSEL ==================== */
.carousel-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding-top: 40px;
}

.carousel-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    perspective: 1000px;
    z-index: 2;
    /* Ensure it's above background */
    text-align: center;
}

.carousel-header {
    margin-bottom: var(--spacing-lg);
    position: relative;
    z-index: 3;
}

.carousel-header h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(to right, #fff, #ccc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.carousel-header p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
}

.carousel-3d {
    position: relative;
    height: 500px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.carousel-card {
    position: absolute;
    width: 300px;
    height: 450px;
    background: var(--color-gray);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.5s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    pointer-events: none;
    transform: translateX(0) scale(0.8);
    z-index: 0;
    /* backdrop-filter removed for performance */
}

/* States */
.carousel-card.active {
    opacity: 1;
    transform: translateX(0) scale(1.1);
    z-index: 10;
    border-color: var(--color-red);
    box-shadow: 0 20px 50px rgba(255, 51, 51, 0.3);
    pointer-events: auto;
}

.carousel-card.prev {
    opacity: 0.6;
    transform: translateX(-120%) scale(0.85) rotateY(15deg);
    z-index: 5;
    pointer-events: auto;
    /* Allow clicking to navigate */
}

.carousel-card.next {
    opacity: 0.6;
    transform: translateX(120%) scale(0.85) rotateY(-15deg);
    z-index: 5;
    pointer-events: auto;
}

/* For smooth loop transition, hide others */
.carousel-card:not(.active):not(.prev):not(.next) {
    opacity: 0;
    transform: translateX(0) scale(0.5);
    z-index: -1;
}

.card-image {
    width: 100%;
    height: 100%;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.carousel-card:hover .card-image img {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: var(--spacing-xl) var(--spacing-md) var(--spacing-md);
    text-align: left;
    transform: translateY(20px);
    transition: var(--transition-normal);
}

.carousel-card.active .card-overlay {
    transform: translateY(0);
}

.card-tag {
    display: inline-block;
    background: var(--color-red);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    line-height: 1.2;
    max-width: 90%;
    word-wrap: break-word;
    text-transform: uppercase;
}

.card-overlay h3 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: var(--spacing-xs);
    color: white;
}

.btn-fake {
    display: inline-block;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 2px solid var(--color-red);
    padding-bottom: 2px;
}

/* Controls */
.carousel-controls {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    margin-top: var(--spacing-xl);
    z-index: 10;
    position: relative;
}

.carousel-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-normal);
}


.carousel-btn:hover {
    background: var(--color-red);
    border-color: var(--color-red);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .carousel-section {
        padding-top: 60px;
        height: auto;
        min-height: auto;
    }

    .carousel-3d {
        height: 400px;
    }

    .carousel-card {
        width: 240px;
        height: 360px;
    }

    .carousel-card.prev {
        transform: translateX(-60%) scale(0.85);
        /* Tighter stacking on mobile */
    }

    .carousel-card.next {
        transform: translateX(60%) scale(0.85);
    }
}