/**
 * Discount Codes — Combined frontend styles
 * Includes: shortcode checker, coupon apply feedback
 */

/* ── Shortcode: discount code checker ── */
.discount-code-checker-wrapper {
    max-width: 400px;
    margin: 0 0 20px 0;
    padding: 20px;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    background: #f9f9f9;
}

.discount-code-checker-wrapper h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.discount-code-form .form-group {
    margin-bottom: 10px;
}

.discount-code-form input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    margin: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    display: block;
}

.discount-code-form label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.97em;
    color: #333;
}

#check-discount-code-btn {
    background: #0073aa;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
    font-size: 1em;
}

#check-discount-code-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.discount-code-result.success {
    padding: 15px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    color: #155724;
}

.discount-code-result.error {
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
}

.discount-code-result.loading {
    padding: 15px;
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    color: #0c5460;
}

.discount-code-info {
    margin-top: 10px;
}

.discount-code-info strong {
    display: block;
    margin-bottom: 5px;
}

/* ── Coupon apply feedback ── */
.coupon-apply-loading {
    position: relative;
    opacity: 0.6;
}

.coupon-apply-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: coupon-spinner 0.6s linear infinite;
}

@keyframes coupon-spinner {
    to { transform: rotate(360deg); }
}

.coupon-processing-message {
    display: none;
    padding: 12px 16px;
    margin: 12px 0;
    background: #e3f2fd;
    border-left: 4px solid #2196F3;
    border-radius: 4px;
    color: #1565C0;
    font-size: 0.95rem;
    line-height: 1.6;
    font-weight: 500;
    animation: fadeIn 0.3s ease-in;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.coupon-processing-message.show {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.spinner-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #1565C0;
    border-radius: 50%;
    border-top-color: transparent;
    animation: coupon-spinner 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 10px;
}

