/* checkout.css */

/* --- GERAL E FUNDO MÁGICO --- */
body {
    background-color: #0a0a0f;
    color: #eee;
    font-family: 'Orbitron', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 25%, rgba(161, 86, 255, 0.1), transparent 40%),
        radial-gradient(circle at 85% 75%, rgba(0, 234, 255, 0.1), transparent 40%);
}

.hidden {
    display: none !important;
}

/* --- LAYOUT PRINCIPAL DO CHECKOUT --- */
.checkout-container {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: 20px;
}

/* --- FLUXOGRAMA NEON (STEPPER) --- */
.checkout-stepper {
    margin-bottom: 40px;
}
.checkout-stepper ol {
    display: flex;
    justify-content: space-between;
    list-style: none;
    padding: 0;
    position: relative;
}
/* Linha de progresso no fundo */
.checkout-stepper ol::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%);
    z-index: 1;
}
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 2;
    /*background-color: #0a0a0f;  Para cortar a linha de fundo */
    padding: 0 10px;
}
.step-number {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    transition: all 0.3s ease;
}
.step-name {
    font-size: 0.8rem;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

/* Estilo do passo ativo */
.step.active .step-number {
    border-color: #00eaff;
    background-color: rgba(0, 234, 255, 0.2);
    color: #00eaff;
    box-shadow: 0 0 15px #00eaff;
}
.step.active .step-name {
    color: #00eaff;
}

/* --- PAINÉIS DAS ETAPAS --- */
.step-panel {
    display: none; /* Começam escondidos */
    animation: fadeIn 0.6s ease;
}
.step-panel.active {
    display: block; /* Só o ativo aparece */
}
.step-panel h2 {
    color: #ff4ecb;
    text-shadow: 0 0 10px #ff4ecb;
    margin-bottom: 30px;
}

/* --- FORMULÁRIOS --- */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
}
.form-group input[type="text"],
.form-group input[type="tel"] {
    width: 90%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    padding: 15px;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
}
.form-group input:focus {
    outline: none;
    border-color: #00eaff;
}
.form-group-half {
    display: flex;
    gap: 15px;
}
.form-group-half > div {
    flex: 1;
}

/* --- BOTÕES --- */
.btn-primary {
    background-color: #ff4ecb; color: #0a0a0f;
    border: none; padding: 15px; border-radius: 5px;
    font-family: 'Orbitron', sans-serif; font-weight: bold;
    cursor: pointer; transition: all 0.2s ease;
}
.btn-primary:hover {
    box-shadow: 0 0 15px #ff4ecb; transform: scale(1.02);
}
.btn-secondary {
    background-color: transparent; color: #eee;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 15px; border-radius: 5px;
    font-family: 'Orbitron', sans-serif; font-weight: bold;
    cursor: pointer; transition: all 0.2s ease;
}
.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
.btn-full-width {
    width: 100%;
    margin-top: 20px;
}

/* --- ETAPA 2: CONFIRMAÇÃO --- */
.summary-section {
    margin-bottom: 30px;
}
.summary-section h3 {
    color: #00eaff;
    border-bottom: 1px solid rgba(0, 234, 255, 0.3);
    padding-bottom: 10px;
    margin-bottom: 15px;
}
.summary-total p {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
}
.summary-total .grand-total {
    font-size: 1.5rem;
    font-weight: bold;
    color: #39ff14;
    text-shadow: 0 0 8px #39ff14;
    margin-top: 20px;
}
.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px; /* Espaço entre os botões */
    margin-top: 40px;
}

/* Faz com que os botões dentro de .nav-buttons ocupem o espaço igualmente */
.nav-buttons > .btn-primary,
.nav-buttons > .btn-secondary {
    flex: 1; 
}

