.merchant-carousel {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}

.merchant-carousel[hidden],
.merchant-empty-state[hidden] {
  display: none;
}

.merchant-carousel-note[hidden] {
  display: none;
}

.merchant-carousel-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 56px 0;
  color: var(--muted);
  font-size: 12px;
}

.merchant-carousel-count {
  color: #cbb8ff;
  font-weight: 700;
  white-space: nowrap;
}
.merchant-track {
  display: grid;
  grid-auto-columns: minmax(250px, calc((100% - 40px) / 3));
  grid-auto-flow: column;
  gap: 20px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 4px 2px 18px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-color: rgba(183, 162, 255, 0.55) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}

.merchant-public-card {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0, rgba(139, 92, 246, 0.13), transparent 42%),
    linear-gradient(155deg, #15172b, #101220);
  scroll-snap-align: start;
}

.merchant-public-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.merchant-public-logo {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: #e6d8ff;
  background: rgba(139, 92, 246, 0.14);
  font: 800 26px Manrope, sans-serif;
}

.merchant-public-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.merchant-program-badge {
  padding: 7px 10px;
  border: 1px solid rgba(183, 162, 255, 0.2);
  border-radius: 999px;
  color: #cbb8ff;
  background: rgba(139, 92, 246, 0.09);
  font-size: 10px;
  text-align: center;
}

.merchant-public-card h3 {
  margin: 0;
  font: 750 20px/1.25 Manrope, sans-serif;
}

.merchant-public-category {
  margin: 7px 0 0;
  color: #c4a9ff;
  font-size: 12px;
}

.merchant-public-owner {
  margin: 4px 0 0;
  color: #9293a5;
  font-size: 11px;
}

.merchant-public-description {
  display: -webkit-box;
  min-height: 44px;
  margin: 14px 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.merchant-public-reward {
  min-height: 43px;
  margin-top: auto;
  color: #e9ddff;
  font-size: 12px;
  line-height: 1.5;
}

.merchant-join-link {
  justify-content: center;
  margin-top: 13px;
  text-align: center;
}

.merchant-scroll-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}

.merchant-scroll-button:hover:not(:disabled) {
  border-color: rgba(183, 162, 255, 0.5);
  background: rgba(139, 92, 246, 0.14);
}

.merchant-scroll-button:disabled {
  opacity: 0.32;
  cursor: default;
}

.merchant-empty-state {
  margin-top: 28px;
  padding: 28px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
}

.merchant-empty-state h3 {
  margin: 0 0 8px;
  font: 750 18px/1.3 Manrope, sans-serif;
}

.merchant-empty-state p {
  max-width: 560px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.merchant-empty-state button {
  justify-content: center;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .merchant-track {
    grid-auto-columns: minmax(250px, calc((100% - 20px) / 2));
  }
}

@media (max-width: 600px) {
  .merchant-carousel {
    grid-template-columns: minmax(0, 1fr);
  }

  .merchant-carousel-note {
    margin: 10px 0 0;
  }

  .merchant-track {
    display: flex;
    width: 100%;
    min-width: 0;
    grid-auto-columns: unset;
    gap: 12px;
    scrollbar-width: none;
  }

  .merchant-track::-webkit-scrollbar {
    display: none;
  }

  .merchant-public-card {
    flex: 0 0 calc(100% - 38px);
    min-width: 0;
  }

  .merchant-public-card h3,
  .merchant-public-reward {
    overflow-wrap: anywhere;
  }

  .merchant-scroll-button {
    display: none;
  }

  .merchant-empty-state {
    padding: 22px 18px;
  }
}
