/* ─── PRODUCT CARD — reference layout, спокойный зелёный ──────────────────── */
:root {
  --product-green: #3d8f63;
  --product-green-hover: #2f7350;
  --product-green-muted: #5a9a78;
}

/* ─── Сетка ───────────────────────────────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px 20px;
}

.products-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1100px) {
  .products-grid,
  .products-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {
  .products-grid,
  .products-grid--3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 12px;
  }
}

.products-grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 0;
  color: #888;
}

/* ─── Карточка (reference) ────────────────────────────────────────────────── */
.product-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-card-img-wrap {
  position: relative;
  background: #f5f5f5;
  border-radius: 16px;
  aspect-ratio: 1;
  overflow: hidden;
}

.product-card-img-link {
  display: block;
  width: 100%;
  height: 100%;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.product-card:hover .product-img {
  transform: scale(1.05);
}

.product-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #aaa;
  font-size: 13px;
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--product-green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  z-index: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.product-badge.sold-out {
  background: #111;
}

.add-cart-form {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 2;
  margin: 0;
}

.btn-add-card {
  position: static;
  background: var(--product-green);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  height: 36px;
  padding: 0 16px;
  border-radius: 99px;
  border: none;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s, transform 0.18s, background 0.12s;
  min-width: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.product-card:hover .btn-add-card {
  opacity: 1;
  transform: translateY(0);
}

.btn-add-card:hover {
  background: var(--product-green-hover);
}

.btn-add-card:disabled {
  cursor: wait;
  opacity: 0.7;
}

@media (max-width: 991px) {
  .btn-add-card {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 4px;
}

.product-cat {
  font-size: 12px;
  color: var(--product-green-muted);
  font-weight: 500;
}

.product-name {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  line-height: 1.3;
}

.product-name a {
  color: inherit;
}

.product-name a:hover {
  opacity: 0.75;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}

.product-price .price-sale {
  font-size: 18px;
  font-weight: 700;
  color: var(--product-green);
}

.product-price .price-original {
  font-size: 16px;
  color: #777;
  text-decoration: line-through;
}

.product-card.sold-out .product-img {
  opacity: 0.5;
}

/* ─── Вид списком (каталог) ───────────────────────────────────────────────── */
.products-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.products-list .product-card {
  flex-direction: row;
  align-items: center;
  gap: 20px;
  background: #fff;
  border-radius: 16px;
  padding: 12px 16px;
}

.products-list .product-card-img-wrap {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  aspect-ratio: auto;
}

.products-list .product-card-info {
  flex: 1;
  min-width: 0;
}

.products-list .add-cart-form {
  position: static;
}

.products-list .btn-add-card {
  opacity: 1;
  transform: none;
}

@media (max-width: 560px) {
  .products-list .product-card {
    flex-wrap: wrap;
  }

  .products-list .add-cart-form {
    width: 100%;
    padding-left: 112px;
  }

  .products-list .btn-add-card {
    width: 100%;
  }
}
