/**
 * FineCenter Product Badges & Collections V1.0.4
 */

[data-fc-product-gallery],
[data-fc-product-gallery] .fc-product-gallery__main,
.woocommerce-product-gallery,
.fc-pbc-shortcode-host {
    position: relative;
}

.fc-pbc-overlay {
    position: absolute;
    inset: 0;
    z-index: 18;
    pointer-events: none;
    overflow: hidden;
    border-radius: inherit;
}

.fc-pbc-stack {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: calc(100% - 16px);
    pointer-events: none;
}

.fc-pbc-pos-top-right {
    top: 8px;
    right: 8px;
    align-items: flex-end;
}

.fc-pbc-pos-top-center {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
}

.fc-pbc-pos-top-left {
    top: 8px;
    left: 8px;
    align-items: flex-start;
}

.fc-pbc-pos-middle-right {
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    align-items: flex-end;
}

.fc-pbc-pos-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    align-items: center;
}

.fc-pbc-pos-middle-left {
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    align-items: flex-start;
}

.fc-pbc-pos-bottom-right {
    right: 8px;
    bottom: 8px;
    align-items: flex-end;
}

.fc-pbc-pos-bottom-center {
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    align-items: center;
}

.fc-pbc-pos-bottom-left {
    left: 8px;
    bottom: 8px;
    align-items: flex-start;
}

.fc-pbc-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    margin-left: var(--fc-pbc-x, 0px);
    margin-top: var(--fc-pbc-y, 0px);
}

.fc-pbc-badge--image img {
    display: block;
    width: var(--fc-pbc-image-width, 56px);
    max-width: min(var(--fc-pbc-image-width, 56px), 40vw);
    height: auto;
    max-height: 120px;
    object-fit: contain;
}

.fc-pbc-badge--text {
    color: var(--fc-pbc-text-color, #fff);
    background: var(--fc-pbc-text-bg, #17204b);
    border: 1px solid var(--fc-pbc-text-border, #17204b);
    border-radius: var(--fc-pbc-radius, 999px);
    padding: var(--fc-pbc-pad-y, 4px) var(--fc-pbc-pad-x, 8px);
    font-size: var(--fc-pbc-font-size, 13px);
    font-weight: var(--fc-pbc-font-weight, 700);
    line-height: 1.2;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.fc-pbc-shortcode-host {
    width: 100%;
}

.fc-pbc-shortcode-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.fc-pbc-shortcode-badges .fc-pbc-badge {
    margin-left: 0;
    margin-top: 0;
}

@media (max-width: 767px) {
    .fc-pbc-stack {
        gap: 4px;
        max-width: calc(100% - 10px);
    }

    .fc-pbc-pos-top-right,
    .fc-pbc-pos-middle-right,
    .fc-pbc-pos-bottom-right {
        right: 5px;
    }

    .fc-pbc-pos-top-left,
    .fc-pbc-pos-middle-left,
    .fc-pbc-pos-bottom-left {
        left: 5px;
    }

    .fc-pbc-pos-top-right,
    .fc-pbc-pos-top-center,
    .fc-pbc-pos-top-left {
        top: 5px;
    }

    .fc-pbc-pos-bottom-right,
    .fc-pbc-pos-bottom-center,
    .fc-pbc-pos-bottom-left {
        bottom: 5px;
    }

    .fc-pbc-badge--image img {
        max-width: min(var(--fc-pbc-image-width, 56px), 30vw);
        max-height: 86px;
    }
}
/* =========================================================
 * V1.0.4 — Full-width auto-fit text badge
 * ========================================================= */

.fc-pbc-stack--full-width {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: none !important;
    align-items: stretch !important;
}

.fc-pbc-stack--full-width.fc-pbc-pos-top-right,
.fc-pbc-stack--full-width.fc-pbc-pos-top-center,
.fc-pbc-stack--full-width.fc-pbc-pos-top-left {
    top: 8px !important;
    bottom: auto !important;
    transform: none !important;
}

.fc-pbc-stack--full-width.fc-pbc-pos-middle-right,
.fc-pbc-stack--full-width.fc-pbc-pos-center,
.fc-pbc-stack--full-width.fc-pbc-pos-middle-left {
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
}

.fc-pbc-stack--full-width.fc-pbc-pos-bottom-right,
.fc-pbc-stack--full-width.fc-pbc-pos-bottom-center,
.fc-pbc-stack--full-width.fc-pbc-pos-bottom-left {
    top: auto !important;
    bottom: 8px !important;
    transform: none !important;
}

.fc-pbc-badge--text.fc-pbc-badge--auto-fit {
    display: flex;
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;

    text-align: center;
    justify-content: center;

    /*
     * JS computes the final pixel size from the real image width.
     * This remains the safe first-paint/max fallback.
     */
    font-size: var(--fc-pbc-font-size, 13px);
}

@media (max-width: 767px) {
    .fc-pbc-stack--full-width {
        left: 5px !important;
        right: 5px !important;
    }

    .fc-pbc-stack--full-width.fc-pbc-pos-top-right,
    .fc-pbc-stack--full-width.fc-pbc-pos-top-center,
    .fc-pbc-stack--full-width.fc-pbc-pos-top-left {
        top: 5px !important;
    }

    .fc-pbc-stack--full-width.fc-pbc-pos-bottom-right,
    .fc-pbc-stack--full-width.fc-pbc-pos-bottom-center,
    .fc-pbc-stack--full-width.fc-pbc-pos-bottom-left {
        bottom: 5px !important;
    }
}
/* =========================================================
 * V1.0.4 — Shortcode full-width auto-fit
 * ========================================================= */

.fc-pbc-shortcode-badges:has(.fc-pbc-badge--shortcode.fc-pbc-badge--auto-fit) {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    align-items: stretch;
}

.fc-pbc-shortcode-badges
.fc-pbc-badge--shortcode.fc-pbc-badge--auto-fit {
    flex: 1 0 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
}

/*
 * The shortcode host itself must respect the Elementor/container width rather
 * than introducing its own intrinsic width.
 */
.fc-pbc-shortcode-host:has(.fc-pbc-badge--shortcode.fc-pbc-badge--auto-fit) {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
