.uepb-price-with-badge {
    align-items: center;
    display: flex;
    gap: 0.65rem;
    justify-content: space-between;
    max-width: 100%;
    width: 100%;
}

.uepb-price-with-badge__price {
    display: inline-block;
    flex: 1 1 auto;
    min-width: 0;
}

.uepb-bundle-discount-badge {
    align-items: center;
    background: var(--uepb-badge-bg, #111827);
    border-radius: 999px;
    color: var(--uepb-badge-color, #fff);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1;
    margin-left: auto;
    padding: 0.36rem 0.58rem;
    white-space: nowrap;
}

.woocommerce ul.products li.product .price .uepb-price-with-badge,
.woocommerce-page ul.products li.product .price .uepb-price-with-badge,
.price-wrapper .uepb-price-with-badge,
.product-page-price .uepb-price-with-badge {
    display: flex;
}

/* Flatsome product boxes render prices inside .product-small .price-wrapper.
   These selectors keep the discount badge on the same line as the price in archive cards. */
.product-small .box-text .price-wrapper,
.product-small.box .box-text .price-wrapper,
.woocommerce .product-small .price-wrapper {
    overflow: visible;
}

.product-small .box-text .price-wrapper > .price,
.product-small.box .box-text .price-wrapper > .price,
.woocommerce .product-small .price-wrapper > .price {
    display: block;
    max-width: 100%;
    width: 100%;
}

.product-small .box-text .price-wrapper .uepb-price-with-badge,
.product-small.box .box-text .price-wrapper .uepb-price-with-badge,
.woocommerce .product-small .price-wrapper .uepb-price-with-badge {
    align-items: center;
    display: flex !important;
    flex-wrap: nowrap;
    gap: 0.45rem;
    justify-content: center;
    max-width: 100%;
    min-width: 0;
    width: 100%;
}

.product-small .box-text .price-wrapper .uepb-price-with-badge__price,
.product-small.box .box-text .price-wrapper .uepb-price-with-badge__price,
.woocommerce .product-small .price-wrapper .uepb-price-with-badge__price {
    flex: 0 1 auto;
    min-width: 0;
}

.product-small .box-text .price-wrapper .uepb-bundle-discount-badge--price,
.product-small.box .box-text .price-wrapper .uepb-bundle-discount-badge--price,
.woocommerce .product-small .price-wrapper .uepb-bundle-discount-badge--price {
    font-size: 0.62rem;
    margin-left: 0;
    padding: 0.25rem 0.45rem;
    transform: translateY(-1px);
}

.ux-slider .product-small .price-wrapper .uepb-price-with-badge,
.slider-wrapper .product-small .price-wrapper .uepb-price-with-badge,
.flickity-slider .product-small .price-wrapper .uepb-price-with-badge,
.row-slider .product-small .price-wrapper .uepb-price-with-badge {
    align-items: center;
    display: flex !important;
    flex-wrap: nowrap;
    gap: 0.45rem;
    justify-content: center;
    max-width: 100%;
    min-width: 0;
    width: 100%;
}

.ux-slider .product-small .price-wrapper .uepb-bundle-discount-badge--price,
.slider-wrapper .product-small .price-wrapper .uepb-bundle-discount-badge--price,
.flickity-slider .product-small .price-wrapper .uepb-bundle-discount-badge--price,
.row-slider .product-small .price-wrapper .uepb-bundle-discount-badge--price {
    font-size: 0.62rem;
    margin-left: 0;
    padding: 0.25rem 0.45rem;
    transform: translateY(-1px);
}

.single-product .price-wrapper .uepb-price-with-badge,
.single-product .product-page-price .uepb-price-with-badge {
    justify-content: flex-start;
}

.single-product .price-wrapper > .price,
.single-product .product-page-price {
    max-width: 100%;
}

.uepb-single-bundle-contents {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    margin: 1rem 0;
    overflow: visible !important;
    background: #fff;
    position: relative;
    z-index: 1;
}

.uepb-bundle-accordion-summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    list-style: none;
    padding: 1rem;
    user-select: none;
}

.uepb-bundle-accordion-summary::-webkit-details-marker {
    display: none;
}

.uepb-bundle-accordion-title {
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.uepb-bundle-accordion-icon {
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    display: inline-block;
    flex: 0 0 auto;
    height: 0.55rem;
    opacity: 0.7;
    transform: rotate(45deg);
    transition: transform 160ms ease-in-out;
    width: 0.55rem;
}

.uepb-single-bundle-contents[open] .uepb-bundle-accordion-icon {
    transform: rotate(-135deg);
}

.uepb-bundle-accordion-panel {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    overflow: visible !important;
    padding: 0.25rem 1rem 1rem;
    position: relative;
    z-index: 2;
}

.uepb-bundle-product-list {
    list-style: none;
    margin: 0;
    overflow: visible !important;
    padding: 0;
}

.uepb-bundle-product-row {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    min-width: 0;
    overflow: visible !important;
    padding: 0.55rem 0;
    position: relative;
}

.uepb-bundle-product-row + .uepb-bundle-product-row {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.uepb-bundle-product-media-wrap {
    display: inline-flex;
    flex: 0 0 42px;
    height: 42px;
    outline: none;
    position: relative;
    width: 42px;
    z-index: 1;
}

.uepb-bundle-product-media-wrap:hover,
.uepb-bundle-product-media-wrap:focus-visible,
.uepb-bundle-product-media-wrap:focus-within {
    z-index: 2147483647;
}

.uepb-bundle-product-media {
    align-items: center;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 0.45rem;
    display: inline-flex;
    height: 42px;
    justify-content: center;
    overflow: hidden;
    width: 42px;
}

.uepb-bundle-product-image {
    aspect-ratio: 1 / 1;
    display: block;
    height: 100%;
    margin: 0;
    max-height: 42px;
    max-width: 42px;
    object-fit: cover;
    width: 100%;
}

.uepb-bundle-product-name {
    align-items: baseline;
    display: flex;
    flex: 1 1 auto;
    gap: 0.25rem;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.uepb-bundle-product-title {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.uepb-bundle-product-qty {
    flex: 0 0 auto;
    opacity: 0.72;
    white-space: nowrap;
}

.uepb-bundle-product-price {
    flex: 0 0 auto;
    font-size: 0.86em;
    font-weight: 600;
    line-height: 1.2;
    scale: 55%;
    text-align: right;
    transform-origin: right center;
    white-space: nowrap;
}

.uepb-bundle-product-price .amount,
.uepb-bundle-product-price .woocommerce-Price-amount {
    font-size: inherit;
    line-height: inherit;
}

.uepb-bundle-product-price del {
    display: block;
    font-size: 0.82em;
    font-weight: 400;
    opacity: 0.65;
}

.uepb-bundle-line {
    display: inline-block;
    font-size: 0.92em;
    opacity: 0.82;
    padding-top: 0.1rem;
}

@media (max-width: 480px) {
    .uepb-bundle-accordion-summary {
        padding: 0.85rem;
    }

    .uepb-bundle-accordion-panel {
        padding: 0.15rem 0.85rem 0.85rem;
    }

    .uepb-bundle-product-row {
        gap: 0.55rem;
    }

    .uepb-bundle-product-media-wrap,
    .uepb-bundle-product-media {
        flex-basis: 36px;
        height: 36px;
        width: 36px;
    }

    .uepb-bundle-product-image {
        max-height: 36px;
        max-width: 36px;
    }

    .uepb-bundle-product-price {
        font-size: 0.82em;
    }
}


.uepb-bundle-product-media > * {
    display: block;
    height: 100%;
    width: 100%;
}

.uepb-bundle-product-media .wcst-product-preview,
.uepb-bundle-product-media .wcst-preview-stage {
    display: block;
    height: 100%;
    width: 100%;
}

.uepb-bundle-product-media .wcst-preview-stage svg,
.uepb-bundle-product-media .wcst-live-sign-svg,
.uepb-bundle-product-media img {
    display: block;
    height: 100% !important;
    margin: 0;
    width: 100% !important;
}

.uepb-bundle-product-media .wcst-preview-stage svg,
.uepb-bundle-product-media .wcst-live-sign-svg {
    aspect-ratio: 1 / 1 !important;
}

.uepb-bundle-product-media .wcst-product-preview script {
    display: none !important;
}


.uepb-bundle-product-media-tooltip {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 0.75rem;
    bottom: calc(100% + 0.65rem);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
    display: inline-flex;
    height: 150px;
    justify-content: center;
    left: 50%;
    opacity: 0;
    overflow: visible;
    padding: 0.45rem;
    pointer-events: none;
    position: absolute;
    transform: translateX(-50%) translateY(6px) scale(0.96);
    transform-origin: bottom center;
    transition: opacity 140ms ease, transform 140ms ease;
    visibility: hidden;
    width: 150px;
    z-index: 2147483647;
}

.uepb-bundle-product-media-tooltip::after {
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid #fff;
    bottom: -7px;
    content: "";
    height: 0;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
    width: 0;
}

.uepb-bundle-product-media-wrap:hover .uepb-bundle-product-media-tooltip,
.uepb-bundle-product-media-wrap:focus-visible .uepb-bundle-product-media-tooltip,
.uepb-bundle-product-media-wrap:focus-within .uepb-bundle-product-media-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
    visibility: visible;
}

.uepb-bundle-product-media-tooltip > *,
.uepb-bundle-product-media-tooltip .wcst-product-preview,
.uepb-bundle-product-media-tooltip .wcst-preview-stage {
    border-radius: 0.55rem;
    display: block;
    height: 100%;
    overflow: hidden;
    width: 100%;
}

.uepb-bundle-product-media-tooltip img,
.uepb-bundle-product-media-tooltip svg,
.uepb-bundle-product-media-tooltip .wcst-live-sign-svg {
    display: block;
    height: 100% !important;
    margin: 0;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    width: 100% !important;
}

.uepb-bundle-product-media-tooltip .wcst-product-preview script {
    display: none !important;
}

@media (hover: none), (max-width: 640px) {
    .uepb-bundle-product-media-tooltip {
        display: none;
    }
}


/* Keep the tooltip local to the bundle image, but allow it to rise above the accordion. */
.single-product .product,
.single-product .product-main,
.single-product .product-info,
.single-product .product-summary,
.single-product .summary,
.single-product .entry-summary,
.uepb-single-bundle-contents,
.uepb-single-bundle-contents[open],
.uepb-bundle-accordion-summary,
.uepb-bundle-accordion-panel,
.uepb-bundle-product-list,
.uepb-bundle-product-row {
    overflow: visible !important;
}


.uepb-bundle-accordion-panel {
    isolation: isolate;
}

.uepb-bundle-product-media-wrap:hover,
.uepb-bundle-product-media-wrap:focus-visible,
.uepb-bundle-product-media-wrap:focus-within {
    position: relative;
    z-index: 100000;
}

.uepb-bundle-product-media-tooltip {
    z-index: 100001 !important;
}
