/* =============================================================
   Upsell Engine — Frontend Styles
   Product page  → clean product cards below Add to Cart
   Cart page     → horizontal banner with dynamic caption

   ============================================================= */

:root {
    --upsell-theme-text: #1d2327;
    --upsell-theme-muted: #666666;
    --upsell-theme-surface: #ffffff;
    --upsell-theme-card-bg: #ffffff;
    --upsell-theme-subtle-bg: #f6f7f7;
    --upsell-theme-border: rgba(0, 0, 0, 0.12);
    --upsell-theme-link: #2271b1;
    --upsell-theme-button-bg: #2271b1;
    --upsell-theme-button-text: #ffffff;
    --upsell-theme-button-border: transparent;
    --upsell-theme-button-radius: 6px;
    --upsell-theme-button-font: inherit;
    --upsell-theme-font: inherit;
}

.upsell-widget,
.upsell-smart-recommendations {
    box-sizing: border-box;
    font-family: var(--upsell-theme-font);
    color: var(--upsell-theme-text);
    position: relative;
    isolation: isolate;
    max-width: 100%;
    line-height: 1.4;
    text-align: left;
}

.upsell-widget * { box-sizing: border-box; }
.upsell-smart-recommendations * { box-sizing: border-box; }

.upsell-widget :where(h1, h2, h3, h4, h5, h6, p),
.upsell-smart-recommendations :where(h1, h2, h3, h4, h5, h6, p) {
    margin-inline: 0;
}

.upsell-widget :where(a),
.upsell-smart-recommendations :where(a) {
    text-decoration: none;
    box-shadow: none;
}

.upsell-widget :where(img),
.upsell-smart-recommendations :where(img) {
    display: block;
    max-width: 100%;
    height: auto;
    border: 0;
    box-shadow: none;
}

.upsell-widget :where(button, .button, a.button),
.upsell-smart-recommendations :where(button, .button, a.button) {
    font: inherit;
    letter-spacing: normal;
    text-transform: none;
    box-shadow: none;
}

.upsell-widget :where(.upsell-card, .upsell-product-grid, .upsell-carousel-shell, .upsell-carousel-track),
.upsell-smart-recommendations :where(.upsell-smart-recommendations__grid, .upsell-smart-recommendations__item, .upsell-carousel-shell, .upsell-carousel-track) {
    float: none;
    max-width: 100%;
}

.upsell-widget :where(.upsell-card__name, .upsell-card__caption, .upsell-widget__sub),
.upsell-smart-recommendations :where(.upsell-smart-recommendations__name, .upsell-smart-recommendations__subtitle, .upsell-smart-recommendations__badge) {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ── Widget header ────────────────────────────────────────── */
.upsell-widget__header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    /* padding-bottom: 14px; */
}

.upsell-widget__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--upsell-theme-text);
    margin: 0;
    margin-bottom: 13px;
    letter-spacing: -0.02em;
}

.upsell-widget__dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0f6cbd, #63b3ff);
    flex-shrink: 0;
    margin-top: 7px;
    box-shadow: 0 0 0 6px rgba(15, 108, 189, 0.12);
}

.upsell-widget__dot--green { background: #27ae60; }

.upsell-widget__dot--upgrade {
    background: linear-gradient(135deg, #14532d, #4ade80);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.14);
}

.upsell-widget__dot--cross {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    box-shadow: 0 0 0 6px rgba(124, 58, 237, 0.14);
}

.upsell-widget__sub {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--upsell-theme-muted);
    max-width: 58ch;
}

/* =============================================================
   PRODUCT PAGE — card grid below Add to Cart
   ============================================================= */
.upsell-widget--product {
    margin: 24px 0 10px;
    /* background: linear-gradient(180deg, var(--upsell-theme-surface), var(--upsell-theme-subtle-bg));
    border: 1px solid var(--upsell-theme-border);
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05); */
    clear: both;
}

.upsell-widget--count-1,
.upsell-widget--count-2,
.upsell-widget--count-3,
.upsell-smart-recommendations--count-1,
.upsell-smart-recommendations--count-2,
.upsell-smart-recommendations--count-3 {
    width: 100%;
    max-width: min(100%, var(--upsell-box-width));
}

.upsell-widget--count-1,
.upsell-smart-recommendations--count-1 {
    --upsell-box-width: 365px;
}

.upsell-widget--count-2,
.upsell-smart-recommendations--count-2 {
    --upsell-box-width: 570px;
}

.upsell-widget--count-3,
.upsell-smart-recommendations--count-3 {
    --upsell-box-width: 820px;
}

.upsell-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
}

