/**
 * Mini Cart Pricing Fix
 *
 * @package eRide Theme
 * @version 1.1.0
 * @created 2025-12-13
 * @updated 2025-12-13
 *
 * Fixes duplicate pricing display in WooCommerce mini-cart.
 * Problem: WooCommerce renders multiple price elements even when no discount:
 *   1. .wc-block-components-product-price__value (first)
 *   2. .wc-block-components-product-price__regular
 *   3. .wc-block-components-product-price__value (second)
 *
 * Solution: Hide regular price and second value when no actual discount exists.
 */

/* ============================================
   AGGRESSIVE FIX: Hide duplicate prices in mini-cart
   When there's no actual discount (no .is-discounted class)
   ============================================ */

/* Hide the "regular" price element entirely when no discount */
.wc-block-mini-cart__drawer .wc-block-components-product-price__regular {
    display: none !important;
}

/* Only show regular price when followed by actual discounted price */
.wc-block-mini-cart__drawer .wc-block-components-product-price:has(.is-discounted) .wc-block-components-product-price__regular {
    display: inline !important;
    text-decoration: line-through;
    opacity: 0.6;
    font-size: 0.9em;
}

/* Hide duplicate value elements - only show the first one */
.wc-block-mini-cart__drawer .wc-block-components-product-price .wc-block-components-product-price__value ~ .wc-block-components-product-price__value {
    display: none !important;
}

/* ============================================
   Mini-Cart Container Styling
   ============================================ */

/* Clean single price display */
.wc-block-mini-cart__drawer .wc-block-components-product-price {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

/* ============================================
   Fallback for browsers without :has() support
   ============================================ */
@supports not selector(:has(*)) {
    /* For older browsers, just hide the regular price always in mini-cart */
    .wc-block-mini-cart__drawer .wc-block-components-product-price__regular {
        display: none !important;
    }
}
