/**
 * Copyright (c) 2025. Volodymyr Hryvinskyi. All rights reserved.
 * Author: Volodymyr Hryvinskyi <volodymyr@hryvinskyi.com>
 * GitHub: https://github.com/hryvinskyi
 */


/* Main container styles */
.product.media .top-left.animation .prolabel,
.product-info-main.subscription-product-info .top-left.animation .prolabel {
    opacity: 0;
}

.product.media .top-left.animation.initialized .prolabel,
.product-info-main.subscription-product-info .top-left.animation.initialized .prolabel  {
    opacity: 1;
}

.animation .prolabel .prolabel__content {
    background: #E98678;
    color: #fff;
    border-radius: 5px;
    font-size: 20px;
    font-weight: 700;
    height: 30px;
    padding: 0 12px;
    text-transform: uppercase;
    display: inline-block;
    position: relative;
    cursor: pointer;
    min-width: 100px;
    line-height: 30px;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
    transition: background 0.3s ease, transform 0.3s ease;
}

.animation .prolabel .prolabel__content:hover {
    background: #d67368;
}

.product.media .animation .prolabel .prolabel__content {
    margin: 25px 6px 6px 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.box-tocart .prolabels-wrapper .absolute {
    top: -1rem;
    left: 1.3rem;
}
.box-tocart .prolabels-wrapper .prolabel {
    display: none;
}
.box-tocart .prolabels-wrapper .animation .prolabel {
    display: block;
}

/* Container for discount elements */
.animation .prolabel .prolabel__content .discount-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
}

/* Base styles for discount elements */
.animation .prolabel .prolabel__content .discount-percent,
.animation .prolabel .prolabel__content .discount-amount {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: opacity 0.3s ease;
}

/* Simple show/hide states */
.animation .prolabel .prolabel__content .discount-percent.show,
.animation .prolabel .prolabel__content .discount-amount.show {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.animation .prolabel .prolabel__content .discount-percent.hide,
.animation .prolabel .prolabel__content .discount-amount.hide {
    opacity: 0;
    visibility: hidden;
    z-index: 1;
}

/* Amount formatting */
.animation .prolabel .prolabel__content .discount-amount {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0; /* No gap between elements */
}

.animation .prolabel .prolabel__content .discount-amount .big-number {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    padding-left: 4px;
}

.animation .prolabel .prolabel__content .discount-amount .small-number {
    font-size: 10px;
    font-weight: 400;
    text-decoration: underline;
    padding-left: 1px;
    line-height: 1;
    vertical-align: top;
    position: relative;
    top: -4px;
}

/* Optional: Add subtle transition effects */
.prolabel.with-transition .prolabel__content .discount-percent,
.prolabel.with-transition .prolabel__content .discount-amount {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.prolabel.with-transition .prolabel__content .discount-percent.show,
.prolabel.with-transition .prolabel__content .discount-amount.show {
    transform: scale(1);
}

.prolabel.with-transition .prolabel__content .discount-percent.hide,
.prolabel.with-transition .prolabel__content .discount-amount.hide {
    transform: scale(0.9);
}

/* Loading indicator during switch */
.animation .prolabel .prolabel__content.switching::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    animation: loadingBar 0.6s ease-in-out;
    z-index: 3;
}

@keyframes loadingBar {
    0% {
        transform: scaleX(0);
        transform-origin: left;
    }
    50% {
        transform: scaleX(1);
        transform-origin: left;
    }
    51% {
        transform: scaleX(1);
        transform-origin: right;
    }
    100% {
        transform: scaleX(0);
        transform-origin: right;
    }
}