.upsell-product-grid--count-1,
.upsell-product-grid--count-2,
.upsell-product-grid--count-3 {
    grid-template-columns: repeat(var(--upsell-grid-columns), minmax(180px, 250px));
    justify-content: flex-start;
}

.upsell-product-grid--count-1 {
    --upsell-grid-columns: 1;
}

.upsell-product-grid--count-2 {
    --upsell-grid-columns: 2;
}

.upsell-product-grid--count-3 {
    --upsell-grid-columns: 3;
}

.upsell-carousel-shell {
    position: relative;
    margin-top: 15px;
}

.upsell-carousel-nav {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: 1px 0 14px;
}

.upsell-carousel-nav__btn {
    padding: 0px 30px 5px;
    border-radius: 999px;
    border: 1px solid var(--upsell-theme-button-border);
    background: var(--upsell-theme-surface);
    color: var(--upsell-theme-text);
    font-family: var(--upsell-theme-button-font);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.upsell-carousel-nav__btn:hover:not(:disabled) {
    transform: translateY(-1px);
    background: var(--upsell-theme-card-bg);
}

.upsell-carousel-nav__btn:disabled {
    opacity: 0.42;
    cursor: default;
}

.upsell-carousel-shell--static .upsell-carousel-nav {
    display: none;
}

.upsell-carousel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    align-items: stretch;
    padding-bottom: 8px;
    padding-top: 8px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.upsell-carousel-track::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.upsell-carousel-track > * {
    flex: 0 0 min(260px, 82vw);
    scroll-snap-align: start;
    align-self: stretch;
}

/* Product card */
.upsell-card {
    background: var(--upsell-theme-card-bg);
    border: 1px solid var(--upsell-theme-border);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.upsell-card:hover {
    border-color: var(--upsell-theme-border);
    transform: translateY(-3px);
}

.upsell-card__img-wrap {
    display: block;
    overflow: hidden;
    background: radial-gradient(circle at top, var(--upsell-theme-surface), var(--upsell-theme-subtle-bg) 70%);
}

.upsell-card__img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    display: block;
    transition: transform 0.3s;
    padding: 14px;
}

.upsell-card:hover .upsell-card__img { transform: scale(1.04); }

.upsell-card__body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.upsell-card__name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--upsell-theme-text);
    text-decoration: none;
    margin-bottom: 8px;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.upsell-card__name:hover { color: var(--upsell-theme-link); }

.upsell-card__price {
    font-size: 14px;
    font-weight: 700;
    color: var(--upsell-theme-text);
    margin-bottom: 8px;
}

.upsell-card__price del { color: var(--upsell-theme-muted); font-weight: 500; }
.upsell-card__price ins { text-decoration: none; color: var(--upsell-theme-text); }

/* Dynamic caption on product card */
.upsell-card__caption {
    font-size: 11px;
    color: #166534;
    font-weight: 600;
    margin-bottom: 12px;
    background: #effbf3;
    padding: 6px 9px;
    border-radius: 10px;
    display: inline-flex;
    align-self: flex-start;
    line-height: 1.4;
}

.upsell-card__btn {
    display: block;
    text-align: center;
    padding: 10px 12px;
    background: var(--upsell-theme-button-bg);
    color: var(--upsell-theme-button-text) !important;
    border-radius: var(--upsell-theme-button-radius);
    font-size: 12px;
    font-weight: 700;
    font-family: var(--upsell-theme-button-font);
    text-decoration: none;
    transition: filter 0.15s ease, transform 0.15s ease;
    border: 1px solid var(--upsell-theme-button-border);
    cursor: pointer;
    margin-top: auto;
    box-shadow: none;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    align-self: stretch;
    float: none;
}

.upsell-card__btn:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
    color: var(--upsell-theme-button-text) !important;
}

.upsell-card__btn--view {
    background: var(--upsell-theme-subtle-bg) !important;
    color: var(--upsell-theme-text) !important;
    border-color: var(--upsell-theme-border);
    box-shadow: none;
}

.upsell-card__btn--view:hover {
    background: var(--upsell-theme-surface) !important;
    filter: none;
}

