/* ===== VARIÁVEIS CSS ===== */
:root {
    --cor-primaria: #2d8a5b;
    --cor-secundaria: #3b9ebf;
    --cor-fundo: #f5f9f7;
    --cor-texto: #1a2e35;
    --cor-texto-claro: #5a7a85;
    --cor-cartao: #ffffff;
    --cor-borda: #e0ebe5;
    --cor-destaque: #e8f4ed;
    
    --fonte-principal: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --sombra-suave: 0 2px 8px rgba(0, 0, 0, 0.06);
    --sombra-media: 0 4px 20px rgba(0, 0, 0, 0.08);
    --sombra-forte: 0 8px 32px rgba(0, 0, 0, 0.12);
    
    --raio-pequeno: 8px;
    --raio-medio: 12px;
    --raio-grande: 16px;
    --raio-total: 9999px;
    
    --transicao: 0.2s ease;
}

/* ===== RESET E BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--fonte-principal);
    background-color: var(--cor-fundo);
    color: var(--cor-texto);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
    background: var(--cor-cartao);
    padding: 1rem 1.5rem;
    box-shadow: var(--sombra-suave);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.logo {
    height: 48px;
    width: auto;
    object-fit: contain;
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, var(--cor-primaria) 0%, #1f6b45 100%);
    padding: 3rem 1.5rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.subtitulo {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    font-weight: 400;
}

/* ===== SEARCH ===== */
.search-container {
    display: flex;
    gap: 0.75rem;
    max-width: 500px;
    margin: 0 auto;
}

.search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    width: 20px;
    height: 20px;
    color: var(--cor-texto-claro);
    pointer-events: none;
}

#endereco-input {
    width: 100%;
    padding: 1rem 3rem 1rem 3rem;
    font-size: 1rem;
    font-family: inherit;
    border: none;
    border-radius: var(--raio-grande);
    background: var(--cor-cartao);
    box-shadow: var(--sombra-media);
    transition: var(--transicao);
}

#endereco-input:focus {
    outline: none;
    box-shadow: var(--sombra-forte), 0 0 0 3px rgba(255, 255, 255, 0.3);
}

#endereco-input::placeholder {
    color: var(--cor-texto-claro);
}

.btn-limpar {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--cor-texto-claro);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transicao);
}

.btn-limpar:hover {
    color: var(--cor-texto);
}

.btn-limpar svg {
    width: 18px;
    height: 18px;
}

.btn-localizacao {
    width: 52px;
    height: 52px;
    border-radius: var(--raio-grande);
    border: none;
    background: var(--cor-cartao);
    box-shadow: var(--sombra-media);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cor-primaria);
    transition: var(--transicao);
    flex-shrink: 0;
}

.btn-localizacao:hover {
    background: var(--cor-destaque);
    transform: scale(1.05);
}

.btn-localizacao:active {
    transform: scale(0.95);
}

.btn-localizacao svg {
    width: 22px;
    height: 22px;
}

/* ===== AUTOCOMPLETE ===== */
.autocomplete-list {
    list-style: none;
    max-width: 500px;
    margin: 0.5rem auto 0;
    background: var(--cor-cartao);
    border-radius: var(--raio-medio);
    box-shadow: var(--sombra-forte);
    overflow: hidden;
    max-height: 300px;
    overflow-y: auto;
}

.autocomplete-list:empty {
    display: none;
}

.autocomplete-item {
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: var(--transicao);
    border-bottom: 1px solid var(--cor-borda);
    text-align: left;
    font-size: 0.95rem;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--cor-destaque);
}

/* ===== RESULTADOS ===== */
.resultados {
    padding: 2rem 1.5rem;
    background: var(--cor-fundo);
}

.resultados-content {
    max-width: 800px;
    margin: 0 auto;
}

.endereco-titulo {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cor-texto);
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--cor-cartao);
    border-radius: var(--raio-medio);
    box-shadow: var(--sombra-suave);
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* ===== CARDS ===== */
.card {
    background: var(--cor-cartao);
    border-radius: var(--raio-grande);
    box-shadow: var(--sombra-media);
    overflow: hidden;
    transition: var(--transicao);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sombra-forte);
}

