.discount-section {
    background: linear-gradient(135deg, #264dff 0%, #3b82f6 100%);
    border-radius: 16px;
    padding: 24px;
    margin: 20px 0 0;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
    position: relative;
    overflow: hidden;
    animation: slideInFromTop 0.5s ease-out;
}
.discount-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.discount-section-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.discount-section-header i {
    font-size: 28px;
    color: #ffd700;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.discount-section-header h3 {
    margin: 0;
    color: white;
    font-size: 20px;
    font-weight: 400;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.discount-section-header .discount-badge {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 400;
    border: 1px solid rgba(255, 215, 0, 0.3);
    margin-right: auto;
}

/* ==================== فرم تخفیف ==================== */

.discount-form {
    position: relative;
    z-index: 2;
}

.discount-input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.discount-input-container {
    flex: 1;
    position: relative;
}

.discount-input {
    width: 100%;
    padding: 14px 18px;
    padding-right: 45px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #2d3748;
    transition: all 0.3s ease;
    font-family: inherit;
    direction: ltr;
    text-align: right;
}

.discount-input:focus {
    outline: none;
    border-color: #ffd700;
    background: white;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
}

.discount-input::placeholder {
    color: #a0aec0;
    direction: rtl;
}

.discount-input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 18px;
    pointer-events: none;
    transition: all 0.3s ease;
}

.discount-input:focus + .discount-input-icon {
    color: #ffd700;
}

.discount-apply-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #2d3748;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 400;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.discount-apply-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.discount-apply-btn:hover::before {
    left: 100%;
}

.discount-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.discount-apply-btn:active {
    transform: translateY(0);
}

.discount-apply-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.discount-apply-btn i {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.discount-apply-btn:hover i {
    transform: rotate(360deg);
}

/* ==================== لودر ==================== */

.discount-loader {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 12px;
    margin-bottom: 16px;
}

.discount-loader.active {
    display: flex;
}

.discount-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.discount-loader-text {
    margin-right: 12px;
    color: white;
    font-size: 14px;
    font-weight: 400;
}

/* ==================== نمایش تخفیف اعمال شده ==================== */

.discount-applied {
    display: none;
    background: rgb(255 255 255 / 27%);
    border-radius: 10px;
    color: #fff;
    padding: 10px;
    margin-top: 16px;
    animation: slideInFromTop 0.4s ease-out;
}

.discount-applied.active {
    display: block;
}

.discount-applied-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 14px;
    padding-bottom: 14px;
    gap: 20px;
    border-bottom: 2px dashed #e2e8f0;
}
.discount-applied-info {
        display: flex;
    gap: 14px;
}
.discount-applied-details {
        display: flex;
    gap: 15px;
}
.discount-applied-percent {
        background: #3b82f6;
    color: #fff;
    padding: 0 10px;
    border-radius: 21px;
}
.discount-applied-icon i {
           font-size: 30px;
    color: #ffe124;
}
.discount-applied-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #10b981;
    font-weight: 400;
    font-size: 16px;
}

.discount-applied-title i {
    font-size: 20px;
    animation: checkmark 0.5s ease-out;
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

.discount-remove-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.discount-remove-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.discount-remove-btn:active {
    transform: translateY(0);
}

.discount-details {
    display: grid;
    gap: 12px;
}

.discount-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.discount-detail-label {
    color: #64748b;
    font-size: 14px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 8px;
}

.discount-detail-label i {
    font-size: 16px;
    color: #667eea;
}

.discount-detail-value {
    color: #1e293b;
    font-size: 15px;
    font-weight: 400;
}

.discount-code-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 1px;
}

.discount-amount-highlight {
    color: #10b981;
    font-size: 18px;
    font-weight: 700;
}

.discount-percent-badge {
    background: #10b981;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 400;
    margin-right: 8px;
}

.discount-final-total {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    margin: 12px -18px -18px;
    padding: 16px 18px;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.discount-final-total .discount-detail-label,
.discount-final-total .discount-detail-value {
    color: white;
    font-size: 16px;
    font-weight: 700;
}

/* ==================== پیام‌های خطا و موفقیت ==================== */

.discount-message {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 400;
    animation: slideInFromTop 0.3s ease-out;
    position: relative;
    z-index: 2;
}

.discount-message i {
    font-size: 18px;
}

.discount-message.error {
    background: rgba(239, 68, 68, 0.95);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.discount-message.success {
    background: rgba(16, 185, 129, 0.95);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.discount-message.info {
    background: rgba(59, 130, 246, 0.95);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ==================== انیمیشن ورود و خروج ==================== */

.discount-section.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* ==================== ریسپانسیو ==================== */

@media (max-width: 768px) {
    .discount-section {
        padding: 18px;
        margin: 16px 0;
    }

    .discount-section-header h3 {
        font-size: 17px;
    }

    .discount-input-wrapper {
        flex-direction: column;
        gap: 10px;
    }

    .discount-apply-btn {
        width: 100%;
        justify-content: center;
    }

    .discount-detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .discount-detail-value {
        align-self: flex-end;
    }

    .discount-applied-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .discount-remove-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .discount-section {
        padding: 16px;
        border-radius: 12px;
    }

    .discount-section-header {
        flex-wrap: wrap;
    }

    .discount-section-header .discount-badge {
        text-align: center;
    }

    .discount-input {
        font-size: 14px;
        padding: 12px 16px;
        padding-right: 40px;
    }

    .discount-apply-btn {
        font-size: 14px;
        padding: 12px 20px;
    }

    .discount-applied {
        padding: 14px;
    }

    .discount-detail-label,
    .discount-detail-value {
        font-size: 13px;
    }

    .discount-code-badge {
        font-size: 11px;
        padding: 5px 12px;
    }
}



/* ==================== افکت‌های اضافی ==================== */

.discount-shimmer {
    position: relative;
    overflow: hidden;
}

.discount-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}

/* ==================== Tooltip (اختیاری) ==================== */

.discount-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.discount-tooltip .discount-tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #1e293b;
    color: white;
    text-align: center;
    border-radius: 8px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    line-height: 1.4;
}

.discount-tooltip .discount-tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

.discount-tooltip:hover .discount-tooltip-text {
    visibility: visible;
    opacity: 1;
}



@media print {
    .discount-section {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }

    .discount-apply-btn,
    .discount-remove-btn {
        display: none;
    }
}