.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.products-grid--cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.products-grid--cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 520px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card);
  border: 1px solid #1c1c1c;
  cursor: pointer;
  transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeUp 0.35s ease both;
}

.product-card.is-hovered {
  border-color: #2e2e2e;
  transform: translateY(-3px);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.badges {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-img-wrap {
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  aspect-ratio: 300 / 380;
  width: 100%;
}

.card-img-wrap img,
.card-img-wrap .bag-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.badge-new,
.badge-discount {
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.15em;
}

.badge-new {
  color: #fff;
  background: var(--accent);
}

.badge-discount {
  background: #c62828;
  color: #fff;
}

.card-info {
  flex: 1;
  display: grid;
  grid-template-rows: 14px 36px 40px 1fr auto;
  gap: 4px 0;
  padding: 13px 14px 14px;
  min-height: 0;
}

.card-brand {
  height: 14px;
  line-height: 14px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-name {
  height: 36px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.card-bottom {
  height: 40px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px;
}

.card-prices {
  display: grid;
  grid-template-rows: 14px 18px;
  align-content: end;
  height: 40px;
}

.card-price-old {
  height: 14px;
  line-height: 14px;
  font-size: 12px;
  color: var(--soft);
  text-decoration: line-through;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-price-old.is-empty {
  visibility: hidden;
}

.card-price {
  height: 18px;
  line-height: 18px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-price--sale {
  color: var(--text);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 18px;
  padding-bottom: 0;
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot-bg, transparent);
}

.color-dot--light {
  border: 1px solid #333;
}

.card-size {
  font-size: 11px;
  color: var(--soft);
}

.bag-placeholder {
  display: block;
}

.card-social {
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.card-social-hint {
  display: block;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.card-social-links {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 6px;
}

.card-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--text);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-social-btn--tg {
  background: rgba(42, 171, 238, 0.12);
  border-color: rgba(42, 171, 238, 0.35);
  color: #5ec4f7;
}

.card-social-btn--ig {
  background: rgba(225, 48, 108, 0.12);
  border-color: rgba(225, 48, 108, 0.35);
  color: #f06a9a;
}

.card-social-btn:hover {
  transform: translateY(-1px);
}

.card-social-btn--tg:hover {
  background: rgba(42, 171, 238, 0.22);
  border-color: #2aabee;
  color: #8ed4fa;
}

.card-social-btn--ig:hover {
  background: rgba(225, 48, 108, 0.22);
  border-color: #e1306c;
  color: #f59ab8;
}

.card-social-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-social-icon {
  display: block;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.card-social-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: currentColor;
}

.card-social-arrow {
  flex-shrink: 0;
  font-size: 10px;
  opacity: 0.7;
}

@media (max-width: 520px) {
  .card-info {
    grid-template-rows: 13px 33px 36px 1fr auto;
    gap: 3px 0;
    padding: 10px 10px 12px;
  }

  .card-brand {
    height: 13px;
    line-height: 13px;
    font-size: 9px;
  }

  .card-name {
    height: 33px;
    font-size: 12px;
  }

  .card-bottom,
  .card-prices {
    height: 36px;
  }

  .card-prices {
    grid-template-rows: 12px 16px;
  }

  .card-price-old {
    height: 12px;
    line-height: 12px;
    font-size: 11px;
  }

  .card-price {
    height: 16px;
    line-height: 16px;
    font-size: 14px;
  }

  .card-meta {
    height: 16px;
  }

  .card-social {
    padding-top: 8px;
  }

  .card-social-hint {
    margin-bottom: 6px;
  }

  .card-social-links {
    gap: 5px;
  }

  .card-social-btn {
    min-height: 32px;
    padding: 5px 6px;
    font-size: 9px;
    gap: 4px;
  }

  .card-social-icon {
    width: 13px;
    height: 13px;
  }

  .card-social-arrow {
    display: none;
  }
}
