/* ==========================================================================
   Open Tiered Discount (Знижки Екстра) - UniShop2 Theme Styling v1.1.6
   ========================================================================== */

/* 0. Запобігання обрізанню підказки батьківськими блоками та виведення на передній план тільки при наведенні */
.product-thumb__image,
.product-thumb .image {
    z-index: auto !important;
    overflow: visible !important;
}

.sticker {
    overflow: visible !important;
    position: absolute !important;
    top: -5px !important;
    left: -5px !important;
    z-index: 50 !important;
    opacity: 1 !important;
}

/* Підняття шару виключно для самого стікера і випадаючої підказки */
.sticker:hover,
.sticker:focus-within,
.tiered-sticker-wrap:hover,
.tiered_discount:hover,
.product-thumb:has(.tiered-sticker-wrap:hover) .sticker {
    z-index: 999999 !important;
}

.product-thumb:hover,
.product-layout:hover,
.uni-module__item:hover,
.uni-item:hover {
    z-index: 50 !important;
}

.product-thumb .image,
.product-thumb__image,
.product-page__image-main,
.quick-order__image,
.quick-order__image-main {
    overflow: visible !important;
}

/* 1. Стікери на товарах (Каталог, Модулі, Картка товару, Швидке замовлення) */
.sticker__item.tiered_discount,
.sticker__item.tiered-sticker-wrap,
.product-thumb__stickers-item.tiered-sticker-badge,
.product-page__stickers-item.tiered-sticker-badge,
.tiered-sticker-badge {
    background: #e52d27 !important;
    background-color: #e52d27 !important;
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 3px 8px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2) !important;
    position: relative !important;
    white-space: nowrap !important;
    text-align: left !important;
    margin-top: 3px !important;
    z-index: 50 !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    filter: none !important;
}

.sticker__item.tiered_discount:hover,
.sticker__item.tiered-sticker-wrap:hover,
.product-thumb__stickers-item.tiered-sticker-badge:hover,
.product-page__stickers-item.tiered-sticker-badge:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important;
    z-index: 9999999 !important;
    opacity: 1 !important;
    filter: none !important;
}

/* Tooltip Dropdown при наведенні на стікер - 100% суцільний білий чіткий фон */
.tiered-sticker-dropdown {
    display: none;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    margin-top: 6px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25) !important;
    padding: 12px 16px !important;
    min-width: 230px !important;
    z-index: 9999999 !important;
    text-align: left !important;
    white-space: nowrap !important;
    pointer-events: auto !important;
    font-weight: normal !important;
    color: #1e293b !important;
    cursor: default !important;
    opacity: 1 !important;
    filter: none !important;
}

.sticker__item.tiered_discount:hover .tiered-sticker-dropdown,
.sticker__item.tiered-sticker-wrap:hover .tiered-sticker-dropdown,
.tiered-sticker-wrap:hover > .tiered-sticker-dropdown {
    display: block !important;
    opacity: 1 !important;
}

.tiered-dropdown-title {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a !important;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
}

.tiered-dropdown-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tiered-dropdown-row {
    font-size: 12px;
    color: #334155 !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.tiered-dropdown-row b {
    color: #dc2626 !important;
    font-weight: 700;
}

/* 2. Промо-блок під ціною в картці товару та Швидкому замовленні (Чистий стиль без червоних рамок) */
.product-page__tiered-promo,
.quick-order__tiered-promo {
    margin: 15px 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.tiered-clean-promo-box {
    background: #f8fafc !important;
    background-color: #f8fafc !important;
    border-radius: 12px !important;
    padding: 14px 18px !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    color: #b91c1c !important;
    border: none !important;
    border-left: none !important;
    box-shadow: none !important;
}

.tiered-clean-promo-box strong {
    font-weight: 700 !important;
    color: #b91c1c !important;
}

/* 3. Головна шкала прогресу в кошику (Попап та Чекаут) */
.tiered-cart-scales-wrap {
    margin: 18px 0;
    padding: 18px 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.tiered-scale-item {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #e2e8f0;
}
.tiered-scale-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.tiered-scale-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 8px;
}

.tiered-scale-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tiered-scale-title i {
    color: #25a7f3;
    font-size: 15px;
}

.tiered-current-sum-badge {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* Трек прогресу */
.tiered-progress-track {
    position: relative;
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    margin: 32px 16px 36px 16px;
}

.tiered-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #25a7f3 0%, #22c55e 100%);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.35);
}

/* Вузлові точки сходинок */
.tiered-step-node {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: #ffffff;
    border: 3px solid #cbd5e1;
    border-radius: 50%;
    z-index: 2;
    transition: all 0.3s ease;
}

.tiered-step-node.start-node {
    left: 0%;
}

.tiered-step-node.reached {
    border-color: #22c55e;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.tiered-step-label {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 800;
    color: #475569;
    white-space: nowrap;
    background: #f8fafc;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.tiered-step-node.reached .tiered-step-label {
    color: #15803d;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.tiered-step-sum-label {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.tiered-step-node.reached .tiered-step-sum-label {
    color: #15803d;
    font-weight: 700;
}

/* Блок мотивації та кнопка переходу */
.tiered-scale-motivation-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.tiered-scale-motivation {
    font-size: 13px;
    color: #334155;
    line-height: 1.5;
}
.tiered-scale-motivation strong {
    color: #0f172a;
}

.tiered-badge-achieved {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f0fdf4;
    color: #15803d;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid #bbf7d0;
    font-size: 12px;
    font-weight: 700;
    margin-right: 6px;
}

.tiered-next-remaining {
    display: inline-block;
    font-size: 13px;
    color: #334155;
}

.tiered-upsell-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #25a7f3;
    color: #ffffff !important;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(37, 167, 243, 0.25);
    white-space: nowrap;
}
.tiered-upsell-btn:hover {
    background: #1b91d6;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 167, 243, 0.35);
}

