/*******************************************************************************************
*   ___  _          ______                     _ _                _                        *
*  / _ \| |         | ___ \                   | (_)              | |              © 2025   *
* / /_\ | | _____  _| |_/ /_ __ __ _ _ __   __| |_ _ __   __ _   | |_ ___  __ _ _ __ ___   *
* |  _  | |/ _ \ \/ / ___ \ '__/ _` | '_ \ / _` | | '_ \ / _` |  | __/ _ \/ _` | '_ ` _ \  *
* | | | | |  __/>  <| |_/ / | | (_| | | | | (_| | | | | | (_| |  | ||  __/ (_| | | | | | | *
* \_| |_/_|\___/_/\_\____/|_|  \__,_|_| |_|\__,_|_|_| |_|\__, |  \___\___|\__,_|_| |_| |_| *
*                                                         __/ |                            *
*                                                        |___/                             *
* ---------------------------------------------------------------------------------------- *
* This is commercial software, only users who have purchased a valid license and accept    *
* to the terms of the License Agreement can install and use this program.                  *
* ---------------------------------------------------------------------------------------- *
* website: https://cs-cart.alexbranding.com                                                *
*   email: info@alexbranding.com                                                           *
*******************************************************************************************/

.ab-sticker {
    &__tooltip {
        .ut2_round(@round: 4px) when (@abt__ut2_general_use_rounding = little) {
            .border-radius(@round);
        }
        .ut2_round(@round: 8px) when (@abt__ut2_general_use_rounding = full) {
            .border-radius(@round);
        }
        .ut2_round();
    }
}

.ab-stickers-container {
    .T-sticker {

    	.ut2_dl-shadow(@lighten-font) when (@abt__ut2_general_labels_use_shadow = true) {
			box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    	}
    	.ut2_dl-shadow(@lighten-font);

    	.ut2_dl-t-shadow(@lighten-font) when (@abt__ut2_general_labels_use_text_shadow = true) {
    		text-shadow: 0 1px 0 rgba(0,0,0,0.1);
    	}
    	.ut2_dl-t-shadow(@lighten-font);
    }
}

.ty-product-list, .grid-list {
    .ab-stickers-container__product_labels {
        max-width: -webkit-calc(~'100% - 54px');
        max-width: calc(~'100% - 54px');
    }
}

input[name="ab__stickers_output_side"][value="L"] {
    & ~ .ut2-w-c-q__buttons, & ~ .ut2-pl__list-buttons {
        left: auto;
        right: 0;
    }
}
input[name="ab__stickers_output_side"][value="R"] {
    & ~ .ut2-w-c-q__buttons, & ~ .ut2-pl__list-buttons {
        right: auto;
        left: 0;
    }
}
.ty-scroller-list__item {
    input[name="ab__stickers_output_side"][value="L"] {
        & ~ .ty-scroller-list__img-block {
            a[data-ca-target-id="product_quick_view"] {
                left: auto;
                right: 0;
            }
        }
    }
}

.ab-sticker-small_size .T-sticker {
    padding: 2px 4px;
}

.T-sticker {
    .ab-sticker__name {
        font-size: min(13px, calc(var(--font-size-normal) - 2px));
    }
}

.ty-product-block {
    .T-sticker {
        .ab-sticker__name {
            font-size: min(14px, var(--font-size-normal));
        }
    }
}

.ty-quick-view__wrapper {
    .ut2-pb__img-wrapper {
        .quick-view {
            position: relative;
        }
    }
    .ut2-pb__right {
        .ab-s-pictograms-wrapper {
            justify-content: center;
            margin-bottom: 0;
            margin-top: var(--gap-xs);
        }
    }
}

.ab-s-pictograms-wrapper {
    &-position_1&-display_on_detailed_page {
        justify-content: center;
        margin-bottom: var(--gap-sm);
    }
}

.ty-product-list .ut2-pl__info {
    .ab-s-pictograms-wrapper {
        margin-top: var(--gap-xs);
    }
}

.ty-quick-view__wrapper {
    .ab-s-pictograms-wrapper {
        margin-bottom: var(--gap-xs);
    }
}

.ut2-pb__img-wrapper {
    .ab-stickers-wrapper {
        @media (max-width: 899px) {
            top: var(--gap-sm);
            left: var(--gap-sm);
            right: var(--gap-sm);
        }
    }
    &:has(.abt__ut2_pig_counter) {
        .ab-stickers-wrapper {
            bottom: var(--gap-m);
        }
    }
}

.ut2-gl__image {
    &:has(.abt__ut2_hover_gallery_indicators) {
        .ab-stickers-container {
            &__BL, &__BR {
                bottom: var(--gap-xs);
            }
        }
    }

    &:has(.owl-pagination) {
        .ab-stickers-container {
            &__BL, &__BR {
                bottom: var(--gap-sm);
            }
        }
    }
}

.ty-compact-list {
    .ab-stickers-container__price_before,
    .ab-stickers-container__price_after {
        justify-content: flex-end;

        @media (max-width: 469px) {
            justify-content: flex-start;
        }
    }
}

.ut2-thumbnail-list {
    .ab-stickers-container__price_before,
    .ab-stickers-container__price_after {
        width: auto;
    }

    .ab-stickers-container__price_before {
        align-items: flex-end;
    }
}

.ut2-simple-list__wrap:has([class*="ab-stickers-container__price"]) {
    .ut2-simple-list__mix-price-and-button {
        flex-direction: column;
        flex-wrap: wrap;
    }

    .ut2-simple-list__price {
        max-height: max-content;
    }
}

.ut2-simple-list__wrap {
    .ab-stickers-container__price_before {
        margin-bottom: 0;
    }

    .ab-stickers-container__price_after {
        margin-top: 0;
    }
}

.ut2-template-small__item-price {
    .ab-stickers-container__price_before {
        align-items: flex-end;
    }
}

.ty-product-list .ut2-pl__control {
    .ab-stickers-container__price_after {
        margin-top: 0;
    }

    .ab-stickers-container__price_before {
        margin-bottom: var(--gap-xs);
    }
}

.ab-stickers-container__product_labels {
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

.ab__stickers__img-hover {
    .ab-stickers-container__product_labels {
        opacity: 0;
        visibility: hidden;
    }
}

[class*="price"] {
    &.pr-col-rev,
    &.pr-col-rev-mix {
        > div:not([class]) {
            .ab-stickers-container {
                &__price_before {
                    order: 1;
                }

                &__price_after {
                    order: -1;
                }
            }
        }
    }
}
