/* Best Seller / New / Sale Badges for WooCommerce
   ------------------------------------------------ */

/* Make sure product image wrappers are positioning contexts */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
.woocommerce div.product .woocommerce-product-gallery {
    position: relative;
}

/* Hide the default WooCommerce sale flash (we replace it) */
.bsns-replace-default .onsale,
.bsns-replace-default span.onsale {
    display: none !important;
}

/* Badge stacks --------------------------------------------------- */
.bsns-badges {
    position: absolute;
    top: 10px;
    z-index: 9;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.bsns-badges--right { right: 10px; align-items: flex-end; }
.bsns-badges--left  { left: 0;     align-items: flex-start; }

.bsns-badge {
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
    color: #fff;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* -- Discount seal (red starburst) ------------------------------- */
.bsns-badge--sale {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20100%22%3E%3Cpolygon%20points%3D%2250.00%2C0.00%2041.51%2C7.34%2030.87%2C3.81%2025.83%2C13.83%2014.64%2C14.64%2013.83%2C25.83%203.81%2C30.87%207.34%2C41.51%200.00%2C50.00%207.34%2C58.49%203.81%2C69.13%2013.83%2C74.17%2014.64%2C85.36%2025.83%2C86.17%2030.87%2C96.19%2041.51%2C92.66%2050.00%2C100.00%2058.49%2C92.66%2069.13%2C96.19%2074.17%2C86.17%2085.36%2C85.36%2086.17%2C74.17%2096.19%2C69.13%2092.66%2C58.49%20100.00%2C50.00%2092.66%2C41.51%2096.19%2C30.87%2086.17%2C25.83%2085.36%2C14.64%2074.17%2C13.83%2069.13%2C3.81%2058.49%2C7.34%22%20fill%3D%22%23C23440%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
}

/* -- "НОВО" pin (blue teardrop) ---------------------------------- */
.bsns-badge--new {
    width: 48px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 12px;            /* nudge text into the round body */
    font-size: 13px;
    letter-spacing: .3px;
    background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20118%22%3E%3Cpath%20d%3D%22M50%20116%20C%2033%2095%208%2080%208%2045%20a%2042%2042%200%201%201%2084%200%20C%2092%2080%2067%2095%2050%20116%20Z%22%20fill%3D%22%23326E97%22%2F%3E%3C%2Fsvg%3E") top center/contain no-repeat;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
}

/* -- "НАЙ-ПРОДАВАН" ribbon (red banner) -------------------------- */
.bsns-ribbon {
    position: relative;
    display: inline-block;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
}
.bsns-ribbon__body {
    display: block;
    background: linear-gradient(180deg, #cf3744 0%, #bc2f3b 55%, #b02b36 100%);
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    font-size: 12px;
    line-height: 1;
    padding: 8px 22px 8px 12px;
    white-space: nowrap;
    clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%);
}
/* small darker "fold" tail at the bottom-left */
.bsns-ribbon::after {
    content: "";
    position: absolute;
    left: 0;
    top: 100%;
    width: 0; height: 0;
    border-top: 6px solid #7d1f27;
    border-left: 7px solid transparent;
}

/* Slightly larger badges on the single product page -------------- */
.single-product .bsns-badge--sale { width: 64px; height: 64px; font-size: 17px; }
.single-product .bsns-badge--new  { width: 60px; height: 70px; font-size: 16px; padding-bottom: 15px; }
.single-product .bsns-ribbon__body { font-size: 14px; padding: 9px 26px 9px 14px; }
.single-product .bsns-badges { top: 14px; }
.single-product .bsns-badges--right { right: 14px; }

/* Elementor Loop Grid / Loop Carousel support -------------------- */
/* The shortcode wrapper generates no box of its own, so the badges
   anchor to the loop item instead of the Shortcode widget. */
.bsns-shortcode { display: contents; }

/* Make each Elementor loop item a positioning context so top-right /
   top-left badges land over the product image. */
.elementor .e-loop-item,
.elementor-widget-loop-grid .e-loop-item,
.elementor-widget-loop-carousel .e-loop-item,
.e-loop-item { position: relative; }

/* Dual-currency price shortcode [bsns_price] --------------------- */
.bsns-price { display: block; line-height: 1.25; }
.bsns-price__current {
    display: block;
    color: #326E97;
    font-weight: 700;
    font-size: 1.4em;
}
.bsns-price__original {
    display: block;
    color: #777;
    text-decoration: line-through;
    font-size: 1em;
}
