/* Mapa do Padrin: mobile layout, 2026-10-16. Desktop stays intact. */
.mapa-mobile-expressa { display: none; }
.topbar a:focus-visible, .topbar button:focus-visible,
.mobile-acoes a:focus-visible, .mobile-acoes button:focus-visible,
.search-panel :focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 3px;
}
@media (max-width: 767.98px) {
  html, body { width: 100%; height: 100%; overflow: hidden; }
  body { -webkit-text-size-adjust: 100%; }
  .app-shell { height: 100vh; height: 100dvh; }
  .topbar {
    position: fixed; inset: 0 0 auto; min-height: 76px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
    border-radius: 0 0 20px 20px; gap: 8px !important;
    background: #14243f; box-shadow: 0 4px 18px #0f172a26;
  }
  .brand-wrap { flex: 1 1 auto; max-width: none; gap: 8px; min-width: 0; }
  .brand-logo-box { width: 36px; min-width: 36px; height: 42px; }
  .brand-logo-box img { max-height: 38px; }
  .brand-copy h1 { font-size: 16px !important; line-height: 1.2; white-space: normal; }
  .brand-copy p { display: block; font-size: 11px; line-height: 1.3; white-space: normal; margin-top: 3px; }
  .acesso-entrar { flex: 0 0 auto; min-width: 52px; min-height: 44px; padding: 8px; font-size: 14px; }
  .menu-toggle { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; }
  .top-menu {
    inset: calc(100% + 8px) 8px auto !important;
    padding: 12px; border-radius: 18px; background: #14243f;
    max-height: calc(100dvh - 112px - env(safe-area-inset-top, 0px));
    overflow-y: auto; overscroll-behavior: contain;
  }
  .top-menu.open { max-height: calc(100dvh - 112px - env(safe-area-inset-top, 0px)); }
  .top-menu .menu-trigger, .top-menu .top-btn.menu-link,
  .top-menu .menu-dropdown a, .top-menu .menu-dropdown button {
    min-height: 48px; font-size: 15px; line-height: 1.4; white-space: normal;
  }
  .top-menu .acesso-conta {
    position: static; display: flex; flex-direction: column;
    margin: 4px 0 0; padding: 8px; background: #fff;
    border-radius: 14px; gap: 0; box-shadow: none; min-height: 0;
  }
  .top-menu .acesso-conta a {
    display: flex; align-items: center; min-height: 48px;
    padding: 10px; font-size: 15px; color: #14243f;
  }
  .mapa-creditos-acesso { display: none; }
  .mapa-creditos-acesso:has(.mapa-saldo-creditos) {
    display: flex; inset: calc(84px + env(safe-area-inset-top, 0px)) 12px auto;
    width: auto; min-height: 44px; gap: 8px; padding: 8px 12px;
    border-radius: 12px; flex-wrap: wrap; font-size: 13px;
  }
  .mapa-creditos-acesso .mapa-busca-paga { display: none; }
  .mobile-acoes {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    inset: auto 0 0; gap: 8px; padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 1150; background: #fff; border-top: 1px solid #dce4ef;
    box-shadow: 0 -4px 20px #14243f14;
  }
  .mobile-acoes button, .mobile-acoes a {
    display: flex; align-items: center; justify-content: center;
    min-width: 0; min-height: 56px; padding: 8px 5px;
    border: 1px solid #dce4ef; border-radius: 12px; background: #f1f5f9;
    color: #14243f; font: 700 13px/1.3 system-ui, sans-serif;
    text-decoration: none; text-align: center; white-space: normal; box-shadow: none;
    touch-action: manipulation;
  }
  .mobile-acoes button { background: #245dd9; border-color: #245dd9; color: #fff; }
  .mobile-acoes .mapa-mobile-expressa { display: flex; color: #1744a6; background: #eaf0ff; border-color: #d5e1ff; }
  #legendBox.legend-box {
    position: fixed !important; inset: auto 12px calc(88px + env(safe-area-inset-bottom, 0px)) !important;
    transform: none !important; width: auto !important; max-width: none !important;
    justify-content: center !important; gap: 6px !important; z-index: 1000 !important;
    padding: 0 !important; overflow: visible !important;
  }
  #legendBox .legend-item {
    max-width: none !important; font-size: 11px !important; padding: 6px 8px !important;
    overflow: visible !important; box-shadow: 0 2px 8px #14243f1a !important;
  }
  #toastStatus.toast-status {
    inset: auto auto calc(132px + env(safe-area-inset-bottom, 0px)) 12px !important;
    max-width: calc(100vw - 82px) !important; padding: 8px 10px;
    border-radius: 10px; font-size: 11px !important; font-weight: 600;
    line-height: 1.4; z-index: 1000 !important; pointer-events: none;
  }
  .leaflet-top.leaflet-right {
    top: auto !important; bottom: calc(134px + env(safe-area-inset-bottom, 0px)) !important;
    right: 10px !important; transform: none !important;
  }
  .leaflet-control-zoom a { width: 44px !important; height: 44px !important; line-height: 44px !important; }
  .leaflet-bottom { bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important; }
  .leaflet-control-attribution { font-size: 9px; }
  #versao-mapa {
    position: fixed !important; top: auto !important; right: 8px !important;
    bottom: calc(117px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 900 !important; padding: 0 4px !important; font-size: 9px !important;
    background: #ffffffd9 !important; color: #475569 !important; pointer-events: none;
  }
  #searchModal.search-modal, #cadastroModal.cadastro-modal {
    position: fixed; inset: 0; padding: 0 !important; z-index: 15000;
    align-items: stretch; background: #0f172a66;
  }
  #searchModal .search-panel, #cadastroModal .cadastro-panel {
    width: 100% !important; height: 100%; max-height: 100dvh !important;
    padding: calc(18px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
    border-radius: 0; background: #fff; color: #14243f;
    overflow-x: hidden; overflow-y: auto !important; overscroll-behavior: contain;
  }
  .search-head { position: sticky; top: calc(-18px - env(safe-area-inset-top, 0px)); background: #fff; z-index: 3; padding: 8px 0 12px; }
  .search-head h2 { font-size: 22px; line-height: 1.25; color: #14243f; }
  .search-head .eyebrow { font-size: 11px; color: #526580; }
  .search-head .close-btn { flex-shrink: 0; width: 44px; min-height: 44px; background: #edf2f8; border: 1px solid #dce4ef; color: #14243f; border-radius: 12px; }
  .search-panel .nearby-search { background: #f1f5fb; border: 1px solid #dce4ef; padding: 14px; margin: 8px 0 18px; }
  .search-panel .nearby-search label, .search-panel .field label { color: #14243f; font-size: 15px; font-weight: 700; }
  .search-panel .nearby-search p { color: #475569; font-size: 13px; line-height: 1.5; }
  .search-panel .field input, .search-panel .field select {
    width: 100%; min-height: 50px; padding: 12px; font-size: 16px !important;
    border: 1px solid #9aabc1; border-radius: 10px; box-sizing: border-box;
  }
  .search-panel .btn-primary, .search-panel .btn-secondary { min-height: 48px; padding: 12px; font-size: 15px; line-height: 1.4; border-radius: 10px; }
  .search-panel .btn-primary { background: #245dd9; color: #fff; }
  .search-panel .nearby-search .btn-secondary, .search-panel .btn-secondary { background: #fff; border: 1px solid #9aabc1; color: #14243f; }
  .search-panel .results-meta { color: #475569; font-size: 14px; line-height: 1.5; }
  .search-panel .result-item { background: #fff; color: #14243f; border: 1px solid #dce4ef; padding: 14px; margin-bottom: 8px; border-radius: 12px; overflow-wrap: anywhere; }
  .search-panel .result-item strong { font-size: 16px; color: #14243f; }
  .search-panel .result-item span { color: #475569; line-height: 1.5; font-size: 14px; }
  .search-panel a { color: #1744a6; }
  .service-map-picker { bottom: calc(132px + env(safe-area-inset-bottom, 0px)); max-height: calc(100dvh - 240px); overflow-y: auto; }
  .leaflet-popup-content { max-width: calc(100vw - 72px); overflow-wrap: anywhere; }
}
@media (max-width: 360px) {
  .brand-logo-box { width: 28px; min-width: 28px; }
  .brand-copy h1 { font-size: 14px !important; }
  .brand-copy p { font-size: 10px; }
  .topbar { padding-left: 8px; padding-right: 8px; gap: 6px !important; }
  .mobile-acoes { gap: 5px; padding-left: 7px; padding-right: 7px; }
  .mobile-acoes a, .mobile-acoes button { font-size: 12px; }
}
