/**
 * Shops & Rewards section – premium landing block
 * Two horizontal marquee rows: partner shops (row 1), rewards (row 2).
 * Mobile-first, RTL-friendly, uses hero.css variables where relevant.
 */

/* Reuse landing tokens – smaller cards so more show on phone */
:root {
  --shops-bg: #1e2328;
  --shops-bg-elevated: #2a3036;
  --shops-card-bg: #ffffff;
  --shops-card-radius: 14px;
  --shops-card-gap: 10px;
  --shops-card-size: 78px;
  --shops-mask-width: 40px;
  --shops-title-color: #f5f6f7;
  --shops-subtitle-color: #9ca3af;
  --shops-label-color: #6b7280;
  --shops-edge-shine: rgba(255, 255, 255, 0.08);
  --shops-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Section block */
.shops-section {
  background: var(--shops-bg);
  padding: clamp(1.5rem, 5vw, 2.5rem) 0 clamp(2.5rem, 8vw, 4rem);
  overflow: hidden;
  position: relative;
}

.shops-section__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 5%;
}

/* Typography */
.shops-section__title {
  font-size: clamp(1.5rem, 4.5vw, 2.25rem);
  font-weight: 800;
  color: var(--shops-title-color);
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.shops-section__subtitle {
  font-size: clamp(0.9rem, 2.2vw, 1.05rem);
  color: var(--shops-subtitle-color);
  text-align: center;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* Row group: label on side + marquee row */
.shops-section__row-group {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2.5vw, 1.25rem);
  margin-bottom: clamp(1rem, 3vw, 1.5rem);
}

.shops-section__row-group:last-child {
  margin-bottom: 0;
}

/* Label on the side with icon (shop / reward) */
.shops-section__row-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--shops-label-color);
}

.shops-section__row-label-icon {
  font-size: 1.1rem;
  color: var(--shops-subtitle-color);
}

.shops-section__row-label--shop .shops-section__row-label-icon {
  color: var(--shops-label-color);
}

.shops-section__row-label--reward .shops-section__row-label-icon {
  color: var(--shops-label-color);
}

/* Row wrapper: hides overflow and shows edge gradient for “moving” feel */
.shops-section__row-wrap {
  position: relative;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.shops-section__row-wrap--rewards {
  margin-bottom: 0;
}

/* Edge masks: metallic gradient on both sides for “moving” carousel feel */
.shops-section__row-mask {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--shops-mask-width);
  pointer-events: none;
  z-index: 2;
}

.shops-section__row-mask--start {
  left: 0;
  background: linear-gradient(to right, var(--shops-bg) 0%, transparent 100%);
}

.shops-section__row-mask--start::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    var(--shops-edge-shine) 0%,
    transparent 100%
  );
}

.shops-section__row-mask--end {
  right: 0;
  left: auto;
  background: linear-gradient(to left, var(--shops-bg) 0%, transparent 100%);
}

.shops-section__row-mask--end::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to left,
    var(--shops-edge-shine) 0%,
    transparent 100%
  );
}

[dir="rtl"] .shops-section__row-mask--start {
  left: auto;
  right: 0;
  background: linear-gradient(to left, var(--shops-bg) 0%, transparent 100%);
}

[dir="rtl"] .shops-section__row-mask--start::after {
  background: linear-gradient(
    to left,
    var(--shops-edge-shine) 0%,
    transparent 100%
  );
}

[dir="rtl"] .shops-section__row-mask--end {
  right: auto;
  left: 0;
  background: linear-gradient(to right, var(--shops-bg) 0%, transparent 100%);
}

[dir="rtl"] .shops-section__row-mask--end::after {
  background: linear-gradient(
    to right,
    var(--shops-edge-shine) 0%,
    transparent 100%
  );
}

/* Marquee track: flex row, no wrap; animation applied by JS (duration) */
.shops-section__track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--shops-card-gap);
  width: max-content;
  padding: 4px 0;
  will-change: transform;
}

/* Infinite scroll: move by 50% so duplicated content loops seamlessly */
.marquee-track {
  animation: shops-marquee linear infinite;
}

@keyframes shops-marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

[dir="rtl"] .marquee-track {
  animation-name: shops-marquee-rtl;
}

@keyframes shops-marquee-rtl {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(50%);
  }
}

/* Card: rounded square, image fills entire space */
.shops-section__card {
  flex-shrink: 0;
  width: var(--shops-card-size);
  height: var(--shops-card-size);
  border-radius: var(--shops-card-radius);
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  transition: transform 0.25s ease;
}

.shops-section__card:hover {
  transform: scale(1.04);
}

.shops-section__card-inner {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.shops-section__card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Slightly larger cards on larger screens, still compact on phone */
@media (min-width: 480px) {
  :root {
    --shops-card-size: 88px;
    --shops-card-gap: 12px;
  }
}

@media (min-width: 768px) {
  :root {
    --shops-card-size: 100px;
    --shops-card-gap: 14px;
    --shops-mask-width: 56px;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation-duration: 80s;
  }
}
