/* Melorin Rewards - Scoped Styles */

#melorin-rewards-root {
    margin-bottom: 20px;
}

#melorin-rewards-root .melorin-box {
    direction: rtl;
    padding: 12px 15px;
    background: linear-gradient(135deg, #fff0f5 0%, #fce4ec 30%, #fff5f8 70%, #f8e8ff 100%);
    color: #6b3a5b;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
    border: 2px solid #f8bbd0;
    line-height: 1.8;
    box-shadow: 
        0 8px 30px rgba(244, 143, 177, 0.15),
        0 2px 10px rgba(206, 147, 216, 0.1);
    position: relative;
    overflow: hidden;
}

#melorin-rewards-root .melorin-box::before {
    content: '🌸';
    position: absolute;
    top: -15px;
    right: -10px;
    font-size: 40px;
    opacity: 0.15;
    pointer-events: none;
    transform: rotate(15deg);
    animation: melorinFloat 4s ease-in-out infinite;
}

#melorin-rewards-root .melorin-box::after {
    content: '✨';
    position: absolute;
    bottom: 10px;
    left: 15px;
    font-size: 24px;
    opacity: 0.2;
    pointer-events: none;
    animation: melorinSparkleFloat 3s ease-in-out infinite;
}

#melorin-rewards-root .melorin-box.shipping-selected {
    border-right: 4px solid #f06292;
    border-color: #f06292;
    background: linear-gradient(135deg, #fff0f5 0%, #fce4ec 30%, #fce4ec 70%, #f8bbd0 100%);
    box-shadow: 
        0 8px 35px rgba(240, 98, 146, 0.2),
        0 2px 15px rgba(236, 64, 122, 0.1),
        inset 0 0 30px rgba(248, 187, 208, 0.15);
    animation: melorinSoftGlow 3s ease-in-out infinite;
}

#melorin-rewards-root .melorin-box.non-retail-box {
    border-right: 4px solid #ce93d8;
    border-color: #ce93d8;
    background: linear-gradient(135deg, #f8e8ff 0%, #f3e5f5 30%, #fce4ec 70%, #e1bee7 100%);
    box-shadow: 
        0 8px 35px rgba(206, 147, 216, 0.2),
        0 2px 15px rgba(186, 104, 200, 0.1);
}

#melorin-rewards-root .melorin-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

#melorin-rewards-root .melorin-icon {
    font-size: 22px;
    color: #f06292;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(240, 98, 146, 0.3));
    animation: melorinHeartBeat 2s ease-in-out infinite;
}

#melorin-rewards-root .non-retail-box .melorin-icon {
    color: #ce93d8;
    filter: drop-shadow(0 2px 6px rgba(206, 147, 216, 0.3));
    animation: melorinTwinkle 2.5s ease-in-out infinite;
}

#melorin-rewards-root .melorin-title {
    font-size: 15px;
    font-weight: 800;
    color: #e91e63;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(233, 30, 99, 0.1);
}

#melorin-rewards-root .non-retail-box .melorin-title {
    color: #9c27b0;
    text-shadow: 0 1px 3px rgba(156, 39, 176, 0.1);
}

#melorin-rewards-root .melorin-progress {
    height: 12px;
    border-radius: 999px;
    background: #fce4ec;
    overflow: hidden;
    margin-bottom: 12px;
    border: 2px solid #f8bbd0;
    box-shadow: inset 0 2px 4px rgba(240, 98, 146, 0.08);
    position: relative;
    z-index: 1;
}

#melorin-rewards-root .melorin-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, 
        #f8bbd0, 
        #f48fb1, 
        #f06292, 
        #ec407a, 
        #f48fb1,
        #f8bbd0
    );
    background-size: 200% 100%;
    animation: melorinShimmerSweet 2.5s linear infinite;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 0 12px rgba(240, 98, 146, 0.3),
        0 0 24px rgba(236, 64, 122, 0.15);
    position: relative;
}

#melorin-rewards-root .melorin-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.4) 0%, 
        rgba(255, 255, 255, 0) 100%);
    border-radius: inherit;
}

#melorin-rewards-root .melorin-milestones {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

#melorin-rewards-root .melorin-milestone {
    flex: 1;
    text-align: center;
    font-size: 11px;
    opacity: 0.4;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: scale(0.9);
}

#melorin-rewards-root .melorin-milestone.active {
    opacity: 1;
    transform: scale(1.08);
    animation: melorinBounceSweet 0.6s ease-out;
}

#melorin-rewards-root .melorin-milestone span {
    display: block;
    font-size: 24px;
    margin-bottom: 6px;
    filter: drop-shadow(0 2px 6px rgba(240, 98, 146, 0.25));
    transition: all 0.3s ease;
}

#melorin-rewards-root .melorin-milestone.active span {
    filter: drop-shadow(0 3px 10px rgba(240, 98, 146, 0.4));
    animation: melorinWiggle 2s ease-in-out infinite;
}

#melorin-rewards-root .melorin-milestone small {
    display: block;
    font-size: 11px;
    color: #b08090;
    font-weight: 600;
    transition: all 0.3s ease;
}

#melorin-rewards-root .melorin-milestone.active small {
    color: #e91e63;
    text-shadow: 0 1px 4px rgba(233, 30, 99, 0.15);
    font-weight: 700;
}

#melorin-rewards-root .melorin-message {
    font-size: 13px;
    color: #8b6072;
    margin-bottom: 10px;
    line-height: 1.9;
    position: relative;
    z-index: 1;
}

#melorin-rewards-root .melorin-highlight {
    color: #e91e63;
    font-weight: 800;
    background: linear-gradient(135deg, #fce4ec, #fff);
    padding: 2px 8px;
    border-radius: 12px;
    text-shadow: 0 1px 2px rgba(233, 30, 99, 0.08);
    box-shadow: 0 2px 8px rgba(240, 98, 146, 0.1);
}

