/* ==========================================================================
   CONECTADO EM SERGIPE — MAPA LIMPO & ROTEADOR INTELIGENTE (OPENSTREETMAP)
   Visual: Clean, Rápido, Contemporâneo e Minimalista
   "UMA CONEXÃO. 75 CIDADES. UM SÓ SERGIPE."
   ========================================================================== */

:root {
    --bg-primary: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.94);
    --bg-surface-elevated: #ffffff;
    --border-subtle: #e2e8f0;
    --border-highlight: #cbd5e1;
    
    --color-text-primary: #0f172a;
    --color-text-secondary: #475569;
    --color-text-muted: #64748b;
    
    --brand-blue: #0284c7;
    --brand-blue-hover: #0369a1;
    --brand-deep: #f0f9ff;
    --brand-glow: rgba(2, 132, 199, 0.15);

    --status-online: #10b981;
    --status-busy: #f59e0b;
    --route-line: #0284c7;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.15s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #f1f5f9;
    font-family: var(--font-sans);
    color: var(--color-text-primary);
    user-select: none;
}

/* ==========================================================================
   CANVAS DO MAPA MAPLIBRE
   ========================================================================== */
#webgl-container,
#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    min-width: 100%;
    min-height: 100%;
    z-index: 1;
    overflow: hidden;
}

.maplibregl-canvas {
    outline: none;
}

.maplibregl-ctrl-attrib {
    background-color: rgba(255, 255, 255, 0.85) !important;
    color: #64748b !important;
    font-size: 0.65rem !important;
    border-radius: 4px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
}

.maplibregl-ctrl-attrib a {
    color: #0284c7 !important;
}

.maplibregl-ctrl-group {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
    border-radius: 8px !important;
}

/* ==========================================================================
   INTERFACE HUD OVERLAY
   ========================================================================== */
.hud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px 20px;
}

.hud-interactive {
    pointer-events: auto;
}

/* ==========================================================================
   CABEÇALHO SUPERIOR (BRAND & CONTROLES)
   ========================================================================== */
.top-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 12px;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--color-text-primary);
}

.brand-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--color-text-primary);
}

.brand-slogan {
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--brand-blue);
    text-transform: uppercase;
}

/* ==========================================================================
   TRILHA DE NAVEGAÇÃO
   ========================================================================== */
.level-nav-container {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 5px 8px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    gap: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.nav-step-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-secondary);
    padding: 6px 14px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.nav-step-btn:hover {
    color: var(--brand-blue);
    background: #f1f5f9;
}

.nav-step-btn.active {
    background: var(--brand-deep);
    border-color: #bae6fd;
    color: var(--brand-blue);
    font-weight: 700;
}

.nav-step-btn i {
    font-size: 0.82rem;
    color: var(--brand-blue);
}

.nav-divider {
    color: #cbd5e1;
    font-size: 0.7rem;
    user-select: none;
}

/* ==========================================================================
   CONTROLES DO TOPO DIREITO
   ========================================================================== */
.top-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.intercity-route-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 8px 14px;
    color: var(--brand-blue);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.intercity-route-btn:hover, .intercity-route-btn.active {
    background: var(--brand-deep);
    border-color: #bae6fd;
    color: var(--brand-blue-hover);
}

/* PAINEL DE ROTAS E DISTÂNCIAS (CLEAN DESIGN) */
.intercity-route-panel {
    position: absolute;
    top: 74px;
    left: 20px;
    width: 360px;
    max-width: calc(100vw - 32px);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 2px 10px rgba(0, 0, 0, 0.04);
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: fadeIn 0.25s ease;
}

.intercity-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
}

.intercity-panel-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ABAS DE MODO */
.route-panel-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    gap: 4px;
}

.route-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    padding: 7px 10px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.route-tab-btn:hover {
    color: var(--color-text-primary);
}

.route-tab-btn.active {
    background: #ffffff;
    color: var(--brand-blue);
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   SELETOR DE MEIO DE TRANSPORTE (CARRO, MOTO, BICICLETA, A PÉ)
   ========================================================================== */
.transport-mode-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
}

.transport-mode-btn {
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    padding: 6px 4px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.73rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: var(--transition-fast);
}

.transport-mode-btn:hover {
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.6);
}

.transport-mode-btn.active {
    background: #0284c7;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.transport-mode-btn.active i {
    color: #ffffff;
}

