/**
 * Candelea Featured Products — Frontend Carousel Styles
 */

/* ========================= */
/* Section wrapper            */
/* ========================= */
.candelea-featured {
    padding: 2.5rem 0;
}

/* ========================= */
/* Header (title + link)      */
/* ========================= */
.candelea-featured__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.candelea-featured__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.candelea-featured__all-link {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* ========================= */
/* Embla viewport & container */
/* ========================= */
.candelea-featured-carousel {
    position: relative;
}

.candelea-featured-carousel__viewport {
    overflow: hidden;
    width: 100%;
}

.candelea-featured-carousel__container {
    display: flex;
    touch-action: pan-y pinch-zoom;
    gap: 1rem;
    /* gap is handled via slide width calc, keep margin approach */
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

/* ========================= */
/* Individual slide           */
/* ========================= */
.candelea-featured-carousel__slide {
    flex: 0 0 calc(25% - 1rem);
    min-width: 0;
    padding: 0 0.5rem;
    box-sizing: border-box;
}

/* Responsive slide widths — controlled via JS data-attributes + CSS vars */
.candelea-featured-carousel[data-visible="1"] .candelea-featured-carousel__slide {
    flex: 0 0 calc(100% - 1rem);
}
.candelea-featured-carousel[data-visible="2"] .candelea-featured-carousel__slide {
    flex: 0 0 calc(50% - 1rem);
}
.candelea-featured-carousel[data-visible="3"] .candelea-featured-carousel__slide {
    flex: 0 0 calc(33.333% - 1rem);
}
.candelea-featured-carousel[data-visible="4"] .candelea-featured-carousel__slide {
    flex: 0 0 calc(25% - 1rem);
}
.candelea-featured-carousel[data-visible="5"] .candelea-featured-carousel__slide {
    flex: 0 0 calc(20% - 1rem);
}
.candelea-featured-carousel[data-visible="6"] .candelea-featured-carousel__slide {
    flex: 0 0 calc(16.666% - 1rem);
}

/* Make product-miniature cards fill their slide */
.candelea-featured-carousel__slide .product-miniature {
    width: 100%;
    height: 100%;
}

/* ========================= */
/* Navigation arrows          */
/* ========================= */
.candelea-featured-carousel__prev,
.candelea-featured-carousel__next {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0;
}

.candelea-featured-carousel__prev:hover,
.candelea-featured-carousel__next:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.candelea-featured-carousel__prev:disabled,
.candelea-featured-carousel__next:disabled {
    opacity: 0.3;
    cursor: default;
}

.candelea-featured-carousel__prev {
    left: -1.25rem;
}

.candelea-featured-carousel__next {
    right: -1.25rem;
}

/* ========================= */
/* Dot indicators             */
/* ========================= */
.candelea-featured-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.candelea-featured-carousel__dot {
    width: 8px;
    height: 8px;
    border: 2px solid #bbb;
    border-radius: 50%;
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.candelea-featured-carousel__dot:hover {
    border-color: #888;
}

.candelea-featured-carousel__dot--active {
    background: #333;
    border-color: #333;
}

/* ========================= */
/* Responsive                 */
/* ========================= */
@media (max-width: 1199px) {
    .candelea-featured-carousel__slide {
        flex-basis: calc(33.333% - 1rem) !important;
    }
}

@media (max-width: 767px) {
    .candelea-featured-carousel__slide {
        flex-basis: calc(50% - 1rem) !important;
    }

    .candelea-featured-carousel__prev {
        left: -0.5rem;
    }

    .candelea-featured-carousel__next {
        right: -0.5rem;
    }
}

@media (max-width: 479px) {
    .candelea-featured-carousel__slide {
        flex-basis: calc(100% - 1rem) !important;
    }

    .candelea-featured__title {
        font-size: 1.25rem;
    }
}
