/* ============================================================
 * Wallet partial payment — checkout styling (Blocks + Shortcode)
 * ============================================================ */

/* ---------- Blocks checkout container ---------- */
.pisol-wallet-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 10px;
    padding: 14px 16px !important;
    background: #eef2ff;
    border: 1.5px solid #c7d2fe;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    font-size: 14.5px;
    line-height: 1.5;
    color: #1e293b;
}

.pisol-wallet-container input[type="checkbox"]#use-wallet-balance {
    flex: 0 0 auto;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    min-height: 18px;
    margin: 3px 0 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    -webkit-appearance: checkbox;
    appearance: checkbox;
    accent-color: #4f46e5;
    cursor: pointer;
    position: relative;
    transform: none;
    line-height: 1;
}

/* Kill theme custom-check pseudo elements so native glyph stays inside box */
.pisol-wallet-container input[type="checkbox"]#use-wallet-balance::before,
.pisol-wallet-container input[type="checkbox"]#use-wallet-balance::after {
    content: none !important;
    display: none !important;
}

.pisol-wallet-container label {
    margin: 0;
    padding: 0;
    cursor: pointer;
    font-weight: 600;
    color: #1e293b;
}

.pisol-wallet-container label .woocommerce-Price-amount,
.pisol-wallet-container label .amount {
    font-weight: 800;
    color: #4f46e5;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Highlight when checked (modern browsers) */
.pisol-wallet-container:has(input[type="checkbox"]:checked) {
    background: #e0e7ff;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.pisol-wallet-container input[type="checkbox"]:focus-visible + label,
.pisol-wallet-container input[type="checkbox"]:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Processing state while cart updates */
body.pi-aww-processing .pisol-wallet-container {
    opacity: 0.6;
    pointer-events: none;
}

/* ---------- Classic / shortcode checkout field ---------- */
#use_wallet_partial_field.use-wallet-partial {
    display: block;
    margin: 0 0 16px;
    padding: 14px 16px;
    background: #eef2ff;
    border: 1.5px solid #c7d2fe;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

#use_wallet_partial_field.use-wallet-partial:has(input:checked) {
    background: #e0e7ff;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

#use_wallet_partial_field .woocommerce-input-wrapper {
    display: block;
}

#use_wallet_partial_field label.checkbox {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    cursor: pointer;
    font-size: 14.5px;
    line-height: 1.55;
    font-weight: 600;
    color: #1e293b;
}

#use_wallet_partial_field input#use_wallet_partial.input-checkbox {
    flex: 0 0 auto;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    min-height: 18px;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    -webkit-appearance: checkbox;
    appearance: checkbox;
    accent-color: #4f46e5;
    cursor: pointer;
    position: relative;
    transform: none;
    line-height: 1;
}

/* Kill theme custom-check pseudo elements so native glyph stays inside box */
#use_wallet_partial_field input#use_wallet_partial.input-checkbox::before,
#use_wallet_partial_field input#use_wallet_partial.input-checkbox::after {
    content: none !important;
    display: none !important;
}

#use_wallet_partial_field .woocommerce-Price-amount,
#use_wallet_partial_field .amount {
    font-weight: 800;
    color: #4f46e5;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

#use_wallet_partial_field .optional {
    color: #64748b;
    font-weight: 400;
    font-size: 12.5px;
}

#use_wallet_partial_field input#use_wallet_partial:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
    .pisol-wallet-container,
    #use_wallet_partial_field.use-wallet-partial {
        padding: 12px 14px;
        font-size: 14px;
    }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .pisol-wallet-container,
    #use_wallet_partial_field.use-wallet-partial {
        transition: none;
    }
}
