/* طراحی مینیمال و زیبا */
.smart-discount-popup {
    position: fixed;
    bottom: 15px;
    right: 15px;
    width: 280px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
    z-index: 99999;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.smart-discount-popup.active {
    transform: translateY(0);
    opacity: 1;
}

.smart-discount-header {
    padding: 14px 16px;
    background: #4a6bdf;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.smart-discount-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.smart-discount-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.smart-discount-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.smart-discount-body {
    padding: 16px;
}

.smart-discount-product {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.smart-discount-product img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #f0f0f0;
}

.smart-discount-info {
    flex: 1;
}

.smart-discount-info h4 {
    margin: 0 0 6px 0;
    font-size: 14px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.smart-discount-price {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.discount-badge {
    background: #ff4757;
    color: white;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    align-self: flex-start;
    font-weight: 600;
}

.price-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.old-price {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
}

.new-price {
    font-size: 15px;
    color: #2e7d32;
    font-weight: 700;
}

.coupon-section {
    background: #f8f9ff;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    margin-top: 14px;
    border: 1px dashed #4a6bdf;
    transition: all 0.2s;
}

.coupon-section:hover {
    background: #f0f4ff;
}

.coupon-code {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.coupon-code span {
    font-size: 13px;
    color: #666;
}

.coupon-code strong {
    font-size: 15px;
    font-weight: 700;
    color: #4a6bdf;
    background: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #4a6bdf;
    cursor: pointer;
    transition: all 0.2s;
}

.coupon-code strong:hover {
    background: #4a6bdf;
    color: #fff;
    transform: translateY(-1px);
}

.timer-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
}

.coupon-timer {
    direction: ltr;
}

.timer-part {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 40px;
}

.timer-value {
    background: #fff;
    color: #ff4757;
    font-weight: 700;
    font-size: 18px;
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: inline-block;
    min-width: 32px;
    text-align: center;
}

.timer-label {
    font-size: 10px;
    color: #666;
    margin-top: 4px;
    text-align: center;
}

.timer-separator {
    color: #ff4757;
    font-weight: bold;
    font-size: 16px;
    align-self: flex-end;
    margin-bottom: 10px;
}

.timer-expired {
    color: #ff4757;
    font-weight: 700;
    text-align: center;
    padding: 8px;
    font-size: 14px;
    background: #fff5f5;
    border-radius: 6px;
    margin-top: 8px;
}

.smart-discount-footer {
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
}

.view-product {
    display: block;
    text-align: center;
    background: #4a6bdf;
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.view-product:hover {
    background: #3a5bd9;
    color: rgb(153, 153, 153);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(74, 107, 223, 0.3);
}

/* انیمیشن */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.smart-discount-popup.active {
    animation: fadeInUp 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* نسخه موبایل */
@media (max-width: 480px) {
    .smart-discount-popup {
        width: calc(100% - 30px);
        right: 15px;
        left: auto;
        bottom: 15px;
        max-width: 300px;
    }

    .smart-discount-product img {
        width: 56px;
        height: 56px;
    }

    .timer-value {
        font-size: 16px;
        padding: 4px 8px;
    }

    .coupon-code strong {
        font-size: 14px;
        padding: 5px 12px;
    }
}