/* Casa Única 5.0.247 — canonical auto-hiding vertical fast-scroll control.
 * Native page/touch scrolling remains untouched. This component only mirrors
 * position and provides an optional direct-drag affordance. The only animated
 * behavior in this component is visibility fade-in/fade-out.
 */

:root {
  --cu-smart-scrollbar-fade: 170ms;
  --cu-smart-scrollbar-ink: rgba(70, 83, 68, .26);
  --cu-smart-scrollbar-ink-hover: rgba(70, 83, 68, .42);
  --cu-smart-scrollbar-ink-active: rgba(70, 83, 68, .62);
}

/* Temporarily applied only while this control directly manipulates a native
 * scroll position. It prevents the site's smooth anchor policy (and any local
 * scroll-behavior:smooth rule) from turning a drag into an animated catch-up. */
.cu-smart-scroll-direct {
  scroll-behavior: auto !important;
}

.cu-smart-scrollbar {
  position: fixed;
  z-index: 60000;
  display: grid;
  grid-template-rows: 13px minmax(0, 1fr) 13px;
  width: 14px;
  min-height: 42px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--cu-smart-scrollbar-fade) ease;
  contain: layout style;
  user-select: none;
  -webkit-user-select: none;
}

.cu-smart-scrollbar.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.cu-smart-scrollbar[hidden] {
  display: none !important;
}

.cu-smart-scrollbar__arrow {
  position: relative;
  display: grid;
  width: 14px;
  height: 13px;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
  opacity: .72;
}

.cu-smart-scrollbar__arrow::before {
  width: 0;
  height: 0;
  border-right: 3px solid transparent;
  border-left: 3px solid transparent;
  content: "";
}

.cu-smart-scrollbar__arrow--up::before {
  border-bottom: 4px solid var(--cu-smart-scrollbar-ink);
}

.cu-smart-scrollbar__arrow--down::before {
  border-top: 4px solid var(--cu-smart-scrollbar-ink);
}

.cu-smart-scrollbar__arrow:hover::before,
.cu-smart-scrollbar__arrow:focus-visible::before {
  border-top-color: var(--cu-smart-scrollbar-ink-hover);
  border-bottom-color: var(--cu-smart-scrollbar-ink-hover);
}

.cu-smart-scrollbar__arrow:focus-visible {
  outline: 1px solid rgba(70, 83, 68, .22);
  outline-offset: -1px;
}

.cu-smart-scrollbar__track {
  position: relative;
  width: 100%;
  min-height: 0;
  cursor: default;
  touch-action: none;
}

/* Desktop arrow and idle thumb are both optically 6px wide on one centerline.
 * Dragging increases width symmetrically without moving that centerline. */
.cu-smart-scrollbar__thumb {
  position: absolute;
  top: 0;
  left: 50%;
  width: 6px;
  min-height: 24px;
  margin-left: -3px;
  border-radius: 999px;
  background: var(--cu-smart-scrollbar-ink);
  box-shadow: none;
  cursor: grab;
  touch-action: none;
}

.cu-smart-scrollbar:hover .cu-smart-scrollbar__thumb {
  background: var(--cu-smart-scrollbar-ink-hover);
}

.cu-smart-scrollbar.is-dragging .cu-smart-scrollbar__thumb {
  width: 8px;
  margin-left: -4px;
  background: var(--cu-smart-scrollbar-ink-active);
  box-shadow: 0 1px 4px rgba(44, 55, 46, .12);
  cursor: grabbing;
}

@media (hover: none), (pointer: coarse) {
  .cu-smart-scrollbar {
    grid-template-rows: minmax(0, 1fr);
    width: 10px;
  }

  .cu-smart-scrollbar__arrow {
    display: none !important;
  }

  .cu-smart-scrollbar__track {
    grid-row: 1;
  }

  .cu-smart-scrollbar__thumb {
    width: 3px;
    min-height: 28px;
    margin-left: -1.5px;
  }

  .cu-smart-scrollbar.is-dragging .cu-smart-scrollbar__thumb {
    width: 7px;
    margin-left: -3.5px;
    background: var(--cu-smart-scrollbar-ink-active);
    box-shadow: 0 1px 5px rgba(44, 55, 46, .16);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cu-smart-scrollbar {
    transition-duration: 0ms !important;
  }
}
