/* Heiltropfen BLACK FRIDAY + ON SALE flags, v1.1.7.
 * v1.1.7: BLACK FRIDAY flag in the banner colours: black background, orange
 *   #F6910E border, first word white and the rest orange (the first word is
 *   wrapped in span.htbf-w by views/js/htbfbadge-1.1.7.js); ON SALE unchanged.
 * Theme facts (ecco_bella custom CSS): every .product-flag is
 * position:absolute; left:0. ON SALE sits at top:10px (<=768px: 8px), the
 * discount arrow at top:31px (<=768px: 27px).
 * v1.1.5: keep the theme's absolute positioning (no position/display/margin
 *   overrides at all) and give the BF / ON SALE label exactly the height that
 *   ends where the arrow starts: 21px desktop, 19px mobile. v1.1.3/v1.1.4 made
 *   the label position:relative and 23px tall, so it covered the arrow on
 *   mobile cards and pushed the gallery sideways on the product page.
 * The theme template prints the amount twice (PrestaShop "discount" li
 *   "-€2.00" and its own "discount-percentage" li "- €2.00") on the same spot;
 *   the theme copy with the space is hidden when the PrestaShop one exists.
 * :not(#htbf-none) adds ID-level specificity against theme !important rules.
 */
html body .product-flag.bf-sale:not(#htbf-none),
html body .product-flag.on-sale:not(#htbf-none) {
    top: 10px !important;
    box-sizing: border-box !important;
    height: 21px !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 8px !important;
    line-height: 19px !important;
    background: #111111 !important;
    background-image: none !important;
    color: #F6910E !important;
    border: 1px solid #F6910E !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    clip-path: none !important;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 800 !important;
    font-size: 10px !important;
    letter-spacing: 0.05em !important;
    text-align: center !important;
    text-transform: uppercase !important;
    text-indent: 0 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    width: auto !important;
    width: max-content !important;
    min-width: max-content !important;
    max-width: none !important;
    z-index: 10 !important;
    text-shadow:
        -1px -1px 0 #000, 0 -1px 0 #000, 1px -1px 0 #000,
        -1px  0   0 #000,                1px  0   0 #000,
        -1px  1px 0 #000, 0  1px 0 #000, 1px  1px 0 #000 !important;
}

/* First word of the BLACK FRIDAY label (wrapped by the module JS). */
html body .product-flag.bf-sale:not(#htbf-none) .htbf-w {
    color: #ffffff !important;
}

/* ON SALE keeps its own green, with a darker green border and white text. */
html body .product-flag.on-sale:not(#htbf-none) {
    background: #3e7f3d !important;
    color: #ffffff !important;
    border-color: #2b5a2a !important;
    text-shadow:
        -1px -1px 0 #1e3d1d, 0 -1px 0 #1e3d1d, 1px -1px 0 #1e3d1d,
        -1px  0   0 #1e3d1d,                   1px  0   0 #1e3d1d,
        -1px  1px 0 #1e3d1d, 0  1px 0 #1e3d1d, 1px  1px 0 #1e3d1d !important;
}

@media (max-width: 768px) {
    html body .product-flag.bf-sale:not(#htbf-none),
    html body .product-flag.on-sale:not(#htbf-none) {
        top: 8px !important;
        height: 19px !important;
        line-height: 17px !important;
        padding: 0 7px !important;
        font-size: 9px !important;
    }
}

/* Theme duplicate of the discount label ("- €2.00" with a space) sits exactly
 * under PrestaShop's own one ("-€2.00"); show only PrestaShop's. */
html body .product-flags .product-flag.discount ~ .product-flag.discount-percentage:not(#htbf-none) {
    display: none !important;
}

html body .product-flag.bf-sale:not(#htbf-none)::before,
html body .product-flag.bf-sale:not(#htbf-none)::after,
html body .product-flag.on-sale:not(#htbf-none)::before,
html body .product-flag.on-sale:not(#htbf-none)::after {
    display: none !important;
    content: none !important;
}
