/* One Checkout Popup Styles - Minimal Design */

/* Override default button styling with higher specificity */
.one-checkout-popup button[type="button"],
.one-checkout-popup button[type="submit"],
.one-checkout-popup button,
.one-checkout-popup-overlay button[type="button"],
.one-checkout-popup-overlay button[type="submit"],
.one-checkout-popup-overlay button {
    background-color: #E5B489;
    border: none;
    border-radius: 8px;
    color: white;
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 16px;
    text-align: center;
    transition: all 0.3s ease;
    user-select: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(229, 180, 137, 0.2);
}

.one-checkout-popup button:hover,
.one-checkout-popup-overlay button:hover {
    background-color: #d9a06f !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(229, 180, 137, 0.3) !important;
}

.one-checkout-popup button:active,
.one-checkout-popup-overlay button:active {
    transform: translateY(0) !important;
}

/* Popup Overlay */
.one-checkout-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.one-checkout-popup-overlay.show {
    opacity: 1;
}

/* Popup Container */
.one-checkout-popup {
    background: white;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    position: relative;
    direction: rtl;
    font-family: 'Vazir', 'Tahoma', sans-serif;
}

.one-checkout-popup-overlay.show .one-checkout-popup {
    transform: scale(1);
}

/* Close Button - Minimalistic Design with High Specificity Override */
.one-checkout-popup .popup-close,
.one-checkout-popup-overlay .popup-close,
button.popup-close,
.popup-close[type="button"] {
    position: absolute !important;
    top: 15px !important;
    left: 15px !important;
    background: rgba(229, 180, 137, 0.1) !important;
    border: 1px solid rgba(229, 180, 137, 0.3) !important;
    color: #E5B489 !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    z-index: 10 !important;
    line-height: 1 !important;
    padding: 0 !important;
    box-shadow: none !important;
    transform: none !important;
}

.one-checkout-popup .popup-close:hover,
.one-checkout-popup-overlay .popup-close:hover,
button.popup-close:hover,
.popup-close[type="button"]:hover {
    background: #E5B489 !important;
    color: white !important;
    border-color: #E5B489 !important;
    transform: scale(1.05) !important;
    box-shadow: 0 2px 8px rgba(229, 180, 137, 0.3) !important;
}

.one-checkout-popup .popup-close:active,
.one-checkout-popup-overlay .popup-close:active,
button.popup-close:active,
.popup-close[type="button"]:active {
    transform: scale(0.95) !important;
    box-shadow: 0 1px 4px rgba(229, 180, 137, 0.2) !important;
}

/* Close Button Span Override */
.popup-close span,
button.popup-close span {
    font-size: 20px !important;
    line-height: 1 !important;
    color: inherit !important;
}

/* Popup Content */
.popup-content {
    font-family: 'ahang', 'vazir', 'tahoma', sans-serif;
    padding: 25px;
}

/* Product Header - Minimal */
.product-header {
    text-align: center;
    margin-bottom: 20px;
    /* padding-bottom: 20px; */
    /* border-bottom: 1px solid #f0f0f0; */
}

.product-header h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

/* Price Display */
.price-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
}

.current-price {
    font-weight: bold;
    color: #333;
    font-size: 16px;
}

/* Form Styles */
.checkout-form {
    margin-top: 0;
}

.form-group {
    margin-bottom: 15px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    background: #fafafa;
}

.form-group input:focus {
    outline: none;
    border-color: #E5B489;
    background: white;
}

.form-group input::placeholder {
    color: #999;
}

/* Coupon Section */
.coupon-group {
    margin-bottom: 20px;
}

.coupon-input-wrapper {
    display: flex;
    gap: 10px;
}

.coupon-input {
    flex: 1;
    background: #fafafa;
}

.one-checkout-popup .apply-coupon-btn,
.one-checkout-popup-overlay .apply-coupon-btn,
button.apply-coupon-btn,
.apply-coupon-btn[type="button"] {
    background: linear-gradient(135deg, #E5B489 0%, #d9a06f 100%) !important;
    color: white !important;
    border: none !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(229, 180, 137, 0.2) !important;
    position: relative !important;
    overflow: hidden !important;
    display: inline-block !important;
    user-select: none !important;
}

.apply-coupon-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.4s;
}

