/* Moshammer shared carousel core (primitive 3, Sliders & Galleries UI kit). Native scroll-snap is the
 * mechanism; this file styles the JS-generated arrows/dots and offers an OPTIONAL .mos-carousel__track
 * scroll-snap helper for new consumers. Existing scroll-snap carousels (the cat-hero) keep their own
 * track/slide CSS — only the generated dots/arrows come from here. Tokens: var(--mos-carousel-*, …). */

[data-mos-carousel] { position: relative; }

/* Optional track helper for NEW consumers (cart-gift / reviewslider / imageslider once migrated). The
 * slide flex-basis stays consumer-tunable via --mos-carousel-slide (default single-up 100%). */
.mos-carousel__track {
  display: flex;
  gap: var(--mos-carousel-gap, var(--mos-slider-gap, 1rem));
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mos-carousel__track::-webkit-scrollbar { display: none; }
.mos-carousel__track > * { scroll-snap-align: start; flex: 0 0 var(--mos-carousel-slide, 100%); }
@media (prefers-reduced-motion: reduce) { .mos-carousel__track { scroll-behavior: auto; } }

/* Arrows — generated when data-mos-carousel-arrows */
.mos-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  appearance: none;
  border: 0;
  cursor: pointer;
  width: var(--mos-carousel-arrow-size, 2.75rem);
  height: var(--mos-carousel-arrow-size, 2.75rem);
  border-radius: 999px;
  line-height: 1;
  font-size: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--mos-carousel-arrow-bg, rgba(0, 0, 0, 0.4));
  color: var(--mos-carousel-arrow-fg, #fff);
  transition: background-color 160ms ease;
}
.mos-carousel__arrow:hover { background: var(--mos-carousel-arrow-bg-hover, rgba(0, 0, 0, 0.62)); }
.mos-carousel__arrow:focus-visible {
  outline: 2px solid var(--mos-carousel-accent, var(--moshammer-accent-meta, #0ebc5f));
  outline-offset: 2px;
}
.mos-carousel__arrow--prev { left: 0.5rem; }
.mos-carousel__arrow--next { right: 0.5rem; }
[data-mos-carousel][dir="rtl"] .mos-carousel__arrow span { display: inline-block; transform: scaleX(-1); }

/* Dots — generated when data-mos-carousel-dots (overlaid bottom-centre) */
.mos-carousel__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--mos-carousel-dots-bottom, 0.85rem);
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  z-index: 2;
  pointer-events: none; /* let gaps fall through to the slide; the dots re-enable */
}
/* The button is a >=24px hit target (WCAG 2.5.8 / Lighthouse target-size); the visible dot is the
 * small ::before centred inside it, so the control stays easy to tap without a large visual dot. */
.mos-carousel__dot {
  pointer-events: auto;
  appearance: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--mos-carousel-dot-hit, 1.5rem);
  height: var(--mos-carousel-dot-hit, 1.5rem);
  background: none;
}
.mos-carousel__dot::before {
  content: "";
  width: var(--mos-carousel-dot-size, 0.6rem);
  height: var(--mos-carousel-dot-size, 0.6rem);
  border-radius: 999px;
  background: var(--mos-carousel-dot, rgba(255, 255, 255, 0.65));
  /* a soft dark halo so white dots stay legible on light hero imagery, not just dark */
  box-shadow: var(--mos-carousel-dot-shadow, 0 1px 3px rgba(0, 0, 0, 0.55));
  transition: background-color 160ms ease, transform 160ms ease;
}
.mos-carousel__dot:hover::before { background: var(--mos-carousel-dot-hover, rgba(255, 255, 255, 0.8)); }
.mos-carousel__dot.is-active::before {
  background: var(--mos-carousel-dot-active, #fff);
  transform: scale(1.25);
}
.mos-carousel__dot:focus-visible {
  outline: 2px solid var(--mos-carousel-accent, var(--moshammer-accent-meta, #0ebc5f));
  outline-offset: 2px;
  border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
  .mos-carousel__arrow,
  .mos-carousel__dot::before { transition: none; }
}

/* Mouse drag-to-slide (wired by moshammer-carousel.js). The grab cursor only appears on pointer
   devices; touch keeps native scroll-snap. `is-dragging` scrubs 1:1 with snap temporarily off. */
.mos-carousel--draggable [data-mos-carousel-track] { cursor: grab; }
.mos-carousel--draggable.is-dragging [data-mos-carousel-track] { cursor: grabbing; scroll-behavior: auto; }
[data-mos-carousel].is-dragging { user-select: none; }
[data-mos-carousel-track] img { -webkit-user-drag: none; user-select: none; }
