:root {
  --card-radius: 16px;
  --card-border: #e7ece8;
  --card-shadow: 0 10px 28px rgba(25, 50, 35, 0.08);
  --card-shadow-hover: 0 16px 34px rgba(25, 50, 35, 0.14);

  --green-main: #198754;
  --green-dark: #146c43;
  --green-soft: #eef8f2;

  --text-main: #1f2d1f;
  --text-muted: #7b8790;
  --bg-soft: #f8faf8;

  --discount-bg: #ff6b2c;
  --discount-text: #ffffff;

  --product-card-media-h: 260px;
  --product-card-media-h-mobile: 190px;
}

/* ===== Карточка ===== */
.product-card-modern {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.product-card-modern:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: #d6e6db;
}

/* ===== Бейджи ===== */
.product-card-modern__badges {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: calc(100% - 24px);
}

.product-card-modern__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.product-card-modern__badge--hit {
  background: #fff3cd;
  color: #6b5200;
}

.product-card-modern__badge--new {
  background: #d1f2df;
  color: #0f5132;
}

.product-card-modern__badge--sale {
  background: var(--discount-bg);
  color: var(--discount-text);
}

.product-card-modern__badge--recommended {
  background: #dbeafe;
  color: #1d4ed8;
}

.product-card-modern__badge--popular {
  background: #cff4fc;
  color: #055160;
}

.product-card-modern__badge--out {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  background: #6c757d;
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ===== Блок изображения ===== */
.product-card-modern__media {
  position: relative;
  height: var(--product-card-media-h);
  background: linear-gradient(180deg, #ffffff 0%, var(--bg-soft) 100%);
  border-bottom: 1px solid #eef2ef;
  overflow: hidden;
}

.product-card-modern__media .carousel,
.product-card-modern__media .carousel-inner,
.product-card-modern__media .carousel-item {
  height: 100%;
}

.product-card-modern__media-link,
.product-card-modern__media-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-decoration: none;
  padding: 18px;
}

.product-card-modern__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.22s ease;
}

.product-card-modern:hover .product-card-modern__img {
  transform: scale(1.035);
}

/* ===== Кнопки карусели ===== */
.product-card-modern .carousel-control-prev,
.product-card-modern .carousel-control-next {
  width: 40px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.product-card-modern:hover .carousel-control-prev,
.product-card-modern:hover .carousel-control-next {
  opacity: 1;
}

.product-card-modern .carousel-control-prev-icon,
.product-card-modern .carousel-control-next-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: rgba(25, 135, 84, 0.85);
  background-size: 55% 55%;
}

/* ===== Тело карточки ===== */
.product-card-modern__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 16px 16px 18px;
  text-align: left;
}

.product-card-modern__title {
  margin: 0 0 10px;
  min-height: 52px;
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 700;
}

.product-card-modern__title a {
  color: var(--text-main);
  text-decoration: none;
}

.product-card-modern__title a:hover {
  color: var(--green-main);
}

/* ===== Фичи ===== */
.product-card-modern__features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  min-height: 30px;
}

.product-card-modern__feature {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f8faf9;
  border: 1px solid #e4ece7;
  color: var(--green-main);
  font-size: 12px;
  line-height: 1.1;
  font-weight: 600;
}

/* ===== Цена ===== */
.product-card-modern__price-wrap {
  margin-top: auto;
  margin-bottom: 14px;
}

.product-card-modern__old-price {
  min-height: 20px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-bottom: 4px;
}

.product-card-modern__price-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.product-card-modern__price {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--green-main);
  letter-spacing: -0.02em;
}

.product-card-modern__price-note {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Действия ===== */
.product-card-modern__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-card-modern__cart-form .input-group {
  flex-wrap: nowrap;
  border-radius: 12px;
  overflow: hidden;
}

.product-card-modern__qty {
  max-width: 88px;
  border-color: #dce7df;
  font-weight: 600;
  text-align: center;
  border-radius: 12px 0 0 12px !important;
  box-shadow: none !important;
}

.product-card-modern__qty:focus {
  border-color: #a9d5b8;
}

.product-card-modern__btn-cart {
  border: none;
  background: var(--green-main);
  color: #fff;
  font-weight: 700;
  padding: 12px 16px;
  transition: background 0.18s ease, transform 0.18s ease;
  min-width: 126px;
  white-space: nowrap;
}

.product-card-modern__btn-cart:hover,
.product-card-modern__btn-cart:focus {
  background: var(--green-dark);
  color: #fff;
}

.product-card-modern__btn-cart:disabled {
  background: #9fb7a8;
  cursor: not-allowed;
}

.product-card-modern__btn-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  border-width: 1.5px;
}

.product-card-modern__btn-more:hover {
  background: var(--green-soft);
  border-color: var(--green-main);
  color: var(--green-main);
}

/* ===== Адаптив ===== */
@media (max-width: 991.98px) {
  .product-card-modern__price {
    font-size: 1.7rem;
  }
}

@media (max-width: 576px) {
  .product-card-modern__media {
    height: var(--product-card-media-h-mobile);
  }

  .product-card-modern__body {
    padding: 12px 12px 14px;
  }

  .product-card-modern__title {
    min-height: 46px;
    font-size: 0.96rem;
    margin-bottom: 8px;
  }

  .product-card-modern__features {
    margin-bottom: 10px;
    min-height: 0;
  }

  .product-card-modern__feature {
    font-size: 11px;
    padding: 4px 8px;
  }

  .product-card-modern__old-price {
    font-size: 13px;
  }

  .product-card-modern__price {
    font-size: 1.45rem;
  }

  .product-card-modern__qty {
    max-width: 68px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .product-card-modern__btn-cart {
    min-width: 0;
    font-size: 14px;
    padding: 11px 12px;
  }

  .product-card-modern__btn-more {
    font-size: 14px;
    padding: 9px 12px;
  }

  .product-card-modern .carousel-control-prev,
  .product-card-modern .carousel-control-next {
    opacity: 1;
    width: 34px;
  }

  .product-card-modern .carousel-control-prev-icon,
  .product-card-modern .carousel-control-next-icon {
    width: 1.65rem;
    height: 1.65rem;
  }
}
