.produto-adicionado {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    padding: 20px;
    width: 400px;
    max-width: 90%;
    text-align: center;
}
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 9998;
}
.produto-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    margin: 0 auto 15px;
    display: block;
}
.animation {
    animation: fadeInUp 0.5s;
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 30px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}
.btn-continue {
    background-color: var(--primary-color, #007bff);
    color: white;
}
.btn-checkout {
    background-color: var(--success-color, #28a745);
    color: white;
}
.success-icon {
    color: #28a745;
    font-size: 3rem;
    margin-bottom: 15px;
}



/* CSS para melhorias no formulário de cartão */

/* Indicador de carregamento para campos */
.form-control.loading {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%23999' d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z' opacity='.25'/%3E%3Cpath fill='%23999' d='M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z'%3E%3CanimateTransform attributeName='transform' dur='0.75s' repeatCount='indefinite' type='rotate' values='0 12 12;360 12 12'/%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px 20px;
}

/* Estilos para indicador de bandeira do cartão */
.card-brand-indicator {
    min-height: 20px;
    transition: all 0.3s ease;
}

.card-brand-indicator small {
    font-weight: 500;
    display: flex;
    align-items: center;
}

/* Estilos para validação visual aprimorada */
.form-control.is-valid {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='m2.3 6.73.67.67a.5.5 0 0 0 .71 0l2.65-2.65a.5.5 0 0 0-.71-.71L3.3 6.37 1.64 4.71a.5.5 0 0 0-.71.71z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 1.4 1.4M7.2 7.4 5.8 6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Estilos específicos para formulário de cartão */
#form-cartao {
    transition: all 0.3s ease;
}

#form-cartao .section-title {
    color: var(--primary-color, #007bff);
    border-bottom: 2px solid var(--primary-color, #007bff);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Estilos para as opções de pagamento */
.payment-option {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    padding: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.payment-option:hover {
    border-color: var(--primary-color, #007bff);
    background-color: #f8f9fa;
}

.payment-option.selected {
    border-color: var(--primary-color, #007bff);
    background-color: rgba(0, 123, 255, 0.05);
    box-shadow: 0 2px 10px rgba(0, 123, 255, 0.1);
}

.payment-option .form-check-input {
    margin-top: 0;
}

.payment-option .form-check-label {
    cursor: pointer;
    margin-bottom: 0;
}

/* Estilos para formulários de pagamento */
.payment-form {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.payment-form.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Estilos para informações de segurança */
.security-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.875rem;
}

/* Estilos para alertas customizados */
.alert-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

/* Animações suaves */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Estilos responsivos específicos */
@media (max-width: 768px) {
    .payment-option {
        padding: 0.75rem;
    }

    #form-cartao .row.g-2 > .col-md-6,
    #form-cartao .row.g-2 > .col-md-4,
    #form-cartao .row.g-2 > .col-md-8 {
        margin-bottom: 1rem;
    }

    .card-brand-indicator {
        margin-top: 0.5rem;
    }
}

/* Estilos para campos com loading */
.form-control:disabled {
    background-color: #f8f9fa;
    opacity: 0.7;
}

/* Feedback visual para validação */
.invalid-feedback {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.valid-feedback {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    color: #198754;
}

/* Estilos para seletor de parcelas */
#parcelas_cartao {
    font-size: 0.9rem;
}

#parcelas_cartao option {
    padding: 0.5rem;
}

/* Estilos para campos obrigatórios */
.form-label .text-danger {
    font-size: 0.8rem;
}

/* Hover effects para botões */
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Estilos para container de cupom */
.cupom-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid #e9ecef;
}

/* Melhorias de acessibilidade */
.form-control:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Estilos gerais do formulário - Versão Otimizada */
.payment-forms-container {
    padding: 15px 0;
}

.payment-option {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fff;
}

.payment-option:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
}

.payment-option.selected {
    border-color: #007bff;
    background-color: #e3f2fd;
    box-shadow: 0 2px 8px rgba(0,123,255,0.15);
}

.payment-form {
    display: none;
    margin-top: 15px;
    animation: fadeIn 0.3s ease-in;
}

.payment-form.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Estilos das seções de formulário */
.form-section {
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 15px;
    background-color: #fafbfc;
}

/* Estilos dos campos de formulário - Compactos */
.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
    font-size: 13px;
}

.form-control-sm, .form-select-sm {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 8px 12px;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-bottom: 12px;
    height: auto;
}

.form-control-sm:focus, .form-select-sm:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.15rem rgba(0,123,255,0.15);
}

.form-control-sm.is-invalid, .form-select-sm.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.15rem rgba(220,53,69,0.15);
}