.intercity-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.route-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.route-field label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.address-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.address-input-wrapper:focus-within {
    border-color: #0284c7;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.address-field-icon {
    margin-left: 10px;
    font-size: 0.85rem;
}

.address-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--color-text-primary);
    padding: 8px 10px;
    font-family: inherit;
    font-size: 0.8rem;
    outline: none;
}

.address-input::placeholder {
    color: #94a3b8;
    font-size: 0.76rem;
}

.btn-gps-inline {
    background: transparent;
    border: none;
    color: #0284c7;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    transition: var(--transition-fast);
}

.btn-gps-inline:hover {
    color: #0369a1;
}

/* LISTA DE SUGESTÕES DE ENDEREÇO */
.address-suggestions-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 70;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
}

.address-suggestions-dropdown.active {
    display: flex;
}

.suggestion-item {
    padding: 8px 12px;
    font-size: 0.75rem;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: var(--transition-fast);
}

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

.suggestion-item:hover {
    background: #f0f9ff;
    color: #0284c7;
}

.city-select {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: var(--color-text-primary);
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.82rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.city-select:focus {
    border-color: #0284c7;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.city-select option {
    background: #ffffff;
    color: var(--color-text-primary);
}

.route-field-swap {
    display: flex;
    justify-content: center;
    margin: -2px 0;
}

.swap-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: var(--color-text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--transition-fast);
}

.swap-btn:hover {
    color: #0284c7;
    background: #e0f2fe;
    border-color: #7dd3fc;
}

.intercity-results {
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.route-summary-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.72rem;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.route-summary-box .route-path-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-summary-box .route-path-item strong {
    color: var(--color-text-primary);
}

.intercity-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.intercity-metric-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
}

.intercity-metric-box .lbl {
    font-size: 0.62rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #64748b;
    display: block;
    margin-bottom: 2px;
}

.intercity-metric-box .val {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0284c7;
}

/* MARCADORES DE PONTO NO MAPA */
.route-point-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -100%);
    pointer-events: none;
    z-index: 55;
}

.route-point-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.route-point-marker.origin .route-point-badge {
    background: #10b981;
}

.route-point-marker.dest .route-point-badge {
    background: #ef4444;
}

.route-point-pin {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    margin-top: -1px;
}

.route-point-marker.origin .route-point-pin {
    border-top: 6px solid #10b981;
}

.route-point-marker.dest .route-point-pin {
    border-top: 6px solid #ef4444;
}

/* CAMPO DE BUSCA DE MUNICÍPIO */
.city-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 0 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.city-search-icon {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    margin-right: 8px;
}

.city-search-input {
    background: transparent;
    border: none;
    color: var(--color-text-primary);
    font-family: inherit;
    font-size: 0.8rem;
    padding: 8px 0;
    outline: none;
    width: 150px;
    transition: width 0.2s ease;
}

.city-search-input:focus {
    width: 180px;
}

.city-search-input::placeholder {
    color: #94a3b8;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
}

.search-dropdown.active {
    display: flex;
}

.search-item {
    padding: 8px 12px;
    font-size: 0.78rem;
    color: var(--color-text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: var(--transition-fast);
}

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

.search-item:hover {
    background: #f0f9ff;
    color: #0284c7;
}

.portal-exit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 8px 12px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition-fast);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.portal-exit-btn:hover {
    color: var(--brand-blue);
    background: #f1f5f9;
}

/* ==========================================================================
   RODAPÉ HUD
   ========================================================================== */
.footer-hint-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.interaction-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.interaction-tip i {
    color: var(--brand-blue);
}

.camera-controls-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-layer-selector {
    display: flex;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 3px;
    gap: 3px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.layer-btn {
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    padding: 6px 12px;
    border-radius: 7px;
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition-fast);
}

.layer-btn:hover {
    color: var(--color-text-primary);
}

.layer-btn.active {
    background: #0284c7;
    color: #ffffff;
    font-weight: 700;
}

.control-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.control-btn:hover {
    color: var(--brand-blue);
    background: #f1f5f9;
}

/* ==========================================================================
   MARCADORES DE CIDADE NO MAPA (CLEAN DESIGN)
   ========================================================================== */
.city-marker {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.city-marker-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #0284c7;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 2;
}

.city-marker.capital .city-marker-dot {
    width: 15px;
    height: 15px;
    background: #0369a1;
    border-color: #ffffff;
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.4);
}

