/* ===================================================================
   Best Sellers Revamp Component Styles
   =================================================================== */

.cmp-bestsellers-revamp {
    padding: 40px;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    gap: 25px;
    font-family: Archivo, sans-serif;
    max-width: 1440px;
    margin: 0 auto;
}

@media screen and (max-width: 767px) {
    .cmp-bestsellers-revamp {
        padding: 20px;
        gap: 16px;
    }
}

/* ==================== Header + Arrows ==================== */

.cmp-bestsellers-revamp__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cmp-bestsellers-revamp__title {
    font-size: 28px;
    font-weight: 500;
    color: #202129;
    margin: 0;
    font-family: Archivo, sans-serif;
    font-family: "Playfair Display", serif !important;
    @media screen and (max-width:767px){
        font-size: 24px;
    }
}

.cmp-bestsellers-revamp__arrows {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
    @media screen and (max-width: 767px) {
        display: none;
    }
}

.cmp-bestsellers-revamp__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 1px solid #D9D9D9;
    border-radius: 42px;
    background: #FFFFFF;
    color: #202129;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.cmp-bestsellers-revamp__arrow:hover {
    border-color: #202129;
}

/* All cards fit in view (e.g. 4 or fewer on desktop): nothing to slide. */
.cmp-bestsellers-revamp__arrows--hidden {
    display: none;
}

.cmp-bestsellers-revamp__arrow:disabled {
    color: #D9D9D9;
    border-color: #D9D9D9;
    pointer-events: none;
    cursor: default;
}

/* ==================== Product Slider Track ==================== */

.cmp-bestsellers-revamp__track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    /* A horizontal scroller clips vertically too, so this reserves room
       below the cards for the absolutely positioned cart message; the
       negative margin cancels it, so the page layout doesn't change. */
    overflow-y: hidden;
    padding-bottom: 40px;
    margin-bottom: -40px;
}

.cmp-bestsellers-revamp__track::-webkit-scrollbar {
    display: none;
}

@media screen and (max-width: 991px) {
    .cmp-bestsellers-revamp__track {
        gap: 14px;
    }
}

@media screen and (max-width: 767px) {
    .cmp-bestsellers-revamp__track {
        gap: 10px;
        /* Narrow cards wrap the longest message to ~3 lines. */
        padding-bottom: 52px;
        margin-bottom: -52px;
    }
}

/* ==================== Product Card ==================== */

.cmp-bestsellers-revamp__card {
    display: flex;
    flex-direction: column;
    background: #fff;
    /* visible so the cart message can sit below the card; the image
       container clips its own hover zoom. */
    overflow: visible;
    transition: box-shadow 0.2s ease;
    gap: 10px;
    /* Slider: 4 per view on desktop (3 gaps x 20px). */
    flex: 0 0 calc((100% - 60px) / 4);
    scroll-snap-align: start;
    @media screen and (max-width: 991px) {
        /* 3 per view (2 gaps x 14px). */
        flex-basis: calc((100% - 28px) / 3);
    }
    @media screen and (max-width:767px){
        gap: 10px;
        /* ~2 per view + peek of the next card. */
        flex-basis: calc((100% - 10px) / 2.2);
    }
}

.cmp-bestsellers-revamp__card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    touch-action: manipulation; /* eliminates 300ms tap delay on mobile */
}

/* Card Image */

.cmp-bestsellers-revamp__card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1.09 / 1;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 16px;
    @media screen and (max-width:767px){
        aspect-ratio: 160 / 180;
        border-radius: 6px;
    }
}

.cmp-bestsellers-revamp__card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cmp-bestsellers-revamp__card-img--hover {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Hover image swap only on devices with true pointer hover (mouse/trackpad).
   Touch devices (mobile) don't match @media (hover: hover), so the first tap
   goes straight to navigation without triggering the image swap. */
@media (hover: hover) {
    .cmp-bestsellers-revamp__card:hover .cmp-bestsellers-revamp__card-img--hover {
        opacity: 1;
    }
}

@media (max-width: 1024px) {
    .cmp-bestsellers-revamp__card-img--hover {
        display: none;
    }
}

.cmp-bestsellers-revamp__card--no-hover .cmp-bestsellers-revamp__card-img:not(.cmp-bestsellers-revamp__card-img--hover) {
    -webkit-transition: -webkit-transform 0.4s ease;
    -o-transition: transform 0.4s ease;
    transition: transform 0.4s ease;
}

@media (hover: hover) and (min-width: 1025px) {
    .cmp-bestsellers-revamp__card--no-hover:hover .cmp-bestsellers-revamp__card-img:not(.cmp-bestsellers-revamp__card-img--hover) {
        -webkit-transform: scale(1.1);
        -ms-transform: scale(1.1);
        transform: scale(1.1);
    }
}

/* Wishlist Heart */

.cmp-bestsellers-revamp__card-wishlist {
    position: absolute;
    top: 0;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s ease;
    padding: 0;
    color: #333642;
    @media screen and (max-width:650px){
        right: 0;
    }
}

.cmp-bestsellers-revamp__card-wishlist-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.cmp-bestsellers-revamp__card-wishlist[data-wishlist-status="added"] .cmp-bestsellers-revamp__card-wishlist-icon {
    transform: scale(1.05);
}

@media screen and (max-width: 767px) {
    .cmp-bestsellers-revamp__card-wishlist-icon {
        width: 20px;
        height: 20px;
    }
}

/* Card Info */
.cmp-bestsellers-revamp__card-info-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    @media screen and (max-width:767px){
        flex-direction: column;
        gap: 6px;
    }
}