/* 4. Ідеальне вирівнювання колонок, цін та бейджів у кошику (попап) та чекауті */
.header-cart__item-wrapper,
.checkout-cart__item-wrapper {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
}

.header-cart__name,
.checkout-cart__name {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding-right: 15px !important;
}

.header-cart__quantity {
    flex: 0 0 105px !important;
    min-width: 105px !important;
    max-width: 105px !important;
    padding: 0 10px 0 0 !important;
    display: flex !important;
    align-items: center !important;
}

.checkout-cart__quantity {
    flex: 0 0 115px !important;
    min-width: 115px !important;
    max-width: 115px !important;
    padding: 0 15px 0 0 !important;
    display: flex !important;
    align-items: center !important;
}

.header-cart__quantity .qty-switch,
.checkout-cart__quantity .qty-switch,
.qty-switch__cart {
    margin: 0 !important;
    display: inline-flex !important;
    width: 92px !important;
}

.qty-switch__cart .qty-switch__input {
    width: 36px !important;
    flex: 0 0 36px !important;
    min-width: 36px !important;
    height: 30px !important;
    text-align: center !important;
    border-radius: 0 !important;
    border: solid 1px #eee !important;
}

.qty-switch__cart .qty-switch__btn {
    width: 28px !important;
    flex: 0 0 28px !important;
    min-width: 28px !important;
    height: 30px !important;
    line-height: 30px !important;
    text-align: center !important;
    border: none !important;
}

.header-cart__price {
    flex: 0 0 125px !important;
    min-width: 125px !important;
    max-width: 125px !important;
    padding: 0 10px 0 0 !important;
    white-space: nowrap !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    text-align: left !important;
}

.checkout-cart__price {
    flex: 0 0 135px !important;
    min-width: 135px !important;
    max-width: 135px !important;
    padding: 0 15px 0 0 !important;
    white-space: nowrap !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    text-align: left !important;
}

.header-cart__total {
    flex: 0 0 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    padding: 0 10px 0 0 !important;
    white-space: nowrap !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    text-align: left !important;
}

.checkout-cart__total {
    flex: 0 0 135px !important;
    min-width: 135px !important;
    max-width: 135px !important;
    padding: 0 10px 0 0 !important;
    white-space: nowrap !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    text-align: left !important;
}

.header-cart__price-text,
.header-cart__total-text,
.checkout-cart__price-text,
.checkout-cart__total-text {
    margin: 0 0 4px !important;
    color: #888888 !important;
    line-height: 1.2 !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    display: block !important;
}

.header-cart__price .cart-current-price,
.checkout-cart__price .cart-current-price {
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: #222222 !important;
    display: inline-block !important;
}

.tiered-original-price,
.header-cart__price .tiered-original-price,
.checkout-cart__price .tiered-original-price {
    text-decoration: line-through;
    color: #94a3b8 !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    margin: 0 0 2px !important;
    display: block !important;
}

.tiered-cart-discount-badge,
.header-cart__price .tiered-cart-discount-badge,
.checkout-cart__price .tiered-cart-discount-badge {
    display: inline-block !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: #ffffff !important;
    background: #22c55e !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    margin-top: 3px !important;
    width: fit-content !important;
}

/* 5. Інтеграція сповіщення про знижку всередину системного сповіщення UniShop2 */
.uni-alert__discount-badge {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed rgba(255, 255, 255, 0.45);
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.uni-alert__discount-badge i {
    font-size: 15px;
}

.tiered-toast-container {
    display: none !important;
}

.tiered-toast {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #22c55e;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    pointer-events: auto;
    animation: tieredToastIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.tiered-toast.hiding {
    animation: tieredToastOut 0.3s forwards ease;
}

.tiered-toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0fdf4;
    color: #22c55e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.tiered-toast-content {
    flex-grow: 1;
}

.tiered-toast-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.tiered-toast-text {
    font-size: 12px;
    color: #475569;
    margin-top: 2px;
}

/* 8. Промо-бейдж відсотка знижки біля перекресленої ціни в каталозі та картці */
.product-thumb__price.price,
.product-page__price.price,
.uni-module__price.price,
.price {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
}

.price .price-new {
    order: 1 !important;
}

.price .price-old {
    order: 2 !important;
}

.tiered-promo-percent-badge {
    order: 3 !important;
    display: inline-block !important;
    color: #e52d27 !important;
    font-size: 0.85em !important;
    font-weight: 700 !important;
    margin-left: 6px !important;
    letter-spacing: -0.2px !important;
    vertical-align: middle !important;
    line-height: 1 !important;
}

.product-page__price .tiered-promo-percent-badge {
    order: 3 !important;
    font-size: 0.65em !important;
    padding: 3px 8px !important;
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    border-radius: 6px !important;
    margin-left: 10px !important;
}

