/**
 * Peaks - single-product promotional sale callout.
 *
 * Rendered by inc/woo/WooProductSale.php, kept in sync for variable products
 * by assets/js/product-sale.js.
 *
 * Colours/radii are taken from the theme's existing tokens and from the
 * purchase-option cards this sits above, so the callout reads as part of the
 * product column rather than an advert:
 *   --purple-light  #f6f1fb  card background
 *   #d9d5ef                  same hairline border as .product-purchase-option__label
 *   --violet        #6057a6  badge + sale price
 *   --violet-dark   #292642  headings / body text
 */

.theme-product-sale {
    /* Matches the .product-purchase-options rhythm directly below it. */
    margin: 16px 0 24px;
    padding: 16px;
    border: 1px solid #d9d5ef;
    border-radius: 16px;
    background: var(--purple-light, #f6f1fb);
    font-family: var(--font-family);
}

/*
 * The card is rendered as a `hidden` shell for variable products and only
 * revealed once an on-sale variation is selected. `display` below would
 * otherwise beat the user-agent [hidden] rule on specificity, so re-assert it.
 */
.theme-product-sale[hidden] {
    display: none !important;
}

.theme-product-sale__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.theme-product-sale__badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--violet, #6057a6);
    color: var(--white, #fff);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.theme-product-sale__limited {
    color: var(--grey-dark, #444);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
}

.theme-product-sale__limited[hidden] {
    display: none !important;
}

.theme-product-sale__title {
    margin: 0 0 6px;
    color: var(--violet-dark, #292642);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.theme-product-sale__pricing {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    margin: 0 0 6px;
}

/* Regular price - muted + struck through. */
.theme-product-sale__pricing del {
    color: #777;
    font-size: 18px;
    font-weight: 400;
    text-decoration: line-through;
}

/* Sale price - same treatment as .product-purchase-option__price. */
.theme-product-sale__pricing ins {
    color: var(--violet, #6057a6);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    background: transparent;
}

.theme-product-sale__savings {
    margin: 0;
    color: var(--violet-dark, #292642);
    font-size: 15px;
    line-height: 1.4;
}

/*
 * wc_format_sale_price() pairs the aria-hidden <del>/<ins> with screen-reader
 * copy. The theme disables WooCommerce's own stylesheet
 * (woocommerce_enqueue_styles => __return_false), which is what normally hides
 * .screen-reader-text, so scope that rule here or the prices render twice.
 */
.theme-product-sale .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 480px) {
    .theme-product-sale__pricing ins {
        /* Mirrors the mobile step-down used by .subscription-price ins. */
        font-size: 24px;
    }

    .theme-product-sale__header {
        /* Keep the badge and "Limited time" readable rather than cramped. */
        align-items: flex-start;
    }
}
