/* ═══════════════════════════════════════════════════════════════
   VISUAL FILTER BAR (nmf-*)
   Replaces old .nm-filter-* styles (lines ~2331–2440 in main.css)
   ═══════════════════════════════════════════════════════════════ */

/* ── Bar container ─────────────────────────────────────────── */
.nmf-bar {
  background: rgba(212,145,42,0.08);
  border: 1.5px solid rgba(212,145,42,0.2);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 2rem;
}

.nmf-bar__row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

/* ── Button wrapper — fills available space equally ────────── */
.nmf-btn-wrap {
  flex: 1 1 0%;
  min-width: 0;
  position: relative;
}

/* ── Trigger button ────────────────────────────────────────── */
.nmf-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  height: 2.75rem;
  padding: 0 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  font-family: 'Nunito', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nmf-btn:hover {
  border-color: var(--forest-light);
  background: var(--secondary);
}

.nmf-btn.open {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-pale);
}

.nmf-btn.has-val {
  border-color: var(--amber);
  background: var(--amber-pale);
  color: var(--amber);
}

.nmf-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
}

.nmf-btn__icon svg {
  width: 100%;
  height: 100%;
}

.nmf-btn__text {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nmf-chevron {
  width: 0.625rem;
  height: 0.625rem;
  flex-shrink: 0;
  transition: transform 0.15s ease;
  opacity: 0.6;
}

.nmf-btn.open .nmf-chevron {
  transform: rotate(180deg);
}


/* ── Dropdown panel ────────────────────────────────────────── */
.nmf-dd {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06);
  z-index: 100;
}

.nmf-dd.nmf-dd--open {
  display: block;
}


/* ── Region chips ──────────────────────────────────────────── */
.nmf-dd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.nmf-dd-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border-radius: 9999px;
  border: 1.5px solid var(--border);
  background: var(--background);
  font-family: 'Nunito', sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--foreground);
  text-decoration: none;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.nmf-dd-chip:hover {
  border-color: var(--forest-light);
  background: var(--secondary);
  color: var(--forest);
}


/* ── Level & Type tiles ────────────────────────────────────── */
.nmf-dd-tiles {
  display: grid;
  gap: 0.5rem;
}

.nmf-dd-tiles--4 {
  grid-template-columns: repeat(4, 1fr);
}

.nmf-dd-tiles--3 {
  grid-template-columns: repeat(3, 1fr);
}

.nmf-dd-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 0.875rem 0.5rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1.5px solid var(--border);
  background: var(--background);
  cursor: pointer;
  transition: all 0.12s ease;
  text-align: center;
  text-decoration: none;
}

.nmf-dd-tile:hover {
  border-color: var(--forest-light);
  background: var(--secondary);
}

.nmf-dd-tile.active {
  border-color: var(--amber);
  background: var(--amber-pale);
}

.nmf-dt-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: rgba(61,107,34,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nmf-dd-tile.active .nmf-dt-icon {
  background: rgba(212,145,42,0.15);
}

.nmf-dt-icon svg {
  width: 1rem;
  height: 1rem;
}

.nmf-dd-tile.active .nmf-dt-icon svg {
  stroke: var(--amber);
}

.nmf-dt-label {
  font-family: 'Nunito', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--foreground);
}

.nmf-dd-tile.active .nmf-dt-label {
  color: var(--amber);
}


/* ── Month grid ────────────────────────────────────────────── */
.nmf-dd-months {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.375rem;
}

.nmf-dd-month {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0.625rem 0.25rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1.5px solid var(--border);
  background: var(--background);
  cursor: pointer;
  transition: all 0.12s ease;
  text-align: center;
}

.nmf-dd-month:hover {
  border-color: var(--forest-light);
  background: var(--secondary);
}

.nmf-dd-month.peak {
  border-color: var(--amber-light);
}

.nmf-dd-month.active {
  border-color: var(--amber);
  background: var(--amber-pale);
}

.nmf-dm-abbr {
  font-family: 'Nunito', sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--foreground);
}

.nmf-dd-month.active .nmf-dm-abbr {
  color: var(--amber);
}

.nmf-dm-peak {
  font-family: 'Nunito', sans-serif;
  font-size: 0.5625rem;
  font-weight: 800;
  color: var(--amber);
  letter-spacing: 0.05em;
  line-height: 1;
}


/* ── Active pills row ──────────────────────────────────────── */
.nmf-active {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-top: 0.625rem;
  padding-top: 0.625rem;
  border-top: 1px solid rgba(212,145,42,0.15);
}

.nmf-pill {
  background: var(--amber-pale);
  color: var(--amber);
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.nmf-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.75rem;
  background: var(--forest);
  color: #fff;
  border-radius: 9999px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.nmf-clear:hover {
  background: var(--forest-mid);
}


/* ── Responsive: Mobile ────────────────────────────────────── */
@media (max-width: 640px) {
  .nmf-bar {
    padding: 0.625rem 0.75rem;
  }

  .nmf-bar__row {
    flex-wrap: wrap;
  }

  .nmf-btn-wrap {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: calc(50% - 0.25rem);
  }

  .nmf-btn {
    height: 2.625rem;
    font-size: 0.8125rem;
    padding: 0 0.625rem;
    gap: 0.375rem;
  }

  .nmf-dd {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    min-width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
    z-index: 1000;
  }

  .nmf-dd-tiles--4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .nmf-dd-months {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Responsive: Tablet ────────────────────────────────────── */
@media (min-width: 641px) and (max-width: 900px) {
  .nmf-bar__row {
    flex-wrap: wrap;
  }

  .nmf-btn-wrap {
    flex: 1 1 calc(50% - 0.25rem);
  }
}
