:root {
    --brand-blue-start: #133c8e;
    --brand-blue-end: #0f2e6e;
    --brand-text: #0d3584;
    --text-color: #111827;
    --muted-color: #6b7280;
    --card-bg: #f5f5f5;
    --card-border: #d9d9d9;
    --base-font-size: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: #f5f5f5;
    color: var(--text-color);
    line-height: 1.6;
    font-size: var(--base-font-size, 16px);
}

/* Garantir que todos os elementos usem rem baseado em --base-font-size */
html {
    font-size: var(--base-font-size, 16px);
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--brand-blue-start) 0%, var(--brand-blue-end) 100%);
    color: white;
    padding: 24px 0 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-image {
    max-width: 300px;
    max-height: 70px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-top: 10px;
}

.action-btn {
    background: rgba(255,255,255,0.12);
    color: #103175;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    font-size: 16px;
    font-weight: 700;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto; /* manter em linha única no flex container */
}

.action-btn:hover {
    background: rgba(255,255,255,0.18);
}

.action-btn:active {
    transform: scale(0.98);
}

/* Loading */
.loading-container, .error-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 40px 20px;
    text-align: center;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1a3a5f;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-container h2 {
    color: #e53e3e;
    margin-bottom: 10px;
}

/* Content */
.content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    background: white;
    min-height: calc(100vh - 200px);
    padding-bottom: 120px; /* espaço para o botão flutuante */
}

/* Indicador de Progresso */
.progress-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    padding: 20px 0;
    gap: 0;
    flex-wrap: nowrap;
}

.progress-step {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.step-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.step-icon.step-completed {
    background: #10b981;
    color: white;
}

.step-icon.step-active {
    background: var(--brand-text);
    color: white;
}

.step-icon.step-pending {
    background: #e5e7eb;
    color: #9ca3af;
}

.step-label {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.step-title {
    display: block;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-color);
    line-height: 1.2;
    transition: color 0.3s ease, font-weight 0.3s ease;
}

.step-subtitle {
    display: block;
    font-size: 0.875rem;
    color: var(--muted-color);
    line-height: 1.2;
}

/* Estilos para etapas ativas */
.progress-step.step-active .step-title {
    color: var(--brand-text);
    font-weight: 700;
}

.progress-step.step-completed .step-title {
    color: var(--brand-text);
    font-weight: 700;
}

.progress-step.step-pending .step-title {
    color: var(--muted-color);
    font-weight: 600;
}

.progress-step[data-step="1"] .step-title,
.progress-step[data-step="2"] .step-title,
.progress-step[data-step="3"] .step-title {
    color: var(--text-color);
}

.progress-step[data-step="1"] .step-icon.step-completed ~ .step-label .step-title,
.progress-step[data-step="2"] .step-icon.step-active ~ .step-label .step-title {
    color: var(--brand-text);
}

.progress-line {
    flex: 1;
    min-width: 60px;
    max-width: 120px;
    height: 2px;
    background: #e5e7eb;
    margin: 0 15px;
    transition: background 0.3s ease;
}

.progress-line.completed {
    background: #10b981;
}

/* Step Container */
.step-container {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Formulário de Dados */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: white;
    border-radius: 12px;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.form-subtitle {
    color: var(--muted-color);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.dados-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--brand-text);
    box-shadow: 0 0 0 3px rgba(19, 60, 142, 0.1);
}

/* Validação apenas quando tentar submeter */
.form-group input.error,
.form-group select.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group input.success {
    border-color: #10b981;
}

.form-error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 4px;
    display: block;
}

/* Estados do campo CEP */
.form-group input.cep-loading {
    border-color: var(--brand-text);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23133c8e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-6.219-8.56'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    animation: cep-loading 1s linear infinite;
}

@keyframes cep-loading {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.form-group input.cep-success {
    border-color: #10b981;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.form-group input.cep-error {
    border-color: #ef4444;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.cep-error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 4px;
    display: block;
}

/* Botão Buscar CEP */
.btn-buscar-cep {
    background: var(--brand-text);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 48px;
}

.btn-buscar-cep:hover {
    background: var(--brand-blue-end);
    transform: scale(1.05);
}

.btn-buscar-cep:active {
    transform: scale(0.95);
}

.btn-buscar-cep:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Checkbox Label */
.checkbox-label {
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--brand-text);
}

.checkbox-label:hover {
    opacity: 0.8;
}

/* Campo número desabilitado */
#numero:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

/* Step Actions */
.step-actions {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e5e7eb;
}

