/* CityStore Luxury Horizontal Carousel UX — Zero ugly Windows scrollbars (FR LTR + AR RTL) */

/* 1. Hide clunky native browser scrollbars on all horizontal rails */
.marketplace-products,
.flash-products,
.best-products,
.category-grid,
.brand-grid,
.featured-grid,
.rail-filters,
.best-filters,
#recommendItems {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.marketplace-products::-webkit-scrollbar,
.flash-products::-webkit-scrollbar,
.best-products::-webkit-scrollbar,
.category-grid::-webkit-scrollbar,
.brand-grid::-webkit-scrollbar,
.featured-grid::-webkit-scrollbar,
.rail-filters::-webkit-scrollbar,
.best-filters::-webkit-scrollbar,
#recommendItems::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

/* 2. Carousel Shell Wrapper */
.csb-rail-shell {
  position: relative;
  width: 100%;
  min-width: 0;
  align-self: start;
}

.csb-rail-shell > .csb-rail-track {
  scroll-behavior: smooth;
  padding-bottom: 10px !important;
}

.csb-rail-shell.is-scrollable > .csb-rail-track {
  cursor: grab;
}

.csb-rail-shell.is-dragging > .csb-rail-track {
  cursor: grabbing;
  scroll-behavior: auto !important;
  scroll-snap-type: none !important;
  user-select: none;
}

/* 3. Soft translucent edge fades indicating more items */
.csb-rail-shell::before,
.csb-rail-shell::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 22px;
  width: 46px;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.csb-rail-shell::before {
  inset-inline-start: 0;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0) 100%);
}

.csb-rail-shell::after {
  inset-inline-end: 0;
  background: linear-gradient(to left, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0) 100%);
}

[dir="rtl"] .csb-rail-shell::before {
  background: linear-gradient(to left, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0) 100%);
}

[dir="rtl"] .csb-rail-shell::after {
  background: linear-gradient(to right, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0) 100%);
}

.csb-rail-shell.has-prev::before { opacity: 1; }
.csb-rail-shell.has-next::after { opacity: 1; }

/* 4. Floating Frosted-Glass Navigation Arrows */
.csb-rail-arrow {
  position: absolute;
  top: calc(50% - 12px);
  transform: translateY(-50%);
  z-index: 6;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(15, 37, 64, 0.12);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #0f2540;
  box-shadow: 0 8px 24px rgba(11, 34, 61, 0.14), 0 2px 6px rgba(11, 34, 61, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.18s ease, background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.18s ease;
}

.csb-rail-arrow.is-prev { inset-inline-start: 8px; }
.csb-rail-arrow.is-next { inset-inline-end: 8px; }

.csb-rail-arrow:hover {
  background: #0063ee;
  border-color: #0063ee;
  color: #ffffff;
  transform: translateY(-50%) scale(1.06);
  box-shadow: 0 10px 26px rgba(0, 99, 238, 0.32);
}

.csb-rail-arrow:active {
  transform: translateY(-50%) scale(0.97);
}

.csb-rail-arrow:focus-visible {
  outline: 2px solid #0063ee;
  outline-offset: 2px;
}

.csb-rail-arrow.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(0.88);
}

.csb-rail-arrow svg {
  width: 20px;
  height: 20px;
  display: block;
}

[dir="rtl"] .csb-rail-arrow svg {
  transform: scaleX(-1);
}

/* 5. Ultra-Thin Modern Interactive Progress Pill (replaces ugly scrollbar) */
.csb-rail-progress {
  position: relative;
  width: min(220px, 52%);
  height: 4px;
  margin: 8px auto 2px;
  border-radius: 999px;
  background: #e1eaf6;
  overflow: hidden;
  cursor: pointer;
  transition: height 0.15s ease, opacity 0.2s ease;
}

.csb-rail-progress:hover {
  height: 6px;
}

.csb-rail-shell:not(.is-scrollable) .csb-rail-progress {
  display: none;
}

.csb-rail-progress-thumb {
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  width: 32%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0063ee 0%, #2480ff 100%);
  transition: transform 0.08s linear, width 0.2s ease;
  will-change: transform, width;
}

/* 6. Mobile & Touch refinements: keep swipe 100% native + ultra-clean 3px pill */
@media (max-width: 768px) {
  .csb-rail-arrow {
    width: 34px;
    height: 34px;
    opacity: 0.92;
  }
  .csb-rail-arrow svg { width: 16px; height: 16px; }
  .csb-rail-shell::before,
  .csb-rail-shell::after { width: 22px; }
  .csb-rail-progress { width: min(140px, 44%); height: 3px; margin-top: 6px; }
}

@media (hover: none) and (pointer: coarse) {
  .csb-rail-arrow { display: none; }
}
