/* Modal de Checkout */
.checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

.checkout-modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.8em;
    font-weight: 600;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 30px;
}

.checkout-section {
    margin-bottom: 30px;
}

.checkout-section h3 {
    color: #333;
    font-size: 1.3em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    width: 24px;
    height: 24px;
    background: #007acc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Dados do Cliente */
.customer-info {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e9ecef;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.info-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.info-row:nth-child(1) {
    grid-column: 1 / -1;
}

.info-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.info-label {
    font-weight: 500;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

/* Endereço */
.address-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.address-display {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #dee2e6;
    margin-bottom: 15px;
}

.address-text {
    color: #333;
    line-height: 1.5;
    margin: 0;
}

.address-actions {
    display: flex;
    gap: 10px;
}

.btn-edit-address,
.btn-confirm-address {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-edit-address {
    background: #6c757d;
    color: white;
}

.btn-edit-address:hover {
    background: #545b62;
}

.btn-confirm-address {
    background: #28a745;
    color: white;
}

.btn-confirm-address:hover {
    background: #218838;
}

/* Formulário de Endereço */
.address-form {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #dee2e6;
    margin-top: 15px;
}

.address-form h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.2em;
    font-weight: 600;
    border-bottom: 2px solid #007acc;
    padding-bottom: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #000 !important;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    /* border: 1px solid #ddd; */
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input,
.form-group select {
    background: #d3d3d3;
    border-color: #3e3e3e;
    color: #2b2b2b;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.1);
}

/* Resumo do Pedido */
.order-summary {
    background: #007acc;
    color: white;
    border-radius: 12px;
    padding: 20px;
}

.order-summary h3 {
    color: white;
    margin-bottom: 15px;
}

.order-summary span {
    color: white;
}

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

.order-item:last-child {
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 15px;
    padding-bottom: 15px;
    font-weight: 600;
    font-size: 1.1em;
}

/* Seletor de Formas de Pagamento */
.payment-methods-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.payment-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.payment-option input[type="radio"] {
    margin-right: 15px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    accent-color: #00BFFF;
}

.payment-label {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    flex: 1;
    transition: all 0.3s ease;
    cursor: pointer;
}

.payment-option input[type="radio"]:checked + .payment-label {
    background: #e3f2fd;
    border-color: #00BFFF;
    box-shadow: 0 2px 8px rgba(0, 191, 255, 0.2);
}

.payment-icon {
    font-size: 28px;
    min-width: 40px;
}

.payment-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.payment-text strong {
    color: #000;
    font-size: 16px;
}

.payment-text small {
    color: #666;
    font-size: 14px;
}

/* Container do Mercado Pago */
.mercadopago-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e9ecef;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mp-loading {
    text-align: center;
    color: #666;
}

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

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

/* Botões de Ação */
.modal-actions {
    padding: 20px 30px 30px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.btn-modal {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #545b62;
    transform: translateY(-1px);
}

.btn-continue {
    background: #007acc;
    color: white;
}

.btn-continue:hover {
    background: #005c99;
    transform: translateY(-1px);
}

.btn-continue:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Status do Pedido */
.order-status {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.status-pending .status-icon {
    background: #ffc107;
    color: white;
}

.status-approved .status-icon {
    background: #28a745;
    color: white;
}

.status-text {
    color: #856404;
    font-weight: 500;
}

/* Opções de Frete */
.shipping-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shipping-option {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.shipping-option:hover {
    border-color: #007acc;
    background: #f8f9fa;
}

.shipping-option.selected {
    border-color: #28a745;
    background: #f0f9f0;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.shipping-option.selected .shipping-name {
    color: #007acc;
}
#totalPrice {
    color: var(--success-color);
    font-weight: 700;
    font-size: 1.2em;
}
.shipping-option input[type="radio"] {
    margin-right: 15px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #007acc;
}

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

.shipping-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.shipping-details {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #666;
}

.shipping-company {
    color: #007acc;
    font-weight: 500;
}

.shipping-time {
    color: #28a745;
    font-weight: 500;
}

.shipping-price {
    font-weight: 600;
    color: var(--success-color);
    font-size: 16px;
}

.shipping-selected-indicator {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: #28a745;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.shipping-option.selected .shipping-selected-indicator {
    display: flex;
}

/* Loading e Erro do Frete */
.loading-shipping,
.shipping-error {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

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

.shipping-error {
    color: #dc3545;
    background: #f8d7da;
    border-color: #f5c6cb;
}

.btn-retry-shipping {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.3s ease;
}

.btn-retry-shipping:hover {
    background: #c82333;
}

/* Seletor de Endereços com Cards */
.address-selector {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #dee2e6;
    margin-top: 15px;
}

.address-selector h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.2em;
    font-weight: 600;
}

.address-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.address-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.address-card:hover {
    border-color: #007acc;
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.15);
    transform: translateY(-2px);
}

.address-card.selected {
    border-color: #28a745;
    background: #f0f9f0;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.address-card-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 15px 15px 0 15px;
}

.address-card-radio {
    display: flex;
    align-items: center;
    gap: 10px;
}

.address-card-radio input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #007acc;
    cursor: pointer;
}

.radio-label {
    cursor: pointer;
    font-weight: 500;
    color: #333;
}

.address-card-actions {
    display: flex;
    gap: 8px;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.btn-edit-card,
.btn-delete-card {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 16px;
}

.btn-edit-card:hover {
    background: #e3f2fd;
}

.btn-delete-card:hover {
    background: #ffebee;
}

.address-card-content {
    padding: 15px;
}

.address-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin-bottom: 8px;
    text-transform: capitalize;
}

.address-street {
    color: #555;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 4px;
}

.address-details {
    color: #666;
    font-size: 13px;
    margin-bottom: 4px;
}

.address-cep {
    color: #777;
    font-size: 12px;
    font-weight: 500;
}

.address-card-selected-indicator {
    display: none;
    position: absolute;
    top: 110px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: #28a745;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.address-card.selected .address-card-selected-indicator {
    display: flex;
}

/* Card para Adicionar Novo Endereço */
.add-new-card {
    border: 2px dashed #007acc;
    background: #f8f9fa;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-new-card:hover {
    border-color: #005c99;
    background: #e3f2fd;
    transform: translateY(-2px);
}

.add-new-content {
    text-align: center;
    color: #007acc;
}

.add-icon {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
}

.add-text {
    font-weight: 500;
    font-size: 14px;
}

/* Mensagem quando não há endereços */
.no-addresses-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-address-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.no-addresses-message p {
    margin: 5px 0;
    font-size: 14px;
}

.no-addresses-message p:first-child {
    font-weight: 500;
    color: #333;
}

/* Botão Novo Endereço */
.btn-new-address {
    background: #007acc;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 15px;
}

.btn-new-address:hover {
    background: #005c99;
    transform: translateY(-1px);
}

/* ===== ESTILOS PARA FORMULÁRIO INLINE DE ENDEREÇOS ===== */

/* Formulário Inline - Escondido por padrão */
.endereco-form-inline {
    display: none;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #e9ecef;
    animation: fadeIn 0.3s ease-out;
}

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

/* Título do formulário */
.endereco-form-inline h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.2em;
    font-weight: 600;
    border-bottom: 2px solid #007acc;
    padding-bottom: 10px;
}

/* Grid do formulário */
.endereco-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

/* Grupos do formulário */
.endereco-form-grid .form-group {
    margin-bottom: 0;
}

.endereco-form-grid .form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333 !important;
    font-weight: 500;
    font-size: 14px;
}

.endereco-form-grid .form-group input,
.endereco-form-grid .form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: white;
}

.endereco-form-grid .form-group input:focus,
.endereco-form-grid .form-group select:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.1);
}

