/**
 * Bull Bestsellers - Front-end Carousel Styles
 *
 * @author    Bullmade
 * @copyright Bullmade
 * @license   AFL-3.0
 */

.bm-bestsellers {
    padding: 1.5rem;
    margin-inline: 1rem;
    border-radius: 8px;
    background: #f5ede0;
    overflow: hidden;
}

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

.bm-bestsellers__heading {
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0;
    line-height: 1.3;
}

.bm-bestsellers__nav {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.bm-bestsellers__nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    color: #333;
    padding: 0;
    transition: all 0.2s ease;
}

.bm-bestsellers__nav-btn:hover:not(:disabled) {
    border-color: #333;
    background: #333;
    color: #fff;
}

.bm-bestsellers__nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.bm-bestsellers__track-wrapper {
    overflow: hidden;
    position: relative;
}

.bm-bestsellers__track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.bm-bestsellers__track::-webkit-scrollbar {
    display: none;
}

.bm-bestsellers__item {
    flex: 0 0 calc(50% - 0.5rem);
    scroll-snap-align: start;
    min-width: 0;
}

@media (min-width: 576px) {
    .bm-bestsellers__item {
        flex: 0 0 calc(33.333% - 0.667rem);
    }
}

@media (min-width: 768px) {
    .bm-bestsellers__item {
        flex: 0 0 calc(25% - 0.75rem);
    }
}

@media (min-width: 1200px) {
    .bm-bestsellers__item {
        flex: 0 0 calc(20% - 0.8rem);
    }
}

.bm-bestsellers__product {
    position: relative;
}

.bm-bestsellers__product-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.bm-bestsellers__product-link:hover {
    text-decoration: none;
    color: inherit;
}

.bm-bestsellers__product-image {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background: #f5f5f5;
    aspect-ratio: 1;
}

.bm-bestsellers__product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.bm-bestsellers__product-link:hover .bm-bestsellers__product-image img {
    transform: scale(1.05);
}

.bm-bestsellers__product-flags {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.bm-bestsellers__product-flag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 2px;
    background: #333;
    color: #fff;
}

.bm-bestsellers__product-flag--discount,
.bm-bestsellers__product-flag--on-sale {
    background: #c0392b;
}

.bm-bestsellers__product-flag--new {
    background: #2ecc71;
}

.bm-bestsellers__product-info {
    padding: 0.75rem 0.25rem 0;
}

.bm-bestsellers__product-name {
    font-size: 0.875rem;
    font-weight: 400;
    margin: 0 0 0.25rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bm-bestsellers__product-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bm-bestsellers__price--current {
    font-weight: 700;
    font-size: 0.95rem;
}

.bm-bestsellers__price--regular {
    text-decoration: line-through;
    color: #999;
    font-size: 0.8rem;
}