.cmp-bestsellers-revamp__card-info {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    @media screen and (max-width:767px){
        gap: 8px;
    }
}

.cmp-bestsellers-revamp__card-title-link {
    text-decoration: none;
    color: inherit;
}

.cmp-bestsellers-revamp__card-title {
    font-size: 14px;
    font-weight: 300;
    color: #232426;
    line-height: 1.4;
    width: 85%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    @media screen and (max-width:767px){
        font-size: 13px;
        width: 80%;
    }
    @media screen and (max-width:400px){
        font-size: 11px;
    }
}

/* Price */

.cmp-bestsellers-revamp__card-price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

.cmp-bestsellers-revamp__card-price-current {
    font-size: 14px;
    font-weight: 500;
    color: #202129;
    @media screen and (max-width:767px){
        font-size: 12px;
    }
    @media screen and (max-width:400px){
        font-size: 11px;
    }
}

/* "/roll" unit, attached right after the price. */
.cmp-bestsellers-revamp__card-price-unit {
    font-size: 12px;
    font-weight: 400;
    color: #6B6E7B;
    @media screen and (max-width:400px){
        font-size: 11px;
    }
}

/* "Incl. of all taxes" (shown when there is no discount). */
.cmp-bestsellers-revamp__card-price-tax {
    font-size: 12px;
    font-weight: 400;
    color: #6B6E7B;
    @media screen and (max-width:400px){
        font-size: 11px;
    }
}

.cmp-bestsellers-revamp__card-price-mrp {
    font-size: 12px;
    color: #9DA1B0;
    font-weight: 400;
    text-decoration: line-through;
    @media screen and (max-width:400px){
        font-size: 11px;
    }
}

.cmp-bestsellers-revamp__card-discount {
    font-size: 12px;
    font-weight: 500;
    color: #000;
    white-space: nowrap;
    @media screen and (max-width:400px){
        font-size: 11px;
    }
}

/* ==================== Add to cart / Quantity stepper ==================== */

.cmp-bestsellers-revamp__card-cart {
    position: relative;
    margin-top: 4px;
}

/* Add to cart button (Figma: 156x34, radius 60, #202129). */
.cmp-bestsellers-revamp__card-atc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    width: 156px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid #202129;
    border-radius: 60px;
    background: #202129;
    color: #fff;
    font-family: 'Archivo', Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    @media screen and (max-width:767px){
        width: 120px;
        height: 28px;
        font-size: 12px;
        gap: 6px;
    }
}

.cmp-bestsellers-revamp__card-atc-btn:hover {
    background: #000;
}

.cmp-bestsellers-revamp__card-atc-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

.cmp-bestsellers-revamp__card-atc-icon {
    flex: 0 0 auto;
    @media screen and (max-width:767px){
        width: 14px;
        height: 14px;
    }
}

/* Out of stock: same box + border as the button, PDP out-of-stock styling. */
.cmp-bestsellers-revamp__card-atc-btn--oos {
    background: transparent;
    border-color: #B0B1B3;
    color: #B0B1B3;
    font-weight: 400;
    cursor: default;
}

.cmp-bestsellers-revamp__card-atc-btn--oos:hover {
    background: transparent;
}

/* Stepper occupies the same box as the Add to cart button. */
.cmp-bestsellers-revamp__card-stepper {
    display: none;
    align-items: center;
    justify-content: space-between;
    width: 156px;
    height: 34px;
    padding: 4px;
    border-radius: 60px;
    background: #202129;
    @media screen and (max-width:767px){
        width: 120px;
        height: 28px;
    }
}

/* In-cart: hide the Add button, show the stepper. */
.cmp-bestsellers-revamp__card-cart--in-cart .cmp-bestsellers-revamp__card-atc-btn {
    display: none;
}

.cmp-bestsellers-revamp__card-cart--in-cart .cmp-bestsellers-revamp__card-stepper {
    display: flex;
}

.cmp-bestsellers-revamp__card-stepper-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #202129;
    cursor: pointer;
    padding: 0;
    @media screen and (max-width:767px){
        width: 20px;
        height: 20px;
    }
}

.cmp-bestsellers-revamp__card-stepper-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.cmp-bestsellers-revamp__card-stepper-btn svg {
    @media screen and (max-width:767px){
        width: 13px;
        height: 13px;
    }
}

.cmp-bestsellers-revamp__card-stepper-value {
    font-family: 'Archivo', Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    @media screen and (max-width:767px){
        font-size: 12px;
    }
}

/* qty 1 -> show trash, hide minus; qty > 1 -> show minus, hide trash. */
.cmp-bestsellers-revamp__card-stepper-icon--trash,
.cmp-bestsellers-revamp__card-stepper--last .cmp-bestsellers-revamp__card-stepper-icon--minus {
    display: none;
}

.cmp-bestsellers-revamp__card-stepper--last .cmp-bestsellers-revamp__card-stepper-icon--trash {
    display: block;
}

/* Success/error after a cart change - same colours and copy as the PDP.
   Absolutely positioned under the button so showing it never shifts this
   card or its neighbours (the track reserves room for it). */
.cmp-bestsellers-revamp__card-cart-msg {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 6px 0 0;
    font-family: 'Archivo', Arial, sans-serif;
    font-size: 12px;
    line-height: 1.4;
    @media screen and (max-width:767px){
        font-size: 9px;
    }
}

.cmp-bestsellers-revamp__card-cart-msg--success,
.cmp-bestsellers-revamp__card-cart-msg--error {
    display: block;
}

.cmp-bestsellers-revamp__card-cart-msg--success {
    color: #1e8449;
}

.cmp-bestsellers-revamp__card-cart-msg--error {
    color: #c0392b;
}
