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

:root {
    --primary-color: #000000;
    --secondary-color: #f7f7f7;
    --whatsapp-color: #25D366;
    --highlight-color: #fff9c4;
    --text-color: #333333;
    --light-text: #888888;
    --border-radius: 14px;
    --header-height: 60px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-color);
    background-color: #ffffff;
    line-height: 1.5;
}

/* Layout Desktop */
.page-catalog {
    height: 100vh;
    overflow: hidden;
}

.page-catalog .main-content {
    display: flex;
    height: calc(100vh - var(--header-height));
}

/* Header */
.header {
    height: var(--header-height);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
    background: #fff;
    z-index: 1000;
}

.logo {
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
}

.nav a {
    text-decoration: none;
    color: var(--light-text);
    margin-left: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav a.active, .nav a:hover {
    color: var(--primary-color);
}

/* Sidebar e Filtros */
.sidebar {
    width: 35%;
    display: flex;
    flex-direction: column;
    background: var(--secondary-color);
    border-right: 1px solid #eee;
}

.filters {
    padding: 25px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

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

.filter-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--light-text);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.filter-group select, 
.filter-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.9rem;
    outline: none;
}

.input-range {
    display: flex;
    gap: 8px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Lista de Resultados */
.results-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.card {
    background: #fff;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #eee;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.3s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.card.highlight {
    border: 2px solid #ffca28;
    background-color: var(--highlight-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 202, 40, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 202, 40, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 202, 40, 0); }
}

.card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.card-content {
    padding: 16px;
}

.card-bairro {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--light-text);
    text-transform: uppercase;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 4px 0 8px;
}

.card-info {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 15px;
}

/* Botões */
.btn-primary, .btn-secondary, .btn-whatsapp {
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-align: center;
    text-decoration: none;
    transition: opacity 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    flex: 1;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-whatsapp {
    background: var(--whatsapp-color);
    color: #fff;
    display: block;
    width: 100%;
}

.btn-primary:hover, .btn-whatsapp:hover {
    opacity: 0.9;
}

.btn-link {
    color: var(--light-text);
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Mapa */
.map-container {
    width: 65%;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

/* Página de Cadastro */
.container-small {
    max-width: 650px;
    margin: 40px auto;
    padding: 0 20px;
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--light-text);
    margin-bottom: 30px;
}

.form-cadastro .form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-cadastro label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-cadastro input, 
.form-cadastro select, 
.form-cadastro textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
}

.input-readonly {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

/* Upload Area (Upload Box) */
.upload-box {
    position: relative;
    display: block;
    border: 2px dashed #cfcfcf;
    border-radius: 12px;
    padding: 25px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-box:hover {
    background: #f5f5f5;
    border-color: var(--primary-color);
}

.upload-box-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.upload-icon {
    font-size: 24px;
}

.upload-text strong {
    display: block;
    font-size: 1rem;
    color: var(--text-color);
}

.upload-text span {
    display: block;
    color: #666;
    font-size: 13px;
    margin-top: 4px;
}

/* Esconder input nativo mas manter funcional */
.upload-box input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* Mensagens do Formulário */
.form-message {
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.form-message.error {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
}

.form-message.success {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #276749;
}

/* Estado Desabilitado do Botão */
button[disabled] {
    opacity: 0.6;
    cursor: not-allowed !important;
}
.helper {
    display: block;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--light-text);
}

.photos-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.photo-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* Utilitários */
.hidden { display: none; }
.mobile-only { display: none; }
.full-width { width: 100%; }

/* Mobile */
@media (max-width: 768px) {
    .mobile-only { display: block; }
    
    .page-catalog { height: auto; overflow: visible; }
    .page-catalog .main-content { flex-direction: column; height: auto; }
    
    .sidebar { width: 100%; border-right: none; }
    .map-container {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 2000;
        background: #fff;
    }
    
    .map-container.active { display: block; }
    
    .btn-close-map {
        position: absolute;
        top: 20px;
        right: 20px;
        z-index: 2100;
        width: 45px;
        height: 45px;
        background: #fff;
        border-radius: 50%;
        font-size: 24px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
        border: none;
    }

    .filters { padding: 20px; }
    .results-list { padding: 15px; }
    #btn-show-map-container { padding: 0 20px 20px; }
}

/* Leaflet Popup Customization */
.leaflet-popup-content { margin: 10px; width: 200px !important; }
.popup-card img { width: 100%; height: 100px; object-fit: cover; border-radius: 8px; margin-bottom: 10px; }
.popup-card h4 { margin: 0 0 5px; font-size: 1rem; }
.popup-card p { margin: 0 0 10px; font-size: 0.85rem; color: #666; }

/* Suggestions List */
.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.suggestion-item {
    padding: 12px;
    cursor: pointer;
    font-size: 0.9rem;
}

.suggestion-item:hover {
    background: #f5f5f5;
}
.form-info-text {
    font-size: 0.85rem;
    color: var(--light-text);
    margin: 10px 0;
    text-align: center;
    width: 100%;
}
