/* ==========================================================================
   Zenergy Wallet Widget Styles
   Sits between Cart Totals and "Proceed to Checkout" button.
   Matches Zenergy's existing cart page aesthetic.
   ========================================================================== */

.zww-widget {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 18px 20px;
    margin-bottom: 16px;
    font-family: inherit;
    font-size: 14px;
    color: #1a1a2e;
}

/* Disabled / zero-balance state */
.zww-widget.zww-disabled {
    background: #f8f9fb;
    border-color: #e2e8f0;
    opacity: 0.7;
}

/* ------------------------------------------------------------------
   Header
   ------------------------------------------------------------------ */
.zww-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.zww-icon {
    font-size: 16px;
    line-height: 1;
}

.zww-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    letter-spacing: 0.01em;
}

/* ------------------------------------------------------------------
   Balance row
   ------------------------------------------------------------------ */
.zww-balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.zww-balance-label {
    color: #555;
    font-size: 13px;
}

.zww-balance-amount {
    font-weight: 700;
    font-size: 15px;
    color: #1a1a2e;
}

/* ------------------------------------------------------------------
   Input row
   ------------------------------------------------------------------ */
.zww-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.zww-amount-input {
    flex: 1;
    min-width: 80px;
    max-width: 140px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    color: #1a1a2e;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

.zww-amount-input::-webkit-outer-spin-button,
.zww-amount-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.zww-amount-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

/* ------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------ */
.zww-max-btn,
.zww-apply-btn,
.zww-remove-btn {
    height: 40px;
    padding: 0 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s, opacity 0.2s;
    white-space: nowrap;
}

.zww-max-btn {
    background: #f1f5f9;
    color: #374151;
    border: 1px solid #d1d5db;
}

.zww-max-btn:hover:not(:disabled) {
    background: #e2e8f0;
}

.zww-apply-btn {
    background: #1a1a2e;
    color: #ffffff;
}

.zww-apply-btn:hover:not(:disabled) {
    background: #2d2d4e;
}

.zww-remove-btn {
    background: transparent;
    color: #ef4444;
    border: 1px solid #fca5a5;
    padding: 0 12px;
    height: 34px;
    font-size: 12px;
}

.zww-remove-btn:hover:not(:disabled) {
    background: #fef2f2;
}

/* Loading state */
.zww-loading {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ------------------------------------------------------------------
   Applied confirmation row
   ------------------------------------------------------------------ */
.zww-applied-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 4px;
    padding: 10px 14px;
    margin-top: 4px;
}

.zww-applied-label {
    color: #166534;
    font-size: 13px;
}

.zww-applied-label strong {
    font-weight: 700;
}

/* ------------------------------------------------------------------
   Hint / error text
   ------------------------------------------------------------------ */
.zww-hint {
    margin: 8px 0 0;
    font-size: 12px;
    min-height: 16px;
}

.zww-hint-error {
    color: #dc2626;
}

.zww-hint-success {
    color: #16a34a;
}

/* ------------------------------------------------------------------
   Login prompt
   ------------------------------------------------------------------ */
.zww-login-prompt {
    font-size: 13px;
    color: #6b7280;
}

.zww-login-prompt a {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 500;
}

.zww-login-prompt a:hover {
    color: #1d4ed8;
}

/* ------------------------------------------------------------------
   Empty balance message
   ------------------------------------------------------------------ */
.zww-empty-msg {
    margin: 4px 0 0;
    font-size: 12px;
    color: #9ca3af;
}

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media ( max-width: 480px ) {
    .zww-input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .zww-amount-input {
        max-width: 100%;
    }

    .zww-max-btn,
    .zww-apply-btn {
        width: 100%;
        justify-content: center;
    }
}
