﻿/* wwwroot/css/discount-badges.css */


/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
    .discount-badge {
        box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    }
}


/* ===== Base Badge Styles ===== */



.discount-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    border-radius: 12px;
    color: #fff;
    position: relative;
    top: 8px;
    right: 17%;
    z-index: 0 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    background: linear-gradient(135deg, #e63946, #d62839);
}

    .discount-badge:hover {
        transform: scale(1.05);
        box-shadow: 0 3px 8px rgba(0,0,0,0.25);
    }

    .discount-badge i {
        font-size: 9px;
    }



[dir="rtl"] .discount-badges-container {
    right: 27%;
    top:-30px;
    height:40px;
    left: auto;
    align-items: flex-start;
}

/* ===== BOGO Badge ===== */
.badge-bogo {
    background: linear-gradient(135deg, #9c27b0, #7b1fa2);
    overflow: hidden;
}

    .badge-bogo::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.2) 50%, transparent 60%);
        animation: shine 3s infinite;
    }

/* ===== Buy X Pay Y Badge ===== */
.badge-buyxpayy {
    background: linear-gradient(135deg, #f73e04, #ff7600);
    overflow: hidden;
}

    .badge-buyxpayy::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.25) 50%, transparent 60%);
        animation: shine 2.5s infinite;
    }

    .badge-buyxpayy::after {
        content: '💰';
        margin-left: 2px;
        font-size: 10px;
    }

