/* ------------------------------------------------------------------ */
/* Mobile bottom-sheet drawer for thematic selector                    */
/* Replaces Bootstrap dropdown on viewports <768px (BEM)               */
/* ------------------------------------------------------------------ */
.thematic-drawer {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: block;
  pointer-events: none;
}

.thematic-drawer[hidden] {
  display: none;
}

.thematic-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: auto;
}

.thematic-drawer--open .thematic-drawer__backdrop {
  opacity: 1;
}

.thematic-drawer__sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 80dvh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 32px rgba(15, 23, 42, 0.18);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  pointer-events: auto;
}

.thematic-drawer--open .thematic-drawer__sheet {
  transform: translateY(0);
}

.thematic-drawer__grabber {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: #cbd5e1;
  margin: 8px auto 4px;
  flex-shrink: 0;
}

.thematic-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.25rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.thematic-drawer__title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.thematic-drawer__close {
  background: none;
  border: none;
  padding: 0.375rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
}

.thematic-drawer__close:hover,
.thematic-drawer__close:focus-visible {
  background: #f1f5f9;
  color: #0f172a;
  outline: none;
}

/*
 * `min-height: 0` lets the flex child shrink below its content size so the
 * inner scroll takes over instead of stretching the sheet past 80dvh.
 */
.thematic-drawer__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 0 1rem;
}

.thematic-drawer__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1.25rem;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 0.9375rem;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.12s;
  min-height: 48px;
}

.thematic-drawer__item:hover,
.thematic-drawer__item:focus-visible {
  background: #f8fafc;
  outline: none;
}

.thematic-drawer__item--active {
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
}

.thematic-drawer__item--active:hover,
.thematic-drawer__item--active:focus-visible {
  background: #bbf7d0;
}

.thematic-drawer__item--locked {
  color: #94a3b8;
  cursor: not-allowed;
}

.thematic-drawer__item--locked:hover {
  background: #fef2f2;
}

.thematic-drawer__item--clear {
  color: #b91c1c;
}

.thematic-drawer__item--clear:hover,
.thematic-drawer__item--clear:focus-visible {
  background: #fef2f2;
}

.thematic-drawer__item-icon {
  font-size: 1.25rem;
  color: #475569;
  flex-shrink: 0;
  width: 1.5rem;
  text-align: center;
}

.thematic-drawer__item--active .thematic-drawer__item-icon { color: #16a34a; }
.thematic-drawer__item--locked .thematic-drawer__item-icon { color: #cbd5e1; }
.thematic-drawer__item--clear .thematic-drawer__item-icon { color: #dc2626; }

.thematic-drawer__item-label {
  flex: 1;
  line-height: 1.3;
  word-break: break-word;
}

.thematic-drawer__plan-tag {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #7c3aed;
  background: #ede9fe;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.thematic-drawer__plan-tag--clickable { opacity: 0.85; }

.thematic-drawer__divider {
  height: 1px;
  background: #e2e8f0;
  margin: 0.5rem 1.25rem;
}

body.thematic-drawer-lock-scroll {
  overflow: hidden;
  touch-action: none;
}
