/* ============================================================
   📋 LISTAR-CARROS.CSS
   Estilos específicos da página de listagem de carros
   ============================================================ */

/* Reutiliza estilos de formulário para os filtros */
@import url('cadastrar.css');

/* Container Principal */
.container-listagem {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.titulo-principal {
    color: var(--primary-dark);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 700;
}

.titulo-secundario {
    color: var(--primary-dark);
    margin: 2rem 0 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* Grid de Carros */
.grid-carros {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Card de Carro (Estilo específico para listagem admin) */
.car-card {
    background-color: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.car-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.car-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.car-details {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.car-details h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.car-info {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.car-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-top: auto;
    padding-top: 1rem;
}

.car-actions {
    padding: 1rem 0 0 0;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}

.btn-acao {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-edit {
    background-color: var(--primary-color);
    color: white;
}

.btn-edit:hover {
    background-color: var(--primary-dark);
}

.btn-delete {
    background-color: #EF4444;
    /* Red background to match "Editar" style but red */
    color: white;
    border: 1px solid #EF4444;
}

.btn-delete:hover {
    background-color: #DC2626;
}

.btn-sell {
    background-color: #10B981;
    color: white;
}

.btn-sell:hover {
    background-color: #059669;
}

/* Botão Voltar (Padronizado) */
#btnVoltar {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 2rem;
    padding: 0.75rem;
    background-color: transparent;
    color: var(--primary-dark);
    border: 1px solid #cbd5e1;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

#btnVoltar:hover {
    background-color: #f1f5f9;
    border-color: var(--primary-dark);
}

.btn-cancel {
    background-color: transparent;
    color: #ef4444;
    border: 1px solid #ef4444;
}

.btn-cancel:hover {
    background-color: #fef2f2;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
    text-align: center;
    max-height: 85vh;
    /* Evita que o modal extrapole a tela */
    overflow-y: auto;
    /* Adiciona scroll se o conteúdo for extenso */
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--primary-dark);
    font-weight: 700;
}

.modal-select {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Utilitários */
.hidden {
    display: none !important;
}

/* Venda Modal Specifics */
.modal-venda-content {
    max-width: 600px;
    text-align: left;
    padding: 2rem;
}

.modal-header-venda {
    text-align: center;
    color: var(--primary-dark);
    font-weight: 700;
}

.modal-foto-container {
    text-align: center;
    margin-bottom: 20px;
}

.venda-foto-carro {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    display: none; /* Controlled by JS */
}

.modal-titulo-secao {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.venda-valor-input {
    font-size: 1.2rem;
    font-weight: 700;
    color: #10B981;
}

.venda-entrada-input {
    color: var(--primary-color);
}

.venda-financiado-input {
    color: #d97706;
}

.venda-garantia-input {
    background-color: #f1f5f9;
    cursor: not-allowed;
}

.alerta-venda {
    display: none; /* Controlled by JS */
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 4px;
}

.comissao-especial-container {
    display: none; /* Controlled by JS */
    margin-top: 5px;
}

.comissao-especial-container label {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #64748b;
}

.justify-end {
    justify-content: flex-end;
}