#melorin-rewards-root .melorin-footer-note {
    margin-top: 8px;
    font-size: 11px;
    color: #b39d9d;
    font-style: italic;
    position: relative;
    z-index: 1;
}

/* Product/Cart Banner */
.melorin-rewards-banner {
    direction: rtl;
    margin: 0 0 15px 0;
    padding: 14px 18px;
    background: linear-gradient(135deg, #fff0f5 0%, #fce4ec 50%, #fff5f8 100%);
    color: #6b3a5b;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
    border: 2px solid #f8bbd0;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.8;
    animation: melorinSlideInSweet 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 8px 30px rgba(244, 143, 177, 0.15),
        0 2px 10px rgba(206, 147, 216, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.melorin-rewards-banner::before {
    content: '💝';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 35px;
    opacity: 0.12;
    pointer-events: none;
    transform: rotate(-15deg);
    animation: melorinFloat 5s ease-in-out infinite;
}

.melorin-rewards-banner::after {
    content: '💕';
    position: absolute;
    bottom: -5px;
    left: 20px;
    font-size: 20px;
    opacity: 0.1;
    pointer-events: none;
    animation: melorinFloat 4s ease-in-out infinite reverse;
}

.melorin-rewards-banner:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 40px rgba(240, 98, 146, 0.2),
        0 4px 20px rgba(206, 147, 216, 0.15);
    border-color: #f48fb1;
}

.melorin-banner-icon {
    color: #f06292;
    font-size: 22px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(240, 98, 146, 0.35));
    animation: melorinHeartBeat 2s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

.melorin-rewards-banner strong {
    color: #e91e63;
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(233, 30, 99, 0.08);
    position: relative;
    z-index: 1;
}

.melorin-banner-details {
    color: #8b6072;
    font-size: 13px;
    line-height: 1.9;
    position: relative;
    z-index: 1;
}

.melorin-banner-details strong {
    color: #6b3a5b;
}

.melorin-banner-note {
    margin-top: 6px;
    font-size: 11px;
    color: #b39d9d;
    font-style: italic;
    position: relative;
    z-index: 1;
}

.melorin-banner-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #e91e63;
    font-size: 19px;
    font-weight: 800;
    text-shadow: 0 1px 4px rgba(233, 30, 99, 0.1);
    letter-spacing: 0.3px;
    position: relative;
    z-index: 1;
}

.melorin-banner-message {
    color: #8b6072;
    font-size: 13px;
    margin-bottom: 10px;
    line-height: 1.9;
    position: relative;
    z-index: 1;
}

.melorin-progress-bar-container {
    height: 12px;
    border-radius: 999px;
    background: #fce4ec;
    overflow: hidden;
    margin-bottom: 12px;
    border: 2px solid #f8bbd0;
    box-shadow: inset 0 2px 4px rgba(240, 98, 146, 0.08);
    position: relative;
    z-index: 1;
}

.melorin-progress-bar-inner {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, 
        #f8bbd0, 
        #f48fb1, 
        #f06292, 
        #ec407a, 
        #f48fb1,
        #f8bbd0
    );
    background-size: 200% 100%;
    animation: melorinShimmerSweet 2.5s linear infinite;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 0 12px rgba(240, 98, 146, 0.3),
        0 0 24px rgba(236, 64, 122, 0.15);
    position: relative;
}

.melorin-progress-bar-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.4) 0%, 
        rgba(255, 255, 255, 0) 100%);
    border-radius: inherit;
}

.melorin-milestones-container {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    z-index: 1;
}

/* Sweet Animations */
@keyframes melorinShimmerSweet {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

@keyframes melorinSlideInSweet {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes melorinHeartBeat {
    0%, 100% { 
        transform: scale(1);
    }
    15% { 
        transform: scale(1.15);
    }
    30% { 
        transform: scale(1);
    }
    45% { 
        transform: scale(1.1);
    }
    60% { 
        transform: scale(1);
    }
}

@keyframes melorinTwinkle {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1) rotate(10deg);
        opacity: 0.8;
    }
}

@keyframes melorinBounceSweet {
    0% { transform: scale(0.8); }
    40% { transform: scale(1.12); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1.08); }
}

@keyframes melorinWiggle {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-5deg) scale(1.05); }
    75% { transform: rotate(5deg) scale(1.05); }
}

@keyframes melorinSoftGlow {
    0%, 100% { 
        box-shadow: 
            0 8px 35px rgba(240, 98, 146, 0.2),
            0 2px 15px rgba(236, 64, 122, 0.1),
            inset 0 0 30px rgba(248, 187, 208, 0.15);
    }
    50% { 
        box-shadow: 
            0 8px 45px rgba(240, 98, 146, 0.3),
            0 2px 20px rgba(236, 64, 122, 0.18),
            inset 0 0 40px rgba(248, 187, 208, 0.25);
    }
}

@keyframes melorinFloat {
    0%, 100% { 
        transform: translateY(0) rotate(15deg);
    }
    50% { 
        transform: translateY(-8px) rotate(20deg);
    }
}

@keyframes melorinSparkleFloat {
    0%, 100% { 
        transform: translateY(0) scale(1);
        opacity: 0.2;
    }
    50% { 
        transform: translateY(-10px) scale(1.3);
        opacity: 0.35;
    }
}

@media (max-width: 768px) {
    #melorin-rewards-root .melorin-box {
        padding: 10px 12px;
        font-size: 12px;
    }
    .melorin-rewards-banner {
        padding: 12px 14px;
        font-size: 12px;
    }
    #melorin-rewards-root .melorin-milestone span {
        font-size: 20px;
    }
}