/* Badges */
.upsell-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 10px;
    font-weight: 700;
    padding: 5px 9px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    z-index: 1;
    backdrop-filter: blur(6px);
}

.upsell-badge--upsell     { background: rgba(221, 245, 229, 0.95); color: #14532d; }
.upsell-badge--cross_sell { background: rgba(240, 235, 255, 0.95); color: #5b21b6; }

/* =============================================================
   CART PAGE — horizontal banner above cart table
   ============================================================= */
.upsell-widget--cart { margin: 0 0 24px; }

.upsell-cart-banner {
    background: var(--upsell-theme-card-bg);
    border: 1px solid var(--upsell-theme-border);
    border-left: 4px solid var(--upsell-theme-link);
    border-radius: 8px;
    padding: 16px 20px;
}

.upsell-cart-banner__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.upsell-cart-banner__icon { font-size: 20px; }

.upsell-cart-banner__title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--upsell-theme-text);
}

.upsell-cart-banner__sub {
    font-size: 12px;
    color: var(--upsell-theme-muted);
}

.upsell-cart-banner__products {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.upsell-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--upsell-theme-subtle-bg);
    border: 1px solid var(--upsell-theme-border);
    border-radius: 8px;
    padding: 10px 12px;
    min-width: 220px;
    max-width: 320px;
    flex: 1;
    transition: border-color 0.15s;
}

.upsell-cart-item:hover { border-color: var(--upsell-theme-link); }

.upsell-cart-item__img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.upsell-cart-item__info { flex: 1; min-width: 0; }

.upsell-cart-item__name {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--upsell-theme-text);
    text-decoration: none;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upsell-cart-item__name:hover { color: var(--upsell-theme-link); }

.upsell-cart-item__price {
    font-size: 13px;
    font-weight: 600;
    color: var(--upsell-theme-text);
    margin-bottom: 2px;
}

/* Dynamic captions */
.upsell-cart-item__caption {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
    display: inline-block;
    margin-top: 2px;
}

.upsell-cart-item__caption--upgrade {
    background: #e8f4fd;
    color: #0c447c;
}

.upsell-cart-item__caption--save {
    background: #edf7ed;
    color: #1b5e20;
}

.upsell-cart-item__caption--cross {
    background: #f3f0ff;
    color: #4527a0;
}

.upsell-cart-item__btn {
    flex-shrink: 0;
    padding: 7px 14px;
    background: var(--upsell-theme-button-bg);
    color: var(--upsell-theme-button-text) !important;
    border-radius: var(--upsell-theme-button-radius);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--upsell-theme-button-font);
    text-decoration: none;
    border: 1px solid var(--upsell-theme-button-border);
    transition: filter 0.15s ease;
    white-space: nowrap;
}

.upsell-cart-item__btn:hover { filter: brightness(0.95); color: var(--upsell-theme-button-text) !important; }

.upsell-smart-recommendations {
    margin: 24px 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    clear: both;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.upsell-smart-recommendations__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.upsell-smart-recommendations__copy {
    max-width: 62ch;
}

.upsell-smart-recommendations__eyebrow {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e8f1ff;
    color: #0f5ea8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.upsell-smart-recommendations__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--upsell-theme-text);
    padding: 0px !important;
}

.upsell-smart-recommendations__subtitle {
    margin: 10px 0 0;
    margin-bottom: 0px !important;
    font-size: 14px;
    line-height: 1.6;
    color: var(--upsell-theme-muted);
}

.upsell-smart-recommendations__pill {
   display:none;
}

.upsell-smart-recommendations__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
    max-width: 95%;
}

.upsell-smart-recommendations__grid--count-1,
.upsell-smart-recommendations__grid--count-2,
.upsell-smart-recommendations__grid--count-3 {
    grid-template-columns: repeat(var(--upsell-smart-grid-columns), minmax(180px, 250px));
    justify-content: flex-start;
}

.upsell-smart-recommendations__grid--count-1 {
    --upsell-smart-grid-columns: 1;
}

.upsell-smart-recommendations__grid--count-2 {
    --upsell-smart-grid-columns: 2;
}

.upsell-smart-recommendations__grid--count-3 {
    --upsell-smart-grid-columns: 3;
}