.form-control-sm.is-valid, .form-select-sm.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.15rem rgba(40,167,69,0.15);
}

/* Espaçamento otimizado para colunas */
.row.g-2 {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.5rem;
}

/* Estilos dos alertas - Compactos */
.alert-sm {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: none;
}

.alert-info {
    background-color: #e1f5fe;
    color: #0277bd;
    border-left: 3px solid #03a9f4;
}

.alert-success {
    background-color: #e8f5e8;
    color: #2e7d32;
    border-left: 3px solid #4caf50;
}

.alert-danger {
    background-color: #ffebee;
    color: #c62828;
    border-left: 3px solid #f44336;
}

.alert-warning {
    background-color: #fff3e0;
    color: #ef6c00;
    border-left: 3px solid #ff9800;
}

/* Estilos do botão principal */
.btn-theme {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,123,255,0.25);
}

.btn-theme:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.35);
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

.btn-theme:disabled {
    opacity: 0.7;
    transform: none;
    box-shadow: 0 2px 8px rgba(0,123,255,0.15);
}

/* Títulos de seção */
.section-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
    font-size: 14px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 4px;
}

/* Ícones dos métodos de pagamento */
.payment-option i {
    font-size: 1.5rem;
    margin-right: 12px;
}

/* Estilos para os radios personalizados */
.form-check-input {
    margin-top: 0.5em;
}

/* Responsividade melhorada */
@media (max-width: 768px) {
    .form-section {
        padding: 12px;
    }

    .payment-option {
        padding: 10px 12px;
    }

    .payment-option .d-flex {
        flex-direction: column;
        text-align: center;
    }

    .payment-option i {
        margin-right: 0;
        margin-bottom: 8px;
    }

    .btn-theme {
        padding: 10px 20px;
        font-size: 14px;
    }

    .form-control-sm, .form-select-sm {
        font-size: 16px; /* Evita zoom no iOS */
    }
}

@media (max-width: 576px) {
    .row.g-2 > * {
        margin-bottom: 8px;
    }

    .section-title {
        font-size: 13px;
    }

    .form-label {
        font-size: 12px;
    }
}

/* Melhorias na área de cupom */
.cupom-container {
    border-radius: 8px;
    border: 2px dashed #dee2e6;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    margin-bottom: 20px;
}

.cupom-container h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px;
}

/* Indicadores de carregamento */
.spinner-border-sm {
    width: 0.875rem;
    height: 0.875rem;
}

/* Melhorias no resumo do pedido */
.order-summary {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.order-summary .border-top {
    border-color: #dee2e6 !important;
    border-width: 1px !important;
}

.order-summary .border-bottom {
    border-color: #dee2e6 !important;
    border-width: 1px !important;
}

/* Otimização para campos específicos */
input[name="numero_cartao"] {
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
}

input[name="cvv"] {
    text-align: center;
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
}

input[name="expdate"] {
    text-align: center;
    font-family: 'Courier New', monospace;
}

/* Estados dos inputs melhorados */
.form-control-sm:valid {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73.94-.94 2.94 2.94'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Melhorar espaçamento entre elementos */
.payment-methods {
    margin-bottom: 20px;
}

.payment-forms-container h6 {
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    color: #343a40;
}

/* Ajustar altura mínima dos formulários */
.payment-form {
    min-height: auto;
}

/* Otimizar espaçamento vertical */
.mt-3 {
    margin-top: 1rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

/* Melhorar aparência dos selects */
.form-select-sm {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

/* Estilos para indicação de carregamento no CEP */
.form-control.loading {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor'%3E%3Cpath d='M21 12a9 9 0 11-6.219-8.56'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Estilos para carrinho vazio otimizados */
.empty-cart {
    padding: 2rem 0;
}

.card {
    border-radius: 10px;
    border: none;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1) !important;
}

.table th, .table td {
    vertical-align: middle;
}

/* Estilos para preços promocionais */
.price-original {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.9rem;
    display: block;
}

.price-promotional {
    font-size: 1.2rem;
    font-weight: 700;
    color: #dc3545;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #007bff;
}

/* Otimização adicional para mobile */
@media (max-width: 480px) {
    .payment-forms-container {
        padding: 10px 0;
    }

    .form-section {
        padding: 10px;
        margin-bottom: 15px;
    }

    .payment-option {
        padding: 8px 10px;
        margin-bottom: 8px;
    }

    .form-control-sm, .form-select-sm {
        padding: 6px 10px;
        margin-bottom: 10px;
    }

    .btn-theme {
        padding: 8px 16px;
        font-size: 13px;
    }
}