/* ==========================================
   RESET E LAYOUT PRINCIPAL
   ========================================== */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Montserrat', sans-serif; }
body { background-color: #fcfcfc; color: #333; padding: 40px 20px; }

.escondido { display: none !important; }
.loading-text { text-align: center; font-size: 14px; color: #888; }

.container-checkout {
    max-width: 1200px; margin: 0 auto;
    display: grid; grid-template-columns: 1.8fr 1.2fr; gap: 40px; align-items: flex-start;
    transition: 0.4s ease;
}

/* Quando entra na Tela de Sucesso, removemos o grid para centralizar */
.container-checkout.layout-sucesso {
    display: block; 
}

.coluna-esquerda { width: 100%; position: relative; padding-bottom: 80px; }
.coluna-direita { background: #fff; position: sticky; top: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border-radius: 4px; overflow: hidden; }

/* ==========================================
   BARRA DE PROGRESSO COM 3 ETAPAS
   ========================================== */
.barra-progresso { display: flex; justify-content: space-between; width: 100%; max-width: 600px; margin-bottom: 40px; position: relative; margin-left: auto; margin-right: auto;}
.barra-progresso::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 3px; background-color: #e30613; z-index: 1; }
.etapa { display: flex; justify-content: center; position: relative; z-index: 2; flex: 1; border-bottom: 3px solid #ccc; padding-bottom: 15px; transition: 0.4s ease;}
.etapa-info { background: #fcfcfc; padding: 0 15px; display: flex; align-items: center; gap: 15px; }

.bolinha { width: 34px; height: 34px; border-radius: 50%; background-color: #fff; color: #aaa; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: bold; border: 2px solid #aaa; transition: 0.4s; }
.texto { font-size: 16px; color: #888; font-weight: 500;}

/* Cores Ativas (Vermelho) */
.etapa.ativa { border-bottom-color: #e30613; }
.etapa.ativa .bolinha { background-color: #e30613; border-color: #e30613; color: #fff; }
.etapa.ativa .texto { color: #e30613; font-weight: 700; }

/* ==========================================
   ENDEREÇO E FRETE (ETAPA 1)
   ========================================== */
.titulo-sessao { font-size: 18px; font-weight: 700; color: #222; margin-bottom: 20px; }
.card-endereco-dinamico { border: 1px solid #e30613; border-radius: 4px; padding: 18px 20px; display: flex; align-items: flex-start; gap: 15px; margin-bottom: 20px; background-color: #fff; width: 100%; max-width: 600px; }
.card-endereco-dinamico input[type="radio"] { accent-color: #e30613; width: 18px; height: 18px; margin-top: 2px; }
.texto-endereco { font-size: 14px; color: #555; line-height: 1.6; }

.linha-frete { display: grid; grid-template-columns: 30px 1fr 100px; align-items: center; padding: 18px 0; border-bottom: 1px solid #eaeaea; cursor: pointer; transition: 0.2s; max-width: 600px; }
.linha-frete input[type="radio"] { accent-color: #e30613; width: 18px; height: 18px; }
.frete-desc-container { display: flex; flex-direction: column; gap: 4px; }
.frete-valor { font-size: 15px; color: #333; font-weight: 600; }
.frete-desc { font-size: 13px; color: #666; }
.frete-transportadora { font-size: 13px; color: #888; text-align: right; }

/* ==========================================
   PAGAMENTO E CARTÃO DE CRÉDITO
   ========================================== */
.opcoes-pagamento-v2 { display: flex; flex-direction: column; gap: 15px; max-width: 600px; margin-bottom: 25px; }
.card-pagamento { display: block; cursor: pointer; }
.card-pagamento input { display: none; }
.info-pagamento { display: flex; align-items: center; gap: 12px; font-size: 15px; color: #444; }

.radio-custom { width: 18px; height: 18px; border: 2px solid #ccc; border-radius: 50%; display: inline-block; position: relative; background: #fff; transition: 0.2s; }
.card-pagamento input:checked + .info-pagamento .radio-custom { border-color: #e30613; }
.card-pagamento input:checked + .info-pagamento .radio-custom::after { content: ''; width: 10px; height: 10px; background: #e30613; border-radius: 50%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }

.mensagem-pagamento { font-size: 14px; color: #666; margin-bottom: 20px; }
.formulario-cartao { max-width: 500px; margin-bottom: 20px; }
.lista-bandeiras { display: flex; gap: 15px; align-items: center; margin-bottom: 20px; font-size: 32px; }
.bandeira-texto { background: #444; color: #fff; font-size: 11px; padding: 4px 8px; border-radius: 4px; font-weight: bold; letter-spacing: 1px; }

.form-pagamento { display: flex; flex-direction: column; gap: 15px; max-width: 500px; }
.form-pagamento input, .form-pagamento select { padding: 14px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; color: #333; outline: none; background: #fff; }
.form-pagamento input:focus, .form-pagamento select:focus { border-color: #e30613; }
.linha-inputs { display: flex; gap: 15px; }
.linha-inputs input { flex: 1; }

.cartao-preto-css { background: linear-gradient(135deg, #2b2b2b 0%, #1a1a1a 100%); width: 340px; height: 210px; border-radius: 12px; padding: 25px; color: #fff; position: relative; box-shadow: 0 10px 20px rgba(0,0,0,0.3); margin-top: 25px; display: flex; flex-direction: column; justify-content: space-between; font-family: 'Courier New', Courier, monospace; }
.cartao-chip i { font-size: 36px; color: #d4af37; transform: rotate(90deg); opacity: 0.8; }
.cartao-numero { font-size: 24px; letter-spacing: 2px; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }
.cartao-rodape { display: flex; justify-content: space-between; align-items: flex-end; }
.cartao-rodape small { font-size: 10px; opacity: 0.6; font-family: 'Montserrat', sans-serif; text-transform: uppercase; }
.cartao-rodape div { font-size: 16px; letter-spacing: 1px; margin-top: 2px; text-transform: uppercase; }

/* Faturamento */
.checkbox-padrao { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #666; cursor: pointer; }
.checkbox-padrao input { display: none; }
.check-box-icon { width: 16px; height: 16px; border: 1px solid #ccc; border-radius: 3px; display: inline-block; position: relative; background: #fff; transition: 0.2s; }
.checkbox-padrao input:checked + .check-box-icon { background: #666; border-color: #666; }
.checkbox-padrao input:checked + .check-box-icon::after { content: '✔'; color: #fff; font-size: 11px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }

.checkbox-vermelha { font-size: 14px; color: #444; }
.checkbox-vermelha input:checked + .check-box-icon { background: #e30613; border-color: #e30613; }
.select-faturamento { width: 100%; max-width: 500px; padding: 14px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; color: #444; background-color: #fff; outline: none; cursor: pointer; }

/* ==========================================
   BOTÕES PRINCIPAIS
   ========================================== */
.container-btn-checkout { display: flex; justify-content: flex-end; max-width: 600px; margin-top: 30px; }
.btn-primario { background-color: #e30613; color: #ffffff; border: none; padding: 16px 45px; border-radius: 30px; font-size: 14px; font-weight: 700; cursor: pointer; transition: 0.3s; }
.btn-primario:hover { background-color: #c90510; transform: scale(1.02); }

.btn-secundario { width: 100%; max-width: 600px; background-color: transparent; border: 1px solid #e30613; color: #e30613; padding: 14px; border-radius: 30px; font-size: 14px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.btn-secundario:hover { background-color: #e30613; color: #fff; }

.btn-voltar-fixo {
    position: fixed;
    bottom: 40px;
    left: calc(50% - 600px + 20px);
    background-color: transparent; color: #444; border: 1px solid #666; padding: 8px 15px; font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 4px; z-index: 100; transition: 0.3s;
}
.btn-voltar-fixo:hover { background-color: #eee; color: #111; }
@media (max-width: 1240px) { .btn-voltar-fixo { left: 20px; } }

/* ==========================================
   TELA DE SUCESSO (PASSO 3)
   ========================================== */
.bloco-sucesso { text-align: center; padding: 60px 20px; max-width: 600px; margin: 0 auto; animation: fadeIn 0.5s ease-in-out; }
.icone-sucesso { font-size: 80px; color: #e30613; margin-bottom: 20px; }
.bloco-sucesso h2 { font-size: 36px; color: #222; margin-bottom: 15px; }
.bloco-sucesso p { font-size: 16px; color: #555; line-height: 1.5; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================
   RESUMO DO PEDIDO
   ========================================== */
.cabecalho-resumo { background-color: #EBE6E1; padding: 25px; border-bottom: 1px solid #ddd;}
.cabecalho-resumo h3 { font-size: 18px; color: #333; font-weight: 700; }

.resumo-totais-topo { padding: 25px; border-bottom: 1px solid #eaeaea; }
.linha-total { display: flex; justify-content: space-between; font-size: 14px; color: #555; margin-bottom: 15px; align-items: flex-start; }
.linha-total.total-destaque { font-size: 16px; color: #e30613; font-weight: 700; margin-top: 25px; margin-bottom: 0; }

.resumo-qtd-itens { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #666; padding: 20px 25px; border-bottom: 1px solid #eaeaea; }

.lista-itens-resumo { padding: 25px; max-height: 380px; overflow-y: auto; }
.lista-itens-resumo::-webkit-scrollbar { width: 6px; }
.lista-itens-resumo::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.item-resumo { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 25px; }
.item-resumo img { width: 55px; height: auto; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.item-detalhes { flex: 1; }
.item-titulo { font-size: 13px; color: #444; text-transform: uppercase; margin-bottom: 8px; line-height: 1.4; }
.item-qtd { font-size: 12px; color: #888; }
.item-preco { font-size: 14px; color: #e30613; font-weight: bold; }

.bloco-resumo-info { padding: 25px; border-top: 1px solid #eaeaea; }
.cabecalho-bloco-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.cabecalho-bloco-info h4 { font-size: 15px; color: #333; font-weight: 700; }
.btn-editar-resumo { font-size: 11px; color: #666; font-weight: 700; cursor: pointer; letter-spacing: 1px; }
.btn-editar-resumo:hover { color: #e30613; }
.texto-info-resumo { font-size: 13px; color: #555; line-height: 1.8; }