.city-marker-pulse {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(2, 132, 199, 0.2);
    border: 1px solid rgba(2, 132, 199, 0.5);
    animation: marker-radar 2.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}

.city-marker-label {
    position: absolute;
    top: -22px;
    white-space: nowrap;
    font-size: 0.72rem;
    font-weight: 700;
    color: #0f172a;
    background: #ffffff;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

@keyframes marker-radar {
    0% { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* ==========================================================================
   MARCADOR DE GPS DO USUÁRIO (VOCÊ ESTÁ AQUI)
   ========================================================================== */
.user-gps-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    z-index: 50;
}

.user-gps-pulse {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.25);
    border: 1.5px solid rgba(16, 185, 129, 0.7);
    animation: user-radar 2s ease-out infinite;
    top: -12px;
    left: -12px;
}

.user-gps-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #10b981;
    border: 2.5px solid #ffffff;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.8), 0 2px 6px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

.user-gps-label {
    position: absolute;
    top: -26px;
    white-space: nowrap;
    font-size: 0.68rem;
    font-weight: 700;
    color: #065f46;
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    padding: 2px 7px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

@keyframes user-radar {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* MARCADORES DE LOJAS E PROFISSIONAIS */
.street-place-marker {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -100%);
    transition: transform 0.2s ease;
}

.street-place-marker:hover {
    transform: translate(-50%, -108%) scale(1.1);
    z-index: 60;
}

.place-pin-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1.5px solid #0284c7;
    border-radius: 16px;
    padding: 4px 9px;
    color: #0f172a;
    font-size: 0.72rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    white-space: nowrap;
}

.place-pin-badge.loja {
    border-color: #0284c7;
}

.place-pin-badge.profissional {
    border-color: #10b981;
}

.place-pin-tip {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #0284c7;
    margin-top: -1px;
}

/* MARCADOR DE VEÍCULO ANIMADO */
.vehicle-live-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0284c7;
    border: 2px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 12px;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
    z-index: 50;
    transition: transform 0.3s ease;
}

/* ==========================================================================
   TOOLTIP DE HOVER
   ========================================================================== */
.map-tooltip {
    position: fixed;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transform: translate(-50%, -120%);
    transition: opacity 0.15s ease, transform 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
}

