/* category-filter.css */

/* ── Panel container ─────────────────────────────────────────────────────
   Positioned at bottom-right, just above the Leaflet zoom controls.
   Leaflet zoom is at bottom:20px right:10px — we sit just above it.
   When port detail panel opens (body.pdp-open), slides left. */
.cat-filter-panel {
  position: fixed;
  bottom: 20px;
  right: 10px;
  z-index: 1100;
  background: rgba(15, 23, 36, 0.93);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 10px 12px 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  min-width: 190px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  user-select: none;
  transition: right 280ms cubic-bezier(0.22,1,0.36,1),
              opacity 0.2s ease, transform 0.2s ease;
}

/* Slide LEFT when port detail panel is open (340px wide + 10px gap) */
body.pdp-open .cat-filter-panel {
  right: 356px;
}

/* Hidden state — triggered by the ✕ button */
.cat-filter-panel.cat-filter-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
}

/* ── Header row ──────────────────────────────────────────────────────────── */
.cat-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Title ──────────────────────────────────────────────────────────────── */
.cat-filter-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

/* ── Hide button ─────────────────────────────────────────────────────────── */
.cat-filter-hide-btn {
  background: rgba(255,255,255,0.06);
  border: none;
  border-radius: 4px;
  color: rgba(255,255,255,0.4);
  width: 18px; height: 18px;
  font-size: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.cat-filter-hide-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ── Button list ────────────────────────────────────────────────────────── */
.cat-filter-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-filter-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 5px 8px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 150ms, opacity 150ms, transform 100ms;
}
.cat-filter-btn:hover { background: rgba(255, 255, 255, 0.09); }
.cat-filter-btn:active { transform: scale(0.97); }
.cat-filter-btn:not(.active) { opacity: 0.35; }

/* ── Solid dot ───────────────────────────────────────────────────────────── */
.cat-dot {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.2);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* ── Half-and-half dot for combined categories ───────────────────────────── */
.cat-dot-half {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.2);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  background: linear-gradient(90deg, var(--c1) 50%, var(--c2) 50%);
}

.cat-filter-btn:not(.active) .cat-dot,
.cat-filter-btn:not(.active) .cat-dot-half { opacity: 0.4; }

/* ── Label ──────────────────────────────────────────────────────────────── */
.cat-label {
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

/* ── Separator between single and combo types ────────────────────────────── */
.cat-filter-separator {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 3px 0;
}

/* ── All / None row ─────────────────────────────────────────────────────── */
.cat-filter-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cat-action-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 0;
  cursor: pointer;
  transition: background 150ms;
}
.cat-action-btn:hover { background: rgba(255, 255, 255, 0.13); color: #fff; }

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .cat-filter-panel { bottom: 16px; right: 8px; }
  body.pdp-open .cat-filter-panel { right: 8px; bottom: 8px; }
}
