.xmed-sales-slot {
    --xmed-navy: #183153;
    box-sizing: border-box;
    max-width: 1380px;
    margin: 28px auto;
    padding: 20px clamp(14px, 2vw, 24px);
    border: 1px solid var(--xmed-border, #e9ecef);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(24, 49, 83, .07);
}

.xmed-sales-slot:not(.is-ready) {
    min-height: 100px;
}

.xmed-sales-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.xmed-sales-heading h2 {
    margin: 0;
    color: var(--xmed-navy);
    font-size: clamp(1.35rem, 2.2vw, 1.8rem);
    font-weight: 750;
}

.xmed-sales-controls {
    display: flex;
    gap: 8px;
}

.xmed-sales-controls button {
    width: 38px;
    height: 38px;
    border: 1px solid #cbd6e1;
    border-radius: 50%;
    background: #fff;
    color: var(--xmed-navy);
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.xmed-sales-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    grid-template-rows: 1fr;
    gap: 14px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
}

.xmed-sales-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--xmed-border, #e9ecef);
    border-radius: 14px;
    background: #fff;
    scroll-snap-align: start;
    transition: box-shadow .18s ease, border-color .18s ease;
}

.xmed-sales-card:hover {
    border-color: #7fc584;
    box-shadow: 0 10px 24px rgba(24, 49, 83, .10);
}

.xmed-sales-card__image {
    position: relative;
    display: flex;
    height: clamp(175px, 15vw, 215px);
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: #fff;
}

.xmed-sales-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.xmed-sales-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 12px;
    border-top: 1px solid #edf1f4;
}

.xmed-sales-card h3 {
    display: -webkit-box;
    min-height: 3.15em;
    margin: 7px 0 12px;
    overflow: hidden;
    color: #132a47;
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.xmed-sales-card h3 a {
    color: inherit;
    text-decoration: none;
}

.xmed-sales-rating {
    color: #ecaa00;
    font-size: .88rem;
    white-space: nowrap;
}

.xmed-sales-rating strong {
    color: #19375b;
}

.xmed-sales-rating small {
    color: #708096;
}

.xmed-sales-rating--new {
    color: #4b8c50;
    font-weight: 650;
}

.xmed-sales-card__footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
    margin-top: auto;
}

.xmed-sales-price {
    display: flex;
    min-height: 24px;
    align-items: baseline;
    gap: 8px;
    color: var(--xmed-green, #58a85c);
    font-size: 24px;
    font-weight: 800;
}

.xmed-sales-add-form {
    margin: 0;
}

.xmed-sales-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: 9px;
    background: var(--xmed-green, #58a85c);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none !important;
    width: 100%;
    border: 0;
    cursor: pointer;
}

.xmed-sales-button:hover {
    background: var(--xmed-green-hover, #4b9550);
}

@media (min-width: 992px) {
    .xmed-sales-track {
        grid-auto-columns: calc((100% - 42px) / 4);
    }
}

@media (min-width: 640px) and (max-width: 991.98px) {
    .xmed-sales-track {
        grid-auto-columns: calc((100% - 14px) / 2);
    }
}

@media (max-width: 639.98px) {
    .xmed-sales-slot {
        width: 100%;
        margin: 24px 0;
        padding: 18px 12px;
        border: 1px solid var(--xmed-border, #e9ecef);
        border-radius: 16px;
        overflow: hidden;
    }

    .xmed-sales-track {
        grid-auto-columns: calc(100% - 46px);
        gap: 12px;
        padding-bottom: 8px;
    }

    .xmed-sales-controls {
        display: none;
    }

    .xmed-sales-card__image {
        height: 180px;
    }

    .xmed-sales-card {
        border-radius: 14px;
    }

    .xmed-sales-heading h2 {
        font-size: 1.22rem;
        line-height: 1.25;
    }

}

@media (prefers-reduced-motion: reduce) {
    .xmed-sales-card {
        animation: none;
        transition: none;
    }
}

/* Native VM controls; VM still owns quantity changes and add-to-cart. */
.xmed-sales-add-form .xmed-addtocart-row{display:flex;gap:8px;align-items:stretch;width:100%;flex-wrap:wrap}
.xmed-sales-add-form .xmed-qty-wrap{flex:0 0 100px;min-width:0}
.xmed-sales-add-form .quantity-box{display:flex;align-items:stretch;border:1px solid #dee2e6;border-radius:6px;height:48px;overflow:hidden}
.xmed-sales-add-form .quantity-input{width:34px;flex:1;min-width:0;border:0;border-inline:1px solid #dee2e6;padding:0!important;text-align:center;background:transparent;color:var(--xmed-text,#1f2937);font:inherit;appearance:textfield;-moz-appearance:textfield}
.xmed-sales-add-form .quantity-input::-webkit-inner-spin-button,.xmed-sales-add-form .quantity-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.xmed-sales-add-form .quantity-controls{flex:0 0 30px;padding:0!important;font-size:22px;line-height:1;color:var(--xmed-text,#1f2937);border:0;border-radius:0;background:transparent;text-decoration:none}
.xmed-sales-add-form .quantity-controls:hover{background:var(--xmed-green-soft,#eef7f1)}
.xmed-sales-add-form .xmed-addtocart-btn-wrap{flex:1 1 125px;min-width:0}
.xmed-sales-add-form .xmed-sales-button{background:var(--xmed-green,#58a85c)!important;color:#fff!important;border:1px solid var(--xmed-green,#58a85c);border-radius:12px;font-family:inherit;font-size:14px;line-height:1.3;padding:10px 8px;width:100%;min-height:48px;white-space:normal}
.xmed-sales-add-form .xmed-sales-button:hover{background:var(--xmed-green-hover,#4b9550)!important;border-color:var(--xmed-green-hover,#4b9550)}
.xmed-sales-add-form button:focus-visible,.xmed-sales-add-form input:focus-visible{outline:3px solid #173f31;outline-offset:2px}
/* Do not stretch cards without offers into large empty white panels. */
.xmed-sales-track{align-items:start}
.xmed-sales-card__body{flex:0 0 auto}
.xmed-sales-card__footer{margin-top:0}
