/* Soft360 Omnibus Price Label
   Renders "XXX zł taniej" badge computed against 30-day lowest price.
   Core PrestaShop discount badge is hidden via inline <style> emitted alongside the badge
   (so the fallback path — no omnibus data — keeps the core badge visible). */

.soft360-price-saving {
    display: inline-block;
    padding: 4px 16px;
    background: #FAE5E5;
    color: #DD4848;
    border-radius: 99px;
    font-family: Poppins, sans-serif;
    font-size: 13px;
    font-style: normal;
    font-weight: 600;
    line-height: 21px;
    white-space: nowrap;
    vertical-align: middle;
}

@media (max-width: 767px) {
    .soft360-price-saving {
        font-size: 12px;
        padding: 3px 9px;
        margin-left: 6px;
        line-height: 18px;
    }
}

/* Hide the crossed-out regular price next to the current price — always. */
.product-prices .regular-price,
.product-price-and-shipping .regular-price {
    display: none !important;
}

/* Theme hides the product-flag "discount" inside pos-special-products slider —
   re-show it (we render it as "Promocja", not as the old discount amount). */
.pos-special-products .product-flag .discount {
    display: block !important;
}

/* For pack products, suppress the "Promocja" flag (keep only the "Pakiet" flag). */
.product-flag:has(.pack) .discount {
    display: none !important;
}

/* For pack products, also hide the x13pricehistory omnibus line.
   - Listings: pack miniatures carry .product-flag .pack.
   - PDP: pack pages render .ap5-pack-product blocks (advancedpack) instead of a flag. */
article:has(.product-flag .pack) .x13pricehistory-product-list,
article:has(.product-flag .pack) .x13pricehistory,
#main:has(.product-flag .pack) .x13pricehistory,
#main:has(.product-flag .pack) .x13pricehistory-product-list,
#main:has(.ap5-pack-product) .x13pricehistory,
#main:has(.ap5-pack-product) .x13pricehistory-product-list {
    display: none !important;
}

/* Hide PrestaShop core discount badge (PDP + miniature) — replaced by our omnibus badge
   when available, otherwise the product-flag "Promocja" stays as the visual cue. */
#price-block .discount.discount-amount,
#price-block .discount.discount-percentage,
.product-price-and-shipping .discount-amount.discount-product,
.product-price-and-shipping .discount-percentage.discount-product,
.ap5-pack-product-reduction-value {
    display: none !important;
}

/* Theme hides `.product-price.has-discount .product-discount` entirely; re-show it
   when our badge sits inside, otherwise the badge is hidden too. */
.product-price.has-discount .product-discount:has(.soft360-price-saving) {
    display: inline-block !important;
}

/* On product listings (.product-price-and-shipping is flex; .x13pricehistory-product-list
   uses order:99 + width:100% to wrap to next line). Slot our badge between .price (order 0)
   and the x13pricehistory omnibus line. */
.product-price-and-shipping .soft360-price-saving--list {
    order: 1;
    color: #DD4848;
    text-align: right;
    font-family: Poppins;
    font-size: 13px;
    font-style: normal;
    font-weight: 600;
    padding: 4px 16px;
    line-height: 21px; /* 161.538% */
}

/* Breakpoint-driven layout. Apply the "badge on own row" treatment only at the multi-column
   range (sm/md/lg/xl-1: 768–1399px) where the card is too narrow for inline.
   Below sm (≤767px) the layout is single column / wide card row — badge stays inline next
   to the price and the omnibus line sits naturally underneath. */
@media (min-width: 768px) and (max-width: 1399.98px) {
    .product-price-and-shipping > .price {
        flex-basis: 100%;
    }
    .product-price-and-shipping .soft360-price-saving--list {
        margin-top: 12px;
        text-align: left;
    }
}

/* Strikethrough the 30-day lowest price text rendered by x13pricehistory. */
.x13pricehistory__text--before-discount strong,
.x13pricehistory__text--before-discount .x13pricehistory__lowest-price,
.x13pricehistory-product-list__omnibus-price {
    color: #9CA3AF;
    font-weight: 600;
}

/* Hide x13pricehistory's own discount badge — we replace it with our omnibus badge. */
.x13pricehistory__text--real-discount-value,
.x13pricehistory-product-list .price-percent-reduction,
.x13pricehistory-product-list .discount {
    display: none !important;
}
