/**
 * GS Badge – Frontend Styles
 * Ultra-lightweight: ~1.5KB minified
 * Zero dependencies, no animations by default
 */

/* ── Badge Container ──────────────────────────────────────────────── */
.gsb-badge {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    pointer-events: none;
    box-sizing: border-box;
    z-index: 10;
    font-family: inherit;
}

/* ── Type: SVG / Image ────────────────────────────────────────────── */
.gsb-type-svg svg {
    width: 100%;
    height: auto;
    display: block;
}

.gsb-type-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* ── Type: Countdown ──────────────────────────────────────────────── */
.gsb-type-countdown {
    flex-direction: column;
    gap: 2px;
    text-align: center;
    min-width: 100px;
}

.gsb-cd-label {
    font-size: 0.75em;
    font-weight: 600;
    opacity: 0.9;
    letter-spacing: 0.03em;
}

.gsb-cd-timer {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    font-size: 1.1em;
    letter-spacing: 0.02em;
}

.gsb-cd-timer span {
    display: inline;
}

/* ── Context: Cart ────────────────────────────────────────────────── */
.gsb-ctx-cart {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
    margin-left: 6px;
    font-size: 11px !important;
    padding: 2px 6px !important;
}

/* ── Single product: overlay inside gallery, CSS-only positioning ───── */
.woocommerce-product-gallery {
    position: relative;
}

.gsb-single-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* ── Shop loop: ensure image container is positioned for badge overlay ── */
/* Universal: WooCommerce standard link wrapper */
.woocommerce ul.products li.product > a,
.woocommerce ul.products li.product .woocommerce-LoopProduct-link {
    position: relative;
    overflow: visible;
}
/* Flatsome */
.woocommerce ul.products li.product .box-image,
.woocommerce ul.products li.product .image-fade_in_back {
    position: relative;
    overflow: visible;
}
/* Astra, GeneratePress, OceanWP, Storefront */
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap,
.woocommerce ul.products li.product .woocommerce-loop-product__link,
.woocommerce ul.products li.product .product-image,
.woocommerce ul.products li.product .product-thumbnail {
    position: relative;
    overflow: visible;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .gsb-badge:not(.gsb-type-svg):not(.gsb-type-image) {
        font-size: 11px !important;
    }
    .gsb-type-svg svg,
    .gsb-type-image img {
        max-width: 36px;
    }
    .gsb-type-countdown {
        min-width: 80px;
    }
}
