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

.topshops-head__text {
  min-width: 0;
}

.topshops-head__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.topshops-title {
  white-space: normal;
}

.topshops-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 99px;
  background: #4fce5d;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.topshops-subtitle {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.4;
}

.topshops-link {
  margin-top: 4px;
}

.topshops-row.tp-hscroll {
  --tp-cols: 2.2;
  gap: 10px;
  margin-top: -6px;
  padding-top: 6px;
  padding-bottom: 16px;
}

.topshops-row.tp-hscroll > .swiper-slide {
  width: calc((100% - (var(--tp-cols) - 1) * 10px) / var(--tp-cols));
}

@media (min-width: 640px)  { .topshops-row.tp-hscroll { --tp-cols: 3.3; } }
@media (min-width: 768px)  { .topshops-row.tp-hscroll { --tp-cols: 3.2; } }
@media (min-width: 1024px) { .topshops-row.tp-hscroll { --tp-cols: 5.3; } }

.topshops-tile {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  isolation: isolate;
  transition: transform .2s ease, box-shadow .2s ease;
}

.topshops-tile:hover,
.topshops-tile:focus {
  color: #fff;
  text-decoration: none;
}

.topshops-tile:focus-visible {
  outline: 2px solid rgba(33, 70, 125, .5);
  outline-offset: -2px;
}

.topshops-tile.active {
  transform: translateY(-4px);
  box-shadow: 0 10px 18px -8px rgba(15, 23, 42, .45);
}

.topshops-tile::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -11px;
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: #21467d;
  transform: translateX(-50%) scaleX(0);
  transition: transform .2s ease;
  pointer-events: none;
}

.topshops-tile.active::after {
  transform: translateX(-50%) scaleX(1);
}

@media (hover: hover) {
  .topshops-tile:not(.active):hover {
    transform: translateY(-2px);
  }
}

.topshops-tile__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.topshops-tile.has-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(150deg, rgba(0, 0, 0, .45) 0%, rgba(0, 0, 0, .12) 45%, rgba(0, 0, 0, 0) 70%);
}

.topshops-tile--c0 { background: linear-gradient(135deg, #f2b63c 0%, #e08a1e 100%); }
.topshops-tile--c1 { background: linear-gradient(135deg, #c9a27a 0%, #8c6240 100%); }
.topshops-tile--c2 { background: linear-gradient(135deg, #3f8f57 0%, #1f5d36 100%); }
.topshops-tile--c3 { background: linear-gradient(135deg, #4d8fd6 0%, #23589c 100%); }
.topshops-tile--c4 { background: linear-gradient(135deg, #d98b6a 0%, #a7553b 100%); }
.topshops-tile--c5 { background: linear-gradient(135deg, #2f6f5e 0%, #173f35 100%); }

.topshops-tile__brand {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}

.topshops-tile__logo {
  display: block;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.topshops-tile__logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.topshops-tile__name {
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.15;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  overflow-wrap: anywhere;
}

@media (max-width: 580px) {
  .topshops-head {
    margin-bottom: 12px;
  }

  .topshops-subtitle {
    font-size: 13px;
  }

  .topshops-badge {
    padding: 4px 10px;
    font-size: 12px;
  }
}

@media (max-width: 580px), (min-width: 1024px) and (max-width: 1399px) {
  .topshops-tile__brand {
    top: 10px;
    left: 10px;
    right: 10px;
    gap: 8px;
    min-height: 30px;
  }

  .topshops-tile__logo {
    width: 30px;
    height: 30px;
  }

  .topshops-tile__name {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topshops-tile,
  .topshops-tile::after {
    transition: none;
  }
}
