/* Compact labels at the top of the photo frame; price/rating data stays in its existing module. */
#Mod522.kvt-best-sellers .kvt-sales-grid { padding-top: 7px; }
#Mod522.kvt-best-sellers .blocksp .spacer { overflow: visible; }
#Mod522.kvt-best-sellers .blocksp .product-anh { padding-top: 32px; border-radius: 12px 12px 0 0; }
#ja-extra .kvt-monthly-offer .kvt-offer-grid { padding-top: 7px; }
#ja-extra .kvt-monthly-offer .spacer { overflow: visible; }
#ja-extra .kvt-monthly-offer .product-anh { overflow: visible; padding-top: 32px; }

#Mod522.kvt-best-sellers .kvt-sales-discount,
#ja-extra .kvt-monthly-offer .kvt-offer-discount {
    position: absolute;
    z-index: 3;
    top: -7px;
    left: 13px;
    margin: 0;
    padding: 4px 9px;
    border: 0;
    border-radius: 4px 6px 6px 0;
    background: linear-gradient(105deg, #e60025, #cf001e);
    box-shadow: 0 2px 3px #88001626, inset 0 1px 0 #ffffff26;
    color: #fff;
    font: 700 11px/18px Arial, sans-serif;
    white-space: nowrap;
}
#Mod522.kvt-best-sellers .kvt-sales-discount::before,
#ja-extra .kvt-monthly-offer .kvt-offer-discount::before {
    content: "";
    position: absolute;
    top: 0;
    left: -7px;
    width: 7px;
    height: 7px;
    background: #8d0016;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
    pointer-events: none;
}
#Mod522.kvt-best-sellers .kvt-sales-discount::after,
#ja-extra .kvt-monthly-offer .kvt-offer-discount::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 7px;
    height: 3px;
    border-radius: 0 0 0 3px;
    background: #a00019;
    pointer-events: none;
}

#Mod522.kvt-best-sellers .kvt-sales-proof { top: 0; right: 0; z-index: 2; }
#Mod522.kvt-best-sellers .kvt-sales-rating {
    gap: 4px;
    min-height: 26px;
    padding: 3px 8px;
    border: 1px solid #eadb9a;
    border-top: 0;
    border-right: 0;
    border-radius: 0 12px 0 8px;
    background: #fff9dc;
    box-shadow: none;
    font: 500 11px/18px Arial, sans-serif;
    font-variant-numeric: tabular-nums;
}
#Mod522.kvt-best-sellers .kvt-sales-star { color: #b78312; font-size: 13px; }
#Mod522.kvt-best-sellers .kvt-sales-score { font-weight: 700; }
#Mod522.kvt-best-sellers .kvt-sales-rating-separator { color: #93897a; }
#Mod522.kvt-best-sellers .kvt-sales-review-count { color: #625b4e; font-size: 10px; }
#Mod522.kvt-best-sellers .kvt-sales-rating-pending { background: #f4f4f4; border-color: #e6e6e6; color: #777; }
#Mod522.kvt-best-sellers .kvt-sales-rating-pending .kvt-sales-star { color: #999; }

@media (max-width: 600px) {
    #Mod522.kvt-best-sellers .blocksp .product-anh { padding-top: 30px; }
    #Mod522.kvt-best-sellers .kvt-sales-discount,
    #ja-extra .kvt-monthly-offer .kvt-offer-discount { left: 10px; padding: 3px 7px; font-size: 10px; }
    #Mod522.kvt-best-sellers .kvt-sales-rating { gap: 3px; padding: 3px 6px; font-size: 10px; }
    #Mod522.kvt-best-sellers .kvt-sales-star { font-size: 12px; }
}
@media (max-width: 400px) {
    /* Narrow cards keep the rating on its own row above the product photo. */
    #Mod522.kvt-best-sellers .kvt-sales-proof { top: 25px; right: 6px; }
    #Mod522.kvt-best-sellers .kvt-sales-rating { border: 0; border-radius: 5px; }
    #Mod522.kvt-best-sellers .blocksp .product-anh { padding-top: 52px; }
}

