/* CF Builder Carousel Styles */

.cf-carousel-container {
    position: relative;
    width: 100%;
    margin: 2rem auto;
}

.cf-carousel-wrapper {
    overflow: hidden;
    position: relative;
}

.cf-carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    gap: var(--carousel-gap, 20px);
}

.cf-carousel-slide {
    flex: 0 0 calc((100% - (var(--items-per-view, 3) - 1) * var(--carousel-gap, 20px)) / var(--items-per-view, 3));
    position: relative;
}

/* Image Container */
.cf-carousel-image-container {
    position: relative;
    overflow: hidden;
    background: transparent;
}

.cf-carousel-image {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Hover Image Effect */
.cf-carousel-image-container.has-hover .cf-carousel-image-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cf-carousel-image-container.has-hover:hover .cf-carousel-image {
    opacity: 0;
}

.cf-carousel-image-container.has-hover:hover .cf-carousel-image-hover {
    opacity: 1;
}

/* Content */
.cf-carousel-content {
    padding: 1rem 0;
}

.cf-carousel-title {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
}

.cf-carousel-caption {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.5;
}

/* Navigation Arrows */
.cf-carousel-prev,
.cf-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    font-family: ETmodules !important;
    font-size: 3rem;
    color: #8B1A1A;
    opacity: 0.8;
}

.cf-carousel-prev:hover,
.cf-carousel-next:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.cf-carousel-prev:disabled,
.cf-carousel-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.cf-carousel-prev {
    left: -30px;
}

.cf-carousel-prev::before {
    content: "\34";
}

.cf-carousel-next {
    right: -30px;
}

.cf-carousel-next::before {
    content: "\35";
}

/* Dots Navigation */
.cf-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1.5rem;
}

.cf-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.cf-carousel-dot:hover {
    background: #999;
}

.cf-carousel-dot.active {
    background: #333;
    width: 24px;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cf-carousel-slide {
        flex: 0 0 calc((100% - (var(--items-mobile, 1) - 1) * var(--carousel-gap, 20px)) / var(--items-mobile, 1));
    }

    .cf-carousel-prev,
    .cf-carousel-next {
        width: 40px;
        height: 40px;
        font-size: 2.5rem;
    }

    .cf-carousel-prev {
        left: 10px;
    }

    .cf-carousel-next {
        right: 10px;
    }
}

/* Touch/Swipe Support Indicators */
@media (pointer: coarse) {
    .cf-carousel-wrapper {
        cursor: grab;
    }

    .cf-carousel-wrapper:active {
        cursor: grabbing;
    }
}

/* Optional: Fade effect for autoplay */
.cf-carousel-container[data-transition="fade"] .cf-carousel-track {
    transition: opacity 0.5s ease;
}

/* Cloned slides for infinite scroll */
.cf-carousel-slide.cloned {
    pointer-events: none; /* Prevent interactions with cloned slides */
}

/* Loading state */
.cf-carousel-container.loading .cf-carousel-slide {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}