/* ── ScrollLegend styles — mirrors the React component exactly ─────────────── */

.sl-root {
  position: fixed;
  left: 1rem;         /* left-4 */
  top: 50%;
  transform: translateY(-50%);  /* -translate-y-1/2 */
  z-index: 50;
}

.sl-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;       /* space-y-3 */
}

/* ── Each row ─────────────────────────────────────────────────────────────── */

.sl-row {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  outline: none;
}

.sl-row:focus-visible .sl-line {
  outline: 2px solid #C8A96A;
  outline-offset: 2px;
}

/* ── Horizontal line ──────────────────────────────────────────────────────── */

.sl-line {
  height: 2px;          /* h-0.5 */
  width: 1rem;          /* w-4 default */
  background: #9ca3af;  /* gray-400 */
  transition: width 200ms ease, background 200ms ease;
  flex-shrink: 0;
}

/* Hover via parent group */
.sl-row:hover .sl-line {
  background: #4b5563;  /* gray-600 */
}

/* Active state */
.sl-line--active {
  width: 1.5rem;        /* w-6 */
  background: #ef4444 !important;  /* red-500 */
}

/* ── Label ────────────────────────────────────────────────────────────────── */

.sl-label {
  margin-left: 1rem;    /* ml-4 */
  font-size: 0.875rem;  /* text-sm */
  font-weight: 500;
  white-space: nowrap;
  color: #d1d5db;       /* gray-300 */
  opacity: 0;
  transform: translateX(-0.5rem);  /* -translate-x-2 */
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease, color 200ms ease;
}

/* Show labels when legend is hovered */
.sl-list--hovered .sl-label {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* Active label colour */
.sl-label--active {
  color: #ef4444;       /* red-500 */
}

/* ── Dark backgrounds (Hayat Naturals uses light cream) ─────────────────── */
/* Legend sits on the left edge which may have any background, keep it readable */

@media (prefers-color-scheme: dark) {
  .sl-line { background: #4b5563; }
  .sl-row:hover .sl-line { background: #9ca3af; }
  .sl-label { color: #6b7280; }
}

/* ── Hide on mobile (too small to be useful) ─────────────────────────────── */
@media (max-width: 767px) {
  .sl-root { display: none; }
}
