/*
 * Black Friday: sale badge
 *
 * While the Black Friday sale is on, the red "SALE!" pill on products is shown
 * as the stacked BLACK / FRIDAY sticker lock-up from the hero slide.
 *
 * Loaded only while "Black Friday Sale Badge" is ticked in the Customizer
 * (Appearance → Customize → Shop & Product Display). Untick it after the sale
 * and the normal "SALE!" pill comes back.
 *
 * The badge markup and its default styling live in the
 * soulcountry-product-template-block plugin; these rules only restyle it.
 * The original "Sale" text stays in the page for screen readers.
 *
 * Artwork: sale-badge-black-friday.svg (cream stickers, red lettering, as on the
 * slide). sale-badge-black-friday-red.svg is the colour-swapped twin.
 */

/* Product cards (shop, collections, homepage) and the WooCommerce block badge */
body .custom-product-template .product-image-wrapper .product-sale-badge,
body .wc-block-components-product-sale-badge {
    top: 8px !important;
    left: 8px !important;
    /* about a quarter of the product image: 100px on desktop cards, smaller in narrow grids */
    width: clamp(62px, 26%, 100px) !important;
    height: auto !important;
    aspect-ratio: 380 / 234;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: url('sale-badge-black-friday.svg') left top / contain no-repeat !important;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.22));
    overflow: hidden;
    white-space: nowrap;
    text-indent: -9999px;
    pointer-events: none;
}

/* Product page gallery (badge added by cakeclub_product_gallery_sale_badge()) */
body .scgallery__main .cc-gallery-sale-badge {
    /* fixed fallback first; browsers with container query units scale it with the image */
    width: 120px;
    width: clamp(96px, 22cqw, 150px);
    aspect-ratio: 380 / 234;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: url('sale-badge-black-friday.svg') left top / contain no-repeat;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.22));
    overflow: hidden;
    white-space: nowrap;
    text-indent: -9999px;
}

/* Small "also viewed" thumbnails */
body .ccav__sale-badge {
    top: 4px;
    left: 4px;
    width: 46px;
    aspect-ratio: 380 / 234;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: url('sale-badge-black-friday.svg') left top / contain no-repeat;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.22));
    overflow: hidden;
    white-space: nowrap;
    text-indent: -9999px;
}
