/* ════════════════════════════════════════════════════════════════════
   Inspira Woo Add-ons — Brand Badge (frontend)
   ════════════════════════════════════════════════════════════════════ */

.iwa-brand-badge {
    position: absolute;
    z-index: 5;
    display: inline-block;
    padding: 5px 10px;
    background: var(--iwa-bb-bg, #14130F);
    color: var(--iwa-bb-text, #FFFFFF);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    line-height: 1.4;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(20, 19, 15, .15);
    pointer-events: none;
    max-width: calc(100% - 24px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Position presets */
.iwa-brand-badge--top-left     { top: 12px;    left: 12px;  }
.iwa-brand-badge--top-right    { top: 12px;    right: 12px; }
.iwa-brand-badge--bottom-left  { bottom: 12px; left: 12px;  }
.iwa-brand-badge--bottom-right { bottom: 12px; right: 12px; }

/* The badge needs a positioned ancestor to anchor against.
 * WooCommerce loop items (`li.product`) and product galleries are not
 * always position:relative by default — set it explicitly. */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    position: relative;
}

/* Single product: badges live in a JS-mounted overlay inside
 * `.woocommerce-product-gallery` (sibling of the slider figure). The
 * overlay is absolute-positioned over the figure; individual badges
 * within it position themselves at their configured corner. This is
 * OUTSIDE Flexslider's figure so the slider can't touch them. */
.woocommerce div.product .woocommerce-product-gallery {
    position: relative;
}
.iwa-brand-badges-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}
.iwa-brand-badge--single {
    z-index: 10;
    pointer-events: auto;
}

@media (max-width: 640px) {
    .iwa-brand-badge {
        font-size: 9px;
        padding: 4px 8px;
        letter-spacing: .06em;
    }
    .iwa-brand-badge--top-left,
    .iwa-brand-badge--top-right,
    .iwa-brand-badge--bottom-left,
    .iwa-brand-badge--bottom-right {
        top: 8px; bottom: auto;
    }
    .iwa-brand-badge--bottom-left  { bottom: 8px; top: auto; }
    .iwa-brand-badge--bottom-right { bottom: 8px; top: auto; }
    .iwa-brand-badge--top-left,
    .iwa-brand-badge--bottom-left  { left: 8px; right: auto; }
    .iwa-brand-badge--top-right,
    .iwa-brand-badge--bottom-right { right: 8px; left: auto; }
}