.map-tooltip.visible {
    opacity: 1;
    transform: translate(-50%, -130%);
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tooltip-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.tooltip-badge {
    font-size: 0.62rem;
    background: #f1f5f9;
    color: var(--brand-blue);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.tooltip-metrics {
    display: flex;
    gap: 12px;
}

.tooltip-metric-item {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.6rem;
    color: #64748b;
    text-transform: uppercase;
}

.metric-value {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.tooltip-hint {
    font-size: 0.65rem;
    color: #0284c7;
    margin-top: 2px;
}

/* ==========================================================================
   PAINEL DA CIDADE
   ========================================================================== */
.city-dashboard-panel {
    position: absolute;
    top: 74px;
    left: 20px;
    width: 320px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    z-index: 55;
    display: none;
    flex-direction: column;
    gap: 12px;
    animation: fadeIn 0.25s ease;
}

.city-dashboard-panel.active {
    display: flex;
}

.city-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.city-panel-title-wrap h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--color-text-primary);
}

.city-panel-title-wrap span {
    font-size: 0.68rem;
    color: var(--brand-blue);
    font-weight: 600;
    text-transform: uppercase;
}

.city-panel-close-btn {
    background: #f1f5f9;
    border: none;
    color: var(--color-text-muted);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.city-panel-close-btn:hover {
    color: #ef4444;
    background: #fee2e2;
}

.city-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.city-stat-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 6px;
    text-align: center;
}

.city-stat-card .val {
    font-size: 0.86rem;
    font-weight: 800;
    color: #0284c7;
}

.city-stat-card .lbl {
    font-size: 0.62rem;
    color: #64748b;
    margin-top: 2px;
}

.city-actions-wrap {
    display: flex;
    gap: 8px;
}

.btn-enter-street {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-enter-street:hover {
    background: #0369a1;
}

.btn-city-route-calc {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-city-route-calc:hover {
    background: #e0f2fe;
}

/* ==========================================================================
   PAINEL DE ROTA ATIVA (RODAPÉ DIREITO)
   ========================================================================== */
.route-live-panel {
    position: absolute;
    bottom: 64px;
    right: 20px;
    width: 320px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    z-index: 55;
    display: none;
    flex-direction: column;
    gap: 10px;
    animation: fadeIn 0.25s ease;
}

.route-live-panel.active {
    display: flex;
}

.route-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.route-pulse-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.route-dot-anim {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}

.route-metrics-row {
    display: flex;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
}

.route-time-val {
    font-size: 1rem;
    font-weight: 800;
    color: #0284c7;
}

.route-dist-val {
    font-size: 1rem;
    font-weight: 800;
    color: var(--color-text-primary);
}

.route-actions-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.route-btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25d366;
    color: #ffffff;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    transition: var(--transition-fast);
}

.route-btn-action:hover {
    background: #1da851;
}

.route-gps-buttons {
    display: flex;
    gap: 6px;
}

.route-btn-gps {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 7px 10px;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.route-btn-gps.waze {
    background: #33ccff;
    color: #ffffff;
}

.route-btn-gps.waze:hover {
    background: #00bfff;
}

.route-btn-gps.gmaps {
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

.route-btn-gps.gmaps:hover {
    background: #e2e8f0;
}

/* ==========================================================================
   MODAL DE PERFIL (LOJA & PROFISSIONAL)
   ========================================================================== */
.profile-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 150;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.profile-modal-backdrop.active {
    display: flex;
}

.profile-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    width: 440px;
    max-width: 100%;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.25s ease;
}

.profile-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f1f5f9;
    border: none;
    color: #64748b;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.profile-close-btn:hover {
    color: #ef4444;
    background: #fee2e2;
}

.profile-header {
    display: flex;
    gap: 14px;
    align-items: center;
}

.profile-avatar-box {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.profile-avatar-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.profile-title-area {
    display: flex;
    flex-direction: column;
}

.profile-type-badge {
    font-size: 0.65rem;
    color: #0284c7;
    font-weight: 700;
    text-transform: uppercase;
}

.profile-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
}

.profile-rating-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 3px;
}

.profile-stars {
    color: #f59e0b;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.profile-status-pill {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.profile-status-pill.online {
    background: #dcfce7;
    color: #15803d;
}

.profile-status-pill.busy {
    background: #fef3c7;
    color: #b45309;
}

.profile-detail-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.section-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.address-box {
    font-size: 0.8rem;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-badge {
    background: #f1f5f9;
    color: #334155;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 6px;
}

.profile-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn-profile-route {
    background: #0284c7;
    color: #ffffff;
    border: none;
    padding: 9px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-profile-route:hover {
    background: #0369a1;
}

.btn-profile-streetview {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0284c7;
    padding: 9px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-profile-streetview:hover {
    background: #e0f2fe;
}

.whatsapp-action-btn {
    grid-column: 1 / -1;
    background: #25d366;
    color: #ffffff;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.whatsapp-action-btn:hover {
    background: #1da851;
}

.portal-action-btn {
    grid-column: 1 / -1;
    background: #f1f5f9;
    color: #0f172a;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.portal-action-btn:hover {
    background: #e2e8f0;
}

/* ==========================================================================
   MODAL DE STREET VIEW
   ========================================================================== */
.streetview-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 160;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.streetview-modal-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    width: 800px;
    max-width: 100%;
    height: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.streetview-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid #e2e8f0;
}

.streetview-tabs {
    display: flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
    gap: 4px;
}

.sv-tab-btn {
    background: transparent;
    border: none;
    color: #64748b;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
}

.sv-tab-btn.active {
    background: #ffffff;
    color: #0284c7;
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.streetview-modal-body {
    flex: 1;
    position: relative;
    background: #0f172a;
}

.sv-view-tab-content {
    display: none;
    width: 100%;
    height: 100%;
}

.sv-view-tab-content.active {
    display: block;
}

.sv-google-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #ffffff;
    text-align: center;
    padding: 30px;
}

.sv-google-card h4 {
    color: #0f172a;
    margin-bottom: 8px;
}

.sv-google-card p {
    color: #64748b;
    margin-bottom: 14px;
}

.sv-direct-link-btn {
    background: #0284c7;
    color: #ffffff;
    text-decoration: none;
    padding: 9px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8rem;
}

/* ==========================================================================
   LOADER
   ========================================================================== */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: opacity 0.3s ease;
}

.loader-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #0284c7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
}

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

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

/* ==========================================================================
   RESPONSIVIDADE MOBILE & TABLET (100% RESPONSIVO)
   ========================================================================== */

/* Telas Médias / Tablets (<= 900px) */
@media (max-width: 900px) {
    .brand-slogan {
        display: none;
    }

    .city-search-input {
        width: 120px;
    }
}

/* Smartphones em Geral (<= 640px) */
@media (max-width: 640px) {
    .hud-overlay {
        padding: 10px 12px;
        padding: env(safe-area-inset-top, 10px) env(safe-area-inset-right, 12px) env(safe-area-inset-bottom, 10px) env(safe-area-inset-left, 12px);
    }

    .top-nav-bar {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 6px;
    }

    .brand-section {
        padding: 6px 10px;
        border-radius: 10px;
        gap: 8px;
    }

    .brand-badge {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .brand-name {
        font-size: 0.82rem;
    }

    .level-nav-container {
        padding: 4px 6px;
        gap: 2px;
    }

    .nav-step-btn {
        padding: 5px 8px;
        font-size: 0.75rem;
    }

    .nav-step-btn span {
        display: none;
    }

    .top-controls {
        gap: 6px;
    }

    .intercity-route-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .intercity-route-btn span {
        display: none;
    }

    .city-search-box {
        padding: 0 8px;
    }

    .city-search-icon {
        font-size: 0.75rem;
        margin-right: 5px;
    }

    .city-search-input {
        width: 85px;
        font-size: 0.75rem;
        padding: 6px 0;
    }

    .city-search-input:focus {
        width: 130px;
    }

    .portal-exit-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .portal-exit-btn span {
        display: none;
    }

    /* Rodapé HUD Mobile */
    .footer-hint-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 6px;
    }

    .interaction-tip {
        display: none;
    }

    .camera-controls-wrap {
        width: 100%;
        justify-content: space-between;
    }

    .map-layer-selector {
        padding: 2px;
        gap: 2px;
        flex: 1;
        justify-content: space-around;
    }

    .layer-btn {
        padding: 5px 8px;
        font-size: 0.7rem;
        gap: 4px;
    }

    .control-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    /* Painéis e Drawers Mobile */
    .city-dashboard-panel {
        left: 10px;
        right: 10px;
        width: auto;
        max-width: calc(100vw - 20px);
        top: auto;
        bottom: 12px;
        border-radius: 16px;
        padding: 14px 16px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    }

    .city-stats-grid {
        gap: 6px;
    }

    .city-stat-card {
        padding: 6px 4px;
    }

    .city-stat-card .val {
        font-size: 0.82rem;
    }

    .city-stat-card .lbl {
        font-size: 0.58rem;
    }

    .intercity-route-panel {
        left: 10px;
        right: 10px;
        top: 58px;
        width: auto;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 72px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 16px;
        padding: 14px 16px;
    }

    .intercity-metrics-grid {
        gap: 6px;
    }

    .route-gps-buttons {
        flex-direction: column;
        gap: 6px;
    }

    .route-live-panel {
        left: 10px;
        right: 10px;
        bottom: 12px;
        width: auto;
        max-width: calc(100vw - 20px);
        border-radius: 16px;
        padding: 14px 16px;
    }

    /* Modais Mobile */
    .profile-card {
        width: 100%;
        max-width: calc(100vw - 20px);
        max-height: 88vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 16px 14px;
        border-radius: 16px;
        margin: 10px;
    }

    .profile-header {
        gap: 10px;
    }

    .profile-avatar-box {
        width: 44px;
        height: 44px;
        font-size: 1.15rem;
    }

    .profile-name {
        font-size: 1rem;
    }

    .profile-actions-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .streetview-modal-card {
        width: 100%;
        max-width: calc(100vw - 16px);
        height: 82vh;
        border-radius: 16px;
    }

    .streetview-modal-header {
        flex-wrap: wrap;
        gap: 6px;
        padding: 10px 12px;
    }

    .sv-header-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    .sv-tab-btn {
        padding: 5px 8px;
        font-size: 0.7rem;
        white-space: nowrap;
    }
}

/* Smartphones Muito Pequenos (<= 380px) */
@media (max-width: 380px) {
    .brand-name {
        font-size: 0.76rem;
    }

    .city-search-input {
        width: 65px;
    }

    .city-search-input:focus {
        width: 100px;
    }

    .layer-btn {
        padding: 4px 6px;
        font-size: 0.65rem;
    }
}