/* Ações do formulário */
.endereco-form-actions {
    display: flex;
    Justify-content: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Botões modernos */
.btn-cancel-inline,
.btn-save-inline {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-cancel-inline {
    background: #6c757d;
    color: white;
}

.btn-cancel-inline:hover {
    background: #545b62;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-save-inline {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-save-inline:hover {
    background: linear-gradient(135deg, #218838 0%, #1aa085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-save-inline:active {
    transform: translateY(0);
}

/* Responsividade */
@media (max-width: 768px) {
    .address-list {
        grid-template-columns: 1fr;
    }
    
    .address-card-header {
        padding: 12px 12px 0 12px;
    }
    
    .address-card-content {
        padding: 12px;
    }
    
    .address-card-actions {
        gap: 6px;
    }
    
    .btn-edit-card,
    .btn-delete-card {
        width: 28px;
        height: 28px;
    }

    .endereco-form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .endereco-form-actions {
        flex-direction: column;
    }

    .btn-cancel-inline,
    .btn-save-inline {
        width: 100%;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .form-group input,
    .form-group select {
        background: #2d2d2d !important;
        border-color: #3e3e3e !important;
        color: #e0e0e0 !important;
    }
    
    .endereco-form-grid .form-group input,
    .endereco-form-grid .form-group select {
        background: #1e1e1e !important;
        border-color: #3e3e3e !important;
        color: #e0e0e0 !important;
    }
    
    .endereco-form-grid .form-group input:focus,
    .endereco-form-grid .form-group select:focus {
        border-color: #007acc !important;
        box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.2) !important;
    }
    
    .shipping-option {
        background: #1e1e1e;
    }
    .shipping-option.selected {
        background: #1e4a2a;
    }
    .shipping-option:hover {
    border-color: #007acc;
    background: #173820;
    }
    .shipping-price {
        color: var(--success-color);
    }
    .checkout-modal .modal-content {
        background: #1e1e1e;
        color: #e0e0e0;
    }
    
    .modal-header {
        border-bottom-color: #3e3e3e;
    }
    
    .modal-header h2 {
        color: #e0e0e0;
    }
    
    .modal-close:hover {
        background: #3e3e3e;
        color: #e0e0e0;
    }
    
    .customer-info {
        background: #2d2d2d;
        border-color: #3e3e3e;
    }
    
    .info-row {
        background: #1e1e1e;
        border-color: #3e3e3e;
    }
    
    .info-label {
        color: #b0b0b0;
    }
    
    .info-value {
        color: #e0e0e0;
    }
    
    .address-section {
        background: #2d2d2d;
        border-color: #3e3e3e;
    }
    
    .address-display {
        background: #1e1e1e;
        border-color: #3e3e3e;
    }
    
    .address-text {
        color: #e0e0e0;
    }
    
    .address-selector {
        background: #1e1e1e;
        border-color: #3e3e3e;
    }
    
    .address-selector h4 {
        color: #e0e0e0;
    }
    
    .address-card {
        background: #1e1e1e;
        border-color: #3e3e3e;
    }
    
    .address-card.selected {
        background: #1e4a2a;
        border-color: #28a745;
    }
    
    .radio-label {
        color: #e0e0e0;
    }
    
    .btn-edit-card:hover {
        background: #1e3a5f;
    }
    
    .btn-delete-card:hover {
        background: #4a1e1e;
    }
    
    .address-name {
        color: #e0e0e0;
    }
    
    .address-street {
        color: #cccccc;
    }
    
    .address-details {
        color: #b0b0b0;
    }
    
    .address-cep {
        color: #999;
    }
    
    .add-new-card {
        background: #2d2d2d;
        border-color: #007acc;
    }
    
    .add-new-card:hover {
        background: #1e3a5f;
    }
    
    .add-new-content {
        color: #007acc;
    }
    
    .no-addresses-message {
        color: #b0b0b0;
    }
    
    .no-addresses-message p:first-child {
        color: #e0e0e0;
    }
    
    .address-form {
        background: #1e1e1e;
        border-color: #3e3e3e;
    }
    
    .form-group label {
        color: #e0e0e0 !important;
    }
    
    .form-group input,
    .form-group select {
        background: #2d2d2d;
        border-color: #3e3e3e;
        color: #e0e0e0;
    }
    
    .form-group input:focus,
    .form-group select:focus {
        border-color: #007acc;
        box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.2);
    }
    
    .modal-actions {
        border-top-color: #3e3e3e;
    }

    .endereco-form-inline {
        background: #2d2d2d;
        border-color: #3e3e3e;
    }

    .endereco-form-inline h4 {
        color: #e0e0e0;
        border-bottom-color: #007acc;
    }

    .endereco-form-grid .form-group label {
        color: #e0e0e0 !important;
    }

    .endereco-form-grid .form-group input,
    .endereco-form-grid .form-group select {
        background: #1e1e1e;
        border-color: #3e3e3e;
        color: #e0e0e0;
    }

    .endereco-form-grid .form-group input:focus,
    .endereco-form-grid .form-group select:focus {
        border-color: #007acc;
        box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.2);
    }

    .endereco-form-actions {
        border-top-color: #3e3e3e;
    }
    .shipping-name {
        color: var(--text-light)
    }
}