/**
 * PDP labels overlay on product image (M1-style placement).
 *
 * Important: individual labels keep their own CSS classes and inline
 * positioning. This file only makes sure
 * the labels container sits over the gallery area and does not try
 * to restyle or reposition each label.
 */

/* Make the gallery stage a positioning context for PDP labels. */
.product.media .fotorama__stage {
    position: relative;
}

/* Stretch labels wrapper over the gallery stage so it survives gallery swaps. */
.product.media .fotorama__stage > .agd-labels {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100002 !important;
    pointer-events: none;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
    padding: 8px;
    overflow: visible;
}

/* Allow each label to receive clicks and use its own styles/positions */
.product.media .fotorama__stage > .agd-labels > div,
.product.media .fotorama__stage > .agd-labels > span {
    position: absolute;
    z-index: 100003 !important;
    pointer-events: auto;
}

/* Base for css style positioned labels (label-table2) on PDP */
.product.media .fotorama__stage > .agd-labels .label-table2 {
    position: absolute;
    z-index: 100003 !important;
}

.product.media .fotorama__stage > .agd-labels .label-table2.top-left {
    top: 0;
    left: 0;
}

.product.media .fotorama__stage > .agd-labels .label-table2.top-center {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.product.media .fotorama__stage > .agd-labels .label-table2.top-right {
    top: 0;
    right: 0;
}

.product.media .fotorama__stage > .agd-labels .label-table2.middle-left {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.product.media .fotorama__stage > .agd-labels .label-table2.middle-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.product.media .fotorama__stage > .agd-labels .label-table2.bottom-left {
    /* Lift bottom-left labels (e.g. Bestseller) above the thumbnail strip */
    bottom: 0;
    left: 0;
}

.product.media .fotorama__stage > .agd-labels .label-table2.bottom-right {
    bottom: 0;
    right: 0;
}

.product.media .fotorama__stage > .agd-labels .label-table2.bottom-center {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.product.media .fotorama__stage > .agd-labels .label-table2.middle-right {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

.product.media .fotorama__stage > .agd-labels .agd-label--free-shipping {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 100003 !important;
}

@media (max-width: 767px) {
    .product.media .fotorama__stage > .agd-labels {
        z-index: 3 !important;
        box-sizing: border-box;
        padding: 10px 48px 12px;
    }

    .product.media .fotorama__stage > .agd-labels > div,
    .product.media .fotorama__stage > .agd-labels > span {
        z-index: 4 !important;
    }

    .product.media .fotorama__stage > .agd-labels .sticker.top-left {
        top: 8px;
        left: 8px;
    }

    .product.media .fotorama__stage > .agd-labels .sticker.top-right {
        top: 8px;
        right: 8px;
    }

    .product.media .fotorama__stage > .agd-labels .agd-label--free-shipping {
        left: 8px;
        bottom: 8px;
    }
}

/* Shared badge styling for built-in labels. */
.agd-labels .sticker .labelsale {
    background-color: #e84118;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
}

/* Ensure the sticker container is anchored over the image (PDP + PLP). */
.agd-labels .sticker {
    position: absolute;
    z-index: 100004 !important;
}

.agd-labels .sticker.top-right {
    top: 0;
    right: 0;
}

.agd-labels .sticker.top-left {
    top: 0;
    left: 0;
}

.agd-labels .agd-label--new .labelnew {
    background-color: #6aac4b;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
}

.agd-labels .agd-label--bestseller .agd-label__text {
    background-color: #3184ca;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
}

.agd-labels .agd-label--preorder .labelpreorder {
    background-color: #d73939;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
}

.agd-labels .agd-label--free-shipping .agd-label__text {
    background: #3184ca;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

/* Anchor PLP labels to the current theme's product card wrapper. */
body.page-products .product-item-info,
body.catalog-product-view .product-item-info,
body.catalog-category-view .product-item-info,
body.catalogsearch-result-index .product-item-info,
body.checkout-cart-index .product-item-info,
body.cms-index-index .product-item-info {
    position: relative;
}

body.page-products .product-item-info > .agd-labels.agd-labels--plp,
body.catalog-product-view .product-item-info > .agd-labels.agd-labels--plp,
body.catalog-category-view .product-item-info > .agd-labels.agd-labels--plp,
body.catalogsearch-result-index .product-item-info > .agd-labels.agd-labels--plp,
body.checkout-cart-index .product-item-info > .agd-labels.agd-labels--plp,
body.cms-index-index .product-item-info > .agd-labels.agd-labels--plp {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

body.page-products .product-item-info > .agd-labels.agd-labels--plp > div,
body.page-products .product-item-info > .agd-labels.agd-labels--plp > span,
body.catalog-product-view .product-item-info > .agd-labels.agd-labels--plp > div,
body.catalog-product-view .product-item-info > .agd-labels.agd-labels--plp > span,
body.catalog-category-view .product-item-info > .agd-labels.agd-labels--plp > div,
body.catalog-category-view .product-item-info > .agd-labels.agd-labels--plp > span,
body.catalogsearch-result-index .product-item-info > .agd-labels.agd-labels--plp > div,
body.catalogsearch-result-index .product-item-info > .agd-labels.agd-labels--plp > span,
body.checkout-cart-index .product-item-info > .agd-labels.agd-labels--plp > div,
body.checkout-cart-index .product-item-info > .agd-labels.agd-labels--plp > span,
body.cms-index-index .product-item-info > .agd-labels.agd-labels--plp > div,
body.cms-index-index .product-item-info > .agd-labels.agd-labels--plp > span {
    pointer-events: auto;
}

body.cms-index-index .product-item-top > .sticker,
.page-products .product-item-top > .sticker {
    position: absolute;
    z-index: 6;
}

body.cms-index-index .product-item-top > .sticker.top-right,
.page-products .product-item-top > .sticker.top-right {
    top: 8px;
    right: 8px;
}

body.cms-index-index .product-item-top > .sticker.top-left,
.page-products .product-item-top > .sticker.top-left {
    top: 0;
    left: 0;
}

body.cms-index-index .product-item-top > .sticker.bottom-left,
.page-products .product-item-top > .sticker.bottom-left {
    bottom: 0;
    left: 0;
}

body.cms-index-index .product-item-top > .sticker.bottom-right,
.page-products .product-item-top > .sticker.bottom-right {
    bottom: 0;
    right: 0;
}

.agd-labels .sticker .labelnew {
    background-color: #009a3d;
    color: #ffffff;
    display: block;
    padding: 0 12px;
    height: 26px;
    line-height: 26px;
    font-size: 12px;
    text-transform: uppercase;
    text-align: center;
}

.agd-labels .sticker .labelpreorder {
    background-color: #d60b15;
    color: #ffffff;
    display: block;
    padding: 0 12px;
    height: 26px;
    line-height: 26px;
    font-size: 12px;
    text-transform: uppercase;
    text-align: center;
}

.agd-labels .agd-label__image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 100%;
}

.agd-labels--plp .agd-label__image {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain;
}

.agd-labels .agd-label__image-wrap {
    position: relative;
    display: inline-block;
    line-height: 0;
    max-width: 100%;
}

.agd-labels .agd-label,
.agd-labels .sticker {
    display: block;
}

.agd-labels .agd-label__text--overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    color: #ffffff;
    text-align: center;
    pointer-events: none;
    white-space: normal;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.agd-labels--plp {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    pointer-events: none;
    width: 100%;
    height: auto;
    max-width: 100%;
}

.agd-labels--plp > div,
.agd-labels--plp > span {
    pointer-events: auto;
}

.agd-labels--plp .label-table2 {
    position: absolute;
    z-index: 4;
}

.agd-labels--plp .agd-label__image-wrap {
    display: block;
    width: 100%;
    height: 100%;
}

.agd-labels--plp .label-table2.top-left {
    top: 0;
    left: 0;
}

.agd-labels--plp .label-table2.top-center {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.agd-labels--plp .label-table2.top-right {
    top: 0;
    right: 0;
}

.agd-labels--plp .label-table2.middle-left {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.agd-labels--plp .label-table2.middle-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.agd-labels--plp .label-table2.bottom-left {
    bottom: 0;
    left: 0;
}

.agd-labels--plp .label-table2.bottom-center {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.agd-labels--plp .label-table2.bottom-right {
    bottom: 0;
    right: 0;
}

.agd-labels--plp .label-table2.middle-right {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

.product-list-style-38 .product-item-top,
.product-list-style-41 .product-item-top {
    position: relative;
}

.product-list-style-38 .agd-labels--plp,
.product-list-style-41 .agd-labels--plp {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    pointer-events: none;
    width: 100%;
    height: auto;
    max-width: 100%;
    aspect-ratio: 1 / 1;
}

.product-list-style-38 .agd-labels--plp > div,
.product-list-style-41 .agd-labels--plp > div {
    pointer-events: auto;
}

.product-list-style-38 .agd-labels--plp .label-table2,
.product-list-style-41 .agd-labels--plp .label-table2 {
    position: absolute;
    z-index: 4;
}

.product-list-style-38 .agd-labels--plp .label-table2.top-left,
.product-list-style-41 .agd-labels--plp .label-table2.top-left {
    top: 0;
    left: 0;
}

.product-list-style-38 .agd-labels--plp .label-table2.top-center,
.product-list-style-41 .agd-labels--plp .label-table2.top-center {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.product-list-style-38 .agd-labels--plp .label-table2.top-right,
.product-list-style-41 .agd-labels--plp .label-table2.top-right {
    top: 0;
    right: 0;
}

.product-list-style-38 .agd-labels--plp .label-table2.middle-left,
.product-list-style-41 .agd-labels--plp .label-table2.middle-left {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.product-list-style-38 .agd-labels--plp .label-table2.middle-center,
.product-list-style-41 .agd-labels--plp .label-table2.middle-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.product-list-style-38 .agd-labels--plp .label-table2.bottom-left,
.product-list-style-41 .agd-labels--plp .label-table2.bottom-left {
    bottom: 0;
    left: 0;
}

.product-list-style-38 .agd-labels--plp .label-table2.bottom-right,
.product-list-style-41 .agd-labels--plp .label-table2.bottom-right {
    bottom: 0;
    right: 0;
}

.product-list-style-38 .agd-labels--plp .label-table2.bottom-center,
.product-list-style-41 .agd-labels--plp .label-table2.bottom-center {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.product-list-style-38 .agd-labels--plp .label-table2.middle-right,
.product-list-style-41 .agd-labels--plp .label-table2.middle-right {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}
