.category-rail {
  width: 100%;
  overflow: visible;
}

.category-rail-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: visible;
}

.category-rail-track {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-block: 8px;
  margin-block: -8px;
}

.category-rail-track::-webkit-scrollbar {
  display: none;
}

.category-rail-items {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  width: max-content;
  padding-inline-end: 4px;
}

/* Compact side arrows — beside the track, never covering cards */
.category-rail-arrow {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
  transition: opacity 0.22s var(--ease-out), transform 0.22s var(--ease-out), box-shadow 0.22s, border-color 0.22s;
}

.category-rail-arrow svg {
  width: 20px;
  height: 20px;
}

.category-rail-inner:hover .category-rail-arrow,
.category-rail-arrow:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.category-rail-arrow:hover {
  border-color: rgba(13, 148, 136, 0.35);
  box-shadow: var(--shadow-lg);
  background: var(--primary-light);
}

@media (max-width: 768px) {
  .category-rail.has-overflow .category-rail-arrow {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
  }

  .category-rail-arrow {
    width: 36px;
    height: 36px;
  }
}

@media (hover: none) {
  .category-rail.has-overflow .category-rail-arrow {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .category-rail-arrow {
    transition: none;
  }
}
