/*
Theme Name: Theme Montcar
Description: Tema profissional para portfólio de veículos com filtros dinâmicos
Author: Emanoel de Oliveira
Version: 1.0.0
*/

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    font-size: 100%;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 0.75rem;
}

@media (max-width: 768px) {
    .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 2rem;
    }
}

/* Tipografia */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #2c3e50;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

a {
    color: #e74c3c;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #c0392b;
    text-decoration: underline;
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background: #e74c3c;
    color: #fff;
}

.btn-primary:hover {
    background: #c0392b;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
}

.btn-outline-primary {
    background: transparent;
    color: #e74c3c;
    border: 2px solid #e74c3c;
}

.btn-outline-primary:hover {
    background: #e74c3c;
    color: #fff;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Header */
.site-header {
    background: #e74c3c;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.site-header.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.site-logo {
    font-size: 1.25rem;
    font-weight: bold;
    color: #e74c3c;
    text-decoration: none;
    width: 180px;
    max-width: 60%;
}

.site-logo:hover {
    color: #c0392b;
    text-decoration: none;
}

.main-navigation {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.current {
    color: #e74c3c;
    text-decoration: none;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #e74c3c;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.current::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-toggle-btn {
    background: none;
    border: none;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.search-toggle-btn:hover {
    background: #f8f9fa;
    color: #e74c3c;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #333;
    cursor: pointer;
    padding: 0.5rem;
}

/* Pesquisa */
.header-search {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 1rem;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.header-search.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 1rem;
    outline: none;
}

.search-form input[type="search"]:focus {
    border-color: #e74c3c;
}

.search-form button {
    padding: 0.75rem 1.5rem;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-form button:hover {
    background: #c0392b;
}

/* Footer */
.site-footer {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: #fff;
    margin-bottom: 1rem;
}

.footer-section p,
.footer-section a {
    color: #bdc3c7;
    line-height: 1.6;
}

.footer-section a:hover {
    color: #e74c3c;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 2rem;
    text-align: center;
    color: #95a5a6;
}

/* Formulários */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-group input.valid {
    border-color: #28a745;
}

.form-group input.invalid {
    border-color: #dc3545;
}

.field-message {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.field-message.error {
    color: #dc3545;
}

.field-message.success {
    color: #28a745;
}

/* Filtros de Veículos */
.vehicle-filters {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 3rem;
    overflow: hidden;
}

.filter-header {
    background: #e74c3c;
    color: #fff;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-header h3 {
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.filter-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.filter-content {
    padding: 2rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.filter-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

/* Cards de Veículos */
.vehicle-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.vehicle-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* Modais */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 2rem;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

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

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

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

.modal-body {
    padding: 2rem;
}

/* Paginação */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    list-style: none;
    margin: 3rem 0;
    padding: 0;
}

.pagination li a,
.pagination li span {
    display: block;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pagination li a:hover,
.pagination li .current {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
    text-decoration: none;
    transform: translateY(-2px);
}

/* Utilitários */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.spin {
    animation: spin 1s linear infinite;
}

/* Botão Voltar ao Topo */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

#back-to-top:hover {
    background: #c0392b;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .site-header {
        position: relative;
    }
    
    .header-content {
        padding: 1rem 0;
    }
    
    .main-navigation {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
        z-index: 1001;
    }
    
    .main-navigation.active {
        left: 0;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .nav-menu a {
        padding: 1rem 0;
        border-bottom: 1px solid #e9ecef;
        width: 100%;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .menu-toggle.active {
        color: #e74c3c;
    }
    
    .header-search {
        position: relative;
        box-shadow: none;
        border-top: 1px solid #e9ecef;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    .modal-header,
    .modal-body {
        padding: 1.5rem;
    }
    
    h1 { font-size: 1.95rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1rem; }
    
    #back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
}

/* Estados de carregamento */
.loading {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.loading i {
    font-size: 3rem;
    color: #e74c3c;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

.error-message {
    text-align: center;
    padding: 4rem 2rem;
    color: #dc3545;
}

.error-message i {
    font-size: 3rem;
    margin-bottom: 2rem;
}

.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.no-results i {
    font-size: 4rem;
    color: #e9ecef;
    margin-bottom: 2rem;
}

.no-results h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.preloader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e74c3c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Acessibilidade */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .vehicle-filters,
    .btn,
    .modal-overlay,
    #back-to-top {
        display: none !important;
    }
    
    .vehicle-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: #000;
        page-break-after: avoid;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
}

/* Variáveis CSS para personalização */
:root {
    --primary-color: #e74c3c;
    --primary-dark: #c0392b;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #2c3e50;
    --border-color: #e9ecef;
    --text-color: #333;
    --text-muted: #6c757d;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --border-radius: 6px;
    --box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* Modo escuro (opcional) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #e0e0e0;
        --border-color: #333;
        --card-bg: #2d2d2d;
    }
    
    body.dark-mode {
        background-color: var(--bg-color);
        color: var(--text-color);
    }
    
    .dark-mode .vehicle-card,
    .dark-mode .vehicle-filters,
    .dark-mode .modal-content {
        background: var(--card-bg);
        border-color: var(--border-color);
    }
    
    .dark-mode h1,
    .dark-mode h2,
    .dark-mode h3,
    .dark-mode h4,
    .dark-mode h5,
    .dark-mode h6 {
        color: var(--text-color);
    }
}