.upsell-smart-recommendations__item {
    background: linear-gradient(180deg, var(--upsell-theme-card-bg), var(--upsell-theme-surface));
    border: 1px solid var(--upsell-theme-border);
    border-radius: 14px;
    overflow: hidden;
    padding: 0;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    align-self: stretch;
}

.upsell-smart-recommendations__item:hover {
    transform: translateY(-3px);
    border-color: var(--upsell-theme-border);
}

.upsell-smart-recommendations__image-link {
    display: block;
    text-align: center;
    margin: 0;
    padding: 14px 14px 6px;
    background: radial-gradient(circle at top, var(--upsell-theme-surface), var(--upsell-theme-subtle-bg) 72%);
    min-height: 168px;
}

.upsell-smart-recommendations__image-link img {
    width: 100%;
    height: 148px;
    object-fit: contain;
}

.upsell-smart-recommendations__body {
    padding: 0 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 188px;
}

.upsell-smart-recommendations__badge {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eff8f0;
    color: #166534;
    font-size: 11px;
    font-weight: 700;
}

.upsell-smart-recommendations__name {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    min-height: calc(1.4em * 3);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.upsell-smart-recommendations__name a {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--upsell-theme-text);
    text-decoration: none;
    margin-bottom: 8px;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.upsell-smart-recommendations__name a:hover {
    color: var(--upsell-theme-link);
}

.upsell-smart-recommendations__price {
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--upsell-theme-text);
    margin-top: auto;
}

.upsell-smart-recommendations__price del {
    color: var(--upsell-theme-muted);
    font-weight: 500;
}

.upsell-smart-recommendations__price ins {
    text-decoration: none;
    color: var(--upsell-theme-text);
}

.upsell-smart-recommendations__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: var(--upsell-theme-button-radius);
    border: 1px solid var(--upsell-theme-button-border);
    background: var(--upsell-theme-button-bg);
    color: var(--upsell-theme-button-text) !important;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--upsell-theme-button-font);
    text-decoration: none;
    box-shadow: none;
    margin-top: auto;
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    min-width: 0;
    float: none;
}

.upsell-smart-recommendations__btn:hover {
    filter: brightness(0.95);
    color: var(--upsell-theme-button-text) !important;
}

.upsell-smart-recommendations__btn--ghost {
    background: var(--upsell-theme-subtle-bg);
    color: var(--upsell-theme-text) !important;
    border-color: var(--upsell-theme-border);
    box-shadow: none;
}

.upsell-smart-recommendations--layout-slider .upsell-smart-recommendations__grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    align-items: stretch;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.upsell-smart-recommendations--layout-slider .upsell-smart-recommendations__grid::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.upsell-smart-recommendations--layout-slider .upsell-smart-recommendations__item {
    min-width: 252px;
    max-width: 252px;
    flex: 0 0 252px;
    scroll-snap-align: start;
}

.upsell-widget--compact,
.upsell-smart-recommendations--compact {
    
}

.upsell-widget--compact,
.upsell-smart-recommendations--compact .upsell-smart-recommendations__header {
    margin-bottom: 14px;
    padding-bottom: 10px;
}

.upsell-widget--compact .upsell-product-grid {
    grid-template-columns: 1fr;
    gap: 12px;
}

.upsell-widget--compact .upsell-card {
    display: grid;
    grid-template-columns: 96px 1fr;
    align-items: stretch;
}

.upsell-widget--compact .upsell-card__img-wrap {
    height: 100%;
}

.upsell-widget--compact .upsell-card__img {
    height: 100px;
    padding: 10px;
}

.upsell-widget--compact .upsell-card__body {
    padding: 12px;
    min-width: 0;
}

.upsell-widget--compact .upsell-card__name {
    -webkit-line-clamp: 3;
}

.upsell-widget--compact .upsell-card__btn {
    display: flex;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    margin: auto 0 0;
    align-self: stretch;
    justify-content: center;
}

.upsell-smart-recommendations--compact .upsell-smart-recommendations__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.upsell-smart-recommendations--compact .upsell-smart-recommendations__grid,
.upsell-smart-recommendations--compact.upsell-smart-recommendations--layout-grid .upsell-smart-recommendations__grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible;
}

.upsell-smart-recommendations--compact .upsell-smart-recommendations__item {
    min-width: 0;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 92px 1fr;
    align-items: stretch;
}

.upsell-smart-recommendations--compact.upsell-smart-recommendations--layout-slider .upsell-smart-recommendations__grid {
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    padding-bottom: 8px;
}

