/**
 * ============================================================
 * PIX PAYMENT STYLES
 * Estilos para o modal e botões de pagamento Pix
 * ============================================================
 */

/* ============================================================
   BOTÃO PIX NOS CARDS
   ============================================================ */
.btn-pix-pay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #32BCAD 0%, #298075 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(50, 188, 173, 0.2);
}

.btn-pix-pay:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(50, 188, 173, 0.4);
    background: linear-gradient(135deg, #2AA89B 0%, #239189 100%);
}

.btn-pix-pay:active {
    transform: translateY(0);
}

/* Ícone Pix como imagem */
.btn-pix-pay .pix-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    /* Deixa branco para combinar com o botão */
}

/* Fallback para FontAwesome */
.btn-pix-pay i {
    font-size: 14px;
}

/* ============================================================
   MODAL PIX
   ============================================================ */
#pixPaymentModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
    box-sizing: border-box;
}

#pixPaymentModal.active {
    display: flex;
}

.pix-modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: pixModalSlideIn 0.3s ease;
}

@keyframes pixModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
/* Header - New Premium Style */
/* Header - Fixed Alignment (Forced) */
.pix-modal-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    padding: 20px 24px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    border-radius: 20px 20px 0 0 !important;
    width: 100%;
    box-sizing: border-box;
}

.pix-modal-header h3 {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 0 !important;
    font-size: 1.25rem !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    white-space: nowrap !important;
    flex: 1;
    /* Ocupa o espaço mas respeita o botão */
}

.pix-modal-header h3 img.pix-icon {
    display: inline-block !important;
    vertical-align: middle !important;
}

.pix-modal-close {
    background: #f1f5f9 !important;
    border: none !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    color: #64748b !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s !important;
    flex-shrink: 0 !important;
    /* Crítico: impede encolhimento */
    margin-left: 10px;
    /* Garante separação */
}

.pix-modal-close:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

/* Body */
.pix-modal-body {
    padding: 24px;
}

/* Error message */
.pix-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    color: #dc2626;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

/* Item info */
.pix-item-info {
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.pix-item-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

/* Form */
.pix-form-group {
    margin-bottom: 16px;
}

.pix-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.pix-form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.pix-form-group input:focus {
    outline: none;
    border-color: #32BCAD;
    box-shadow: 0 0 0 3px rgba(50, 188, 173, 0.15);
}

.pix-form-group input::placeholder {
    color: #9ca3af;
}

.pix-form-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* Generate button */
.pix-generate-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #32BCAD 0%, #2AA89B 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(50, 188, 173, 0.3);
}

.pix-generate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(50, 188, 173, 0.4);
}

.pix-generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ============================================================
   STEP 2 - QR CODE
   ============================================================ */
.pix-step {
    display: none;
}

.pix-step.active,
.pix-step[style*="display: block"] {
    display: block;
}

.pix-qr-container {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
}

.pix-qr-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    background: white;
    border: 3px solid #32BCAD;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#pixQrCode {
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#pixQrCode img,
#pixQrCode canvas {
    display: block !important;
    margin: 0 auto !important;
    max-width: 100% !important;
    height: auto !important;
}

/* Amount display */
.pix-amount-display {
    text-align: center;
    margin-bottom: 16px;
}

.pix-amount-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}

.pix-amount-value {
    font-size: 28px;
    font-weight: 800;
    color: #32BCAD;
}

/* Instructions */
.pix-instructions {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%);
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.pix-instructions-title {
    font-size: 14px;
    font-weight: 700;
    color: #065f46;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pix-instructions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pix-instructions-list li {
    font-size: 13px;
    color: #047857;
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
}

.pix-instructions-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
}

/* Code textarea */
.pix-code-container {
    margin-bottom: 16px;
}

.pix-code-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pix-code-label span {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

#pixCodeText {
    width: 100%;
    height: 80px;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.4;
    resize: none;
    background: #f8fafc;
    box-sizing: border-box;
}

#pixCodeText:focus {
    outline: none;
    border-color: #32BCAD;
}

/* Copy button */
.pix-copy-btn {
    width: 100%;
    padding: 14px 20px;
    background: #1e293b;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.pix-copy-btn:hover {
    background: #334155;
}

.pix-copy-btn.copied {
    background: #10b981;
}

/* Mark paid button */
.pix-paid-btn {
    width: 100%;
    padding: 12px 20px;
    background: #10b981;
    color: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.pix-paid-btn:hover:not(:disabled) {
    border-color: #10b981;
    color: #10b981;
    background: #f0fdf4;
}

.pix-paid-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Expiration */
.pix-expiration {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 12px;
}

.pix-expiration i {
    margin-right: 4px;
}

/* ============================================================
   STEP 3 - SUCCESS
   ============================================================ */
.pix-success {
    text-align: center;
    padding: 20px 0;
}

.pix-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: pixSuccessPop 0.4s ease;
}

@keyframes pixSuccessPop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.pix-success-icon i {
    font-size: 40px;
    color: white;
}

.pix-success-title {
    font-size: 22px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 12px;
}

.pix-success-message {
    font-size: 15px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 24px;
}

.pix-success-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, #32BCAD 0%, #2AA89B 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pix-success-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(50, 188, 173, 0.4);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
    .pix-modal-content {
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
        /* Mobile sheet style */
        width: 100% !important;
        max-width: 100% !important;
    }

    .pix-modal-header {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        padding: 16px 20px !important;
        padding-right: 60px !important;
        /* Espaço seguro para o botão X */
        border-radius: 20px 20px 0 0 !important;
        border-bottom: 1px solid #e2e8f0 !important;
        background: #ffffff !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }

    .pix-modal-header h3 {
        font-size: 16px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin: 0 !important;
        width: 100% !important;
        /* Pode ocupar tudo pois o botão é absolute */
    }

    .pix-modal-close {
        position: absolute !important;
        top: 50% !important;
        right: 20px !important;
        transform: translateY(-50%) !important;
        width: 32px !important;
        height: 32px !important;
        border-radius: 50% !important;
        z-index: 10 !important;
        margin: 0 !important;
    }

    .pix-modal-body {
        padding: 20px;
    }

    #pixQrCode {
        width: 180px;
        height: 180px;
    }

    #pixQrCode img,
    #pixQrCode canvas {
        max-width: 180px !important;
    }

    .pix-amount-value {
        font-size: 24px;
    }

    .btn-pix-pay {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ============================================================
   PIX - Mantém cores oficiais do Pix independente do tema
   O Pix tem identidade visual própria (#32BCAD)
   ============================================================ */

/* ============================================================
   BOX "COMO FUNCIONA" - VERSÃO MELHORADA
   ============================================================ */

.pix-process-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #60a5fa;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

/* Barra animada no topo */
.pix-process-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa, #3b82f6);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Header */
.pix-process-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #93c5fd;
}

.pix-process-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.pix-process-title {
    margin: 0;
    font-weight: 700;
    color: #1e40af;
    font-size: 1rem;
    letter-spacing: -0.3px;
}

/* Steps */
.pix-process-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pix-step-item {
    display: flex;
    align-items: start;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    transition: all 0.2s;
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.pix-step-item:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: #60a5fa;
    transform: translateX(4px);
}

.step-number {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.step-text {
    flex: 1;
    color: #1e40af;
    font-size: 0.9rem;
    line-height: 1.6;
    padding-top: 3px;
}

.step-text strong {
    color: #1e3a8a;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .pix-process-info {
        padding: 16px;
    }

    .step-number {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .step-text {
        font-size: 0.85rem;
    }

    .pix-process-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .pix-process-title {
        font-size: 0.9rem;
    }
}