/* Events — compact search + filters toolbar (anchored popovers) */

.ev-tools-bar {
  position: relative;
  margin-bottom: 12px;
  z-index: calc(var(--z-modal-panel, 1210) + 2);
  isolation: isolate;
}

.ev-tools-row {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ev-tools-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff 0%, #f4f7ff 100%);
  box-shadow:
    0 1px 3px rgba(30, 58, 138, 0.08),
    inset 0 0 0 1px rgba(30, 58, 138, 0.1);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--pn);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-width: 0;
}
.ev-tools-btn:hover {
  box-shadow:
    0 2px 8px rgba(30, 58, 138, 0.12),
    inset 0 0 0 1px rgba(30, 58, 138, 0.14);
}
.ev-tools-btn.is-open {
  box-shadow:
    0 4px 14px rgba(30, 58, 138, 0.16),
    inset 0 0 0 2px rgba(249, 168, 37, 0.45);
}
.ev-tools-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(30, 58, 138, 0.08);
  font-size: 15px;
  flex-shrink: 0;
  color: var(--pn);
}
.ev-tools-btn.is-open .ev-tools-btn-icon {
  background: linear-gradient(145deg, var(--pn) 0%, #2a4fad 100%);
  color: var(--py);
}
.ev-tools-btn-label {
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ev-tools-btn .filter-active-badge {
  flex-shrink: 0;
}
.ev-tools-btn.has-active {
  box-shadow:
    0 2px 10px rgba(76, 175, 80, 0.15),
    inset 0 0 0 1px rgba(76, 175, 80, 0.35);
}

.ev-tools-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1335;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.ev-tools-backdrop.open {
  display: block;
}

.ev-tools-popover {
  display: none;
  position: fixed;
  z-index: 1338;
  margin: 0;
  padding: 0;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(30, 58, 138, 0.1);
  box-shadow:
    0 4px 6px rgba(30, 58, 138, 0.06),
    0 18px 44px rgba(30, 58, 138, 0.2);
  transform-origin: top center;
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  transition:
    opacity 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.24s cubic-bezier(0.34, 1.2, 0.64, 1);
  max-height: min(72dvh, 520px);
  overflow: hidden;
}
.ev-tools-popover.open {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.ev-tools-popover-hd {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 8px;
  border-bottom: 0.5px solid var(--pb);
}
.ev-tools-popover-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #90A4AE;
}
.ev-tools-popover-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: -6px -8px -6px 0;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: rgba(30, 58, 138, 0.06);
  color: var(--pn);
  font-size: 18px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.ev-tools-popover-close:hover {
  background: rgba(30, 58, 138, 0.12);
}
.ev-tools-popover-ft {
  flex-shrink: 0;
  padding: 10px 14px 14px;
  border-top: 0.5px solid var(--pb);
  background: #fff;
}
.ev-tools-popover-ft .ev-tools-done-btn {
  width: 100%;
  min-height: 44px;
}

.ev-search-popover .ev-sw {
  margin: 12px 14px 14px;
  border-radius: 10px;
}

.ev-filters-popover {
  width: min(400px, calc(100vw - 24px));
}
.ev-filters-popover .ev-filters-panel,
.ev-filters-popover .module-filters-panel {
  display: block !important;
  border: none !important;
  border-radius: 0 !important;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ev-filters-popover .filter-panel-section:first-child {
  padding-top: 14px;
}

.ev-filters-popover:not(.open) .ev-filters-panel,
.ev-filters-popover:not(.open) .module-filters-panel {
  display: none !important;
}

@media (max-width: 767px) {
  .ev-tools-popover:not(.open),
  .ev-filter-menu-popover:not(.open) {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }
  .ev-tools-popover.open.ev-tools-popover--sheet,
  .ev-filter-menu-popover.open {
    flex-direction: column;
    overflow: hidden;
    max-height: min(88dvh, calc(100dvh - 24px)) !important;
    border-radius: 16px;
  }
  .ev-tools-bar:has(.ev-tools-popover.open) .ev-tools-row {
    position: relative;
    z-index: 1339;
  }
}

#view-events .module-filters-group {
  display: none;
}
#view-events .ev-search-wrap {
  display: none;
}
