/* Best Seller Compact Slider Styles */

.bestseller-section {
    background: #f0f0f2;
    padding: 3rem 0;
}

.bestseller-header {
    padding-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.bestseller-viewall {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #4b5563;
    font-size: 1.1rem;
    font-weight: 600;
    transition: color 0.3s ease;
    margin-left: 3px;
}

.bestseller-viewall:hover {
    color: #111;
}

.bestseller-viewall-btn {
    width: 32px;
    height: 32px;
    background: #e5e5ea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bestseller-viewall:hover .bestseller-viewall-btn {
    background: #111;
    color: #fff;
    transform: translateX(4px);
}

.bestseller-viewall-btn .material-symbols-outlined {
    font-size: 1.2rem;
}

/* Slider Track */
.bestseller-slider-track {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding: 0.5rem 1.25rem 2rem;
    scroll-snap-type: x mandatory;
    scroll-padding: 1.25rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
    box-sizing: border-box;
}

.bestseller-slider-track::-webkit-scrollbar {
    display: none;
}

/* Compact Card Styles */
.bs-card {
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    flex-shrink: 0;
    width: clamp(160px, 45vw, 230px);
    /* Perfectly matched to the laptop cards slider width */
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
}

.bs-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.bs-card-img-wrap {
    position: relative;
    background: #f8f8f8;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    /* Reduced padding */
    overflow: hidden;
}

.bs-card-img-wrap img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bs-card:hover .bs-card-img-wrap img {
    transform: scale(1.1);
}

.bs-card-body {
    padding: 1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.bs-card-name {
    font-size: 0.95rem;
    /* Slightly smaller typography */
    font-weight: 700;
    line-height: 1.4;
    color: #1a1c1d;
    height: 2.8em;
    /* Fixed height for name to ensure alignment */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bs-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.25rem;
}

.bs-card-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #4b5563;
}

.bs-star {
    font-size: 0.9rem;
    color: #fbbf24;
    font-variation-settings: 'FILL' 1;
}

.bs-card-price {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1c1d;
}

/* Swatches */
.bs-swatches {
    display: flex;
    gap: 4px;
    margin-top: 0.5rem;
}

.bs-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #fff;
    box-shadow: 0 0 0 1px #e5e7eb;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.bs-swatch.active {
    box-shadow: 0 0 0 1.5px #1a1c1d;
}

/* Badge */
.bs-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: #1a1c1d;
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 5;
}

/* Desktop Slider Styles */
@media (min-width: 1024px) {
    .bestseller-slider-track {
        display: flex;
        /* Changed from grid to flex to keep slider functionality */
        overflow-x: auto;
        gap: 1.5rem;
        padding: 0.5rem 0;
        max-width: 100%;
        margin: 0;
        scroll-padding: 0;
    }

    /* Force the cards to take up roughly 1/5th of the width minus gaps */
    .bestseller-slider-track .bs-card {
        width: calc((100% - (4 * 1.5rem)) / 5);
        min-width: 220px;
        /* Ensure they don't get TOO small */
    }

    .slider-nav-btn {
        display: flex !important;
        /* Ensure arrows are visible on desktop slider */
    }
}