/* Shared bottom-sheet pattern (filters, favorites, tag picker, ...).
   Depends on the --bg-elevated/--border-subtle/--radius-xl/--radius-pill
   custom properties already defined in each page's :root. */

.sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: 19;
  background: rgba(3, 4, 5, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sheet-scrim.is-open { opacity: 1; pointer-events: auto; }

.sheet-overlay {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 20;
  /* The wrapper's layout height matches its (translated-away) child's content
     height even when the sheet is closed, since CSS transforms don't shrink
     the box for ancestor sizing purposes — without this, the empty wrapper
     silently intercepts clicks on whatever sits underneath it (e.g. bottom nav). */
  pointer-events: none;
}

.sheet {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 12px 20px max(28px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 80vh;
  overflow-y: auto;
  pointer-events: auto;
}

.sheet.is-open { transform: translateY(0); }

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--border-subtle);
  margin: 0 auto 20px;
}

.sheet-title {
  font-size: 20px;
  font-weight: 570;
  letter-spacing: -0.01em;
}

.sheet-submit-row {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

/* Checkbox list — used by the tag picker sheet */

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}

.checkbox-row:last-child { border-bottom: none; }

.checkbox-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--border-subtle);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.checkbox-row input[type="checkbox"]:checked {
  border-color: var(--accent-lime);
  background: var(--accent-lime);
}

.checkbox-row input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #0B0D08;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-row span {
  font-size: 15px;
  color: var(--text-primary);
}
