/**
 * Candelea Bestsellers — Frontend Carousel Styles
 */

.candelea-bestsellers {
    padding: 2.5rem 0;
}

.candelea-bestsellers__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

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

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

.candelea-bestsellers-carousel {
    position: relative;
}

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

.candelea-bestsellers-carousel__container {
    display: flex;
    touch-action: pan-y pinch-zoom;
    gap: 1rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.candelea-bestsellers-carousel__slide {
    flex: 0 0 calc(25% - 1rem);
    min-width: 0;
    padding: 0 0.5rem;
    box-sizing: border-box;
}

.candelea-bestsellers-carousel[data-visible="1"] .candelea-bestsellers-carousel__slide { flex: 0 0 calc(100% - 1rem); }
.candelea-bestsellers-carousel[data-visible="2"] .candelea-bestsellers-carousel__slide { flex: 0 0 calc(50% - 1rem); }
.candelea-bestsellers-carousel[data-visible="3"] .candelea-bestsellers-carousel__slide { flex: 0 0 calc(33.333% - 1rem); }
.candelea-bestsellers-carousel[data-visible="4"] .candelea-bestsellers-carousel__slide { flex: 0 0 calc(25% - 1rem); }
.candelea-bestsellers-carousel[data-visible="5"] .candelea-bestsellers-carousel__slide { flex: 0 0 calc(20% - 1rem); }
.candelea-bestsellers-carousel[data-visible="6"] .candelea-bestsellers-carousel__slide { flex: 0 0 calc(16.666% - 1rem); }

.candelea-bestsellers-carousel__slide .product-miniature {
    width: 100%;
    height: 100%;
}

.candelea-bestsellers-carousel__prev,
.candelea-bestsellers-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-bestsellers-carousel__prev:hover,
.candelea-bestsellers-carousel__next:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.candelea-bestsellers-carousel__prev { left: -1.25rem; }
.candelea-bestsellers-carousel__next { right: -1.25rem; }

.candelea-bestsellers-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.candelea-bestsellers-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-bestsellers-carousel__dot:hover { border-color: #888; }

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

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

@media (max-width: 767px) {
    .candelea-bestsellers-carousel__slide { flex-basis: calc(50% - 1rem) !important; }
    .candelea-bestsellers-carousel__prev { left: -0.5rem; }
    .candelea-bestsellers-carousel__next { right: -0.5rem; }
}

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