/* RH – Shop Sort Bar (Buttons, Minimal, RTL, 12px) */
/* ------------------------------------------------------------------ */
/* Base container */
.rh-sortbar {
  font-size: 12px;
  color: #404040;
  margin: 8px 0 16px;
}

/* Wrapper */
.rh-sortbar__wrap {
  background: #80808020;
  padding: 10px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
}

/* Right side (label area) */
.rh-sortbar__right {
  display: inline-flex;
  align-items: center;
}

.rh-sortbar__label {
  font-weight: 700;
  color: #404040;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Pills row: single-line + horizontal scroll on ALL breakpoints */
.rh-sortbar__pills {
  margin-inline-start: 16px;
  display: flex;
  align-items: center;
  gap: 16px;

  /* single row */
  flex: 1 1 auto;
  flex-wrap: nowrap;               /* keep in one line */
  white-space: nowrap;             /* ensure inline pills never wrap */

  /* scrolling */
  overflow-x: auto;                /* horizontal scroll */
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;           /* Firefox hide */
  padding-inline: 4px;             /* breathing room on edges */

  /* scroll snapping for a nicer feel */
  scroll-snap-type: x proximity;

  /* for edge-fade overlays */
  position: relative;
}

/* hide scrollbar for webkit */
.rh-sortbar__pills::-webkit-scrollbar { display: none; }

/* Subtle fade edges to hint scrollability (non-blocking) */
.rh-sortbar__pills::before,
.rh-sortbar__pills::after {
  content: "";
  position: sticky;                /* sticks to the edge as you scroll */
  top: 0;
  width: 16px;
  height: 100%;
  pointer-events: none;            /* never block clicks */
  z-index: 1;
}

.rh-sortbar__pills::before {
  /* left fade (for RTL it visually sits near the right edge since container is RTL-aware) */
  inline-size: 16px;
  margin-inline-start: -4px;       /* align fade with container padding */
  background: linear-gradient(to left, transparent, #F3EEF2);
  inset-inline-start: 0;
}

.rh-sortbar__pills::after {
  /* right fade */
  inline-size: 16px;
  margin-inline-end: -4px;
  background: linear-gradient(to right, transparent, #F3EEF2);
  inset-inline-end: 0;
}

/* Each pill */
.rh-sortbar__pill {
  all: unset;
  display: inline-block;           /* works with white-space: nowrap */
  flex: 0 0 auto;                  /* prevent shrinking */
  cursor: pointer;
  color: #404040 !important;
  font-weight: 400;
  font-size: 12px !important;
  line-height: 1.2;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;

  /* snap alignment so each pill can rest cleanly */
  scroll-snap-align: start;
}

.rh-sortbar__pill:hover {
  color: #6C3D6B !important;
  text-decoration: none !important;
}

.rh-sortbar__pill.is-active {
  color: #6C3D6B !important;
  font-weight: 700;
  text-decoration: none !important;
  border: none !important;
}

/* Count */
.rh-sortbar__count {
  margin-inline-start: auto;
  white-space: nowrap;
  color: #404040;
  font-weight: 600;
  font-size: 12px;
}

/* ------------------------------------------------------------------ */
/* Mobile adjustments */
@media (max-width: 767px) {
  .rh-sortbar__right,
  .rh-sortbar__label {
    display: none !important;      /* hide the label on small screens */
  }

  .rh-sortbar__wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 8px 12px;
    overflow: hidden;
  }

  .rh-sortbar__count {
    order: 0;
    flex: 0 0 auto;
    margin: 0;
    white-space: nowrap;
  }

  .rh-sortbar__pills {
    order: 1;
    flex: 1 1 auto;

    /* already single-line & scrollable from base rules */
    /* keep compact look on mobile */
    gap: 16px;
    padding-bottom: 2px;
  }
}
