/* RESET & FONTS */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

:root {
    --primary-accent: #E91E63;
    --background-color: #f4f6f8;
    --card-background: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e0e6ed;
    --header-height: 40px;
    --shadow-color: rgba(44, 62, 80, 0.1);
    
    /* Status Colors */
    --status-live: #27ae60;   /* Green */
    --status-soon: #2196F3;   /* Blue */
    --status-ending: #d35400; /* Dark Orange */
    --status-today: #C2185B;  /* rosa escuro da marca */
    --status-ended: #95a5a6;  /* Gray */
}

body.dark-mode {
    --primary-accent: #ff4081;
    --background-color: #1a202c;
    --card-background: #2d3748;
    --text-primary: #edf2f7;
    --text-secondary: #a0aec0;
    --border-color: #4a5568;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

*, *::before, *::after { box-sizing: border-box; }

/* --- ANIMAÇÃO DE TRAJETO (MARCHING ANTS) --- */
@keyframes dash-animation {
    to { stroke-dashoffset: -20; }
}
.rota-animada {
    stroke-dasharray: 12, 8;
    animation: dash-animation 1s linear infinite;
}

/* MAP DARK MODE INVERSION */
body.dark-mode .map-tiles {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
    -webkit-filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
    transition: filter 0.3s ease;
}
body.dark-mode .satellite-tiles { filter: none; }

/* LAYOUT */
html { height: 100%; overflow: hidden; }
body {
    height: 100%; height: 100dvh; width: 100%;
    margin: 0; padding: 0; overflow: hidden;
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    display: flex; flex-direction: column;
}

/* HEADER */
.top-header {
    height: var(--header-height);
    flex: 0 0 auto;
    background: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 0.5em;
    z-index: 500;
}

.header-logo {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1;
}

.header-logo .site-title { 
    margin: 0; 
    font-size: 1rem; 
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px; 
    color: var(--text-primary);
}

.title-text { display: flex; align-items: baseline; }

/* --- CORES EXTRAÍDAS DA LOGO --- */
.c-teal { color: #00acc1; } 
.c-yellow { color: #fbc02d; } 
.c-orange { color: #fb8c00; } 
.c-green { color: #7cb342; } 
.c-pink { color: var(--primary-accent); }

.title-icon { width: 20px; height: 20px; }

.header-logo .site-subtitle {
    font-size: 0.7em;
    color: var(--text-secondary);
    margin-top: 2px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.author-link { color: #2196F3; text-decoration: underline; font-weight: 600; }
.author-link:hover { color: #1976D2; }

.header-actions { display: flex; align-items: center; gap: 2px; }

/* HEADER BUTTONS */
.contact-btn, .support-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    transition: transform 0.2s, background-color 0.2s;
    cursor: pointer;
    border: none;
    background: none;
}
.contact-btn { color: #2196F3; }
.contact-btn:hover { transform: scale(1.1); background-color: rgba(33, 150, 243, 0.1); }
.support-btn { color: #E91E63; }
.support-btn:hover { transform: scale(1.1); background-color: rgba(233, 30, 99, 0.1); }

/* THEME SWITCH */
.theme-switch { position: relative; display: flex; align-items: center; justify-content: space-between; width: 50px; height: 26px; background-color: var(--background-color); border: 1px solid var(--border-color); border-radius: 30px; cursor: pointer; padding: 0 4px; overflow: hidden; }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background-color: var(--card-background); border-radius: 50%; transition: transform 0.3s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.2); z-index: 2; }
body.dark-mode .switch-thumb { transform: translateX(24px); }
.sun-icon, .moon-icon { width: 14px; height: 14px; position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; }
.sun-icon { left: 6px; color: #f39c12; }
.moon-icon { right: 6px; color: #9b59b6; }

/* MAIN CONTENT */
.main-content-area {
    flex: 1; height: calc(100dvh - var(--header-height));
    position: relative; overflow: hidden; 
    display: flex; flex-direction: column;
}
.container { width: 100%; height: 100%; max-width: 1600px; margin: 0 auto; padding: 1em; display: flex; flex-direction: column; }
main { flex: 1; display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }

/* GRID LAYOUT DESKTOP */
.main-content-grid { 
    display: grid; 
    grid-template-columns: 35% 1fr; 
    gap: 1.5em; 
    height: 100%; 
    width: 100%; 
    min-height: 0; 
}

/* LEFT COLUMN (MAPA + ANUNCIO) */
.left-column {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow: hidden !important;
    gap: 1em;
}

/* MAP - ALTERADO PARA FLEX COLUMN (Permite Toolbar no topo) */
.map-container {
    flex: 1 1 auto !important;
    width: 100%;
    border-radius: 12px; 
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative; 
    background: #e5e5e5;
    min-height: 0 !important;
    display: flex; /* Adicionado */
    flex-direction: column; /* Adicionado */
}

/* --- BARRA DE FERRAMENTAS DO MAPA (NOVA) --- */
.map-toolbar {
    flex: 0 0 auto; /* Não estica */
    background-color: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    padding: 5px 7px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    z-index: 10;
}

/* Botão Estilo Busca (Input Fake) */
.search-trigger-bar {
    flex: 1; 
    background-color: var(--background-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 12px;
    height: 30px;
    font-size: 0.7rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.search-trigger-bar:hover { background-color: #fff; border-color: #bbb; }
.search-trigger-bar svg { color: var(--primary-accent); width: 18px; height: 18px; }

/* Grupo de Botões (Direita) */
.map-toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

/* Botões da Barra (Pílulas) */
.toolbar-btn {
    background-color: var(--background-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0 12px;
    height: 30px;
    font-size: 0.7rem; 
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.toolbar-btn:hover { background-color: var(--border-color); }
.toolbar-btn svg { width: 14px; height: 14px; }

/* Estados Ativos */
.toolbar-btn.active.water-trigger { background-color: #00B0FF; color: white; border-color: #00B0FF; }
.toolbar-btn.active.wc-trigger { background-color: #FB8C00; color: white; border-color: #FB8C00; }

#map { width: 100%; flex: 1; z-index: 1; }

/* --- CONTROLES DE VISIBILIDADE --- */
.mobile-only-flex { display: none !important; }
.desktop-only { display: flex !important; }

/* --- TOGGLE SATÉLITE ESTILIZADO (SWITCH) --- */
.map-control-switch { 
    position: absolute; bottom: 10px; left: 10px; 
    z-index: 1000; 
    background-color: var(--card-background); /* Sensível ao tema */
    padding: 4px 8px; 
    border-radius: 20px; /* Arredondado */
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2); 
    display: flex; 
    align-items: center;
    gap: 8px;
}

.map-control-switch::after {
    content: "SAT";
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary);
    user-select: none;
}

/* The Switch Box */
.map-control-switch .switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
    margin: 0;
}

.map-control-switch .switch input { opacity: 0; width: 0; height: 0; }

/* The Slider */
.map-control-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}
/* Bolinha do slider */
.map-control-switch .slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.map-control-switch input:checked + .slider {
    background-color: var(--primary-accent);
}

.map-control-switch input:checked + .slider:before {
    transform: translateX(16px);
}

/* MAP BUTTONS */
.map-search-btn { 
    display: flex; align-items: center; gap: 6px; 
    position: absolute; top: auto; bottom: 10px; left: 50%; transform: translateX(-50%) translateY(100px); 
    z-index: 1001; 
    padding: 6px 14px; 
    background-color: var(--primary-accent); 
    color: white; border: none; border-radius: 20px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.25); 
    cursor: pointer; 
    font-weight: 600; font-size: 0.8em; 
    opacity: 0; transition: transform 0.3s, opacity 0.3s; pointer-events: none; 
    white-space: nowrap; 
}
.map-search-btn.visible { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }

.map-initial-locate-btn {
    position: absolute; bottom: 10px; right: 10px; z-index: 1002;
    display: flex; align-items: center; gap: 6px;
    background-color: var(--primary-accent); color: white;
    padding: 6px 12px; border: none; border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25); cursor: pointer;
    font-weight: 600; transition: transform 0.2s, box-shadow 0.2s;
    animation: slideUpFade 0.5s ease-out;
}
.map-initial-locate-btn span { font-size: 0.7em; line-height: 1.1; text-align: left; display: block; }
.map-initial-locate-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,0.3); background-color: #d81b60; }

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

.map-locate-btn {
    position: absolute; bottom: 10px; right: 10px; z-index: 1000;
    width: 40px; height: 40px;
    background-color: white; color: var(--text-primary);
    border: none; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}
.map-locate-btn:hover { background-color: #f0f0f0; color: var(--primary-accent); }
.map-locate-btn.active { color: var(--primary-accent); background-color: rgba(233, 30, 99, 0.1); }
body.dark-mode .map-locate-btn { background-color: #333; color: var(--text-primary); }
body.dark-mode .map-locate-btn:hover { background-color: #444; color: var(--primary-accent); }
body.dark-mode .map-locate-btn.active { background-color: #1a202c; color: var(--primary-accent); }

/* --- ÍCONES NO MAPA & EFEITO ZOOM --- */

/* 1. Configuração da Transição */
.wc-toilet-shape, 
.water-drop-shape {
    width: 100%; height: 100%;
    pointer-events: auto;
    position: relative;
    will-change: transform; 
}

/* Banheiro: Fundo Sólido sem Sombra */
.wc-toilet-shape {
    background-color: #FB8C00; 
    border: 1px solid #ffffff;
    border-radius: 2px 2px 1px 1px;
}
/* Detalhe do teto (mantido, é leve) */
.wc-toilet-shape::before {
    content: ''; position: absolute; top: 2px; left: 2px; right: 2px; height: 2px;
    background-color: rgba(255,255,255,0.4); border-radius: 1px;
}

/* Água: Fundo Sólido sem Sombra */
.water-drop-shape {
    background-color: #00B0FF; 
    border: 1px solid #ffffff;
    border-radius: 0 50% 50% 50%;
    transform: rotate(45deg);
}

/* ZOOM */
.map-high-zoom .wc-marker-container .wc-toilet-shape {
    transform: scale(1.6); 
}

.map-high-zoom .water-marker-container .water-drop-shape {
    transform: rotate(45deg) scale(1.6); 
}

@media (min-width: 769px) {
    .wc-marker-container:hover .wc-toilet-shape {
        background-color: #FFA726; border-color: #fff; z-index: 1000; transform: scale(1.2); cursor: pointer;
    }
    .water-marker-container:hover .water-drop-shape {
        background-color: #40C4FF; border-color: #fff; z-index: 1000; transform: rotate(45deg) scale(1.2); cursor: pointer;
    }
}

/* --- POPUP BUTTONS --- */
.wc-popup-btn, .water-popup-btn {
    color: white; border: none; padding: 6px 12px; border-radius: 20px; font-size: 0.75em; font-weight: 600; cursor: pointer; width: 100%; margin-top: 5px; transition: background-color 0.2s; display: flex; align-items: center; justify-content: center; gap: 5px;
}
.wc-popup-btn { background-color: #FB8C00; }
.wc-popup-btn:hover { background-color: #EF6C00; }
.water-popup-btn { background-color: #00B0FF; }
.water-popup-btn:hover { background-color: #0091EA; }


/* --- AJUSTE MOBILE --- */
@media (max-width: 768px) {
    .mobile-only-flex { display: flex !important; }
    .desktop-only { display: none !important; }
    
    /* Layout Mobile */
    .container { padding: 0; }
    .main-content-grid { display: flex; flex-direction: column; gap: 0; }
    
    /* AUMENTO DA ALTURA DO MAPA (de 35vh para 45vh) */
    .left-column { flex: 0 0 45vh; gap: 0; }
    
    .map-container { width: 100%; border-radius: 0 0 12px 12px; z-index: 20; height: 100%; }
}

/* USER MARKER & ANIMATIONS */
.user-location-marker { background: transparent; border: none; }
.user-dot { width: 16px; height: 16px; background-color: #FFD700; border: 2px solid black; border-radius: 2px; box-shadow: 0 1px 4px rgba(0,0,0,0.4); position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(45deg); z-index: 2; }
.user-pulse { width: 40px; height: 40px; background-color: rgba(233, 30, 99, 0.4); border-radius: 4px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(45deg); z-index: 1; animation: map-pulse 2s infinite; }
@keyframes map-pulse { 0% { transform: translate(-50%, -50%) rotate(45deg) scale(0.5); opacity: 1; } 100% { transform: translate(-50%, -50%) rotate(45deg) scale(1.5); opacity: 0; } }

@keyframes blink-marker { 0% { stroke-width: 3; stroke-opacity: 1; opacity: 1; } 50% { stroke-width: 10; stroke-opacity: 0.6; opacity: 0.8; } 100% { stroke-width: 3; stroke-opacity: 1; opacity: 1; } }
.marker-selected-anim { animation: blink-marker 1s ease-in-out 4; transform-origin: center; }

@keyframes card-flash { 0% { box-shadow: 0 0 0 0 rgba(233, 30, 99, 0); } 50% { box-shadow: 0 0 15px 4px rgba(233, 30, 99, 0.3); } 100% { box-shadow: 0 0 0 0 rgba(233, 30, 99, 0); } }
.evento-card.highlighted { animation: card-flash 1s ease-in-out 4; border-color: var(--primary-accent); z-index: 5; }
.evento-card.expanded { border-color: var(--primary-accent); background-color: rgba(233, 30, 99, 0.03); }
body.dark-mode .evento-card.expanded { background-color: rgba(233, 30, 99, 0.1); }

.leaflet-control-reset a { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"></path></svg>'); background-size: 16px 16px; background-position: center; background-repeat: no-repeat; cursor: pointer; background-color: white; }
body.dark-mode .leaflet-control-reset a { background-color: #333; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"></path></svg>'); }

/* LIST */
.events-list-container {
    height: 100%; overflow-y: auto; padding-right: 4px; padding-bottom: 4em; padding: 0px 10px 120px 10px !important;
    display: flex; flex-direction: column; min-height: 0;
    overflow-x: hidden; position: relative; min-width: 0;
}
.events-list-container::-webkit-scrollbar { width: 8px; }
.events-list-container::-webkit-scrollbar-track { background: transparent; }
.events-list-container::-webkit-scrollbar-thumb { background-color: var(--border-color); border-radius: 4px; }

/* INFO BANNER */
.info-banner { background-color: #fff3cd; border: 1px solid #ffeeba; color: #856404; padding: 12px; border-radius: 8px; margin-bottom: 15px; display: flex; align-items: flex-start; gap: 10px; font-size: 0.7rem; line-height: 1.4; }
.info-icon { font-size: 1.2rem; line-height: 1; }
.info-text strong { font-weight: 700; }
body.dark-mode .info-banner { background-color: #2c3e50; border-color: #4a5568; color: #ffeb3b; }

/* --- RESULTS HEADER OTIMIZADO --- */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    
    /* Full Width Hack ajustado */
    padding: 4px 10px;
    
    /* CORREÇÃO AQUI: Mudamos de -5px para 0 no topo */
    margin: 0px -10px 5px -10px; 
    
    width: calc(100% + 20px);
    
    background-color: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    
    /* Adicione position sticky para fixar o cabeçalho ao rolar */
    position: -webkit-sticky; /* Para Safari */
    position: sticky;
    top: 0;
    
    z-index: 90;
    gap: 4px; 
    height: 44px;
    flex-shrink: 0; /* Garante que o header não seja esmagado */
}

/* 1. Contador (Esquerda) */
.total-count {
    /* Ajuste de fonte para caber 2 linhas na altura de 44px */
    font-size: 0.65rem; 
    font-weight: 400;
    color: var(--text-secondary);
    margin: 0;
    
    /* --- LÓGICA DE QUEBRA DE LINHA (Onde a mágica acontece) --- */
    white-space: normal;  /* Permite que o texto quebre linhas */
    width: min-content;   /* O TRUQUE: Força a caixa a ter a largura da maior palavra, forçando a quebra */
    line-height: 1;       /* Altura de linha bem justa (1.0) para não estourar o header */
    text-align: left;     /* Alinha o texto (pode mudar para center se preferir) */
    
    /* Previne sumiço do texto */
    overflow: visible;
    text-overflow: clip;
    flex-shrink: 0;       /* Garante que ele não seja esmagado */
}

/* 2. Barra de Ordenação (Centro) */
.sort-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px; /* Gap reduzido */
    background: var(--background-color);
    padding: 2px 4px; /* Padding reduzido */
    border-radius: 20px;
    flex-shrink: 1; /* Permite encolher levemente se faltar espaço */
}

.sort-icon-indicator {
    color: var(--text-secondary);
    opacity: 0.6;
    display: flex !important;
    align-items: center;
    margin-right: 2px;
}
.sort-icon-indicator svg { width: 10px; height: 10px; }

.sort-circle {
    width: 24px;  /* Reduzido de 28px */
    height: 24px; /* Reduzido de 28px */
    border-radius: 50%;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}
.sort-circle svg { width: 14px; height: 14px; }

.sort-circle:hover { background: rgba(0,0,0,0.05); }

.sort-circle.active {
    background: #fff;
    color: var(--primary-accent);
    border-color: var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transform: scale(1.05);
}

/* 3. Grupo Favoritos (Direita) */
.fav-cluster { 
    display: flex; 
    align-items: center; 
    gap: 4px; /* Gap reduzido */
    background-color: transparent; 
    padding: 0; 
    border-radius: 0;
    flex-shrink: 0; 
}

.share-favs-btn { 
    /* O JS controla o display: flex/none */
    align-items: center; 
    justify-content: center; 
    background-color: #25D366; 
    color: white; 
    border: none; 
    width: 26px; /* Reduzido de 30px */
    height: 26px; /* Reduzido de 30px */
    border-radius: 50%; 
    cursor: pointer; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.15); 
    padding: 0; 
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }

.share-favs-btn svg { width: 14px; height: 14px; }

/* CORREÇÃO DO BOTÃO FAVORITOS & CHECKBOX OCULTO */
.fav-toggle-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* ESCONDE O QUADRADINHO DO CHECKBOX */
.fav-toggle-wrapper input { 
    display: none; 
}

.fav-toggle-wrapper label { 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 4px; 
    padding: 0 10px; /* Mais compacto */
    height: 26px;    /* Altura reduzida para acompanhar os botões */
    border-radius: 20px; 
    transition: all 0.2s; 
    font-size: 0.7rem; 
    font-weight: 600; 
    color: var(--text-secondary); 
    background-color: var(--background-color); 
    border: 1px solid var(--border-color); 
    
    white-space: nowrap; 
    box-sizing: border-box;
}

.fav-toggle-wrapper label svg { 
    width: 12px; 
    height: 12px; 
    fill: none; 
    stroke: currentColor; /* Usa a cor do texto */
    stroke-width: 2.5;
    flex-shrink: 0; 
}

/* Estados do botão Favoritos */
.fav-toggle-wrapper label:hover { background-color: #eee; }

/* ESTADO ATIVO (CHECKED) - Estilo Botão Sólido */
.fav-toggle-wrapper input:checked + label { 
    color: white; 
    background-color: var(--primary-accent); /* Fundo Rosa Sólido */
    border-color: var(--primary-accent); 
    box-shadow: 0 2px 5px rgba(233, 30, 99, 0.3);
}

.fav-toggle-wrapper input:checked + label svg { 
    fill: white; 
    stroke: white; 
}

/* --- MOBILE TWEAKS --- */
@media (max-width: 300px) {
    .results-header {
        padding: 4px 5px;
        gap: 2px;
    }
    
    .total-count {
        font-size: 0.65rem; /* Fonte menor em telas muito pequenas */
        max-width: 70px;
    }
    
    /* Esconde o label "Favoritos" apenas em telas minúsculas (iPhone SE antigo), mantendo o ícone */
    .fav-toggle-wrapper label span {
        display: none; 
    }
    .fav-toggle-wrapper label {
        padding: 0 8px;
    }
}

/* FILTERS */
.filters-wrapper { background: var(--card-background); padding: 0.8em; border-radius: 12px; margin-bottom: 1em; border: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 5px rgba(0,0,0,0.05); width: 100%; max-width: 100%; box-sizing: border-box; }
.filtros-container form { display: flex; flex-direction: column; gap: 0.5em; }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5em; }
.filtro-item { width: 100%; }

.filtro-item label { 
    display: flex; 
    align-items: center; 
    gap: 6px;
    font-size: 0.7em; 
    font-weight: 600; 
    margin-bottom: 4px; 
    color: var(--text-secondary);
}
.filtro-item label svg {
    opacity: 0.8;
    color: var(--primary-accent);
}

.filtro-item input, .filtro-item select { width: 100%; padding: 8px; font-size: 0.85rem; border-radius: 6px; border: 1px solid var(--border-color); background: var(--background-color); color: var(--text-primary); }
.quick-filters { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 2px; margin-bottom: 2px; align-items: center; }
.filter-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-group:not(:last-child) { padding-right: 0; margin-right: 0; border-right: none; }

.chip-checkbox { display: inline-block; cursor: pointer; }
.chip-checkbox input { display: none; }
.chip-checkbox span { background-color: var(--background-color); border: 1px solid var(--border-color); color: var(--text-primary); padding: 6px 12px; border-radius: 20px; font-size: 0.8em; transition: all 0.2s; font-weight: 500; display: inline-block; display: inline-flex; align-items: center; justify-content: center; line-height: 1; height: 100%; }
.chip-checkbox input:checked + span { background-color: rgba(233, 30, 99, 0.1); color: var(--primary-accent); border-color: var(--primary-accent); font-weight: 700; }
.chip-destaque { font-weight: 700; border-color: var(--primary-accent) !important; color: var(--primary-accent) !important; }
.chip-checkbox input:checked + .chip-destaque { background-color: rgba(233, 30, 99, 0.15) !important; color: var(--primary-accent) !important; border-color: var(--primary-accent) !important; }

.filter-footer { background-color: var(--background-color); padding: 15px; margin: 10px -0.8em -0.8em -0.8em; border-top: 1px solid var(--border-color); border-radius: 0 0 12px 12px; }
.filter-actions-row { display: flex; gap: 10px; align-items: center; width: auto; }
.btn-filtrar { background: var(--primary-accent); color: white; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 0.85rem; height: 36px; flex: 1; justify-content: center; }
.btn-limpar { background-color: #7f8c8d; color: white; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 0.85rem; height: 36px; text-decoration: none; display: flex; align-items: center; justify-content: center; flex: 1; }
.btn-limpar:hover { background-color: #95a5a6; }

/* EVENT CARDS (COMPACTADO PARA OTIMIZAÇÃO) */
.eventos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.8em; padding-top: 4px; }
.evento-card { 
    background: var(--card-background); 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    padding: 8px; /* Reduzido de 0.8em */
    position: relative; 
    transition: transform 0.2s; 
    box-shadow: 0 2px 4px var(--shadow-color); 
    display: flex; flex-direction: column; 
    cursor: pointer; overflow: hidden; 
}
.evento-card:hover { transform: translateY(-3px); border-color: var(--primary-accent); }

/* MINI LIKE COUNTER */
.mini-like-counter { position: absolute; bottom: 8px; right: 10px; font-size: 0.75em; color: var(--text-secondary); font-weight: 600; display: flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, 0.9); padding: 2px 6px; border-radius: 10px; pointer-events: none; z-index: 3; }
body.dark-mode .mini-like-counter { background: rgba(45, 55, 72, 0.9); color: var(--text-secondary); }
.evento-card.expanded .mini-like-counter { display: none; }

/* STATUS COLORS & TAGS */
.status-bg-em-andamento { background-color: rgba(39, 174, 96, 0.08); border-color: rgba(39, 174, 96, 0.4); }
.status-bg-em-breve { background-color: rgba(33, 150, 243, 0.08); border-color: rgba(33, 150, 243, 0.4); }
.status-bg-encerrando { background-color: rgba(211, 84, 0, 0.08); border-color: rgba(211, 84, 0, 0.4); }
.status-bg-hoje { background-color: rgba(194, 24, 91, 0.06); border-color: rgba(194, 24, 91, 0.4); }
.status-bg-encerrado { opacity: 0.8; background-color: rgba(149, 165, 166, 0.1); }
.status-tag { position: absolute; top: 0; left: 0; font-size: 0.65em; padding: 3px 10px; border-radius: 0 0 8px 0; font-weight: 700; color: white; z-index: 2; text-transform: uppercase; letter-spacing: 0.5px; }
.status-em-andamento { background-color: var(--status-live); padding-left: 18px; }
.status-em-andamento::before { content: ''; position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; background-color: white; border-radius: 50%; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); } 70% { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); } }
.status-em-breve { background-color: var(--status-soon); }
.status-encerrando { background-color: var(--status-ending); }
.status-hoje { background-color: var(--status-today); }
.status-encerrado { background-color: var(--status-ended); font-weight: 500; }
.evento-card.status-bg-em-andamento .card-header, .evento-card.status-bg-em-breve .card-header, .evento-card.status-bg-encerrando .card-header, .evento-card.status-bg-hoje .card-header, .evento-card.status-bg-encerrado .card-header { padding-top: 18px; }

/* CARD INFO */
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.3em; }
.card-header h2 { 
    font-size: 0.75rem; /* Compactado */
    margin: 0; 
    color: var(--primary-accent); 
    line-height: 1.2; 
    padding-right: 10px; 
    flex: 1; 
}
.header-tags { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.icons-row { display: flex; gap: 4px; }
.feature-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; }
.feature-kids svg { color: #F57C00; }
.feature-pet svg { color: #e67e22; }

.tamanho-tag { font-size: 0.6em; font-weight: 700; background: var(--primary-accent); color: white; padding: 2px 6px; border-radius: 4px; white-space: nowrap; display: inline-flex; justify-content: center; align-items: center; transition: width 0.3s ease; }
.tamanho-1 { width: 70px; opacity: 1; }
.tamanho-2 { width: 95px; opacity: 1; }
.tamanho-3 { width: 120px; opacity: 1; }

.categoria-tag { font-size: 0.6em; background: var(--border-color); padding: 1px 6px; border-radius: 4px; white-space: nowrap; color: var(--text-primary); border: 1px solid transparent; }
.categoria-tag.tag-ensaio { background-color: #F8BBD0; color: #C2185B; font-weight: 700; border: 1px solid #F48FB1; padding: 2px 5px; font-size: 0.5em; text-transform: uppercase; letter-spacing: 0.5px; border-radius: 6px; display: inline-block; }

.card-meta { font-size: 0.75em; color: var(--text-secondary); } /* Compactado */
.meta-row { display: flex; align-items: center; margin-bottom: 2px; }
.meta-row.date-row { justify-content: space-between; gap: 10px; }
.date-wrapper { display: flex; align-items: center; gap: 5px; }
.meta-row.address-row { gap: 5px; padding-right: 50px; }
.evento-card.expanded .meta-row.address-row { padding-right: 0; }
.meta-row.address-row span { font-size: 0.75em; line-height: 1.2; }

.card-desc { margin-top: 6px; padding-top: 6px; border-top: none; font-size: 0.75rem; color: var(--text-primary); line-height: 1.3; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.price-info { font-size: 0.6rem; color: var(--text-secondary); font-weight: 500; white-space: nowrap; }
body.dark-mode .price-info { color: #a0aec0; }

.btn-ingresso { display: inline-block; margin-top: 8px; background-color: #2c3e50; color: white; padding: 6px 12px; border-radius: 6px; text-decoration: none; font-size: 0.8em; font-weight: 600; transition: background 0.2s; }
.btn-ingresso:hover { background-color: #34495e; }

/* EXPANDED CONTENT */
.expand-content { display: none; margin-top: 10px; border-top: none; padding-top: 10px; }
.evento-card.expanded .expand-content { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.card-actions { display: flex; gap: 8px; align-items: stretch; } /* Gap reduzido */
.directions-btn { flex: 1; text-align: center; background-color: var(--primary-accent); color: white; padding: 8px; border-radius: 8px; font-size: 0.85em; font-weight: 600; text-decoration: none; transition: background-color 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.2); display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; font-family: inherit; }
.directions-btn:hover { background-color: #c2185b; }

.share-btn { width: 40px; background: white; border: 1px solid var(--border-color); border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #25D366; box-shadow: 0 2px 5px rgba(0,0,0,0.1); transition: all 0.2s; flex-shrink: 0; }
.share-btn:hover { background-color: #25D366; color: white; border-color: #25D366; }

.fav-btn { min-width: 40px; padding: 0 10px; background: white; border: 1px solid var(--border-color); border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #ccc; box-shadow: 0 2px 5px rgba(0,0,0,0.1); transition: all 0.2s; flex-shrink: 0; gap: 4px; }
.fav-btn:hover { color: var(--primary-accent); border-color: var(--primary-accent); }
.evento-card.is-favorite .fav-btn svg { fill: var(--primary-accent); stroke: var(--primary-accent); }
.evento-card.is-favorite .fav-btn { border-color: var(--primary-accent); color: var(--primary-accent); background-color: rgba(233, 30, 99, 0.05); }
.like-count { font-size: 0.8rem; font-weight: 700; line-height: 1; color: inherit; }

/* DARK MODE ADJUSTMENTS */
body.dark-mode .fav-btn, body.dark-mode .share-btn { background-color: var(--card-background); border-color: var(--border-color); color: var(--text-secondary); }
body.dark-mode .share-btn { color: #25D366; }
body.dark-mode .share-btn:hover { background-color: #25D366; color: white; border-color: #25D366; }
body.dark-mode .fav-btn:hover { color: var(--primary-accent); border-color: var(--primary-accent); background-color: rgba(255, 255, 255, 0.05); }
body.dark-mode .evento-card.is-favorite .fav-btn { background-color: rgba(233, 30, 99, 0.2); border-color: var(--primary-accent); color: var(--primary-accent); }

/* --- TRANSIÇÃO DO BANNER ROTATIVO --- */
.ad-transition {
    transition: opacity 0.5s ease-in-out;
    opacity: 1;
}

.ad-hidden-state {
    opacity: 0;
}

/* Sidebar Desktop - CORRIGIDO E AJUSTADO */
.desktop-map-ad {
    background: linear-gradient(135deg, #fff9c4 0%, #ffffff 100%);
    border: 1px solid #f1c40f;
    border-radius: 12px;
    padding: 24px;
    /* REMOVIDA MARGEM SUPERIOR PARA EQUILIBRAR */
    margin-top: 0 !important; 
    box-shadow: 0 4px 12px var(--shadow-color);
    text-align: center;
    min-height: 220px; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    transition: opacity 0.5s ease-in-out;
}

.desktop-map-ad.parceiro-vanfall {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    min-height: auto !important; /* Altura automática */
    box-shadow: none !important;
}

.desktop-map-ad.parceiro-ta-aqui {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    min-height: auto !important; /* Altura automática */
    box-shadow: none !important;
}

.desktop-map-ad .ad-text {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.desktop-map-ad h3 { 
    margin: 0; 
    font-size: 1.2rem;
    color: #2c3e50; 
    line-height: 1.2;
}

.desktop-map-ad p { 
    margin: 0; 
    font-size: 0.9rem; 
    color: #555; 
    line-height: 1.4;
}

/* --- AJUSTE IMAGENS DE ANÚNCIO (REMOVE FAIXA BRANCA) --- */
.ad-link-wrapper {
    display: block;
    width: 100%;
    height: auto;
    /* Remove altura de linha fantasma */
    line-height: 0 !important; 
    font-size: 0 !important;
}

.ad-link-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover; 
    border-radius: 12px;
}

.desktop-map-ad .ad-link-wrapper img {
    border-radius: 12px;
}

/* Card de Publicidade no Feed (Mobile/Lista) - CORRIGIDO */
.card-destaque {
    background: linear-gradient(135deg, #fff9c4 0%, #ffffff 100%);
    border: 1px solid #f1c40f;
    text-align: center;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    cursor: default;
    border-radius: 8px;
    /* REMOVIDA MARGEM INFERIOR PARA EQUILIBRAR */
    margin-bottom: 0 !important; 
}

.card-destaque.parceiro-vanfall {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.card-destaque.parceiro-ta-aqui {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.ad-label {
    font-size: 0.6em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    font-weight: 600;
}

.ad-content h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 0.9rem;
}

.ad-content p {
    font-size: 0.75em;
    color: #555;
    margin: 5px 0 10px 0;
}

/* Dark Mode */
body.dark-mode .desktop-map-ad, body.dark-mode .card-destaque {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    border-color: #f1c40f;
}
body.dark-mode .desktop-map-ad h3, body.dark-mode .ad-content h3 { color: #f1c40f; }
body.dark-mode .desktop-map-ad p, body.dark-mode .ad-content p { color: #ccc; }

/* Transições do Rotativo */
.ad-hidden-state {
    opacity: 0;
}

/* --- MODERN LOADER (SPINNER & SKELETON UI) --- */
/* Novo Spinner que substitui a máscara */
.loading-spinner {
    position: absolute;
    left: 50%;
    top: 150px;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 20;
}

body.dark-mode .loading-spinner {
    border-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-accent);
}

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

.loading-placeholder {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.8em;
    width: 100%;
    padding: 0;
    margin-top: 0;
}

.skeleton-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8em;
    height: 220px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.skeleton-pulse {
    background: #f6f7f8;
    background: linear-gradient(90deg, #eeeeee 8%, #dddddd 18%, #eeeeee 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 4px;
}

body.dark-mode .skeleton-pulse {
    background: #2d3748;
    background: linear-gradient(90deg, #2d3748 8%, #4a5568 18%, #2d3748 33%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.sk-header { height: 24px; width: 70%; margin-bottom: 5px; }
.sk-tags { display: flex; gap: 5px; }
.sk-tag { height: 16px; width: 50px; border-radius: 10px; }
.sk-line { height: 14px; width: 90%; margin-top: 5px; }
.sk-line.short { width: 60%; }
.sk-footer { margin-top: auto; display: flex; gap: 10px; }
.sk-btn { height: 36px; flex: 1; border-radius: 8px; }
.sk-circle { width: 36px; height: 36px; border-radius: 50%; }

.loading-overlay-icon {
    position: absolute;
    left: 50%;
    top: 150px;
    transform: translateX(-50%);
    font-size: 2rem;
    z-index: 10;
    animation: heartbeat 1.5s infinite;
    text-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

@keyframes heartbeat {
    0% { transform: translateX(-50%) scale(1); opacity: 0.8; }
    50% { transform: translateX(-50%) scale(1.2); opacity: 1; }
    100% { transform: translateX(-50%) scale(1); opacity: 0.8; }
}

/* --- CONTROLE DE VISIBILIDADE DE ANÚNCIOS (RESPONSIVO) --- */

/* !IMPORTANT: Regras Padrão (Mobile First Overridden) */
.mobile-filter-modal { display: none !important; }

/* Desktop: Esconde Feed, Mostra Sidebar */
@media (min-width: 769px) {
    .card-destaque.in-feed {
        display: none !important;
    }
    .desktop-map-ad {
        display: block !important;
    }
    /* BLINDAGEM: Garante que elementos mobile sumam no desktop */
    .mobile-filter-modal { display: none !important; }
}

/* Mobile: Mostra Feed, Esconde Sidebar */
@media (max-width: 768px) {
    /* CORREÇÃO CRÍTICA: Removido !important para permitir que JS esconda anúncios não usados */
    .card-destaque.in-feed {
        display: block; 
    }
    .desktop-map-ad {
        display: none !important;
    }
    .skeleton-card.mobile-hide { display: none !important; }
    
    /* Layout Mobile */
    .container { padding: 0; }
    .main-content-grid { display: flex; flex-direction: column; gap: 0; }
    
    /* AUMENTO DA ALTURA DO MAPA NO MOBILE (de 35vh para 45vh) */
    .left-column { flex: 0 0 45vh; gap: 0; }
    
    .map-container { 
        width: 100%; 
        border-radius: 0 0 12px 12px; 
        z-index: 20; 
        height: 100%; 
        /* Flex column já está definido no padrão */
    }
    
    .events-list-container { flex: 1 1 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0.8em; height: auto; padding-bottom: 120px; overflow-x: hidden; }
    .filters-wrapper { display: none; }
    
    /* Mobile Filter Modal Styles (Visível Apenas no Mobile) */
    
    .mobile-filter-modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); backdrop-filter: blur(3px); }
    .mobile-filter-modal.show { display: block !important; }
    
    #mobile-filter-modal .modal-content { background-color: var(--card-background); margin: 0; position: absolute; bottom: 0; left: 0; width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; display: flex; flex-direction: column; max-height: 85vh; height: 85vh; padding: 0; box-shadow: 0 -5px 25px rgba(0,0,0,0.2); }
    .modal-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--border-color); flex-shrink: 0; }
    .modal-header h2 { font-size: 1.1rem; margin: 0; }
    .close-modal-btn { background: none; border: none; font-size: 1.8rem; color: var(--text-secondary); cursor: pointer; }
    #mobile-filters-container { padding: 20px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
    .filtros-container form { flex-direction: column; gap: 0.5em; }
    .filters-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
    .filtro-busca { grid-column: 1 / -1; }
    .quick-filters { flex-direction: column; align-items: flex-start; gap: 12px; }
    .filter-group:not(:last-child) { border-right: none; padding-right: 0; margin-right: 0; }
    .filter-footer { flex-shrink: 0; padding: 15px 20px; background-color: var(--card-background); border-top: 1px solid var(--border-color); border-radius: 0; margin: 0; position: relative; z-index: 10; box-shadow: 0 -4px 10px rgba(0,0,0,0.05); }
    .filter-actions-row { display: flex; gap: 10px; width: auto; margin: 0; }
    .btn-filtrar, .btn-limpar { flex: 1; justify-content: center; }
}

/* DATE & TIME BADGES */
.date-time-container { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.badge-info { display: inline-flex; align-items: center; gap: 6px; padding: 3px 5px; border-radius: 8px; font-size: 0.65em; font-weight: 600; line-height: 1; letter-spacing: 0.3px; }
.badge-info svg { width: 12px; height: 12px; stroke-width: 2.5; }
.badge-date { background-color: #FFF8E1; color: #F57F17; border: 1px solid #FFE082; }
.badge-time { background-color: #F3E5F5; color: #aa2424; border: 1px solid #E1BEE7; }
body.dark-mode .badge-date { background-color: #2c2c2c; color: #e0e0e0; border-color: #444; }
body.dark-mode .badge-time { background-color: #361e1e; color: #e7bebe; border-color: #5d2c2c; }

/* MODALS */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); backdrop-filter: blur(3px); }
.modal.show { display: block; }
.modal-content { background-color: var(--card-background); margin: 15% auto; padding: 20px; width: 90%; max-width: 400px; border-radius: 16px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); position: relative; text-align: center; }
.close-modal { position: absolute; top: 10px; right: 15px; font-size: 28px; font-weight: bold; color: var(--text-secondary); cursor: pointer; }
.close-modal:hover { color: var(--primary-accent); }
.welcome-content { max-width: 380px; text-align: center; padding: 30px 25px; border-radius: 20px; }
.welcome-icon { font-size: 3.5rem; margin-bottom: 10px; animation: floating 3s ease-in-out infinite; }
@keyframes floating { 0% { transform: translate(0, 0px); } 50% { transform: translate(0, 10px); } 100% { transform: translate(0, -0px); } }
.nav-modal-content { background: var(--card-background); width: 90%; max-width: 340px; padding: 25px; border-radius: 24px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.2); border: 1px solid var(--border-color); position: relative; margin: 15% auto; }
.nav-options { display: flex; flex-direction: column; gap: 12px; }
.nav-option-btn { display: flex; align-items: center; justify-content: flex-start; gap: 20px; width: 100%; padding: 16px 20px; border: none; border-radius: 16px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; text-decoration: none; position: relative; font-family: 'Poppins', sans-serif; }
.nav-option-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.nav-option-btn:active { transform: scale(0.98); }
.nav-option-btn img { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.btn-google { background-color: #f8f9fa; color: #3c4043; border: 1px solid #e8eaed; }
body.dark-mode .btn-google { background-color: #303134; color: #e8eaed; border-color: #5f6368; }
.btn-waze { background-color: #33ccff; color: white; box-shadow: 0 4px 12px rgba(51, 204, 255, 0.25); }
.btn-waze:hover { background-color: #00c3ff; box-shadow: 0 6px 15px rgba(51, 204, 255, 0.35); }
.btn-uber { background-color: #000000; color: #ffffff; border: 1px solid #000000; }
.btn-uber:hover { background-color: #333333; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); }
body.dark-mode .btn-uber { border: 1px solid #555; background-color: #000; }
body.dark-mode .btn-uber:hover { background-color: #222; border-color: #777; }
.nav-modal-content .close-modal-btn { position: absolute; top: 15px; right: 15px; background: transparent; border: none; font-size: 24px; color: var(--text-secondary); cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.nav-modal-content .close-modal-btn:hover { background-color: rgba(0,0,0,0.05); color: var(--primary-accent); }
.mobile-only-opt { display: none !important; }
@media (max-width: 768px) { .mobile-only-opt { display: flex !important; } }

/* RATING STARS */
.rating-container { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; background: rgba(0,0,0,0.03); border-radius: 8px; margin-top: 10px; width: 100%; }
.rating-label { font-size: 0.9rem; color: var(--text-secondary); font-weight: 600; }
.stars { display: flex; gap: 10px; cursor: pointer; }
.star-icon { width: 32px; height: 32px; fill: #ddd; transition: transform 0.2s, fill 0.2s; }
.star-icon:hover { transform: scale(1.15); }
.star-icon.active { fill: #f1c40f; }
.rating-thanks { font-size: 1rem; color: var(--status-live); font-weight: bold; animation: fadeIn 0.5s; margin-top: 5px; }

/* Sidebar Desktop */
.highlight-box {
    background: linear-gradient(135deg, #fff9c4 0%, #ffffff 100%);
    border: 1px solid #f1c40f;
    border-radius: 12px;
    padding: 24px;
    margin-top: 0 !important;
    box-shadow: 0 4px 12px var(--shadow-color);
    text-align: center;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    transition: opacity 0.5s ease-in-out;
}
/* Mobile Feed */
.content-highlight {
    background: linear-gradient(135deg, #fff9c4 0%, #ffffff 100%);
    border: 1px solid #f1c40f;
    text-align: center;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    cursor: default;
    border-radius: 8px;
    margin-bottom: 0 !important;
}
/* Remove estilos padrão para parceiros com imagem full */
.highlight-box.brand-sponsor, .content-highlight.brand-sponsor {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    min-height: auto !important;
    box-shadow: none !important;
}
/* Imagens */
.link-wrapper-full { display: block; width: 100%; height: auto; line-height: 0 !important; font-size: 0 !important; }
.link-wrapper-full img { width: 100%; height: auto; display: block; object-fit: cover; border-radius: 12px; }

/* Dark Mode overrides */
body.dark-mode .highlight-box, body.dark-mode .content-highlight {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    border-color: #f1c40f;
}

/* Controle de Visibilidade Responsiva */
@media (min-width: 769px) {
    .content-highlight.in-feed { display: none !important; }
    .highlight-box { display: block !important; }
}
@media (max-width: 768px) {
    .content-highlight.in-feed { display: block; }
    .highlight-box { display: none !important; }
}

/* --- OTIMIZAÇÃO DE FILTROS MOBILE --- */
@media (max-width: 768px) {
    /* Reduz o tamanho da fonte e espaçamento dos botões (chips) no mobile */
    #mobile-filters-container .chip-checkbox span {
        font-size: 0.8rem !important;      /* Letra um pouco menor */
        padding: 6px 10px !important;      /* Botão mais magrinho */
        min-height: 32px;                  /* Altura mínima menor */
        line-height: 1.2;
    }

    /* Aproxima os grupos de filtros para caber mais na tela */
    #mobile-filters-container .filter-group {
        gap: 6px !important;           /* Menos espaço entre os botões */
        margin-bottom: 8px !important; /* Menos espaço entre as linhas */
        justify-content: flex-start;   /* Alinha à esquerda */
        flex-wrap: wrap;
    }

    /* Reduz o tamanho dos inputs de texto e selects no mobile */
    #mobile-filters-container input[type="text"],
    #mobile-filters-container select {
        padding: 4px;
        font-size: 0.9rem;
        height: 38px; /* Altura reduzida */
    }
    
    #mobile-filters-container .filtro-item {
        margin-bottom: 4px; /* Menos espaço entre Data, Bairro, etc */
    }
    
    #mobile-filters-container label {
        font-size: 0.85rem; /* Label (Ex: "Bairro:") menor */
        margin-bottom: 4px;
    }

    /* Ajuste do modal para aproveitar mais a tela */
    .mobile-filter-modal .modal-content {
        padding: 10px; /* Menos borda interna */
        max-height: 90vh; /* Garante que não ultrapasse a tela */
    }
    
    .mobile-filter-modal .modal-header h2 {
        font-size: 1.3rem;
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    /* --- 1. ESTRUTURA DO MODAL --- */
    .mobile-filter-modal .modal-content {
        max-height: 85vh; /* Garante que cabe na tela com sobra */
    }
    
    .modal-header {
        padding: 10px 15px; /* Cabeçalho mais fino */
        border-bottom: 1px solid #eee;
    }
    .modal-header h2 { font-size: 1.1rem; margin: 0; }
    .close-modal-btn { font-size: 1.5rem; line-height: 1; }

    /* --- 2. ÁREA DE SCROLL (CONTAINER) --- */
    #mobile-filters-container {
        padding: 12px 15px; /* Menos borda lateral */
        gap: 8px; /* Aproxima os blocos verticalmente */
    }

    /* --- 3. CHIPS (BOTÕES DE FILTRO RÁPIDO) --- */
    #mobile-filters-container .quick-filters {
        gap: 6px; /* Menos espaço entre os grupos de botões */
    }
    
    #mobile-filters-container .filter-group {
        gap: 5px !important; 
        margin-bottom: 4px !important;
    }

    #mobile-filters-container .chip-checkbox span {
        font-size: 0.75rem !important; /* Letra menor */
        padding: 4px 10px !important;  /* Botão mais magrinho */
        min-height: 28px;              /* Altura forçada menor */
        line-height: 1.1;
        border-radius: 14px;           /* Arredondamento ajustado */
    }

    /* --- 4. CORREÇÃO DO GRID (DATA, BAIRRO, ESTILO) --- */
    #mobile-filters-container .filters-grid {
        display: grid;
        grid-template-columns: 1fr 1fr; /* Duas colunas */
        gap: 4px 10px; /* Gap Vertical: 8px, Horizontal: 10px */
        margin-top: 5px;
    }

    /* TRUQUE: Faz o 3º item (Estilo) ocupar a linha toda se estiver sozinho */
    /* Se preferir que SEMPRE ocupe a linha toda, use grid-column: 1/-1 em todos */
    #mobile-filters-container .filtro-item:nth-child(3) {
        grid-column: 1 / -1; 
    }

    /* Inputs e Selects mais baixos */
    #mobile-filters-container input[type="text"],
    #mobile-filters-container select {
        height: 36px;       /* Reduzido de ~45px para 36px */
        font-size: 0.9rem;
        padding: 0 8px;
    }
    
    #mobile-filters-container label {
        font-size: 0.75rem;
        margin-bottom: 2px;
        color: #666;
    }

    /* --- 5. RODAPÉ (BOTÕES DE AÇÃO) --- */
    .filter-footer {
        padding: 10px 15px; /* Menos padding */
        background: #fff;   /* Garante fundo branco se for sticky */
    }

    /* --- CORREÇÃO DARK MODE PARA O FOOTER --- */
    body.dark-mode .filter-footer {
        background: var(--card-background); /* Usa a cor escura do card */
        border-top: 1px solid var(--border-color); /* Garante visibilidade da borda */
    }
    
    .btn-filtrar, .btn-limpar {
        height: 42px;         /* Botões menos "gordos" */
        font-size: 0.9rem;
        border-radius: 8px;
        text-transform: uppercase;
        font-weight: 700;
        letter-spacing: 0.5px;
    }
}

/* --- NOVO: Modal/Tooltip de Instalação (Onboarding) --- */
.install-guide-modal {
    display: none;
    position: fixed;
    top: 50px; /* Logo abaixo do header */
    right: 10px;
    z-index: 2002;
    max-width: 250px;
    animation: fadeInDown 0.5s ease-out;
}

.install-guide-modal.show {
    display: block;
}

.install-guide-content {
    background-color: var(--card-background);
    padding: 12px 15px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    position: relative;
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Setinha apontando para cima (para o botão verde) */
.guide-arrow {
    position: absolute;
    top: -8px;
    right: 88px; /* Ajuste conforme a posição do botão verde */
    width: 16px;
    height: 16px;
    background-color: var(--card-background);
    border-left: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    transform: rotate(45deg);
}

.close-guide-btn {
    position: absolute;
    top: 2px;
    right: 5px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
}

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

/* Modo Escuro para o Tooltip */
body.dark-mode .install-guide-content, 
body.dark-mode .guide-arrow {
    background-color: #2d3748;
    border-color: #4a5568;
}

/* --- NOVA ETIQUETA DE DISTÂNCIA --- */
.distance-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background-color: rgba(33, 150, 243, 0.1);
    color: #1976D2;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: auto; /* Empurra para a direita */
    white-space: nowrap;
    border: 1px solid rgba(33, 150, 243, 0.2);
    flex-shrink: 0; /* Garante que a etiqueta não amasse */
}

/* Ajuste Dark Mode */
body.dark-mode .distance-badge {
    background-color: rgba(33, 150, 243, 0.2);
    color: #64B5F6;
    border-color: rgba(33, 150, 243, 0.3);
}

/* Ajuste no texto do endereço para não atropelar a etiqueta */
.address-text-truncate {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* --- CORREÇÃO DO MODAL DE APOIO (QR CODE) --- */
.qr-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.pix-img {
    max-width: 100%;
    width: 250px; /* Limita o tamanho para não ficar gigante */
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

/* --- ESTILO DO MODAL DE APOIO (ADICIONAR NO FINAL DO STYLE.CSS) --- */
.pix-copy-wrapper {
    margin: 15px 0;
    text-align: left;
    width: 100%;
}

.pix-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
}

.pix-copy-box {
    display: flex;
    align-items: center;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden; /* Garante que o input não vaze */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.pix-copy-box input {
    flex: 1; /* Ocupa todo espaço disponível */
    border: none;
    background: transparent;
    padding: 12px;
    font-family: 'Courier New', monospace; /* Fonte monoespaçada para código */
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    min-width: 0; /* Evita quebra de layout no flex */
}

.copy-btn {
    background-color: var(--card-background);
    border: none;
    border-left: 1px solid var(--border-color);
    padding: 0 15px;
    height: 42px; /* Mesma altura do input aprox */
    cursor: pointer;
    color: var(--primary-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.copy-btn:hover {
    background-color: rgba(233, 30, 99, 0.05);
}

.copy-btn.copied {
    background-color: #27ae60;
    color: white;
}

.nubank-btn {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #820AD1; /* Roxo Nubank */
    color: white !important;
    font-weight: 700;
    padding: 14px;
    border-radius: 12px;
    text-decoration: none;
    margin-top: 15px;
    transition: background-color 0.2s, transform 0.2s;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(130, 10, 209, 0.2);
}

.nubank-btn:hover {
    background-color: #6d06b1;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(130, 10, 209, 0.3);
}

/* ===== Página principal (antes inline em index.html) ===== */
        /* --- LOADING OVERLAY & TIPS --- */
        #loading-overlay {
            display: none;
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
            z-index: 9999;
            flex-direction: column;
            align-items: center;
            justify-content: center; /* Centralização Exata */
            text-align: center;
            padding: 20px;
        }
        #loading-overlay.show { display: flex; animation: fadeIn 0.3s; }
        
        .loader-content h3 {
            margin-top: 20px;
            color: #E91E63;
            font-family: 'Poppins', sans-serif;
            font-weight: 700;
            font-size: 18px;
        }
        
        .loader-tips {
            margin-top: 10px;
            font-size: 14px;
            color: #666;
            font-style: italic;
            height: 20px; /* Evita pulo de layout */
            animation: fadeIn 0.5s;
        }

        .custom-spinner {
            width: 50px; height: 50px;
            border: 5px solid #ddd;
            border-top: 5px solid #E91E63;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

        /* --- MODAL DE SELEÇÃO DE COMPARTILHAMENTO --- */
        .share-option-modal {
            display: none;
            position: fixed; z-index: 4000; left: 0; top: 0; width: 100%; height: 100%;
            background-color: rgba(0,0,0,0.6); backdrop-filter: blur(3px);
            align-items: flex-end; /* Mobile Bottom Sheet Style */
            justify-content: center;
        }
        .share-option-modal.show { display: flex; animation: fadeIn 0.2s; }
        
        .share-options-content {
            background: white; width: 100%; max-width: 500px;
            border-radius: 20px 20px 0 0; padding: 25px;
            display: flex; flex-direction: column; gap: 15px;
            box-shadow: 0 -5px 25px rgba(0,0,0,0.2);
            animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }
        
        @media (min-width: 768px) {
            .share-option-modal { align-items: center; }
            .share-options-content { border-radius: 20px; width: 350px; }
        }

        .share-opt-btn {
            display: flex; align-items: center; gap: 15px;
            padding: 16px; border-radius: 12px; border: 1px solid #eee;
            background: #f8f9fa; color: #333; font-weight: 600; font-size: 1rem;
            cursor: pointer; text-align: left; transition: all 0.2s;
            font-family: 'Poppins', sans-serif;
        }
        .share-opt-btn:hover { background: #fff; border-color: #ddd; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
        
        .share-opt-icon {
            width: 40px; height: 40px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-size: 20px; color: white; flex-shrink: 0;
        }
        .opt-whatsapp .share-opt-icon { background: #25D366; }
        .opt-instagram .share-opt-icon { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }

        /* --- TOOLTIP DE NOVIDADE --- */
        .feature-tooltip {
            position: absolute;
            top: 45px; right: 0;
            background: #2c3e50; color: white;
            padding: 8px 12px; border-radius: 8px;
            font-size: 0.75rem; font-weight: 600;
            box-shadow: 0 4px 15px rgba(0,0,0,0.2);
            z-index: 100;
            pointer-events: none;
            animation: bounceIn 0.5s;
            display: none; /* Controlado via JS */
            white-space: nowrap;
        }
        .feature-tooltip::after {
            content: ''; position: absolute; top: -6px; right: 15px;
            border-left: 6px solid transparent; border-right: 6px solid transparent;
            border-bottom: 6px solid #2c3e50;
        }
        @keyframes bounceIn {
            0% { opacity: 0; transform: translateY(-10px); }
            100% { opacity: 1; transform: translateY(0); }
        }

        /* --- MODAL DE PREVIEW DA IMAGEM --- */
        .share-modal {
            display: none;
            position: fixed;
            z-index: 5000;
            left: 0; top: 0;
            width: 100%; height: 100%;
            background-color: rgba(0,0,0,0.85);
            align-items: center;
            justify-content: center;
            flex-direction: column;
            backdrop-filter: blur(5px);
        }
        .share-modal.show { display: flex; animation: fadeIn 0.3s; }
        
        .share-preview-container {
            background: transparent;
            max-width: 85%;
            max-height: 65vh;
            margin-bottom: 20px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.5);
            border-radius: 12px;
            overflow: hidden;
        }
        .share-preview-container { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; }
        .share-preview-img {
            scroll-snap-align: center; flex: none;
            max-width: 100%;
            max-height: 65vh;
            display: block;
            border-radius: 12px;
        }
        .share-actions {
            display: flex;
            gap: 15px;
            flex-wrap: wrap;
            justify-content: center;
        }
        .share-action-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 24px;
            border-radius: 50px;
            font-weight: 600;
            font-family: 'Poppins', sans-serif;
            border: none;
            cursor: pointer;
            transition: transform 0.2s;
            text-decoration: none;
            color: white;
            font-size: 14px;
        }
        .share-action-btn:active { transform: scale(0.95); }
        .btn-native-share { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
        .btn-download-img { background: #333; border: 1px solid #555; }
        .btn-close-share {
            position: absolute; top: 20px; right: 20px;
            background: rgba(255,255,255,0.2); color: white;
            border: none; width: 40px; height: 40px; border-radius: 50%;
            font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center;
        }

        /* --- STORY DO ROTEIRO "Ingresso" (1080x1920, uma imagem por dia) --- */
#story-export-container { --rosa:#E91E63; --rosa2:#C2185B; --tinta:#2a1420; --suave:#7a5a68;
  width:1080px; height:1920px; position:fixed; left:-9999px; top:0; z-index:-1; box-sizing:border-box; overflow:hidden; font-family:'Poppins',sans-serif; color:var(--tinta); background:var(--rosa); }
#story-export-container .confete { position:absolute; inset:0; background-image:radial-gradient(rgba(255,255,255,.16) 9px, transparent 10px), radial-gradient(rgba(194,24,91,.55) 7px, transparent 8px);
  background-size:120px 120px, 90px 90px; background-position:0 0, 45px 60px; }
#story-export-container header { position:relative; height:300px; box-sizing:border-box; padding:60px 60px 0; display:flex; align-items:center; gap:34px; color:#fff; }
#story-export-container .badge { flex:none; width:170px; height:170px; border-radius:50%; background:#fff; display:grid; place-items:center; border:6px solid #FFD1E1; }
#story-export-container .badge img { width:126px; height:126px; }
#story-export-container h1 { font-size:92px; line-height:.95; margin:0; letter-spacing:-3px; font-weight:700; }
#story-export-container h1 em { font-style:normal; color:#FFE3EE; }
#story-export-container header p { margin:10px 0 0; font-size:32px; font-weight:600; opacity:.95; }
#story-export-container .ticket { position:relative; margin:0 50px; background:#fff; border-radius:40px; padding:0 20px 20px; } /* sem box-shadow: o html2canvas desenha a sombra como moldura cinza */
#story-export-container .tkhead { height:90px; display:flex; align-items:center; justify-content:space-between; font-size:32px; font-weight:700; color:var(--rosa2); letter-spacing:2px; padding:0 14px; }
#story-export-container .map { position:relative; overflow:hidden; border-radius:24px; }
#story-export-container .map img { filter:saturate(.8); }
#story-export-container .pin { position:absolute; border-radius:50%; background:var(--rosa); color:#fff; font-weight:700; display:grid; place-items:center; border:5px solid #fff; box-shadow:0 4px 12px rgba(0,0,0,.35); box-sizing:border-box; }
#story-export-container .osm { position:absolute; right:10px; bottom:8px; font-size:16px; color:#555; background:rgba(255,255,255,.85); padding:2px 8px; border-radius:6px; }
#story-export-container .cut { border-top:5px dashed #f3c1d3; margin:34px -20px 30px; position:relative; }
#story-export-container .cut::before, #story-export-container .cut::after { content:''; position:absolute; top:-30px; width:56px; height:56px; border-radius:50%; background:var(--rosa2); }
#story-export-container .cut::before { left:-28px; } #story-export-container .cut::after { right:-28px; }
#story-export-container .tl { list-style:none; margin:0; padding:0 14px; }
#story-export-container .tl li { height:var(--row); display:grid; grid-template-columns:64px 120px 1fr; gap:22px; align-items:center; position:relative; }
#story-export-container .tl li + li::before { content:''; position:absolute; left:30px; top:calc(var(--row) * -0.5 + 32px); height:calc(var(--row) - 64px); border-left:4px dotted var(--rosa); }
#story-export-container .tl .n { width:64px; height:64px; border-radius:50%; background:var(--rosa); color:#fff; font-weight:700; font-size:32px; display:grid; place-items:center; }
#story-export-container .tl .h { font-size:40px; font-weight:700; color:var(--rosa2); font-variant-numeric:tabular-nums; }
#story-export-container .tl .t { min-width:0; }
#story-export-container .tl b { display:block; font-size:38px; line-height:1.15; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#story-export-container .tl small { display:block; font-size:28px; color:var(--suave); }
/* muitos blocos: bairro na mesma linha do nome */
#story-export-container .tl.dense li { grid-template-columns:52px 110px 1fr; }
#story-export-container .tl.dense li + li::before { left:24px; top:calc(var(--row) * -0.5 + 26px); height:calc(var(--row) - 52px); }
#story-export-container .tl.dense .n { width:52px; height:52px; font-size:26px; }
#story-export-container .tl.dense .h { font-size:36px; }
#story-export-container .tl.dense .t { display:flex; align-items:baseline; gap:14px; }
#story-export-container .tl.dense b { font-size:34px; flex:0 1 auto; min-width:0; }
#story-export-container .tl.dense small { font-size:26px; flex:none; }
#story-export-container .foot { position:absolute; left:0; right:0; bottom:0; height:150px; color:#fff; display:flex; align-items:center; justify-content:center; gap:.3em; font-size:40px; }
#story-export-container .foot b { font-weight:700; }

        @keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ===== Legibilidade e toque (piso: 12px de texto, 40px+ de toque) ===== */
.badge-info span,
.address-text-truncate,
.distance-badge,
.price-info,
.btn-ingresso,
.status-tag,
.total-count,
.map-search-btn span,
.map-initial-locate-btn span { font-size: 0.8rem !important; }
.categoria-tag,
.tamanho-tag,
.categoria-tag.tag-ensaio { font-size: 0.75rem !important; }
.badge-info span { font-weight: 700; }
.evento-card h2 { font-size: 1.1rem !important; line-height: 1.25; }
.toolbar-btn { font-size: 0.8rem !important; }

.support-btn, .contact-btn { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
.btn-ingresso { min-height: 40px; display: inline-flex !important; align-items: center; }
.leaflet-touch .leaflet-bar a { width: 40px !important; height: 40px !important; line-height: 40px !important; }

/* ===== Componentes de usabilidade (2027) ===== */
:root {
    --st-andamento: #27ae60; --st-breve: #2196F3; --st-hoje: #C2185B; --st-futuro: #F48FB1;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--primary-accent); outline-offset: 2px; }

/* Busca em destaque no topo dos filtros */
.filtro-busca-topo input {
    width: 100%; box-sizing: border-box; height: 46px; padding: 0 14px; font-size: 16px; /* 16px evita zoom no iOS */
    border: 2px solid var(--border-color); border-radius: 12px; background: var(--background-color); color: var(--text-primary);
    margin-bottom: 10px;
}
.filtro-busca-topo input:focus { border-color: var(--primary-accent); outline: none; }

/* Contador de filtros ativos na barra de busca */
.filter-count {
    background: var(--primary-accent); color: #fff; border-radius: 999px; min-width: 20px; height: 20px;
    font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px;
}
.filter-count[hidden] { display: none; }

/* Ação principal + legenda */
.quick-bar { display: flex; flex-direction: column; gap: 8px; padding: 10px 0 4px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; font-size: 0.8rem; color: var(--text-secondary); }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.15); }

/* Ordenação com rótulos */
.sort-bar { gap: 4px !important; }
.sort-circle {
    width: auto !important; height: 36px !important; min-width: 44px; border-radius: 999px !important;
    padding: 0 10px !important; gap: 4px; font: 600 0.8rem 'Poppins', sans-serif; white-space: nowrap;
}
@media (max-width: 340px) { .sort-circle span { display: none; } }

/* Coração no card fechado: agora é botão */
.mini-like-counter {
    pointer-events: auto !important; border: 1px solid var(--border-color); cursor: pointer;
    min-height: 36px; min-width: 52px; padding: 4px 10px !important; font-size: 0.85rem !important; justify-content: center;
}
.mini-heart { fill: none !important; stroke: var(--primary-accent); stroke-width: 2.2; }
.evento-card.is-favorite .mini-heart { fill: var(--primary-accent) !important; }
.evento-card.is-favorite .mini-like-counter { border-color: var(--primary-accent); }

/* Conflito de horário nos favoritos */
.fav-conflicts {
    background: #FFF4E5; color: #8a4b00; border: 1px solid #FFCC80; border-radius: 10px;
    padding: 10px 12px; font-size: 0.85rem; margin: 6px 0 10px;
}
body.dark-mode .fav-conflicts { background: #3a2a12; color: #ffcc80; border-color: #8a5a1a; }

/* Tooltip de compartilhar não cobre mais o 1º card */
.feature-tooltip { top: auto !important; bottom: 46px; }
.feature-tooltip::after { top: auto !important; bottom: -6px; border-bottom: none !important; border-top: 6px solid #2c3e50; }

/* Offline e toast */
.offline-banner {
    position: sticky; top: 0; z-index: 2000; background: #2c3e50; color: #fff; text-align: center;
    font-size: 0.85rem; font-weight: 600; padding: 6px 10px;
}
.offline-banner[hidden] { display: none; }
.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
    background: #2c3e50; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 0.9rem; max-width: min(92vw, 420px);
    z-index: 3000; transition: all .25s ease; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Desktop: mapa maior */
@media (min-width: 1100px) {
    .main-content-grid { grid-template-columns: minmax(420px, 46%) 1fr !important; }
    .quick-bar { flex-direction: row; align-items: center; }
    }
.evento-card:not(.expanded) .address-row { padding-right: 66px; }
.mini-like-counter { bottom: 8px !important; min-height: 32px; }
.evento-card:not(.expanded) .date-time-container { padding-right: 0; }
@media (max-width: 768px) {
    .evento-card:not(.expanded) .date-time-container .categoria-tag { display: none; }
    .results-header .total-count { white-space: nowrap; }
}
@media (max-width: 768px) {
    .results-header { flex-wrap: wrap; row-gap: 6px; height: auto !important; padding: 6px 10px !important; }
    .results-header .total-count { order: -1; flex: 1; margin: 0; text-align: left; background: none; border: none; font-size: 0.85rem !important; font-weight: 600; }
    .results-header .fav-cluster { order: 0; }
    .results-header .sort-bar { order: 1; width: 100%; justify-content: space-between; }
    .results-header .sort-circle { flex: 1; }
}
@media (min-width: 769px) {
    #filter-form .btn-filtrar { display: none; }
    #filter-form .btn-limpar { flex: 0 0 auto; padding: 6px 16px; }
}

/* ===== Rodada de design: card, seções, offline, parceiro ===== */
.card-quando { display: inline-block; margin-top: 2px; font-size: 0.8rem; font-weight: 700; color: var(--st-breve); }
.card-quando.quando-em-andamento, .card-quando.quando-encerrando { color: var(--st-andamento); }
.evento-card .badge-time { font-weight: 700; font-size: 0.85rem; }
.evento-card .distance-badge { margin-left: auto; font-weight: 700; }
.secao-header { grid-column: 1 / -1; width: 100%; margin: 14px 2px 2px; font-size: 0.8rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary, #666); }
.secao-header:first-child { margin-top: 2px; }
.baixar-offline-btn { min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--primary-color, #E91E63);
  background: transparent; color: var(--primary-color, #E91E63); font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.dados-rodape { margin: 18px 12px 28px; text-align: center; font-size: 0.75rem; color: var(--text-secondary, #666); }
.parceiro-perto { flex-direction: column; gap: 4px; padding: 12px 14px; border: 2px dashed #EA5546; }
.parceiro-perto .parceiro-tag { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; color: #EA5546; }
.parceiro-perto small { color: var(--text-secondary, #666); }
.parceiro-acoes { display: flex; gap: 8px; margin-top: 6px; }
.parceiro-acoes > * { min-height: 36px; padding: 0 14px; border-radius: 18px; border: 0; background: #EA5546; color: #fff;
  font: inherit; font-weight: 700; display: inline-flex; align-items: center; text-decoration: none; cursor: pointer; }
.leaflet-interactive:focus-visible { outline: 3px solid #2196F3; }
.evento-card .card-header { flex-wrap: wrap; } .card-header .card-quando { order: 3; flex-basis: 100%; margin-top: 0; }
.previa-faixa{background:#341E4C;color:#fff;font-size:13px;text-align:center;padding:6px 12px}
.previa-faixa a{color:#FFD54F}

/* Prévia 2027 (gerar_previa.py) e convite a anunciantes */
.previa-aviso { margin: 8px 0 10px; padding: 10px 12px; border-radius: 10px; background: #FFF4D6; color: #5A3E00; border: 1px solid #F2C94C; font-size: 0.82rem; line-height: 1.4; }
.previa-aviso strong { display: block; margin-bottom: 2px; }
.previa-aviso[hidden] { display: none; }
body.dark-mode .previa-aviso { background: #3A2F12; color: #FBE7B0; border-color: #8A6D1E; }
.tag-previa { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: #FFF4D6; color: #7A5600; border: 1px solid #F2C94C; white-space: nowrap; }
body.dark-mode .tag-previa { background: #3A2F12; color: #FBE7B0; border-color: #8A6D1E; }
.anuncie-btn { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: #E91E63; color: #fff !important; font-weight: 700; font-size: 0.8rem; text-decoration: none; white-space: nowrap; }
.anuncie-btn:hover { filter: brightness(1.08); }
.sua-marca-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 2px dashed #E91E63; background: rgba(233, 30, 99, 0.05); text-decoration: none; color: inherit; cursor: pointer; }
.sua-marca-card strong { font-size: 1rem; }
.sua-marca-card span { font-size: 0.82rem; opacity: 0.85; }
.sua-marca-card .sua-marca-tag { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: #E91E63; opacity: 1; font-weight: 700; }
@media (max-width: 480px) {
    .anuncie-btn { padding: 4px 8px; font-size: 0.7rem; }
    .previa-aviso { font-size: 0.75rem; padding: 8px 10px; margin: 6px 8px 8px; }
}
@media (max-width: 420px) {
    .header-actions .contact-btn { display: none; }
}

/* ==========================================================================
   DESIGN 2027: padronização (mesma identidade de 2026: rosa, Poppins, mapa + lista)
   Uma camada só, no fim do arquivo, para sobrepor os ajustes antigos.
   ========================================================================== */
:root {
    --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-pill: 999px;
    --surface-2: #f1f3f6;
    --ring: rgba(233, 30, 99, 0.12);
    --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
    --shadow-2: 0 6px 18px rgba(16, 24, 40, 0.12);
    --h-btn: 44px; --h-chip: 34px; --h-pill: 24px;
}
body.dark-mode { --surface-2: #374151; --ring: rgba(255, 64, 129, 0.2); }

button, input, select, textarea { font-family: inherit; }
.ic { flex-shrink: 0; vertical-align: middle; }

/* --- Botões: primário (rosa), secundário (contorno), ícone (quadrado) --- */
.btn-filtrar, .directions-btn, .map-initial-locate-btn, .map-search-btn, .anuncie-btn {
    background: var(--primary-accent); color: #fff; border: 0; font-weight: 600; letter-spacing: 0; text-transform: none;
}
.btn-filtrar, .btn-limpar, .directions-btn {
    min-height: var(--h-btn); height: auto; border-radius: var(--r); font-size: 0.95rem; padding: 0 18px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: none; cursor: pointer;
}
.btn-filtrar:hover, .directions-btn:hover { background: #d81b60; }
.btn-limpar { background: transparent !important; color: var(--text-primary); border: 1px solid var(--border-color); font-weight: 600; }
.btn-limpar:hover { border-color: var(--text-secondary); background: var(--surface-2) !important; }
.share-btn, .fav-btn {
    min-width: var(--h-btn); height: var(--h-btn); border-radius: var(--r); background: var(--card-background);
    border: 1px solid var(--border-color); color: var(--text-primary); gap: 6px; font-weight: 600;
}
.share-btn:hover { background: #25D366; border-color: #25D366; color: #fff; }
.card-actions { gap: 8px; margin-top: 10px; }
.btn-ingresso {
    min-height: 36px; border-radius: var(--r-pill); padding: 0 14px; gap: 6px; font-weight: 600;
    background: var(--text-primary); color: var(--card-background) !important; font-size: 0.85rem !important;
}

/* --- Chips de filtro --- */
.chip-checkbox span {
    min-height: var(--h-chip); padding: 0 14px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.85rem; font-weight: 500; border: 1px solid var(--border-color); background: var(--card-background); color: var(--text-primary);
    transition: background .15s, border-color .15s, color .15s;
}
.chip-checkbox input:checked + span { background: var(--ring); border-color: var(--primary-accent); color: var(--primary-accent); font-weight: 600; }
.chip-destaque { background: var(--card-background) !important; }

/* --- Etiquetas (pílulas) do card: mesmo tamanho, mesma forma --- */
.badge-info, .tamanho-tag, .categoria-tag, .tag-previa, .categoria-tag.tag-ensaio, .distance-badge {
    height: var(--h-pill); padding: 0 9px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.75rem !important; font-weight: 600; line-height: 1; white-space: nowrap; text-transform: none; letter-spacing: 0;
    border: 1px solid transparent;
}
.badge-info { background: var(--surface-2); color: var(--text-primary); }
.badge-info svg { width: 13px; height: 13px; color: var(--primary-accent); stroke-width: 2.2; }
.badge-info span { font-size: 0.8rem !important; font-weight: 700; }
.evento-card .badge-time { font-size: 0.8rem; }
.tamanho-tag { background: var(--ring); color: var(--primary-accent); }
.categoria-tag { background: var(--surface-2); color: var(--text-secondary); }
.categoria-tag.tag-ensaio { background: #EDE7F6; color: #5E35B1; }
body.dark-mode .categoria-tag.tag-ensaio { background: #3b2a5c; color: #D1C4E9; }
.tag-previa { background: #FFF4D6; color: #7A5600; border-color: #F2C94C; }
.distance-badge { background: transparent; color: var(--text-secondary); padding: 0 4px; }

/* --- Card --- */
.eventos-grid { gap: 10px; }
.evento-card {
    border-radius: var(--r-lg); padding: 12px 14px; box-shadow: var(--shadow-1); border: 1px solid var(--border-color);
    background: var(--card-background); transition: border-color .15s, box-shadow .15s;
}
.evento-card:hover { transform: none; box-shadow: var(--shadow-2); }
.evento-card.expanded { box-shadow: 0 0 0 2px var(--ring), var(--shadow-2); background: var(--card-background); }
/* status: faixa de cor à esquerda + etiqueta; o fundo do card fica limpo */
.status-bg-em-andamento, .status-bg-em-breve, .status-bg-encerrando, .status-bg-hoje { background: var(--card-background); border-left-width: 4px; }
.status-bg-em-andamento { border-left-color: var(--status-live); }
.status-bg-em-breve { border-left-color: var(--status-soon); }
.status-bg-encerrando { border-left-color: var(--status-ending); }
.status-bg-hoje { border-left-color: var(--status-today); }
.status-tag {
    position: static; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
    height: 22px; padding: 0 9px !important; margin-bottom: 6px; border-radius: var(--r-pill);
    font-size: 0.7rem !important; letter-spacing: .04em;
}
.status-em-andamento::before { position: static; transform: none; flex-shrink: 0; }
.evento-card[class*="status-bg-"] .card-header { padding-top: 0; }
/* título na linha de cima; etiquetas embaixo, sem cortar na borda */
.card-header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.card-header h2 { flex: 1 1 100%; padding-right: 0; font-size: 1.05rem !important; font-weight: 700; line-height: 1.25; }
.card-header .card-quando { order: 0; flex-basis: auto; font-size: 0.8rem; }
.header-tags { flex-shrink: 1; flex-wrap: wrap; gap: 6px; }
.date-time-container { gap: 6px; margin-bottom: 8px; }
.meta-row.address-row { gap: 6px; color: var(--text-secondary); }
.meta-row.address-row svg { flex-shrink: 0; }
.evento-card:not(.expanded) .address-row { padding-right: 64px; }
.mini-like-counter {
    bottom: 12px !important; right: 12px; min-height: 34px; min-width: 52px; border-radius: var(--r-pill);
    background: var(--card-background); box-shadow: none; gap: 5px;
}

/* --- Busca, ordenação, barra de resultados --- */
.filtro-busca-topo input {
    height: 48px; border-radius: var(--r); border: 1px solid var(--border-color); background-color: var(--card-background);
    padding-left: 42px; background-repeat: no-repeat; background-position: 14px center; background-size: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E91E63' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
}
.filtro-busca-topo input:focus { border-color: var(--primary-accent); box-shadow: 0 0 0 3px var(--ring); }
.search-trigger-bar { border-radius: var(--r); min-height: 44px; box-shadow: var(--shadow-1); }
.sort-circle { height: 36px !important; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.sort-circle .ic { width: 15px; height: 15px; }
.sort-circle.active { color: var(--primary-accent); background: var(--card-background); box-shadow: var(--shadow-1); }
.baixar-offline-btn { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-pill); }
.secao-header { font-size: 0.75rem; letter-spacing: .08em; margin: 16px 2px 4px; }

/* --- Ação principal --- */

/* --- Avisos --- */
.previa-aviso { border-radius: var(--r); padding: 12px 14px; }
.previa-aviso strong { display: flex; align-items: center; gap: 6px; }
.offline-banner { display: flex; align-items: center; justify-content: center; gap: 8px; }
.offline-banner[hidden] { display: none; }
.fav-conflicts { border-radius: var(--r); }
.fav-conflicts .ic { margin-right: 4px; vertical-align: -3px; }
.sua-marca-card { border-radius: var(--r-lg); }
.popup-title { display: inline-flex; align-items: center; gap: 5px; font-size: 0.9rem; }

/* --- Controles do mapa --- */
.leaflet-bar { border: 0 !important; box-shadow: var(--shadow-2) !important; border-radius: var(--r) !important; overflow: hidden; }
.leaflet-bar a { color: var(--text-primary) !important; }
.map-initial-locate-btn {
    bottom: 26px; right: 12px; height: 44px; padding: 0 14px; border-radius: var(--r-pill); box-shadow: var(--shadow-2);
}
.map-initial-locate-btn span { white-space: nowrap; font-size: 0.85rem !important; }
.map-initial-locate-btn span br { display: none; }
.map-locate-btn { bottom: 26px; right: 12px; width: 44px; height: 44px; border-radius: var(--r); box-shadow: var(--shadow-2); }
.map-search-btn { height: 40px; padding: 0 16px; border-radius: var(--r-pill); font-size: 0.85rem; }

/* --- Filtros (folha no celular) --- */
.filter-footer { display: flex; gap: 10px; padding: 12px 16px; background: var(--card-background); }
.filter-footer .btn-filtrar { flex: 2; }
.filter-footer .btn-limpar { flex: 1; }

/* --- Cabeçalho --- */
.anuncie-btn { height: 34px; padding: 0 14px; border-radius: var(--r-pill); font-size: 0.82rem; }
@media (max-width: 480px) {
    .anuncie-btn { height: 30px; padding: 0 10px; font-size: 0.75rem; }
    .card-header h2 { font-size: 1rem !important; }
    .evento-card { padding: 12px; }
}

.baixar-offline-btn[hidden] { display: none; }
.header-tags { margin-left: 0 !important; justify-content: flex-start; }
.header-tags:empty, .icons-row:empty { display: none; }
.card-header { justify-content: flex-start !important; }
.chip-checkbox span { min-height: 34px !important; height: auto !important; padding: 0 14px !important; font-size: 0.85rem !important; }
.btn-limpar, .btn-filtrar { text-transform: none !important; letter-spacing: 0 !important; }
#mobile-filter-modal .modal-content { height: auto !important; max-height: 92dvh; display: flex; flex-direction: column; }
#mobile-filters-container { height: auto !important; overflow-y: auto; }
#mobile-filters-container .filter-footer { position: sticky; bottom: 0; margin-bottom: 0; padding-bottom: max(12px, env(safe-area-inset-bottom)); }

/* ===== Compacto: mais blocos na tela, mapa do mesmo tamanho ===== */

/* Controles do mapa: cada canto tem um dono, nada se cruza.
   topo-esq: zoom | topo-dir: tela cheia | topo-centro: "Filtrar nesta área"
   baixo-esq: SAT | baixo-dir: localização (acima dos créditos) */
.map-search-btn { top: 12px; bottom: auto; transform: translateX(-50%) translateY(-70px); height: 36px; }
.map-search-btn.visible { transform: translateX(-50%) translateY(0); }
.map-initial-locate-btn, .map-locate-btn { bottom: 24px; right: 10px; }
.map-initial-locate-btn { height: 40px; padding: 0 12px; }
.map-locate-btn { width: 40px; height: 40px; }
#satellite-toggle-container { bottom: 30px !important; left: 10px !important; } /* centro alinhado ao botão de localização */

/* Faixa entre o mapa e a lista */
.quick-bar { gap: 6px; padding: 8px 0 4px; }
.map-legend { font-size: 0.72rem; gap: 10px; }
.map-legend i { width: 9px; height: 9px; }

/* Aviso de prévia: uma linha; toca para ler o resto */
.previa-aviso { margin: 4px 0 6px; padding: 0; font-size: 0.78rem; }
.previa-aviso summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
    min-height: 34px; padding: 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.previa-aviso summary::-webkit-details-marker { display: none; }
.previa-aviso summary::after { content: ''; margin-left: auto; flex-shrink: 0; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .6; }
.previa-aviso[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.previa-aviso p { margin: 0; padding: 0 12px 10px; line-height: 1.4; }
.previa-aviso summary b { font-weight: 700; }

/* Cabeçalho da lista */
@media (max-width: 768px) {
    .results-header { padding: 4px 8px !important; row-gap: 4px; }
    .results-header .total-count { font-size: 0.78rem !important; }
    .fav-toggle-wrapper label { min-height: 30px; padding: 0 10px; font-size: 0.78rem; }
}
.sort-circle { height: 32px !important; font-size: 0.8rem; }
.secao-header { margin: 10px 2px 2px; font-size: 0.7rem; }

/* Card compacto: status no canto, título, uma linha de etiquetas, endereço */
.eventos-grid { gap: 8px; }
.evento-card { padding: 10px 12px; }
.status-tag {
    position: absolute; top: 10px; right: 10px; left: auto; margin: 0;
    height: 20px; padding: 0 8px !important; font-size: 0.62rem !important; border-radius: var(--r-pill);
}
.evento-card .status-tag ~ .evento-info-compact .card-header h2 { padding-right: 104px; }
.card-header { margin-bottom: 6px; gap: 4px 6px; }
.card-header h2 { flex: 1 1 auto; min-width: 0; font-size: 1rem !important; line-height: 1.2; }
.card-header .card-quando { flex-basis: 100%; font-size: 0.75rem; }
.icons-row { gap: 3px; }
.date-time-container { gap: 5px; margin-bottom: 6px; flex-wrap: wrap; }
.badge-info, .tamanho-tag, .categoria-tag, .tag-previa, .categoria-tag.tag-ensaio {
    height: 22px; padding: 0 7px; gap: 4px; font-size: 0.72rem !important;
}
.badge-info span { font-size: 0.76rem !important; }
.badge-info svg { width: 12px; height: 12px; }
.meta-row.address-row { min-height: 20px; }
.meta-row.address-row span { font-size: 0.78rem !important; }
.mini-like-counter { bottom: 8px !important; right: 10px; min-height: 30px; min-width: 46px; padding: 2px 8px !important; font-size: 0.8rem !important; }
.evento-card:not(.expanded) .address-row { padding-right: 56px; }
.card-actions { margin-top: 8px; }
.directions-btn, .share-btn, .fav-btn { min-height: 40px; height: 40px; }
.share-btn, .fav-btn { min-width: 40px; }
@media (max-width: 480px) {
    .evento-card { padding: 10px 12px; }
    .card-header h2 { font-size: 0.98rem !important; }
}
.badge-info, .tamanho-tag, .categoria-tag, .tag-previa { letter-spacing: 0 !important; padding: 0 6px !important; }
.badge-info span { letter-spacing: 0 !important; }
.date-time-container { gap: 4px !important; }
.map-search-btn { top: auto !important; bottom: 74px !important; } /* acima da linha SAT/localização */
.tamanho-tag { width: auto !important; min-width: 0 !important; }
/* Filtros: chips mais baixos e grupos fluindo juntos (menos linhas) */
.chip-checkbox span { min-height: 30px !important; padding: 0 12px !important; }
.chip-checkbox { margin: 0 !important; }
.filter-group { margin-bottom: 0 !important; }
.filter-group:has(> .chip-checkbox) { display: contents; }
.filter-group:has(> .chip-checkbox) + .filter-group:not(:has(> .chip-checkbox)) { margin-top: 6px !important; }
.quick-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
#mobile-filters-container .quick-filters { flex-direction: row !important; flex-wrap: wrap !important; align-items: center !important; gap: 6px !important; }
@media (min-width: 769px) {
    .filtros-container { position: relative; }
    #filter-form .filter-footer { position: absolute; right: 14px; bottom: 14px; padding: 0; margin: 0; border: 0; background: none; width: auto; }
    #filter-form .btn-limpar { min-height: 36px; height: 36px; }
}
/* Porte do bloco: mesma largura, intensidade crescente (contorno, rosa claro, rosa sólido) */
.tamanho-tag.tamanho-1 { background: transparent; color: var(--primary-accent); border-color: rgba(233, 30, 99, 0.45); }
.tamanho-tag.tamanho-2 { background: rgba(233, 30, 99, 0.16); color: #c2185b; border-color: transparent; }
.tamanho-tag.tamanho-3 { background: var(--primary-accent); color: #fff; border-color: transparent; font-weight: 700; }
body.dark-mode .tamanho-tag.tamanho-2 { color: #ff80ab; background: rgba(255, 64, 129, 0.22); }
.porte-barras { flex-shrink: 0; }
/* Data prevista: a etiqueta de data fica amarela (no lugar de uma etiqueta "Prevista" separada) */
.badge-info.badge-prevista { background: #FFF4D6; color: #7A5600; border-color: #F2C94C; }
.badge-info.badge-prevista svg { color: #B7791F; }
body.dark-mode .badge-info.badge-prevista { background: #3A2F12; color: #FBE7B0; border-color: #8A6D1E; }
body.dark-mode .badge-info.badge-prevista svg { color: #F2C94C; }

/* "Sua marca aqui": vitrine com o mesmo destaque que o patrocinador vai ter */
.sua-marca-card {
    gap: 4px; padding: 14px 16px; border: 0 !important; border-radius: var(--r-lg);
    background: linear-gradient(135deg, #E91E63 0%, #9C27B0 100%) !important; color: #fff !important;
    box-shadow: 0 6px 18px rgba(233, 30, 99, 0.3);
}
.sua-marca-card strong { font-size: 1.05rem; color: #fff; }
.sua-marca-card .sua-marca-tag { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
    background: rgba(255, 255, 255, 0.2); color: #fff !important; padding: 3px 9px; border-radius: var(--r-pill); font-size: 0.66rem; }
.sua-marca-card .sua-marca-texto { font-size: 0.82rem; opacity: 0.92; }
.sua-marca-card .sua-marca-cta { align-self: flex-start; margin-top: 6px; background: #fff; color: #C2185B; font-weight: 700;
    font-size: 0.8rem; padding: 6px 12px; border-radius: var(--r-pill); opacity: 1; }
.sua-marca-card:hover { box-shadow: 0 8px 22px rgba(233, 30, 99, 0.4); }
@media (max-width: 420px) {
    .header-logo { flex-shrink: 0 !important; }
    .header-actions { gap: 4px !important; margin-left: 4px !important; }
    .anuncie-btn { padding: 0 9px; }
}
/* Cabeçalho acima do mapa (o z-index antigo não valia sem position) */
.top-header { position: relative; z-index: 2000; }
/* Logo mais justo: mesma fonte e cores, letras mais próximas */
.site-title .title-text { letter-spacing: -0.04em; font-weight: 800; }
.site-title { gap: 4px; }
.site-subtitle { letter-spacing: 0; }
/* Lista de cidades: abre alinhada ao seletor, com rolagem se não couber */
.dropdown-options { min-width: 190px; max-height: min(70vh, 420px); overflow-y: auto; padding: 6px; border-radius: var(--r); box-shadow: var(--shadow-2); }
.option-item { min-height: 40px; padding: 0 12px; justify-content: space-between; }
.option-item.selected::after { content: ''; width: 6px; height: 11px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 10px; }
.dropdown-trigger { height: 32px; padding: 0 10px; gap: 4px; }
/* a etiqueta de ensaio usa a classe de estilo, mas nunca some */
.evento-card .date-time-container .categoria-tag.tag-ensaio { display: inline-flex !important; }
.evento-card:not(.expanded) .card-desc { padding-right: 60px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.price-info { white-space: nowrap; font-weight: 600; }
/* Filtros enxutos: 2 linhas com rótulo sempre à vista; o resto em "Mais filtros" */
.quick-filters { display: flex; flex-direction: column !important; gap: 8px !important; align-items: stretch !important; }
#mobile-filters-container .quick-filters { flex-direction: column !important; align-items: stretch !important; }
.filtro-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.filtro-rotulo { flex-basis: 100%; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); }
.mais-filtros { margin-top: 10px; border-top: 1px solid var(--border-color); }
.mais-filtros summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
    min-height: 44px; font-weight: 600; font-size: 0.9rem; color: var(--text-primary);
}
.mais-filtros summary::-webkit-details-marker { display: none; }
.mais-filtros summary small { font-weight: 400; font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mais-filtros summary::after { content: ''; margin-left: auto; flex-shrink: 0; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .6; }
.mais-filtros[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.mais-filtros > .quick-filters { margin-bottom: 10px; }
.filtro-rotulo { text-align: left; }
@media (min-width: 769px) { #filter-form .filter-footer { bottom: 18px; right: 14px; } .mais-filtros summary { padding-right: 96px; } .mais-filtros summary::after { position: absolute; right: 110px; } .mais-filtros { position: relative; } }

/* Filtros: chip que daria 0 blocos fica apagado; lista vazia oferece tirar filtros */
.chip-checkbox.chip-vazio span { opacity: .38; cursor: not-allowed; }
.lista-vazia { grid-column: 1/-1; text-align: center; padding: 2em 1em; color: var(--text-secondary); }
.lista-vazia p { margin: 0 0 .4em; }
.lista-vazia-dica { font-size: .85rem; }
.lista-vazia-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: .6em; }
.lista-vazia-chip { font: inherit; font-size: .85rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--primary-accent); background: transparent; color: var(--primary-accent); cursor: pointer; }

/* Desktop: "Limpar" numa linha própria, alinhado à direita, sem cobrir "Mais filtros" */
@media (min-width: 769px) {
  #filter-form .filter-footer { position: static; display: flex; justify-content: flex-end; margin-top: 8px; }
  .mais-filtros summary { padding-right: 0; }
  .mais-filtros summary::after { right: 0; }
}
/* Espaço abaixo do mapa: card "Sua marca aqui" na largura da coluna */
#sidebar-content-slot .sua-marca-card { display: block; margin-top: 0; }

/* Filtros do PC recolhíveis: compacto = só a busca + botão "Filtros (n)" */
.filtro-busca-topo { display: flex; gap: 8px; align-items: center; }
.filtro-busca-topo input { flex: 1; min-width: 0; }
.filtros-toggle { display: none; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-color); background: var(--card-background); color: var(--text-primary); font: 600 0.85rem 'Poppins', sans-serif; cursor: pointer; white-space: nowrap; }
.filtros-toggle:hover, .filtros-toggle:focus-visible { border-color: var(--primary-accent); color: var(--primary-accent); }
#filter-form > :not(.filtro-busca-topo):not(input[type=hidden]) { transition: opacity .2s; }
.filters-wrapper.compacto { padding-block: 0.5em; }
.filters-wrapper.compacto #filter-form > :not(.filtro-busca-topo) { display: none; }
.filters-wrapper.compacto .filtros-toggle { display: inline-flex; }

/* Cabeçalho de resultados no PC: uma linha, mesma altura (44px) e mesmo formato de pílula nos três grupos */
@media (min-width: 769px) {
    .results-header { margin: 0 0 6px; width: 100%; box-sizing: border-box; border: 1px solid var(--border-color); border-radius: 12px; padding: 0 6px 0 12px; gap: 8px; }
    .results-header .total-count { width: auto; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; font-size: 0.82rem !important; font-weight: 600; color: var(--text-primary); }
    .results-header .sort-bar { background: var(--background-color); border: 1px solid var(--border-color); padding: 2px; border-radius: 999px; gap: 2px !important; }
    .results-header .sort-circle { height: 30px !important; font-size: 0.8rem; transform: none; }
    .results-header .fav-toggle-wrapper label { height: 34px; padding: 0 12px; border-radius: 999px; font-size: 0.8rem; gap: 6px; background: var(--card-background); }
    .results-header .fav-toggle-wrapper label svg { width: 14px; height: 14px; }
    .results-header .share-favs-btn { height: 34px; }
    .results-header .share-favs-btn svg { width: 16px; height: 16px; }
}
/* checkbox de Favoritos continua acessível pelo teclado (antes era display:none) */
.fav-toggle-wrapper input { display: block !important; position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.fav-toggle-wrapper input:focus-visible + label { outline: 2px solid var(--primary-accent); outline-offset: 2px; }

/* Modo escuro: botões de zoom do mapa estavam brancos com símbolo claro */
body.dark-mode .leaflet-control-zoom a, body.dark-mode .leaflet-control-zoom a:hover { background: var(--card-background); color: var(--text-primary); border-color: var(--border-color); }
/* Lista leve: o navegador só desenha os cards perto da tela (são ~450) */
.evento-card { content-visibility: auto; contain-intrinsic-size: auto 130px; scroll-margin-top: 96px; }

/* Botão do roteiro: pílula com nome e contador, sempre ao lado de Favoritos */
.share-favs-btn { display: flex; width: auto !important; gap: 5px; padding: 0 10px !important; border-radius: 999px !important; background-color: var(--primary-accent); font: inherit; font-size: 0.78rem; font-weight: 600; }
.share-favs-btn .roteiro-count:not(:empty) { background: rgba(255,255,255,.28); border-radius: 999px; padding: 0 6px; font-size: 0.72rem; }
.share-favs-btn.vazio { background-color: var(--card-background); color: var(--text-secondary, #888); border: 1px solid var(--border-color); box-shadow: none; animation: none; }
.share-favs-btn:focus-visible { outline: 2px solid var(--primary-accent); outline-offset: 2px; }
.share-favs-btn { flex-shrink: 0; }
/* celular com filtro Favoritos ligado: os três botões precisam caber numa linha */
/* celular: contagem + botões numa linha só, ordenação embaixo; encolhe por etapas em telas estreitas */
@media (max-width: 768px) {
    .results-header .total-count { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .results-header .fav-cluster { gap: 6px; }
    .baixar-offline-btn { width: 34px; height: 34px; min-height: 0; padding: 0; justify-content: center; flex-shrink: 0; }
    .baixar-offline-btn .txt { display: none; }
    .share-favs-btn { height: 34px !important; font-size: 0.8rem; }
    .results-header .fav-toggle-wrapper label { height: 34px; box-sizing: border-box; }
}
@media (max-width: 400px) { .results-header .total-count .longo { display: none; } }
@media (max-width: 340px) { .results-header .fav-toggle-wrapper label span { display: none; } }

/* Minha localização: recolhe para círculo só com o ícone */
.map-initial-locate-btn { transition: padding .25s, width .25s; }
.map-initial-locate-btn span { transition: opacity .2s; }
.map-initial-locate-btn.recolhido { width: 40px; height: 40px; padding: 0 !important; justify-content: center; border-radius: 50%; gap: 0; }
.map-initial-locate-btn.recolhido span { display: none; }
@media (prefers-reduced-motion: reduce) { .map-initial-locate-btn, .map-initial-locate-btn span { transition: none; } }

/* Aviso (toast) com botão de ação; acima dos modais */
.toast { z-index: 6000; display: flex; align-items: center; gap: 12px; }
.toast.com-acao.show { pointer-events: auto; }
.toast-acao { flex: none; background: none; border: 0; padding: 4px 2px; color: #ff8fb8; font: inherit; font-weight: 700; cursor: pointer; }
.toast-acao:focus-visible { outline: 2px solid #ff8fb8; outline-offset: 2px; border-radius: 4px; }

/* Preview do story: uma imagem por vez, do tamanho exato dela, e bolinhas de página */
.share-preview-container { width: min(85vw, calc(65vh * 9 / 16)); max-width: none !important; }
.share-preview-img { width: 100%; height: auto; flex: 0 0 100% !important; }
.share-dots { display: flex; gap: 8px; justify-content: center; margin: -8px 0 16px; }
.share-dots:empty { display: none; }
.share-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.4); cursor: pointer; }
.share-dots button[aria-current] { background: #fff; width: 22px; border-radius: 99px; }

/* Celular bem estreito (≤360px, ex.: iPhone SE antigo): topo cabia só até 358px */
@media (max-width: 360px) {
    .top-header .site-title, .top-header .title-text { font-size: 12.5px; }
    .header-actions .support-btn { min-width: 28px; padding-inline: 2px; }
    .top-header .header-actions .anuncie-btn { font-size: 0.7rem; }
    /* o botão de tema mantém 50px: a bolinha do modo escuro anda 24px fixos */
    .header-actions .anuncie-btn { padding: 0 7px; }
    .top-header .header-actions { gap: 2px !important; margin-left: 2px !important; }
    .top-header .dropdown-trigger { padding-inline: 4px; }
}
.share-preview-container { scrollbar-width: none; }
.share-preview-container::-webkit-scrollbar { display: none; }

/* Amarelo de destaque em detalhes (propostas H + I) */
:root { --destaque: #FFC233; --destaque-fg: #3a2a00; }
.top-header { border-bottom: 2px solid #F5B000; } /* dourado mais forte: o amarelo some no branco */
body.dark-mode .top-header { border-bottom-color: var(--destaque); }
.anuncie-btn { background: var(--destaque); color: var(--destaque-fg) !important; }
.share-favs-btn .roteiro-count:not(:empty) { background: var(--destaque); color: var(--destaque-fg); }
.share-favs-btn.vazio .roteiro-count:not(:empty) { background: rgba(255,255,255,.28); color: inherit; }

/* Legenda de status dentro do mapa (sai do feed) */
.map-legend.no-mapa { position: absolute; z-index: 800; left: 50%; transform: translateX(-50%); top: 10px; gap: 8px; padding: 3px 9px; border-radius: 999px;
    background: color-mix(in srgb, var(--card-background) 85%, transparent); font-size: 0.66rem; color: var(--text-primary); white-space: nowrap; pointer-events: none; flex-wrap: nowrap; }
.map-legend.no-mapa i { width: 8px; height: 8px; }
/* Barra Buscar/Filtrar mais baixa */
.map-toolbar { padding: 4px 7px; }
.search-trigger-bar { min-height: 36px; height: 36px; }
@media (max-width: 360px) { .map-legend.no-mapa { gap: 5px; padding: 2px 7px; font-size: 0.6rem; } }

/* Computador (mouse): só "Baixar imagem"; celular (toque): os dois */
@media (hover: hover) and (pointer: fine) { .btn-native-share { display: none !important; } }
