/* ── Lonn WC Product Banner — Frontend ─────────────────── */

.wcpb-item-wrap,
.wcpb-single-wrap {
    position: relative;
    display: block;
    line-height: 0;
    overflow: visible;
}

.wcpb-item-wrap > img,
.wcpb-item-wrap > a,
.wcpb-single-wrap > .woocommerce-product-gallery__image,
.wcpb-single-wrap > a {
    display: block;
    line-height: 0;
}

/* Badge base — Auto จำกัดไม่ให้ใหญ่เกิน; โหมด sized ปลดล็อก */
.wcpb-badge {
    position: absolute;
    z-index: 10;
    line-height: 0;
    pointer-events: none;
    max-width: 42%;
}

.wcpb-badge--sized {
    max-width: none;
}

.wcpb-badge-link {
    pointer-events: auto;
    display: block;
    line-height: 0;
    cursor: pointer;
}

.wcpb-badge-img {
    display: block;
    max-width: 100%;
    height: auto;
    width: 100%;
    object-fit: contain;
}

.wcpb-badge--bottom-left  { bottom: 0; left: 0; }
.wcpb-badge--bottom-right { bottom: 0; right: 0; }
.wcpb-badge--top-left     { top: 0; left: 0; }
.wcpb-badge--top-right    { top: 0; right: 0; }

.woocommerce ul.products li.product .wcpb-item-wrap,
.woocommerce ul.products li.product a img {
    overflow: visible;
}

/* Single product — overlay ครอบรูปหลัก ติดทุกสไลด์ */
.woocommerce-product-gallery.wcpb-gallery-has-badges {
    position: relative;
}

.wcpb-gallery-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    z-index: 40;
    pointer-events: none;
    line-height: 0;
    /* ให้อยู่เหนือรูป แต่ไม่บัง thumbnail ด้านล่าง (ความสูงตั้งจาก JS) */
}

.wcpb-gallery-overlay .wcpb-badge {
    z-index: 41;
}

.wcpb-gallery-overlay .wcpb-badge-link {
    pointer-events: auto;
}

/* กัน theme ตัด badge */
.woocommerce div.product div.images,
.woocommerce-product-gallery,
.woocommerce-product-gallery__wrapper,
.flex-viewport {
    overflow: visible;
}