/* All discounted catalog cards share a gold label flush with their outer edge. */
#Mod522.kvt-best-sellers .kvt-sales-grid > .blocksp { height: auto !important; }
#Mod522.kvt-best-sellers .blocksp .product-anh { flex: 0 0 auto; }
#Mod522.kvt-best-sellers .blocksp .product-anh a { display: block; height: 200px !important; margin: 0; padding: 0 !important; }
#Mod522.kvt-best-sellers .blocksp .product-anh img { position: static; width: 100%; height: 200px; object-fit: contain; }
#ja-khungchinh .browse-view .blocksp.kvt-has-discount-ribbon > .spacer {
    position: relative;
    overflow: visible;
}
#ja-extra .kvt-monthly-offer[data-offer-count] .kvt-offer-grid { overflow: visible; }
#ja-khungchinh .browse-view .blocksp.kvt-has-discount-ribbon > .spacer > .kvt-card-discount {
    position: absolute;
    z-index: 4;
    top: -1px;
    left: -1px;
    right: auto;
    bottom: auto;
    grid-area: auto;
    margin: 0;
    padding: 3px 8px;
    border: 0;
    border-radius: 4px 0 6px 0;
    background: linear-gradient(180deg, #ffe997, #ffd66b);
    box-shadow: inset 0 1px 0 #fff4c4, 0 1px 0 #d7a131, 0 2px 3px #7b510014;
    color: #603b05;
    font: 700 11px/16px Arial, sans-serif;
    white-space: nowrap;
    transform: none;
}
#ja-khungchinh .browse-view .blocksp.kvt-has-discount-ribbon > .spacer > .kvt-card-discount::before { content: none; }
#ja-khungchinh .browse-view .blocksp.kvt-has-discount-ribbon > .spacer > .kvt-card-discount::after {
    content: "";
    position: absolute;
    top: auto;
    bottom: -3px;
    left: 0;
    width: 3px;
    height: 3px;
    border-radius: 0;
    background: #bc871e;
    clip-path: polygon(100% 0, 100% 100%, 0 0);
    pointer-events: none;
}
@media (max-width: 600px) {
    #Mod522.kvt-best-sellers .blocksp .product-anh a { height: 150px !important; }
    #Mod522.kvt-best-sellers .blocksp .product-anh img { height: 150px; }
    #ja-khungchinh .browse-view .blocksp.kvt-has-discount-ribbon > .spacer > .kvt-card-discount { padding: 3px 6px; font-size: 10px; line-height: 14px; }
}

/* Sales and the existing review button share the bottom row of each catalog card. */
#ja-khungchinh .browse-view .blocksp.kvt-has-sales .kvt-sales-sales {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2px 8px;
    min-height: 20px;
}
#ja-khungchinh .browse-view .blocksp.kvt-has-sales .kvt-sales-sold {
    color: #484848;
    font-weight: 600;
    white-space: nowrap;
    line-height: 20px;
}
#ja-khungchinh .browse-view .blocksp.kvt-has-sales .kvt-sales-proof {
    position: static;
    inset: auto;
    z-index: auto;
    flex: 0 0 auto;
    margin-left: auto;
    font-size: 11px;
    line-height: 20px;
}
#ja-khungchinh .browse-view .blocksp.kvt-has-sales .kvt-sales-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    width: auto;
    min-height: 20px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    box-shadow: none;
    color: #484848;
    font: 500 11px/20px Arial, sans-serif;
    white-space: nowrap;
    cursor: pointer;
}
#ja-khungchinh .browse-view .blocksp.kvt-has-sales .kvt-sales-star { color: #b78312; font-size: 13px; }
#ja-khungchinh .browse-view .blocksp.kvt-has-sales .kvt-sales-score { font-weight: 600; }
#ja-khungchinh .browse-view .blocksp.kvt-has-sales .kvt-sales-rating-separator { color: #93897a; }
#ja-khungchinh .browse-view .blocksp.kvt-has-sales .kvt-sales-review-count { color: #625b4e; font-size: 10px; }
#ja-khungchinh .browse-view .blocksp.kvt-has-sales .kvt-sales-rating-pending { color: #777; }
#ja-khungchinh .browse-view .blocksp.kvt-has-sales .kvt-sales-rating-pending .kvt-sales-star { color: #999; }
#ja-khungchinh .browse-view .blocksp.kvt-has-sales .kvt-sales-extra { flex-basis: 100%; }
#Mod522.kvt-best-sellers .blocksp .product-anh { padding-top: 24px; }
@media (max-width: 600px) {
    #ja-khungchinh .browse-view .blocksp.kvt-has-sales .kvt-sales-sales { column-gap: 4px; font-size: 11px; }
    #ja-khungchinh .browse-view .blocksp.kvt-has-sales .kvt-sales-rating { gap: 2px; font-size: 10px; }
    #ja-khungchinh .browse-view .blocksp.kvt-has-sales .kvt-sales-star { font-size: 12px; }
    #ja-khungchinh .browse-view .blocksp.kvt-has-sales .kvt-sales-review-count { font-size: 9px; }
}
@media (max-width: 360px) {
    #ja-khungchinh .browse-view .blocksp.kvt-has-sales .kvt-sales-sales { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
    #ja-khungchinh .browse-view .blocksp.kvt-has-sales .kvt-sales-proof { justify-self: end; margin-left: 0; }
}
