/* ===================================
   PIX CHECKOUT — 3-Step Clean Design
   =================================== */

/* Overlay */
.pix-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 12px;
}

.pix-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal */
.pix-modal {
    background: #fff;
    border-radius: 18px;
    width: 100%;
    max-width: 420px;
    max-height: 94vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(24px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.pix-overlay.active .pix-modal {
    transform: translateY(0) scale(1);
}

.pix-modal::-webkit-scrollbar {
    width: 3px;
}

.pix-modal::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

/* Top bar (back + title + close) */
.pix-topbar {
    display: flex;
    align-items: center;
    padding: 18px 20px 0;
    gap: 12px;
}

.pix-back {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: #1e293b;
    font-size: 22px;
    cursor: pointer;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
    padding: 0;
}

.pix-back:hover {
    background: #f1f5f9;
}

.pix-back.visible {
    display: flex;
}

.pix-topbar-info {
    flex: 1;
}

.pix-topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
}

.pix-topbar-step {
    font-size: 12px;
    color: #3b82f6;
    margin: 2px 0 0;
    font-weight: 500;
}

.pix-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: #94a3b8;
    font-size: 22px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.pix-close:hover {
    background: #f1f5f9;
    color: #475569;
}

/* Product summary bar */
.pix-product-bar {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.pix-product-bar img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8fafc;
    padding: 2px;
}

.pix-product-bar-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #1e3a5f;
}

.pix-product-bar-price {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

/* Steps container */
.pix-step {
    display: none;
    padding: 4px 20px 20px;
    flex-direction: column;
}

.pix-step.active {
    display: flex;
}

/* Fields */
.pix-field {
    margin-bottom: 4px;
    padding-top: 10px;
}

.pix-field label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.pix-field input {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 1.5px solid #e2e8f0;
    background: transparent;
    color: #0f172a;
    font-size: 16px;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    border-radius: 0;
    -webkit-appearance: none;
}

.pix-field input::placeholder {
    color: #cbd5e1;
    font-weight: 400;
}

.pix-field input:focus {
    border-bottom-color: #3b82f6;
}

.pix-field input.error {
    border-bottom-color: #ef4444;
}

.pix-field .field-error {
    font-size: 11px;
    color: #ef4444;
    margin-top: 4px;
    display: none;
}

.pix-field .field-error.visible {
    display: block;
}

/* Row (side-by-side fields) */
.pix-row {
    display: flex;
    gap: 16px;
}

.pix-row .pix-field {
    flex: 1;
}

.pix-row .pix-field.small {
    flex: 0 0 80px;
}

/* Continue button */
.pix-continue {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: #0f2744;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pix-continue:hover:not(:disabled) {
    background: #1a3a5c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 39, 68, 0.25);
}

.pix-continue:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Pay button (green) */
.pix-pay-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pix-pay-btn:hover:not(:disabled) {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.3);
}

.pix-pay-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Spinner */
.pix-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pix-spin 0.7s linear infinite;
    vertical-align: middle;
}

@keyframes pix-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Shipping options */
.pix-shipping-option {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
    gap: 12px;
}

.pix-shipping-option:hover {
    border-color: #cbd5e1;
}

.pix-shipping-option.selected {
    border-color: #0f2744;
    background: #f8fafc;
}

.pix-shipping-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pix-shipping-option.selected .pix-shipping-radio {
    border-color: #0f2744;
}

.pix-shipping-option.selected .pix-shipping-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #0f2744;
    border-radius: 50%;
}

.pix-shipping-info {
    flex: 1;
}

.pix-shipping-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.pix-shipping-name span {
    font-weight: 400;
    color: #94a3b8;
    font-size: 12px;
    margin-left: 4px;
}

.pix-shipping-price {
    font-size: 14px;
    font-weight: 700;
    color: #16a34a;
    white-space: nowrap;
}

.pix-shipping-price.paid {
    color: #0f172a;
}

/* Order summary */
.pix-summary {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.pix-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 14px;
    color: #64748b;
}

.pix-summary-row span:last-child {
    color: #0f172a;
    font-weight: 500;
}

.pix-summary-row.free span:last-child {
    color: #16a34a;
    font-weight: 600;
}

.pix-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 0;
    margin-top: 8px;
    border-top: 1px solid #e2e8f0;
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

/* Security footer */
.pix-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 14px 20px 18px;
    font-size: 11px;
    color: #94a3b8;
}

.pix-security span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Error global */
.pix-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 0 20px;
    color: #dc2626;
    font-size: 13px;
    text-align: center;
    display: none;
}

.pix-error.visible {
    display: block;
}

/* ===================================
   STEP 4 — PIX Payment Result
   =================================== */
.pix-payment {
    text-align: center;
}

.pix-payment-title {
    font-size: 16px;
    font-weight: 700;
    color: #16a34a;
    margin: 8px 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pix-payment-sub {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 18px;
}

.pix-qr-wrapper {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
    display: inline-block;
    margin-bottom: 16px;
}

.pix-qr-wrapper canvas {
    display: block;
}

.pix-copy-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    text-align: left;
}

.pix-copy-label {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.pix-copy-code {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #334155;
    word-break: break-all;
    line-height: 1.5;
    max-height: 52px;
    overflow: hidden;
}

.pix-copy-btn {
    width: 100%;
    padding: 14px;
    border: 2px solid #3b82f6;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.06);
    color: #3b82f6;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pix-copy-btn:hover {
    background: rgba(59, 130, 246, 0.12);
}

.pix-copy-btn.copied {
    border-color: #16a34a;
    color: #16a34a;
    background: rgba(22, 163, 74, 0.06);
}

.pix-timer {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.pix-timer strong {
    color: #f59e0b;
    font-variant-numeric: tabular-nums;
}

/* CEP loading */
.pix-cep-loading {
    font-size: 12px;
    color: #3b82f6;
    margin-top: 4px;
    display: none;
}

.pix-cep-loading.visible {
    display: block;
}