/* checkout.css - Estilos adicionais para o checkout */

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.checkout-container {
    animation: fadeIn 0.5s ease;
}

/* Loading no botão */
.btn-finalizar-pedido:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Checkbox personalizado */
.termos-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Estilo para campos inválidos */
.form-group input.error,
.form-group select.error {
    border-color: #e74c3c;
    background-color: #fff5f5;
}

/* Responsivo */
@media (max-width: 480px) {
	.resumo-item-imagem {
        width: 40px;
        height: 40px;
    }
    
    .resumo-item-nome {
        font-size: 0.75rem;
    }
    
    .resumo-item-preco {
        font-size: 0.75rem;
    }
    .checkout-container {
        margin: 20px auto;
    }
    
    .checkout-header h1 {
        font-size: 1.5rem;
    }
    
    .checkout-form .form-section {
        padding: 15px;
    }
    
    .payment-option-label {
        flex-direction: column;
    }
    
    .payment-option-label input[type="radio"] {
        margin-bottom: 10px;
    }
}

/* Estilos do Checkout */
.checkout-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.checkout-header {
    text-align: center;
    margin-bottom: 40px;
}

.checkout-header h1 {
    font-size: 2rem;
    color: #2c3e50;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
}

.checkout-form .form-section {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.checkout-form .form-section h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    color: #2c3e50;
}

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

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #2c3e50;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #ff6b35;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}

/* Opções de Pagamento */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.payment-option {
    border: 1px solid #ddd;
    border-radius: 12px;
    transition: all 0.3s;
}

.payment-option:hover {
    border-color: #ff6b35;
}

.payment-option-label {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    cursor: pointer;
}

.payment-option-label input[type="radio"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.payment-option-content {
    flex: 1;
}

.payment-option-content strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 5px;
    color: #2c3e50;
}

.payment-details {
    margin-top: 8px;
}

.pix-desconto {
    background: #d4edda;
    color: #00a859;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-right: 10px;
}

.pix-valor {
    font-size: 1rem;
    font-weight: bold;
    color: #00a859;
}

#parcelamento-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
}

/* Termos */
.termos-section {
    margin-bottom: 0;
}

.termos-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.termos-label a {
    color: #ff6b35;
    text-decoration: none;
}

.termos-label a:hover {
    text-decoration: underline;
}

/* Botões */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn-finalizar-pedido {
    flex: 2;
    padding: 15px;
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-finalizar-pedido:hover {
    background: #e55a2b;
    transform: translateY(-2px);
}

.btn-voltar-carrinho {
    flex: 1;
    padding: 15px;
    background: #f5f5f5;
    color: #333;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-voltar-carrinho:hover {
    background: #e0e0e0;
}

/* Resumo do Pedido */
.checkout-resumo {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.checkout-resumo h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* Imagem do produto no resumo */
.resumo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.resumo-item-imagem {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.resumo-item-imagem img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.resumo-item-nome {
    font-size: 0.85rem;
    color: #2c3e50;
    font-weight: 500;
}

.resumo-item-quantidade {
    font-size: 0.7rem;
    color: #999;
}

.resumo-item-preco {
    font-size: 0.85rem;
    font-weight: bold;
    color: #e74c3c;
    flex-shrink: 0;
}

.resumo-total {
    border-top: 2px solid #f0f0f0;
    padding-top: 15px;
}

.resumo-linha {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9rem;
}

.resumo-linha.total {
    font-size: 1.2rem;
    font-weight: bold;
    border-top: 1px solid #eee;
    margin-top: 10px;
    padding-top: 15px;
    color: #e74c3c;
}

.resumo-pagamento {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
}

/* Modal Termos */
.termos-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: none;  /* Mude de 'flex' para 'none' por padrão */
    align-items: center;
    justify-content: center;
}

.termos-modal.show {
    display: flex;  /* Classe para mostrar o modal */
}


.termos-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.termos-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.termos-modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.termos-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.termos-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.termos-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

.btn-fechar-termos {
    padding: 10px 25px;
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Mensagem de erro/sucesso */
#checkout-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

#checkout-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#checkout-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsivo */
@media (max-width: 768px) {
    .checkout-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .checkout-resumo {
        position: static;
    }
}
/* Endereço de retirada */
.endereco-retirada {
    margin-top: 15px;
    padding: 12px;
    background: #e8f4fd;
    border-left: 4px solid #ff6b35;
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
}

.endereco-retirada .info-box {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.endereco-retirada .info-box strong {
    color: #2c3e50;
    font-size: 0.9rem;
}

.endereco-retirada .info-box p {
    margin: 0;
    color: #555;
    font-size: 0.85rem;
    line-height: 1.4;
}
/* Botão de localização */
.btn-localizacao {
    width: 100%;
    padding: 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    color: #333;
}

.btn-localizacao:hover {
    background: #ff6b35;
    color: white;
    border-color: #ff6b35;
}

/* Mensagens de geolocalização */
.geo-mensagem {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 9999;
    font-size: 14px;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.geo-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.geo-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.geo-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
/* Loading spinner para geolocalização */
.geo-loading {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 9999;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.geo-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: geo-spin 0.8s linear infinite;
}

@keyframes geo-spin {
    to { transform: rotate(360deg); }
}

/* Mensagem informativa */
.geo-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}
/* Campos de endereço */
.form-row .form-group {
    margin-bottom: 15px;
}

#cep {
    text-transform: uppercase;
}

/* Responsivo */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}