/* Aplitap adds the reference line to several different price containers. */
body :is(.price, .cp-shop-card__price, .product__price, .cp-cart__metric-value--price, .cp-cart-recommendations__price, .custom-search-result-price):has(> .sidrena-cijena),
body .single-article.cp-product-view ul.products li.product .price:has(> .sidrena-cijena) {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: baseline !important;
    gap: 6px 10px !important;
    min-width: 0;
    max-width: 100%;
}

/* Homepage/routine cards output price HTML without WooCommerce's .price wrapper. */
body .cp-shop-card .cp-shop-card__price:has(.sidrena-cijena) {
    width: 100%;
    min-width: 0;
}

body .sidrena-cijena {
    display: block;
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    color: #6b6474;
    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
    font-style: normal;
    line-height: 1.5;
    letter-spacing: normal;
    text-align: start;
    text-transform: none;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Keep nested amounts from inheriting the large, bold selling-price rules. */
body :is(.price, .cp-shop-card__price, .product__price, .cp-cart__metric-value, .cp-cart-recommendations__price, .custom-search-result-price) .sidrena-cijena :is(.woocommerce-Price-amount.amount, bdi, .woocommerce-Price-currencySymbol),
body .cp-shop-card .cp-shop-card__price .sidrena-cijena :is(.woocommerce-Price-amount.amount, bdi, .woocommerce-Price-currencySymbol),
body.woocommerce :is(.related.products, .upsells.products, .cross-sells) .cp-shop-card .price .sidrena-cijena :is(.woocommerce-Price-amount.amount, bdi, .woocommerce-Price-currencySymbol) {
    display: inline !important;
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    font-style: inherit !important;
    line-height: inherit !important;
    letter-spacing: normal !important;
    text-decoration: none !important;
    white-space: nowrap;
}

/* The original checkout pill was sized for a single selling price. */
body .checkout .woocommerce-checkout-review-order-table .product__price:has(> .sidrena-cijena) {
    width: 100%;
    padding: 0;
    border-radius: 0;
    background: transparent;
}

@media (max-width: 760px) {
    /* Let the reference use the full row below price, quantity and total. */
    body .cp-cart__metric--price:has(.sidrena-cijena),
    body .cp-cart__metric--price .cp-cart__metric-value--price:has(> .sidrena-cijena) {
        display: contents !important;
    }

    body .cp-cart__metric-value--price:has(> .sidrena-cijena) > :not(.sidrena-cijena):not(.screen-reader-text) {
        grid-column: 1;
        grid-row: 1;
    }

    body .cp-cart__item-side:has(.sidrena-cijena) .cp-cart__metric--quantity {
        grid-column: 2;
        grid-row: 1;
    }

    body .cp-cart__item-side:has(.sidrena-cijena) .cp-cart__metric--total {
        grid-column: 3;
        grid-row: 1;
    }

    body .cp-cart__metric-value--price > .sidrena-cijena {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

.custom-search-result-price del {
    font-weight: 400;
    opacity: 1;
}

.custom-search-result-price ins {
    background: none;
    text-decoration: underline;
    font-weight: 400;
}
