/* ========== Top Sellers — Figma card, always 3 square product thumbs ========== */

.ts-section {
  background: #fff;
  padding: 48px 0 56px;
}

.ts-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.ts-header__heading {
  flex: 1 1 auto;
  min-width: 0;
}

.ts-header__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.ts-header__icon {
  width: 24px;
  height: 24px;
  color: #7c3aed;
  stroke: #7c3aed;
  fill: none;
  flex-shrink: 0;
}

.ts-header__title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: #111827;
  letter-spacing: -0.02em;
}

.ts-header__subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #6b7280;
}

.ts-grid-wrap {
  position: relative;
}

.ts-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 32px;
  height: 32px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: #6b7280;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
  cursor: pointer;
}

.ts-nav:hover {
  background: #f9fafb;
}

.ts-nav svg,
.ts-nav i {
  width: 16px;
  height: 16px;
}

.ts-nav--prev { left: 6px; }
.ts-nav--next { right: 6px; }

.ts-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  padding: 8px 16px 20px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-padding-inline: 16px;
}

.ts-grid::-webkit-scrollbar {
  display: none;
}

/* Mobile-first card: ~85% width so next card peeks */
.ts-card {
  flex: 0 0 calc(100% - 48px);
  width: calc(100% - 48px);
  max-width: 340px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #fff;
  border: 1px solid #f3f4f6;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 450ms ease, transform 300ms ease, box-shadow 300ms ease, border-color 300ms ease;
}

.ts-card.ts-card--visible {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: hover) {
  .ts-card.ts-card--visible:hover {
    transform: translateY(-3px);
    border-color: #d8b4fe;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.14);
  }

  .ts-card:hover .ts-card__avatar {
    transform: scale(1.06);
  }
}

.ts-card__banner {
  position: relative;
  height: 112px;
  background: linear-gradient(90deg, #c084fc 0%, #8b5cf6 48%, #3b82f6 100%);
  overflow: hidden;
}

.ts-card__banner::after {
  content: "";
  position: absolute;
  top: -24px;
  right: -16px;
  width: 128px;
  height: 128px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  filter: blur(18px);
}

.ts-card__badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #7c3aed;
  line-height: 1;
  white-space: nowrap;
}

.ts-card__badge svg,
.ts-card__badge i {
  width: 12px;
  height: 12px;
  color: #7c3aed;
  flex-shrink: 0;
}

.ts-card__body {
  padding: 0 20px 22px;
  text-align: center;
}

.ts-card__avatar-wrap {
  position: relative;
  width: 96px;
  margin: -48px auto 14px;
}

.ts-card__avatar {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  border: 4px solid #fff;
  background: #e5e7eb;
  color: #374151;
  font-size: 22px;
  font-weight: 600;
  line-height: 88px;
  text-align: center;
  box-shadow: 0 10px 18px -6px rgba(15, 23, 42, 0.35);
  transition: transform 300ms ease;
  user-select: none;
}

img.ts-card__avatar {
  display: block;
  object-fit: cover;
  line-height: 0;
}

.ts-card__verified {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #2563eb;
  border: 2px solid #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.ts-card__verified svg,
.ts-card__verified i {
  width: 12px;
  height: 12px;
}

.ts-card__name {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: #111827;
}

.ts-card__stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.4;
  color: #6b7280;
}

.ts-card__stats-star {
  color: #fbbf24;
  font-size: 14px;
  line-height: 1;
}

.ts-card__stats-rating {
  font-weight: 700;
  color: #111827;
}

.ts-card__stats-dot {
  color: #9ca3af;
}

.ts-card__previews {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.ts-card__previews img,
.ts-card__preview-empty {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  background: #f3f4f6;
}

.ts-card__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(90deg, #9333ea 0%, #2563eb 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 200ms ease, filter 200ms ease, box-shadow 200ms ease;
  box-shadow: 0 8px 18px rgba(147, 51, 234, 0.28);
}

.ts-card__btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  color: #fff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.32);
}

/* Phone + tablet: edge-to-edge slider, one card + peek */
@media (max-width: 991.98px) {
  .ts-section {
    padding: 32px 0 40px;
    overflow-x: clip;
  }

  .ts-header {
    margin-bottom: 20px;
  }

  .ts-grid-wrap {
    margin-left: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
    margin-right: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
  }

  .ts-card {
    flex: 0 0 calc(100% - 48px);
    width: calc(100% - 48px);
    max-width: none;
  }

  .ts-card__previews {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .ts-grid-wrap {
    margin-left: calc(-1 * max(16px, env(safe-area-inset-left)));
    margin-right: calc(-1 * max(16px, env(safe-area-inset-right)));
  }

  .ts-header__title {
    font-size: 22px;
  }

  .ts-header__subtitle {
    font-size: 13px;
  }

  .ts-grid {
    gap: 12px;
    padding: 6px 16px 22px;
  }

  .ts-card {
    flex: 0 0 calc(100% - 44px);
    width: calc(100% - 44px);
    border-radius: 22px;
  }

  .ts-card__banner {
    height: 104px;
  }

  .ts-card__body {
    padding: 0 16px 18px;
  }

  .ts-card__avatar-wrap {
    width: 92px;
    margin: -46px auto 12px;
  }

  .ts-card__avatar {
    width: 92px;
    height: 92px;
    line-height: 84px;
    font-size: 20px;
  }

  .ts-card__name {
    font-size: 16px;
  }

  .ts-card__previews {
    gap: 8px;
  }

  .ts-nav {
    width: 28px;
    height: 28px;
  }

  .ts-nav--prev { left: 8px; }
  .ts-nav--next { right: 8px; }
}

/* Desktop: seller grid, still exactly 3 thumbs each */
@media (min-width: 992px) {
  .ts-nav {
    display: none;
  }

  .ts-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    overflow: visible;
    scroll-snap-type: none;
    padding: 4px 0 12px;
  }

  .ts-card {
    flex: none;
    width: auto;
    max-width: none;
  }
}

@media (max-width: 1199.98px) and (min-width: 992px) {
  .ts-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
