.catalog-cards[data-view="grid"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, min(100%, 360px)));
  gap: 20px;
  justify-content: start;
  align-items: start;
}

.listing-tile {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: 210px 44px 32px 56px minmax(34px, 1fr);
  row-gap: 10px;
  width: 100%;
  max-width: 360px;
  height: 505px;
  border-radius: var(--radius-md);
  padding: 16px;
  border: var(--border-soft);
  background: var(--surface-card);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  transition: background 180ms cubic-bezier(0.22, 1, 0.36, 1), border-color 180ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms cubic-bezier(0.22, 1, 0.36, 1), transform 180ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 180ms cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  min-width: 0;
}

.listing-tile > * {
  min-width: 0;
}

.listing-tile:hover {
  border-color: rgba(124, 58, 237, 0.18);
  background: rgba(124, 58, 237, 0.03);
}

.listing-tile__media {
  display: block;
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: 100%;
  height: 100%;
  background: #f8fafc;
}

.listing-tile__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.01);
  transition: opacity 180ms cubic-bezier(0.22, 1, 0.36, 1), transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.listing-tile__img.catalog-image-fade.is-loaded {
  opacity: 1;
  transform: scale(1);
}

.listing-tile__img--placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #eef2ff;
  color: #475569;
  overflow: hidden;
}

.listing-card__placeholder-logo-wrap {
  width: clamp(48px, 30%, 72px);
  aspect-ratio: 1 / 1;
  padding: 6px;
  display: grid;
  place-items: center;
}

.listing-card__placeholder-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.listing-card__placeholder-caption {
  max-width: 100%;
  padding: 0 8px;
  font-size: 11px;
  line-height: 14px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-card__placeholder-fallback {
  width: clamp(48px, 30%, 68px);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(99, 102, 241, 0.12);
  color: #3730a3;
  font-weight: 700;
  font-size: 24px;
}

.listing-tile__title {
  margin: 0;
  min-height: 44px;
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
  overflow: hidden;
  min-width: 0;
  width: 100%;
  max-width: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-wrap: auto;
}

.listing-tile__title a {
  display: -webkit-box;
  width: 100%;
  max-width: none;
  min-width: 0;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: inherit;
  text-decoration: none;
}

.listing-tile__chips {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  min-width: 0;
  flex-wrap: nowrap;
  height: 32px;
}

.listing-tile__chip {
  display: inline-block;
  height: 32px;
  max-width: 120px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  background: #eef2ff;
  color: #312e81;
  font-size: var(--fs-xs);
  line-height: 32px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-tile__chip--delivery {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: none;
  min-width: 0;
}

.listing-tile__chip-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
}

.listing-tile__chip-icon svg {
  width: 16px;
  height: 16px;
}

.listing-card__delivery {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #312e81;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.listing-card__delivery-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
}

.listing-card__delivery-icon svg {
  width: 16px;
  height: 16px;
}

.listing-card__delivery-text {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.listing-tile__chip--more {
  background: #f1f5f9;
  color: #334155;
}

.listing-tile__price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(126px, 150px);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 56px;
}

.listing-tile__price {
  max-width: 100%;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-tile__cta {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  justify-content: end;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.listing-tile__btn {
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 42px;
  border-radius: 14px;
  border: 1px solid #6d28d9;
  background: linear-gradient(180deg, #8b5cf6 0%, #7c3aed 58%, #6d28d9 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 10px 20px rgba(76, 29, 149, 0.24);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-tile__btn:hover {
  background: linear-gradient(180deg, #7c3aed 0%, #6d28d9 60%, #5b21b6 100%);
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(76, 29, 149, 0.28);
  color: #fff;
}
.listing-tile__btn:active {
  transform: translateY(0);
  box-shadow: 0 7px 14px rgba(76, 29, 149, 0.22);
}
.listing-tile__btn:focus-visible {
  outline: 2px solid #a78bfa;
  outline-offset: 2px;
}

.listing-tile__btn.is-disabled,
.listing-tile__btn[aria-disabled="true"] {
  border-color: #cbd5e1;
  background: #e2e8f0;
  color: #64748b;
  pointer-events: none;
}

.listing-tile__seller-row {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.listing-tile__seller {
  min-width: 0;
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 16px;
}

.listing-tile__seller-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.listing-tile__seller-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 24px;
  transition: opacity 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.listing-tile__seller-avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #475569;
  font-weight: 700;
  font-size: 11px;
}

.listing-tile__seller-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-tile__rating {
  flex-shrink: 1;
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
  text-decoration: none;
  color: inherit;
  opacity: .82;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-tile__rating:hover {
  text-decoration: underline;
}

.listing-tile__rating--empty {
  opacity: .68;
}

.listing-card__seller-inline {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.listing-card__seller-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.listing-card__seller-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 24px;
}

.listing-card__seller-avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.listing-card__seller-name {
  min-width: 0;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1199px) {
  .catalog-cards[data-view="grid"] {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    justify-content: stretch;
  }

  .listing-tile {
    width: 100%;
    max-width: none;
    height: 430px;
    grid-template-rows: 180px 44px 30px 52px minmax(30px, 1fr);
  }
}

.listing-tile__btn--ghost { display: none; }
