/* Frontend Badge Styles */
.pbm-badges-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.pbm-badge {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: all;
    z-index: 10;
    word-wrap: break-word;
    text-align: center;
    line-height: 1.2;
}

.pbm-text-badge {
    min-width: 50px;
}

.pbm-image-badge {
    padding: 0;
    background: transparent !important;
    box-shadow: none;
}

.pbm-image-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.pbm-discount-badge {
    background: #e74c3c;
    color: #fff;
}

/* Position Classes */
.pbm-position-top-left {
    top: 10px;
    left: 10px;
}

.pbm-position-top-center {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.pbm-position-top-right {
    top: 10px;
    right: 10px;
}

.pbm-position-middle-left {
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
}

.pbm-position-middle-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pbm-position-middle-right {
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
}

.pbm-position-bottom-left {
    bottom: 10px;
    left: 10px;
}

.pbm-position-bottom-center {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.pbm-position-bottom-right {
    bottom: 10px;
    right: 10px;
}

/* Product Loop Styles */
.woocommerce ul.products li.product {
    position: relative;
}

.woocommerce ul.products li.product .pbm-badges-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.woocommerce ul.products li.product a {
    position: relative;
    display: block;
}

/* Single Product Styles */
.single-product .woocommerce-product-gallery {
    position: relative;
}

.single-product .pbm-badges-wrapper.pbm-single-product {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.single-product .pbm-single-product .pbm-badge {
    font-size: 14px;
    padding: 10px 15px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .pbm-badge {
        font-size: 10px;
        padding: 6px 10px;
    }
    
    .single-product .pbm-single-product .pbm-badge {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .pbm-position-top-left,
    .pbm-position-top-center,
    .pbm-position-top-right {
        top: 5px;
    }
    
    .pbm-position-bottom-left,
    .pbm-position-bottom-center,
    .pbm-position-bottom-right {
        bottom: 5px;
    }
    
    .pbm-position-top-left,
    .pbm-position-middle-left,
    .pbm-position-bottom-left {
        left: 5px;
    }
    
    .pbm-position-top-right,
    .pbm-position-middle-right,
    .pbm-position-bottom-right {
        right: 5px;
    }
}

/* Animation (Optional) */
.pbm-badge {
    animation: pbmFadeIn 0.3s ease-in-out;
}

@keyframes pbmFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Fix for themes that might interfere */
.pbm-badges-wrapper * {
    box-sizing: border-box;
}