/* ===== Buy Y Get X Badge ===== */
.badge-buyxgety {
    background: linear-gradient(135deg, #673ab7, #512da8);
}

/* ===== Buy This Get That Badge ===== */
.badge-buythisgetthat {
    background: linear-gradient(135deg, #3f51b5, #303f9f);
}

/* ===== Buy Over X (Spend & Save) Badge ===== */
.badge-buyoverx {
    background: linear-gradient(135deg, #00bcd4, #0097a7);
}

/* ===== Percentage Off Badge ===== */
.badge-percentage {
    background: linear-gradient(135deg, #e63946, #d62839);
}

/* ===== Fixed Amount Off Badge ===== */
.badge-fixed {
    background: linear-gradient(135deg, #e63946, #d62839);
}

/* ===== SKU/Product Discount Badge ===== */
.badge-sku {
    background: linear-gradient(135deg, #e63946, #d62839);
}

/* ===== Category Discount Badge ===== */
.badge-category {
    background: linear-gradient(135deg, #e63946, #d62839);
}

/* ===== Manufacturer Discount Badge ===== */
.badge-manufacturer {
    background: linear-gradient(135deg, #795548, #5d4037);
}

/* ===== Site-wide Sale Badge ===== */
.badge-sitewide {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

/* ===== Shipping Badge ===== */
.badge-shipping {
    background: linear-gradient(135deg, #4caf50, #388e3c);
}

/* ===== Cart Level Discount Badge ===== */
.badge-cart {
    background: linear-gradient(135deg, #ff9800, #ef6c00);
}

/* ===== Custom/Default Badge ===== */
.badge-custom {
    background: linear-gradient(135deg, #607d8b, #455a64);
}

/* ===== Urgency Modifier (Limited Time) ===== */
.badge-urgent {
    animation: urgent-pulse 1s ease-in-out infinite;
}

    .badge-urgent::after {
        content: '⏰';
        margin-left: 4px;
        font-size: 10px;
    }

/* ===== Animations ===== */
@keyframes shine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

@keyframes urgent-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.02);
    }
}

/* ===== Product Container ===== */
.product-item {
    position: relative;
}

/* ===== Multiple Badges Container ===== */
.discount-badges-container {
    position: relative;
    top: 0px;
    right:24%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 0 !important;
    align-items: flex-end;
}

    .discount-badges-container .discount-badge {
        position: relative;
        top: auto;
        right: auto;
    }

/* ===== Tooltip Styles ===== */
.discount-badge[data-tooltip] {
    cursor: pointer;
}

    .discount-badge[data-tooltip]::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0,0,0,0.9);
        color: #fff;
        padding: 6px 10px;
        border-radius: 4px;
        font-size: 10px;
        font-weight: 400;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s, visibility 0.2s;
        margin-bottom: 6px;
        z-index: 1 !important;
    }

    .discount-badge[data-tooltip]:hover::after {
        opacity: 1;
        visibility: visible;
    }

/* ===== Responsive Styles ===== */



/* ===== Product Details Page Badge (Larger) ===== */
.product-details .discount-badge {
    font-size: 14px;
    padding: 8px 16px;
}


/* ===== Enhanced Badge Styling (Design Reference Match) ===== */
.discount-badge {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.2;
}

.discount-badge span {
    display: inline-flex;
    align-items: center;
}


/* ========== Product Detail Discount Badge (inside flyout, positioned left via order) ========== */
.product-detail-discount-badge {
    order: -1;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

    .product-detail-discount-badge .discount-badge {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        display: inline-flex;
        font-size: 13px;
        padding: 6px 12px;
        border-radius: 16px;
    }

    .product-detail-discount-badge .discount-badges-container {
        display: inline-flex;
        flex-wrap: nowrap;
        gap: 6px;
    }

        .product-detail-discount-badge .discount-badges-container .discount-badge {
            position: relative !important;
            top: -40px !important;
            right: 110px !important;
        }


/* ========== Product Page Stickers/Badges ========== */
.product-page-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 12px 0;
    direction: rtl;
}

    .product-page-badges li {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

        .product-page-badges li img {
            border-radius: 8px;
            transition: transform 0.2s;
        }

            .product-page-badges li img:hover {
                transform: scale(1.1);
            }

@media (max-width: 992px) {
    .discount-badge {
        font-size: 10px;
        padding: 4px 7px;
        border-radius: 10px;
    }
}


@media (max-width: 768px) {
    .product-page-badges li img {
        width: 35px;
        height: 35px;
    }




    [dir="rtl"] .discount-badges-container {
        right: -7% !important;
        top: -68px !important;
        position: absolute;
        left: auto;
        align-items: flex-start;
    }

    [dir="rtl"] .product-item .discount-badges-container {
        right: 13% !important;
        top: -20px !important;
        position: relative;
        left: auto;
        height:40px;
        align-items: flex-start;
    }


    .related-card-badge {
        position: absolute;
        top: 125px !important;
        right: 15% !important;
    }

    .discount-badges-container {
        position: absolute;
        top: 20px !important;
        right: 15% !important;
        display: flex;
        flex-direction: column;
        gap: 4px;
        z-index: 0 !important;
        align-items: flex-end;
    }

    .product-detail-discount-badge .discount-badges-container .discount-badge {
        position: relative !important;
        top: 64px !important;
        right: 132px !important;
    }
}

@media (max-width: 576px) {
    .discount-badge {
        font-size: 14px;
        padding: 3px 6px;
        border-radius: 8px;
    }

        .discount-badge i {
            font-size: 8px;
        }
}

@media (max-width: 480px) {


    .product-detail-discount-badge .discount-badges-container .discount-badge {
        position: relative !important;
        top: 64px !important;
        right: 132px !important;
    }

    .product-page-badges li img {
        width: 30px;
        height: 30px;
    }
}

/* ===== Badge with Limit Text (Two Lines) ===== */
.discount-badge.has-limit {
    flex-direction: column;
    align-items: center;
    padding: 4px 10px;
    line-height: 1.2;
}

.discount-badge .badge-main-text {
    display: block;
    font-weight: 700;
}

.discount-badge .badge-limit-text {
    display: block;
    font-size: 9px;
    font-weight: 500;
    opacity: 0.9;
    margin-top: 2px;
}

/* Hide icon when badge has limit text to save space */
.discount-badge.has-limit i,
.discount-badge.has-limit > span:last-child:not(.badge-main-text):not(.badge-limit-text) {
    display: none;
}