.one-checkout-popup .apply-coupon-btn:hover,
.one-checkout-popup-overlay .apply-coupon-btn:hover,
button.apply-coupon-btn:hover,
.apply-coupon-btn[type="button"]:hover {
    background: linear-gradient(135deg, #d9a06f 0%, #E5B489 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(229, 180, 137, 0.3) !important;
}

.one-checkout-popup .apply-coupon-btn:hover::before,
.one-checkout-popup-overlay .apply-coupon-btn:hover::before,
button.apply-coupon-btn:hover::before,
.apply-coupon-btn[type="button"]:hover::before {
    left: 100% !important;
}

.one-checkout-popup .apply-coupon-btn:active,
.one-checkout-popup-overlay .apply-coupon-btn:active,
button.apply-coupon-btn:active,
.apply-coupon-btn[type="button"]:active {
    transform: translateY(0) !important;
}

.one-checkout-popup .apply-coupon-btn:disabled,
.one-checkout-popup-overlay .apply-coupon-btn:disabled,
button.apply-coupon-btn:disabled,
.apply-coupon-btn[type="button"]:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.one-checkout-popup .apply-coupon-btn:disabled::before,
.one-checkout-popup-overlay .apply-coupon-btn:disabled::before,
button.apply-coupon-btn:disabled::before,
.apply-coupon-btn[type="button"]:disabled::before {
    display: none !important;
}

/* Coupon Result */
.coupon-result {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
}

.coupon-result.success {
    background: #f0f9f0;
    color: #2e7d2e;
    border: 1px solid #c3e6c3;
}

.coupon-result.error {
    background: #fdf2f2;
    color: #c53030;
    border: 1px solid #fed7d7;
}

/* Payment Methods */
.payment-methods {
    margin: 20px 0 12px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    /* margin-bottom: 8px; */
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-option:hover {
    border-color: #E5B489;
    background: #fafafa;
}

.payment-option.selected {
    border-color: #E5B489;
    background: #fdf9f5;
}

.payment-radio {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease;
}

.payment-option.selected .payment-radio {
    border-color: #E5B489;
}

.radio-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    transition: background-color 0.2s ease;
}

.payment-option.selected .radio-dot {
    background: #E5B489;
}

.payment-info {
    flex: 1;
}

.payment-title {
    display: block;
    font-weight: 500;
    color: #333;
    font-size: 14px;
    margin-bottom: 2px;
}

.payment-desc {
    display: block;
    color: #666;
    font-size: 12px;
}

/* Submit Button - Enhanced Minimalistic Design with High Specificity */
.one-checkout-popup .checkout-submit-btn,
.one-checkout-popup-overlay .checkout-submit-btn,
button.checkout-submit-btn,
.checkout-submit-btn[type="submit"] {
    width: 100% !important;
    background: linear-gradient(135deg, #E5B489 0%, #d9a06f 100%) !important;
    color: white !important;
    border: none !important;
    padding: 16px 20px !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    margin-bottom: 20px !important;
    box-shadow: 0 4px 12px rgba(229, 180, 137, 0.3) !important;
    letter-spacing: 0.5px !important;
    text-transform: none !important;
    overflow: hidden !important;
    display: block !important;
    user-select: none !important;
    white-space: nowrap !important;
}

.checkout-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.one-checkout-popup .checkout-submit-btn:hover,
.one-checkout-popup-overlay .checkout-submit-btn:hover,
button.checkout-submit-btn:hover,
.checkout-submit-btn[type="submit"]:hover {
    background: linear-gradient(135deg, #d9a06f 0%, #E5B489 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(229, 180, 137, 0.4) !important;
}

.one-checkout-popup .checkout-submit-btn:hover::before,
.one-checkout-popup-overlay .checkout-submit-btn:hover::before,
button.checkout-submit-btn:hover::before,
.checkout-submit-btn[type="submit"]:hover::before {
    left: 100% !important;
}

.one-checkout-popup .checkout-submit-btn:active,
.one-checkout-popup-overlay .checkout-submit-btn:active,
button.checkout-submit-btn:active,
.checkout-submit-btn[type="submit"]:active {
    transform: translateY(0px) !important;
    box-shadow: 0 2px 8px rgba(229, 180, 137, 0.3) !important;
}

.one-checkout-popup .checkout-submit-btn:disabled,
.one-checkout-popup-overlay .checkout-submit-btn:disabled,
button.checkout-submit-btn:disabled,
.checkout-submit-btn[type="submit"]:disabled {
    background: linear-gradient(135deg, #ccc 0%, #bbb 100%) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.one-checkout-popup .checkout-submit-btn:disabled::before,
.one-checkout-popup-overlay .checkout-submit-btn:disabled::before,
button.checkout-submit-btn:disabled::before,
.checkout-submit-btn[type="submit"]:disabled::before {
    display: none !important;
}

/* Loading State */
.checkout-submit-btn.loading {
    color: transparent;
    pointer-events: none;
}

.checkout-submit-btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Features */
.features {
    display: flex;
    justify-content: space-around;
    /* border-top: 1px solid #f0f0f0; */
}

.feature {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    color: #666;
}

.feature-icon {
    color: #E5B489;
    font-weight: bold;
    font-size: 14px;
}

/* One Checkout Button (Replace Add to Cart) */
.one-checkout-button {
    background: #E5B489;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-transform: none;
    min-width: 120px;
}

.one-checkout-button:hover {
    background: #d19d6f;
    color: white;
}

.one-checkout-button:active {
    transform: translateY(1px);
}

/* Success/Error Messages */
.checkout-success-message {
    background: #f0f9f0;
    color: #2e7d2e;
    border: 1px solid #c3e6c3;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
    text-align: center;
    font-size: 14px;
}

.checkout-error-message {
    background: #fdf2f2;
    color: #c53030;
    border: 1px solid #fed7d7;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
    text-align: center;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .one-checkout-popup {
        width: 95%;
        margin: 10px;
        max-width: 350px;
    }
    
    .popup-content {
        padding: 20px;
    }
    
    .features {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .payment-option {
        padding: 10px;
    }
}

/* RTL Support */
[dir="rtl"] .one-checkout-popup {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .popup-close {
    right: 10px !important;
    top: 10px !important;
    left: auto;


}

/* Animation for popup entrance */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Free Order Success Styling */
.free-order-success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin: 15px 0;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.free-order-success h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 700;
}

.free-order-success p {
    margin: 8px 0;
    font-size: 14px;
}

.free-order-success .download-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.free-order-success .download-section h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.free-order-success .download-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.free-order-success .download-section li {
    margin: 8px 0;
}

.free-order-success .download-link {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.free-order-success .download-link:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Prevent body scroll when popup is open */
body.popup-open {
    overflow: hidden;
}

.one-checkout-popup-overlay {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}