/**
 * Product Badge & Tag Images – Frontend Styles
 * Anchor: wd-carousel-item / product item (NOT image)
 * Behavior: overlay – allow overflow like price-ratio
 */

/* =====================================================
   CORE ANCHOR (GIỐNG .product-item)
===================================================== */

.wd-carousel-item,
.woocommerce ul.products li.product {
    position: relative;
    overflow: visible;
}

/* =====================================================
   BASE BADGE CONTAINER
===================================================== */

.product-badge-container {
    cursor: unset;
    position: absolute;
    z-index: 60;
    pointer-events: none;
}

/* =====================================================
   INSTALLMENT LABEL – TOP LEFT (PRICE-RATIO STYLE)
===================================================== */

.product-installment-label {
    top: 0;
    left: 5px;
}

.installment-label-box {
    background: url('../img/price-ratio.png') left center no-repeat;
    background-size: cover;
    height: 31px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
}

.installment-label-text {
    font-style: normal;
    font-weight: bold;
    font-size: 12px;
    line-height: 1;
    color: #fff;
    white-space: nowrap;
}

/* =====================================================
   DISCOUNT LABEL – TOP RIGHT (ENHANCED)
===================================================== */

.product-discount-label {
    top: 6px;
    right: 18px;
}

.discount-label-box {
    height: 23px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    /* background: linear-gradient(135deg, #00ff60 0%, #ff7373 100%); */
    background: linear-gradient(135deg, #7f00ff 0%, #e100ff 100%);
    /* background: linear-gradient(135deg, #cb2d3e 0%, #ef473a 60%, #f9d423 100%); */
    /* background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); */

    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(221, 36, 118, 0.35), inset 0 -1px 0 rgba(255, 255, 255, 0.25);
    transform: translateZ(0);
}

.discount-label-text {
    font-weight: 800;
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0.3px;
    color: #ffffff;
    white-space: nowrap;

    /* giúp chữ rõ trên ảnh sáng */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* =====================================================
   IMAGE BADGE (BOTTOM – GIỮ NGUYÊN)
===================================================== */

.product-image-badge {
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.product-image-badge img {
    width: 100%;
    height: auto;
    display: block;
}

/* =====================================================
   REMOVE IMAGE-BOX CONSTRAINTS (QUAN TRỌNG)
===================================================== */

.wd-carousel-item .product-wrapper,
.wd-carousel-item .product-element-top,
.wd-carousel-item .product-image-link,
.wd-carousel-item .wd-product {
    position: static !important;
    overflow: visible !important;
}

/* =====================================================
   NON-CAROUSEL FALLBACK
===================================================== */

.woocommerce ul.products li.product:not(.wd-carousel-item) {
    position: relative;
    overflow: visible;
}

/* =====================================================
   PRODUCT TAGS (KHÔNG LIÊN QUAN LABEL)
===================================================== */

.product-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.product-tags-container .tag-image {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 767px) {

    .product-installment-label {
        left: 0px;
    }

    .product-discount-label {
        right: 11px;
    }

    .installment-label-box,
    .discount-label-box {
        height: 26px;
        padding: 0 12px;
        border-radius: 5px;
    }

    .installment-label-text,
    .discount-label-text {
        font-size: 11px;
    }

    .product-tags-container .tag-image {
        height: 30px;
    }
}

/* =====================================================
   HIGH DPI
===================================================== */

@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    .product-image-badge img,
    .product-tags-container .tag-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}