.card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--cor-primaria) 0%, #1f6b45 100%);
    color: white;
}

.card-domiciliar .card-header {
    background: linear-gradient(135deg, var(--cor-secundaria) 0%, #2a7a94 100%);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--raio-medio);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.card-icon svg {
    width: 24px;
    height: 24px;
}

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--raio-total);
    background: rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-body {
    padding: 1.5rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--cor-borda);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.875rem;
    color: var(--cor-texto-claro);
    font-weight: 500;
}

.info-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cor-texto);
}

/* ===== MAPA ===== */
.mapa-section {
    padding: 0 1.5rem 2rem;
}

.mapa-container {
    max-width: 800px;
    margin: 0 auto;
    border-radius: var(--raio-grande);
    overflow: hidden;
    box-shadow: var(--sombra-media);
}

.mapa {
    height: 350px;
    width: 100%;
    background: var(--cor-borda);
}

/* ===== FAQ ===== */
.faq-section {
    padding: 3rem 1.5rem;
    background: var(--cor-cartao);
}

.faq-content {
    max-width: 800px;
    margin: 0 auto;
}

.faq-titulo {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--cor-texto);
    margin-bottom: 2rem;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--cor-fundo);
    border-radius: var(--raio-medio);
    overflow: hidden;
    transition: var(--transicao);
}

.faq-pergunta {
    width: 100%;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--cor-texto);
    cursor: pointer;
    text-align: left;
    transition: var(--transicao);
}

.faq-pergunta:hover {
    background: var(--cor-destaque);
}

.faq-pergunta svg {
    width: 20px;
    height: 20px;
    color: var(--cor-primaria);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

.faq-item.active .faq-pergunta svg {
    transform: rotate(180deg);
}

.faq-resposta {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-resposta-content {
    padding: 0 1.5rem 1.25rem;
    color: var(--cor-texto-claro);
    font-size: 0.95rem;
    line-height: 1.7;
}

.faq-item.active .faq-resposta {
    max-height: 500px;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--cor-texto);
    color: white;
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-principal {
    margin-bottom: 2rem;
}

.contato-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: white;
    padding: 1.5rem 3rem;
    background: var(--cor-primaria);
    border-radius: var(--raio-grande);
    transition: var(--transicao);
}

.contato-box:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(45, 138, 91, 0.4);
}

.contato-numero {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.contato-texto {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

.footer-info {
    font-size: 0.875rem;
    opacity: 0.7;
}

.footer-info p {
    margin-bottom: 0.5rem;
}

/* ===== LOADING ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--cor-borda);
    border-top-color: var(--cor-primaria);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.loading-overlay p {
    color: var(--cor-texto);
    font-weight: 500;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--cor-texto);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--raio-medio);
    box-shadow: var(--sombra-forte);
    z-index: 1001;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== RESPONSIVO ===== */
@media (max-width: 640px) {
    .header-content {
        gap: 1rem;
    }
    
    .logo {
        height: 36px;
    }
    
    .hero {
        padding: 2rem 1rem 3rem;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .subtitulo {
        font-size: 1rem;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .btn-localizacao {
        width: 100%;
        height: 48px;
    }
    
    .cards-container {
        grid-template-columns: 1fr;
    }
    
    .faq-pergunta {
        padding: 1rem;
        font-size: 0.95rem;
    }
    
    .contato-numero {
        font-size: 2.5rem;
    }
}

/* ===== LEAFLET CUSTOMIZAÇÃO ===== */
.leaflet-popup-content-wrapper {
    border-radius: var(--raio-medio);
    box-shadow: var(--sombra-media);
}

.leaflet-popup-content {
    margin: 1rem;
    font-family: var(--fonte-principal);
}

.marker-popup h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--cor-texto);
}

.marker-popup p {
    font-size: 0.85rem;
    color: var(--cor-texto-claro);
    margin: 0.25rem 0;
}
