/**
 * Checkout styles for MarkShop Store Wallets
 */

/* Wallet payment form */
.payment_method_wallet_gateway {
    margin-bottom: 20px;
}

.wallet-payment-method {
    margin-bottom: 15px;
}

.wallet-payment-method label {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 5px;
}

/* Wallet code input */
#wallet_code_input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#wallet_code_input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

/* User wallet selection */
#user_wallet_select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Balance information */
#wallet_balance_info {
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.wallet-loading {
    color: #666;
    font-style: italic;
}

.wallet-balance-success {
    color: #46b450;
    font-weight: bold;
}

.wallet-balance-error {
    color: #dc3232;
    font-weight: bold;
}

.wallet-balance-warning {
    color: #ffb900;
    font-weight: bold;
}

.balance-details {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

.balance-details span {
    display: block;
    margin-bottom: 3px;
}

/* Enhanced payment scenarios */
.wallet-info-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f0f8ff;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.wallet-info-section h4 {
    margin: 0 0 10px 0;
    color: #0073aa;
    font-size: 16px;
}

.wallet-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.wallet-details span {
    padding: 5px 10px;
    background: white;
    border-radius: 4px;
    font-size: 13px;
    border: 1px solid #ddd;
}

.wallet-balance {
    border-left: 3px solid #46b450;
}

.wallet-credit-limit {
    border-left: 3px solid #ffb900;
}

.wallet-available-total {
    border-left: 3px solid #0073aa;
}

/* Payment scenarios */
.payment-scenarios {
    margin-top: 20px;
}

.payment-scenarios h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.payment-scenario {
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.payment-scenario:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.payment-scenario label {
    display: block;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 5px;
}

.payment-scenario input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.1);
}

.payment-scenario input[type="radio"]:checked + * {
    color: #0073aa;
}

.payment-scenario:has(input[type="radio"]:checked) {
    border-color: #0073aa;
    background: #f8fbff;
}

.scenario-details {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 3px solid #0073aa;
}

.scenario-details small {
    color: #666;
    font-size: 12px;
}

.scenario-credit-usage {
    margin-top: 5px;
    padding: 5px 10px;
    background: #fff3cd;
    border-radius: 4px;
    border-left: 3px solid #ffc107;
}

.scenario-credit-usage small {
    font-size: 12px;
    font-weight: 500;
    color: #856404;
}

/* Different styling for payment scenario types */
.payment-scenario[data-type="full_payment"] {
    border-left: 4px solid #28a745;
}

.payment-scenario[data-type="full_payment_with_limit"] {
    border-left: 4px solid #ffc107;
}

.payment-scenario[data-type="partial_payment"] {
    border-left: 4px solid #17a2b8;
}

.payment-scenario[data-type="partial_payment_with_limit"] {
    border-left: 4px solid #fd7e14;
}

/* Secondary payment method selector */
.secondary-payment-method {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.secondary-payment-method label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #495057;
}

.secondary-payment-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.secondary-payment-select:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

/* Visual feedback for secondary payment options */
.wc_payment_methods li.secondary-option {
    opacity: 0.7;
    position: relative;
}

.wc_payment_methods li.secondary-option::before {
    content: "For remaining amount";
    position: absolute;
    top: -5px;
    right: 10px;
    background: #17a2b8;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
}

.wc_payment_methods li.highlighted-secondary {
    border: 2px solid #17a2b8;
    background: #e7f3ff;
}

/* Hide wallet-hidden items properly */
.wc_payment_methods li.wallet-hidden {
    display: none !important;
}

/* Insufficient balance display */
.wallet-insufficient-balance {
    padding: 15px;
    background: #ffe6e6;
    border-radius: 6px;
    border-left: 4px solid #dc3232;
}

.wallet-insufficient-balance .error {
    color: #dc3232;
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

/* Responsive design */
@media (max-width: 768px) {
    .wallet-details {
        flex-direction: column;
        gap: 10px;
    }
    
    .payment-scenario {
        padding: 10px;
    }
    
    .wallet-info-section {
        padding: 12px;
    }
}

/* Ensure payment methods are not permanently hidden */
.wc_payment_methods {
    display: block !important;
}

.wc_payment_methods li {
    display: list-item !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Only hide when specifically needed by wallet scenarios */
.wc_payment_methods li.wallet-hidden {
    display: none !important;
}

/* Override any theme hiding rules for checkout payment methods */
body.woocommerce-checkout .wc_payment_methods li {
    display: list-item !important;
}