/* --- ETAPA 3: PAGAMENTO (LOADER) --- */
.loader-container {
    text-align: center;
    padding: 50px 0;
}
.loader {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ff4ecb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* --- MODAL DE TOKEN VENCIDO --- */
.modal-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(10, 10, 15, 0.9);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000; backdrop-filter: blur(5px);
}
.modal-content {
    background: #0a0a0f; padding: 30px;
    border: 2px solid #a156ff; border-radius: 10px;
    text-align: center; max-width: 90%;
}
.modal-actions {
    margin-top: 20px; display: flex; gap: 15px;
}

/* --- LAYOUT PARA TELAS MAIORES --- */
@media (min-width: 768px) {
    .checkout-container {
        flex-direction: row;
        gap: 50px;
        max-width: 1000px;
        margin: 0 auto;
    }
    .checkout-stepper {
        flex-direction: column;
        margin-bottom: 0;
    }
    .checkout-stepper ol {
        flex-direction: column;
        align-items: flex-start;
        gap: 50px;
    }
    .checkout-stepper ol::before {
        width: 2px; height: 100%;
        top: 0;
        transform: none;
    }
    .step {
        flex-direction: row;
        gap: 20px;
    }
    .step-name {
        margin-top: 0;
        text-align: left;
    }
    .checkout-content {
        flex: 1;
    }
}

/* --- ANIMAÇÕES --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Adicionar em checkout.css */

.address-card {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.address-card input[type="radio"] {
    display: none; /* Esconde o radio button original */
}

.address-card label {
    flex-grow: 1;
    cursor: pointer;
}

.address-card input[type="radio"]:checked + label + .btn-delete-address {
    /* A mágica acontece aqui! */
    display: none;
}
.address-card:has(input:checked) {
    border-color: #00eaff;
    box-shadow: 0 0 10px rgba(0, 234, 255, 0.5);
}

.address-nickname {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.address-details {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.btn-delete-address {
    background: transparent;
    border: none;
    color: rgba(255, 45, 45, 0.7);
    font-size: 2rem;
    cursor: pointer;
    padding: 0 10px;
    transition: color 0.2s ease;
}
.btn-delete-address:hover {
    color: #ff2d2d;
}

.btn-add-new {
    width: 100%;
    padding: 15px;
    margin-top: 10px;
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-add-new:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Adicionar em checkout.css */

#new-address-form {
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
    
    /* Lógica da animação */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease-out, opacity 0.5s ease-out, padding-top 0.5s ease-out;
}

#new-address-form:not(.hidden) {
    max-height: 1000px; /* Um valor alto para permitir o crescimento */
    opacity: 1;
    padding-top: 20px;
}

.new-address-title {
    color: #00eaff;
    margin-bottom: 20px;
}

/* Adicionar em checkout.css */

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.divider {
    width: 100%;
    height: 1px;
    background-color: rgba(0, 234, 255, 0.3); /* A mesma cor da borda dos títulos */
    margin: 30px 0; /* Espaçamento vertical para dar um respiro */
}

#payment-link-container {
    text-align: center;
    display: flex;
    flex-direction: column; /* Para manter o texto e o botão um em cima do outro */
    align-items: center;   /* A MÁGICA! Centraliza horizontalmente */
    justify-content: center; /* Centraliza verticalmente (bônus) */
}
#payment-link-container p {
    margin-bottom: 20px;
    font-size: 1.2rem;
}
#mercadopago-link-btn {
    display: block; /* Para o target="_blank" funcionar melhor */
    text-decoration: none;
    text-align: center;
    max-width: 100%;
}

#background-video {
    position: fixed; /* Fica fixo, mesmo com scroll */
    right: 0;
    bottom: 0;
    min-width: 100%; 
    min-height: 100%;
    z-index: -1; /* O truque! Joga o vídeo para trás de todo mundo */
    object-fit: cover; /* Garante que o vídeo cubra a tela toda sem distorcer */
}

/* Adicione isso também no CSS */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 15, 0.5); /* Uma camada preta com 50% de transparência */
    z-index: -1; /* Fica junto com o vídeo, atrás do conteúdo */
}