.upsell-smart-recommendations--compact.upsell-smart-recommendations--layout-slider .upsell-smart-recommendations__item {
    min-width: 260px;
    flex: 0 0 260px;
    display: grid;
    grid-template-columns: 92px 1fr;
    align-items: stretch;
    scroll-snap-align: start;
}

.upsell-smart-recommendations--compact .upsell-smart-recommendations__image-link {
    padding: 12px;
}

.upsell-smart-recommendations--compact .upsell-smart-recommendations__image-link img {
    height: 92px;
}

.upsell-smart-recommendations--compact .upsell-smart-recommendations__body {
    padding: 12px 12px 12px 0;
    min-width: 0;
}

.upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__btn,
.cart_totals .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__btn,
.wc-block-cart__sidebar .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__btn {
    display: flex;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    margin: auto 0 0;
    justify-content: center;
}

.upsell-smart-recommendations--compact .upsell-smart-recommendations__pill {
    min-width: 0;
}

.upsell-smart-recommendations--cart.upsell-smart-recommendations--compact,
.cart_totals .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact,
.wc-block-cart__sidebar .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact {
    max-width: 560px;
}

.upsell-smart-recommendations--cart-compact {
    width: 100%;
    margin: 24px 0 0;
    overflow: hidden;
}

.upsell-smart-recommendations--cart-compact .upsell-smart-recommendations__header {
    margin-bottom: 0;
}

.upsell-smart-recommendations--cart-compact .upsell-smart-recommendations__copy {
    max-width: 100%;
}

.upsell-smart-recommendations--cart-compact .upsell-carousel-nav {
    gap: 8px;
    margin: 0 0 14px;
}

.upsell-smart-recommendations--cart-compact .upsell-carousel-shell {
    overflow: hidden;
}

.upsell-smart-recommendations--cart-compact .upsell-smart-recommendations__grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    padding: 10px 0 4px;
    margin: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
    max-width: 100%;
}

.upsell-smart-recommendations--cart-compact .upsell-smart-recommendations__grid::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.upsell-smart-recommendations--cart-compact .upsell-smart-recommendations__item {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: stretch;
    min-width: 286px;
    max-width: 286px;
    flex: 0 0 286px;
    scroll-snap-align: start;
    min-height: 168px;
}

.upsell-smart-recommendations--cart-compact .upsell-smart-recommendations__image-link {
    align-items: center;
    align-self: stretch;
    display: flex;
    justify-content: center;
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    padding: 12px;
}

.upsell-smart-recommendations--cart-compact .upsell-smart-recommendations__body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
    min-height: 0;
    padding: 12px 12px 12px 0;
}

.upsell-smart-recommendations--cart-compact .upsell-smart-recommendations__badge {
    align-self: flex-start;
    margin-bottom: 10px;
}

.upsell-smart-recommendations--cart-compact .upsell-smart-recommendations__name {
    margin-bottom: 0;
    min-height: 0;
}

.upsell-smart-recommendations--cart-compact .upsell-smart-recommendations__price {
    margin: 0 0 12px;
}

.upsell-smart-recommendations--cart-compact .upsell-smart-recommendations__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 10px 12px;
    text-decoration: none;
    margin-top: auto;
}

.upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__grid,
.cart_totals .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__grid,
.wc-block-cart__sidebar .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    padding-bottom: 2px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Override to grid when grid layout is selected */
.upsell-smart-recommendations--cart.upsell-smart-recommendations--compact.upsell-smart-recommendations--layout-grid .upsell-smart-recommendations__grid,
.cart_totals .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact.upsell-smart-recommendations--layout-grid .upsell-smart-recommendations__grid,
.wc-block-cart__sidebar .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact.upsell-smart-recommendations--layout-grid .upsell-smart-recommendations__grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
    flex-wrap: unset !important;
    overflow: visible !important;
    flex-direction: unset !important;
    scroll-snap-type: unset !important;
    scroll-behavior: unset !important;
    padding-bottom: unset !important;
}

.upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__grid::-webkit-scrollbar,
.cart_totals .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__grid::-webkit-scrollbar,
.wc-block-cart__sidebar .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__grid::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__item,
.cart_totals .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__item,
.wc-block-cart__sidebar .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__item {
    min-width: 260px !important;
    max-width: 260px;
    flex: 0 0 260px !important;
    display: grid !important;
    grid-template-columns: 92px 1fr;
    align-items: stretch;
    scroll-snap-align: start;
    min-height: 100%;
}

.upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__image-link,
.cart_totals .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__image-link,
.wc-block-cart__sidebar .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__image-link {
    width: 92px;
    min-width: 92px;
    max-width: 92px;
    padding: 12px;
}

.upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__body,
.cart_totals .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__body,
.wc-block-cart__sidebar .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__body {
    min-width: 0;
    width: 100%;
}

.upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__name,
.cart_totals .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__name,
.wc-block-cart__sidebar .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__name {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__pill,
.cart_totals .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__pill,
.wc-block-cart__sidebar .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__pill {
    display: none !important;
}

.upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__name,
.cart_totals .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__name,
.wc-block-cart__sidebar .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__name {
    font-size: 14px;
    line-height: 1.35;
}

.upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__btn,
.cart_totals .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__btn,
.wc-block-cart__sidebar .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact .upsell-smart-recommendations__btn {
    background: var(--upsell-theme-button-bg) !important;
    color: var(--upsell-theme-button-text) !important;
    border: 1px solid var(--upsell-theme-button-border) !important;
    text-decoration: none !important;
}

.upsell-widget--hook-before_cart_totals,
.upsell-smart-recommendations--hook-before_cart_totals,
.upsell-widget--hook-after_cart_totals,
.upsell-smart-recommendations--hook-after_cart_totals,
.upsell-smart-recommendations--hook-before_cart_totals {
    max-width: none;
    width: 100%;
    margin: 16px 0 0;
    box-sizing: border-box;
}

.cart_totals .upsell-widget--hook-before_cart_totals,
.cart_totals .upsell-smart-recommendations--hook-before_cart_totals,
.cart_totals .upsell-widget--hook-after_cart_totals,
.cart_totals .upsell-smart-recommendations--hook-after_cart_totals,
.wc-block-cart__sidebar .upsell-widget--hook-before_cart_totals,
.wc-block-cart__sidebar .upsell-smart-recommendations--hook-before_cart_totals,
.wc-block-cart__sidebar .upsell-widget--hook-after_cart_totals,
.wc-block-cart__sidebar .upsell-smart-recommendations--hook-after_cart_totals,
.wc-block-cart__sidebar .upsell-smart-recommendations--hook-before_cart_totals {
    margin-top: 14px;
}

.upsell-widget--hook-after_cart_totals,
.upsell-smart-recommendations--hook-after_cart_totals {
    clear: both;
    margin: 16px 0 0;
    box-sizing: border-box;
}

.upsell-widget--hook-before_cart_totals.upsell-widget--compact,
.upsell-widget--hook-after_cart_totals.upsell-widget--compact,
.cart_totals .upsell-widget--hook-before_cart_totals.upsell-widget--compact,
.cart_totals .upsell-widget--hook-after_cart_totals.upsell-widget--compact,
.wc-block-cart__sidebar .upsell-widget--hook-before_cart_totals.upsell-widget--compact,
.wc-block-cart__sidebar .upsell-widget--hook-after_cart_totals.upsell-widget--compact {
    max-width: 560px;
}

.upsell-widget--hook-before_cart_totals.upsell-widget--compact .upsell-product-grid,
.upsell-widget--hook-after_cart_totals.upsell-widget--compact .upsell-product-grid {
    grid-template-columns: repeat(2, 1fr);
}

.upsell-widget--hook-before_cart_totals.upsell-widget--compact .upsell-card,
.upsell-widget--hook-after_cart_totals.upsell-widget--compact .upsell-card {
    display: grid;
    grid-template-columns: 88px 1fr;
    align-items: stretch;
}

.upsell-widget--hook-before_cart_totals.upsell-widget--compact .upsell-card__img,
.upsell-widget--hook-after_cart_totals.upsell-widget--compact .upsell-card__img {
    height: 88px;
    padding: 10px;
}

.upsell-widget--hook-before_cart_totals.upsell-widget--compact .upsell-card__body,
.upsell-widget--hook-after_cart_totals.upsell-widget--compact .upsell-card__body {
    padding: 12px;
}

.upsell-widget--hook-before_cart_totals.upsell-widget--compact .upsell-card__btn,
.upsell-widget--hook-after_cart_totals.upsell-widget--compact .upsell-card__btn {
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    align-self: stretch;
    padding-inline: 12px;
    margin-left: 0;
    margin-right: 0;
}

.upsell-smart-recommendations--hook-before_cart_totals.upsell-smart-recommendations--compact,
.upsell-smart-recommendations--hook-after_cart_totals.upsell-smart-recommendations--compact,
.cart_totals .upsell-smart-recommendations--hook-before_cart_totals.upsell-smart-recommendations--compact,
.cart_totals .upsell-smart-recommendations--hook-after_cart_totals.upsell-smart-recommendations--compact,
.wc-block-cart__sidebar .upsell-smart-recommendations--hook-before_cart_totals.upsell-smart-recommendations--compact,
.wc-block-cart__sidebar .upsell-smart-recommendations--hook-after_cart_totals.upsell-smart-recommendations--compact {
    max-width: 560px;
}

.upsell-smart-recommendations--hook-after_cart_totals.upsell-smart-recommendations--compact,
.cart_totals .upsell-smart-recommendations--hook-after_cart_totals.upsell-smart-recommendations--compact,
.wc-block-cart__sidebar .upsell-smart-recommendations--hook-after_cart_totals.upsell-smart-recommendations--compact {
    width: 100%;
    max-width: 570px;
    margin-top: 0px !important;
    padding-top: 0px !important;
    margin-left: auto;
    margin-right: 0;
    clear: none;
    float: none;
}

@media (max-width: 600px) {
    .upsell-widget__header          { gap: 10px; padding-bottom: 12px; }
    .upsell-widget__title           { font-size: 16px; }
    .upsell-widget__sub             { font-size: 12px; }
    .upsell-product-grid            { grid-template-columns: 1fr; gap: 12px; }
    .upsell-cart-banner__products   { flex-direction: column; }
    .upsell-cart-item               { max-width: 100%; }
    .upsell-last-chance__products   { flex-direction: column; }
    .upsell-lc-item                 { max-width: 100%; }
    .upsell-card__img               { height: 140px; padding: 12px; }
    .upsell-smart-recommendations   { padding: 18px; border-radius: 18px; }
    .upsell-smart-recommendations__header { flex-direction: column; align-items: flex-start; }
    .upsell-smart-recommendations__title { font-size: 20px; }
    .upsell-smart-recommendations__subtitle { font-size: 13px; }
    .upsell-smart-recommendations__grid { grid-template-columns: 1fr; gap: 14px; }
    .upsell-smart-recommendations__image-link img { height: 160px; }
    .upsell-smart-recommendations--layout-slider .upsell-smart-recommendations__item { min-width: 210px; flex-basis: 210px; }
    .upsell-widget--compact .upsell-card,
    .upsell-smart-recommendations--compact .upsell-smart-recommendations__item { grid-template-columns: 82px 1fr; }
    .upsell-widget--compact .upsell-card__img,
    .upsell-smart-recommendations--compact .upsell-smart-recommendations__image-link img { height: 82px; }
}
@media (max-width: 768px) {
    .upsell-widget--hook-before_cart_totals.upsell-widget--compact .upsell-product-grid,
    .upsell-widget--hook-after_cart_totals.upsell-widget--compact .upsell-product-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* Mobile */
@media (max-width: 480px) {
    .upsell-widget--hook-before_cart_totals.upsell-widget--compact .upsell-product-grid,
    .upsell-widget--hook-after_cart_totals.upsell-widget--compact .upsell-product-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}
/* Tablet */
@media (max-width: 768px) {
    .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact.upsell-smart-recommendations--layout-grid .upsell-smart-recommendations__grid,
    .cart_totals .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact.upsell-smart-recommendations--layout-grid .upsell-smart-recommendations__grid,
    .wc-block-cart__sidebar .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact.upsell-smart-recommendations--layout-grid .upsell-smart-recommendations__grid {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact.upsell-smart-recommendations--layout-grid .upsell-smart-recommendations__grid,
    .cart_totals .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact.upsell-smart-recommendations--layout-grid .upsell-smart-recommendations__grid,
    .wc-block-cart__sidebar .upsell-smart-recommendations--cart.upsell-smart-recommendations--compact.upsell-smart-recommendations--layout-grid .upsell-smart-recommendations__grid {
        grid-template-columns: 1fr !important;
    }
}
