/* Active Stores Slider — shared by themes listing + theme detail pages */

.active-stores {
  padding: 48px 0;
  background: #fff;
}

/* Full-bleed container (listing page): spans the page edge-to-edge so the
   random slider stretches the full width instead of the default 1200px container. */
.active-stores .active-stores-container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Full-bleed variant: header stays inset, but the track runs edge-to-edge so a
   partial card peeks at both ends (no side gaps). */
.active-stores-container .active-stores-head {
  padding-inline: 40px;
}

.active-stores-container .active-stores-track {
  padding-left: 0;
  padding-right: 0;
}

/* On the theme detail page the slider is directly followed by a white .section
   (Main Content). Drop the slider's own bottom padding and shrink that section's
   top padding so the gap below the slider matches the gap above it. */
.active-stores:has(+ .section) {
  padding-bottom: 8px;
}

.active-stores + .section {
  padding-top: 16px;
}

.active-stores-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 34px;
  flex-wrap: wrap;
}

.active-stores-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

/* Gradient icon tile */
.active-stores-icon {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary, #094FC3), #2f7bff);
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 10px 22px rgba(9, 79, 195, 0.28);
}

.active-stores-title {
  margin: 0;
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--dark, #0f172a);
  letter-spacing: -0.02em;
}

.active-stores-subtitle {
  margin: 5px 0 0;
  color: var(--gray-500, #64748b);
  font-size: 0.95rem;
}

/* Nav arrows */
.active-stores-nav {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.active-stores-arrow {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--gray-200, #e2e8f0);
  background: #fff;
  color: var(--dark, #0f172a);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.active-stores-arrow:hover {
  background: var(--primary, #094FC3);
  color: #fff;
  border-color: var(--primary, #094FC3);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(9, 79, 195, 0.25);
}

/* Horizontal track — scrollbar hidden (navigate via arrows/swipe/auto-scroll) */
.active-stores-track {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scroll-behavior: auto;
  padding: 6px 4px 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.active-stores-track::-webkit-scrollbar {
  display: none;
}

/* Mouse drag-to-scroll affordance */
.active-stores-track {
  cursor: grab;
}

.active-stores-track.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.active-stores-track.is-dragging a {
  pointer-events: none;
}

.active-store-media img {
  -webkit-user-drag: none;
  user-select: none;
}

/* Card — horizontal: image on one side, content on the other.
   Fixed width so a wider (fluid) container shows more cards. */
.active-store-card {
  position: relative;
  flex: 0 0 360px;
  min-height: 158px;
  scroll-snap-align: start;
  background: var(--gray-50, #f8fafc);
  border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  transition: border-color 0.3s ease;
}

.active-store-card:hover {
  border-color: var(--primary, #094FC3);
}

/* Image side */
.active-store-cover {
  position: relative;
  flex: 0 0 43%;
  align-self: stretch;
}

.active-store-media {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: var(--gray-100, #f1f5f9);
}

.active-store-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.active-store-card:hover .active-store-media img {
  transform: scale(1.07);
}

/* Subtle gradient scrim for depth */
.active-store-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 58%, rgba(0, 0, 0, 0.25) 100%);
  pointer-events: none;
}

/* Platform badge — refined pill (top-start, RTL-aware) */
.active-store-badge {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 2;
  background: var(--primary, #094FC3);
  color: #fff;
  border: none;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  line-height: 1.4;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

/* Online indicator — green dot with pulse, top-end corner facing the platform badge */
.active-store-online {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  z-index: 2;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #22c55e;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.25));
  animation: activeStoreOnlinePulse 1.8s ease-out infinite;
}

@keyframes activeStoreOnlinePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .active-store-online {
    animation: none;
  }
}

/* Content side */
.active-store-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}

/* Logo area — centered with generous space */
.active-store-logo-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
  min-height: 0;
}

/* Theme-name label — overlay on the image, bottom corner (listing slider only) */
.active-store-theme {
  position: absolute;
  bottom: 12px;
  inset-inline-start: 12px;
  z-index: 2;
  max-width: calc(100% - 24px);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-store-theme i {
  font-size: 10px;
  opacity: 0.9;
  flex-shrink: 0;
}

.active-store-logo {
  width: 130px;
  height: 127px;
  padding:15px;
  border-radius: 20px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--gray-200, #e2e8f0);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.active-store-logo img {
  width: 100%;
  padding: 0px;
}

.active-store-logo--empty {
  color: var(--gray-300, #cbd5e1);
  font-size: 30px;
}

/* CTA bar */
.active-store-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--gray-200, #e2e8f0);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary, #094FC3);
}

.active-store-cta-arrow {
  transition: transform 0.3s ease;
  font-size: 0.85rem;
}

.active-store-card:hover .active-store-cta-arrow {
  transform: translateX(-5px);
}

/* In LTR the arrow points the other way and slides right */
[dir="ltr"] .active-store-cta-arrow {
  transform: scaleX(-1);
}

[dir="ltr"] .active-store-card:hover .active-store-cta-arrow {
  transform: scaleX(-1) translateX(-5px);
}

.active-store-card--nolink {
  cursor: default;
}

.active-store-card--nolink .active-store-cta {
  color: var(--gray-400, #94a3b8);
}

/* Mobile: one card per view, still horizontal (image + content) */
@media (max-width: 640px) {
  .active-stores .active-stores-container {
    padding: 0 16px;
  }
  .active-store-card {
    flex-basis: 88%;
  }
  .active-stores {
    padding: 44px 0;
  }
  /* Few-store layouts stack to a single column on phones */
  .active-stores--fit .active-stores-track .active-store-card {
    flex-basis: 100%;
    max-width: 100%;
  }
}

/* Single store: span the full width (no scrolling needed) */
.active-stores--single .active-stores-nav {
  display: none;
}

.active-stores--single .active-stores-track {
  overflow: visible;
}

.active-stores--single .active-store-card {
  flex: 1 1 100%;
  max-width: 100%;
  min-height: 240px;
}

/* Few stores (2–4): distribute evenly across the full width instead of scrolling */
.active-stores--fit .active-stores-nav {
  display: none;
}

.active-stores--fit .active-stores-track {
  flex-wrap: wrap;
  overflow: visible;
}

.active-stores--fit .active-store-card {
  min-height: 200px;
}

.active-stores--count-2 .active-store-card {
  flex: 1 1 calc((100% - 22px) / 2);
  max-width: calc((100% - 22px) / 2);
}

.active-stores--count-3 .active-store-card {
  flex: 1 1 calc((100% - 44px) / 3);
  max-width: calc((100% - 44px) / 3);
}

.active-stores--count-4 .active-store-card {
  flex: 1 1 calc((100% - 66px) / 4);
  max-width: calc((100% - 66px) / 4);
}

/* Tablet: any few-store layout collapses to 2 per row */
@media (min-width: 641px) and (max-width: 992px) {
  .active-stores--fit .active-stores-track .active-store-card {
    flex-basis: calc((100% - 22px) / 2);
    max-width: calc((100% - 22px) / 2);
  }
}
