/* =============================================================================
   Woo Product Badge — Frontend Styles v1.6.0
   Author: J Nayeem
   ============================================================================= */

/* Widget wrapper */
.elementor-widget-woo-product-badge {
    position: absolute !important;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* Ensure product card is positioned */
.e-loop-item,
.woocommerce ul.products li.product,
.wc-block-grid__product,
.woocommerce div.product,
.product-card {
    position: relative !important;
}

/* Badge wrapper */
.wpb-badge-wrap {
    position:      absolute;
    display:       inline-block;
    pointer-events: none;
    z-index:       10;
}
.wpb-has-tooltip { pointer-events: auto; }

/* Position */
.wpb-pos-tl { top:    var(--wpb-offset-y, 10px); left:  var(--wpb-offset-x, 10px); }
.wpb-pos-tr { top:    var(--wpb-offset-y, 10px); right: var(--wpb-offset-x, 10px); }
.wpb-pos-bl { bottom: var(--wpb-offset-y, 10px); left:  var(--wpb-offset-x, 10px); }
.wpb-pos-br { bottom: var(--wpb-offset-y, 10px); right: var(--wpb-offset-x, 10px); }

/* Base badge */
.wpb-badge {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    font-size:       12px;
    font-weight:     700;
    line-height:     1;
    letter-spacing:  0.5px;
    text-transform:  uppercase;
    white-space:     nowrap;
    padding:         5px 12px;
    pointer-events:  auto;
    cursor:          default;
}

/* Shapes */
.wpb-shape-square { border-radius: 4px; }
.wpb-shape-pill   { border-radius: 999px; }
.wpb-shape-circle { border-radius: 50%; width: 42px; height: 42px; padding: 0; font-size: 10px; }
.wpb-shape-ribbon {
    border-radius: 0 4px 4px 0;
    padding-left:  14px;
    clip-path:     polygon(8px 0%, 100% 0%, 100% 100%, 8px 100%, 0% 50%);
}

/* Default colors */
.wpb-badge--unavailable  { background-color: #555555; color: #ffffff; }
.wpb-badge--preorder_tag { background-color: #CF753F; color: #ffffff; }
.wpb-badge--preorder_oos { background-color: #8B4513; color: #ffffff; }
.wpb-badge--discount     { background-color: #c0392b; color: #ffffff; }
.wpb-badge--amount       { background-color: #1a6b45; color: #a8e6c3; }

/* ── Tooltip ─────────────────────────────────────────────────────────────── */
/* Uses position:fixed so it escapes overflow:hidden on loop grid containers  */
.wpb-tooltip {
    position:       fixed;
    background:     #1a1a1a;
    color:          #ffffff;
    font-size:      11px;
    font-weight:    400;
    text-transform: none;
    letter-spacing: 0;
    line-height:    1.5;
    padding:        5px 10px;
    border-radius:  6px;
    max-width:      160px;
    white-space:    normal;
    text-align:     center;
    pointer-events: none;
    opacity:        0;
    visibility:     hidden;
    transition:     opacity 0.2s ease, visibility 0.2s ease;
    z-index:        99999;
    width:          max-content;
    /* JS sets top/left on hover */
}

/* Arrow */
.wpb-tooltip::after {
    content:   '';
    position:  absolute;
    left:      50%;
    transform: translateX(-50%);
    border:    5px solid transparent;
}
.wpb-tip-below::after {
    bottom:              100%;
    border-bottom-color: #1a1a1a;
}
.wpb-tip-above::after {
    top:             100%;
    border-top-color: #1a1a1a;
}

/* Show on hover */
.wpb-has-tooltip:hover .wpb-tooltip {
    opacity:    1;
    visibility: visible;
}