.btn-voltar {
    background: white;
    color: var(--brand-text);
    border: 2px solid var(--brand-text);
    padding: 14px 40px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-voltar:hover {
    background: #f3f4f6;
}

.btn-proximo {
    background: linear-gradient(135deg, var(--brand-blue-start) 0%, var(--brand-blue-end) 100%);
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-proximo:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.btn-proximo:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Payment Container */
.payment-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: white;
    border-radius: 12px;
}

.payment-methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.payment-method-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.payment-method-card:hover {
    border-color: var(--brand-text);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(19, 60, 142, 0.2);
}

.payment-method-card.active {
    border-color: var(--brand-text);
    background: linear-gradient(135deg, var(--brand-blue-start) 0%, var(--brand-blue-end) 100%);
    color: white;
}

.payment-method-card.active .payment-method-icon,
.payment-method-card.active .payment-method-name,
.payment-method-card.active .payment-method-desc {
    color: white;
}

.payment-method-icon {
    font-size: 48px;
    margin-bottom: 10px;
    line-height: 1;
}

.payment-method-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.payment-method-desc {
    font-size: 14px;
    color: var(--muted-color);
}

.payment-form {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e5e7eb;
}

/* PIX */
.pix-result-container {
    text-align: center;
    padding: 20px 0;
}

.pix-qrcode {
    margin: 30px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.pix-qrcode img {
    max-width: 300px;
    width: 100%;
    height: auto;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#pix-qr-code-placeholder {
    padding: 40px;
    color: var(--muted-color);
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
}

.pix-instructions {
    color: var(--muted-color);
    margin: 20px 0;
    font-size: 0.95rem;
}

.pix-copy-paste {
    margin: 30px 0;
    text-align: left;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.pix-copy-paste label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 14px;
}

.pix-copy-paste textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 12px;
    font-family: monospace;
    resize: vertical;
    min-height: 80px;
    background: white;
    color: var(--text-color);
}

.pix-copy-paste textarea:focus {
    outline: none;
    border-color: var(--brand-text);
    box-shadow: 0 0 0 3px rgba(19, 60, 142, 0.1);
}

.pix-copy-paste textarea:read-only {
    cursor: text;
}

/* Cartão */
.card-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Responsivo - Progress Indicator */
@media (max-width: 768px) {
    .progress-indicator {
        gap: 0;
        padding: 15px 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    .progress-indicator::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    .progress-step {
        gap: 8px;
        min-width: fit-content;
        flex-shrink: 0;
    }
    
    .step-icon {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }
    
    .step-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .step-label {
        min-width: fit-content;
    }
    
    .step-title {
        font-size: 0.85rem;
        font-weight: 700;
        white-space: nowrap;
    }
    
    .step-subtitle {
        font-size: 0.7rem;
        white-space: nowrap;
        display: none; /* Esconder subtítulo no mobile para economizar espaço */
    }
    
    .progress-line {
        min-width: 20px;
        max-width: 40px;
        margin: 0 5px;
        flex-shrink: 0;
    }
    
    /* Destacar etapa ativa no mobile */
    .progress-step[data-step] .step-icon.step-active {
        transform: scale(1.1);
        box-shadow: 0 0 0 3px rgba(19, 60, 142, 0.2);
    }
    
    .progress-step[data-step] .step-icon.step-completed {
        transform: scale(1.05);
    }
}

/* Mobile muito pequeno */
@media (max-width: 480px) {
    .progress-indicator {
        padding: 12px 5px;
    }
    
    .step-icon {
        width: 36px;
        height: 36px;
    }
    
    .step-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .step-title {
        font-size: 0.75rem;
    }
    
    .progress-line {
        min-width: 15px;
        max-width: 30px;
        margin: 0 3px;
    }
    
    .progress-step {
        gap: 6px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .payment-methods {
        flex-direction: column;
    }
    
    .step-actions {
        flex-direction: column-reverse;
    }
    
    .btn-voltar,
    .btn-proximo,
    .btn-finalizar {
        width: 100%;
    }
}

/* Orçamento Info */
.orcamento-info {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.info-row {
    display: block;
}

.toolbar-actions,
.toolbar-actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;            /* manter em uma linha */
    white-space: nowrap;          /* evitar quebra dos botões */
    overflow-x: auto;             /* rolagem lateral se faltar espaço */
    -webkit-overflow-scrolling: touch;
    margin-top: 10px;
}

.info-line {
    display: block;               /* orçamento e cliente em linhas separadas */
    margin-bottom: 10px;
}

.info-label {
    font-weight: 700;
    color: var(--text-color);
    font-size: 1rem;
}

.info-value {
    color: var(--brand-text);
    font-size: 1rem;
    font-weight: 600;
}

/* Fórmulas */
.formulas-container {
    margin-bottom: 30px;
}

.formula-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.formula-item:hover {
    border-color: var(--brand-text);
    box-shadow: 0 3px 5px rgba(0,0,0,0.06);
}

.formula-item.selecionada {
    border-color: #c4cee1;
    background: #f3f6f9;
}

.formula-checkbox {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    border: 2px solid var(--brand-text);
    border-radius: 6px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.checkbox-custom.checked {
    background: var(--brand-text);
}

.checkbox-custom.checked::after {
    content: '✓';
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.formula-content {
    flex: 1;
}

.formula-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 15px;
}

.formula-numero {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-color);
}

.formula-valor {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--brand-text);
    white-space: nowrap;
}

.formula-quantidade {
    color: var(--muted-color);
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.formula-descricao {
    color: #374151;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Resumo */
.resumo-container {
    background: white;
    border-top: 2px solid #e5e7eb;
    padding-top: 20px;
    margin-top: 30px;
}

.resumo-line {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 0;
    gap: 15px;
}

.resumo-frete-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.resumo-frete-obs {
    font-size: 0.85rem;
    color: var(--muted-color);
    font-style: italic;
    line-height: 1.4;
}

.resumo-icon {
    font-size: 20px;
    width: 30px;
    text-align: center;
    color: var(--brand-text);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resumo-icon svg {
    width: 100%;
    height: 100%;
    color: inherit;
}

.resumo-label {
    flex: 1;
    color: var(--muted-color);
    font-size: 1rem;
}

.resumo-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.resumo-value.frete-gratis {
    color: #10b981;
    font-weight: 700;
}


.resumo-total {
    background: linear-gradient(135deg, var(--brand-blue-start) 0%, var(--brand-blue-end) 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-label {
    font-size: 1.25rem;
    font-weight: 700;
}

.total-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Botão Finalizar */
.finalizar-container {
    margin: 30px 0;
    text-align: center;
}

.finalizar-flutuante {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: min(640px, calc(100% - 32px));
    z-index: 1000;
}

.btn-finalizar {
    background: linear-gradient(135deg, var(--brand-blue-start) 0%, var(--brand-blue-end) 100%);
    color: white;
    border: none;
    padding: 18px 60px;
    font-size: 1.125rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-finalizar:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.btn-finalizar:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-finalizar:active:not(:disabled) {
    transform: translateY(0);
}

/* Validade */
.validade-message {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin: 30px 0;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Badges */
.badges-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
    max-width: 100%;
    overflow: hidden;
}

/* Versão do Sistema */
.version-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

#version-text {
    color: var(--muted-color);
    font-size: 0.875rem;
    font-weight: 500;
}

.badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    transition: transform 0.2s ease;
}

.badge:hover {
    transform: none;
    box-shadow: none;
}

.badge-image {
    max-height: 120px; /* dobrado */
    max-width: 100%;  /* não estoura o container */
    width: auto;
    height: auto;
    object-fit: contain;
}

.badge-opinioes {
    background: transparent;
    border: none;
}

.badge-gptw {
    background: transparent;
    border: none;
}

.badge-abf {
    background: transparent;
    border: none;
}

.badge-qrcode {
    background: transparent;
    border: none;
}

.qrcode-link {
    display: inline-block;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.qrcode-link:hover {
    transform: scale(1.05);
}

.qrcode-image {
    max-height: 50px !important;
    max-width: 100%;  /* não estoura o container */
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Zoom do conteúdo (A-/A+) */
.no-print { }
.hide-export { }

/* Impressão: manter cores de fundo e garantir visibilidade da logo */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    body {
        background: white !important;
    }
    
    .content {
        background: white !important;
        max-width: 100% !important;
        padding: 20px !important;
    }
    
    .header {
        background: linear-gradient(135deg, var(--brand-blue-start) 0%, var(--brand-blue-end) 100%) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Não imprimir toolbar e botão */
    .no-print { 
        display: none !important; 
    }
    .hide-export { 
        display: none !important; 
    }
    .toolbar-actions {
        display: none !important;
    }
    
    /* Logo branca sobre fundo azul */
    .logo-image { 
        filter: none !important;
    }
    
    /* Header com mesma largura do content */
    .header {
        max-width: 1200px !important;
        margin: 0 auto !important;
        padding: 24px 20px 16px !important;
    }
    
    .header-wrapper {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    /* Garantir que badges fiquem em linha na impressão */
    .badges-container {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 15px !important;
        page-break-inside: avoid;
    }
    
    .badge {
        page-break-inside: avoid;
        flex-shrink: 1;
        flex-grow: 0;
    }
    
    .badge-image {
        max-height: 80px !important;
        max-width: 150px !important;
    }
    
    .qrcode-image {
        max-height: 100px !important;
        max-width: 100px !important;
    }
}

/* Estilos durante exportação (imagem/PDF) */
body.exportando .badges-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 15px !important;
}

body.exportando .badge {
    flex-shrink: 1;
    flex-grow: 0;
}

body.exportando .badge-image {
    max-height: 80px !important;
    max-width: 150px !important;
}

body.exportando .qrcode-image {
    max-height: 100px !important;
    max-width: 100px !important;
}

body.exportando .header {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 24px 20px 16px !important;
}
    
    /* Remover fundos cinzas */
    .formula-item {
        background: #f5f5f5 !important;
        border: 1px solid #d9d9d9 !important;
    }
}

/* Responsivo */
@media (max-width: 768px) {
    .logo-text {
        font-size: 14px;
    }

    .logo-image {
        max-height: 52px;
    }

    .logo-capsule {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .content {
        padding: 20px 15px;
    }

    .formula-item {
        flex-direction: column;
        padding: 15px;
    }

    .formula-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .formula-checkbox {
        width: 30px;
        height: 30px;
    }

    .resumo-line {
        font-size: 14px;
    }

    .resumo-total {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .total-value {
        font-size: 28px;
    }

    .badges-container {
        flex-direction: column;
        align-items: center;
    }

    .badge {
        width: 100%;
        max-width: 300px;
    }

    /* Garantir botão flutuante também no mobile */
    .finalizar-flutuante {
        position: fixed !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        bottom: calc(12px + env(safe-area-inset-bottom)) !important;
        width: calc(100% - 24px) !important;
        z-index: 1000 !important;
    }
}

/* Splash */
.splash-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.splash-card {
    background: linear-gradient(135deg, var(--brand-blue-start) 0%, var(--brand-blue-end) 100%);
    color: #fff;
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.splash-logo-image {
    max-height: 64px;
    width: auto;
    object-fit: contain;
    margin-bottom: 16px;
}

.splash-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.splash-description {
    font-size: 1rem;
    opacity: 0.95;
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 15px;
    }

    .toolbar-actions-row {
        gap: 8px;
    }

    .action-btn {
        min-width: 36px;
        padding: 6px 10px;
    }

    .logo {
        flex-direction: column;
        gap: 8px;
    }

    .logo-text {
        font-size: 12px;
        text-align: center;
    }

    .formula-numero {
        font-size: 16px;
    }

    .formula-valor {
        font-size: 16px;
    }

    .info-label, .info-value {
        font-size: 14px;
    }
}

/* Modais de Pagamento */
.payment-success-modal,
.payment-pending-modal,
.payment-error-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.payment-success-content,
.payment-pending-content,
.payment-error-content {
    background: white;
    border-radius: 16px;
    padding: 60px 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    border-top: 4px solid #4caf50;
}

.payment-pending-content {
    border-top-color: #ff9800;
}

.payment-error-content {
    border-top-color: #ef4444;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-icon {
    font-size: 80px;
    margin: 0 auto 20px;
    line-height: 1;
}

.pending-icon {
    font-size: 80px;
    margin: 0 auto 20px;
    line-height: 1;
}

.error-icon {
    font-size: 80px;
    margin: 0 auto 20px;
    line-height: 1;
}

.error-details {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 20px 0;
    text-align: left;
}

.error-details p {
    margin: 0;
    color: #991b1b;
    font-size: 14px;
}

.payment-success-content h2,
.payment-pending-content h2,
.payment-error-content h2 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 28px;
    font-weight: 600;
}

.payment-success-content p,
.payment-pending-content p,
.payment-error-content p {
    color: var(--muted-color);
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.6;
}

.payment-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.payment-info p {
    margin: 10px 0;
    color: var(--text-color);
    font-size: 14px;
}

.payment-info strong {
    color: var(--text-color);
    font-weight: 600;
}

.btn-close-modal {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--brand-blue-start) 0%, var(--brand-blue-end) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 24px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-close-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(19, 60, 142, 0.3);
}

.btn-close-modal:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .payment-success-content,
    .payment-pending-content,
    .payment-error-content {
        padding: 40px 24px;
        margin: 20px;
    }

    .success-icon,
    .pending-icon,
    .error-icon {
        font-size: 60px;
    }

    .payment-success-content h2,
    .payment-pending-content h2,
    .payment-error-content h2 {
        font-size: 24px;
    }

    .payment-methods-grid {
        grid-template-columns: 1fr;
    }
}
