/* UX Builder: единая компактная карточка товара */
.uxb-product-item {
  width: 100%;
  min-width: 0;
  height: 100%;
  user-select: none;
}

.uxb-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e7edf4;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .035);
  transition: border-color .2s ease, box-shadow .2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .uxb-product-card:hover {
    transform: none;
    border-color: #d8e3ef;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .055);
  }
}

.uxb-product-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 190px;
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid #f0f4f8;
}

.uxb-product-media-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 20px 18px 14px;
}

.uxb-product-card-img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
  object-position: center;
  background: #fff;
  pointer-events: none;
}

.uxb-product-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: calc(100% - 62px);
  pointer-events: none;
}

.uxb-product-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}

.uxb-badge-hit { background: #fee2e2; color: #b91c1c; }
.uxb-badge-new { background: #dcfce7; color: #15803d; }
.uxb-badge-inverter { background: #d1fae5; color: #047857; }
.uxb-badge-wifi { background: #e0f2fe; color: #0369a1; }
.uxb-badge-heat { background: #ffedd5; color: #c2410c; }
.uxb-badge-efficiency { background: #ecfccb; color: #3f6212; }

.uxb-product-card .favorite-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #e5ebf2;
  border-radius: 50%;
  background: rgba(255, 255, 255, .96);
  color: #94a3b8;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .07);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

.uxb-product-card .favorite-btn:hover,
.uxb-product-card .favorite-btn.active {
  transform: none;
  color: #ef4444;
  border-color: #fecaca;
  background: #fff;
}

.uxb-product-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 17px 18px 18px;
}

.uxb-product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 25px;
  gap: 8px;
  margin-bottom: 10px;
}

.uxb-product-brand,
.uxb-product-country {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uxb-product-brand {
  max-width: 58%;
  padding: 4px 9px;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  text-transform: uppercase;
}

.uxb-product-country {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  max-width: 42%;
  color: #64748b;
  font-size: 11px;
  line-height: 1.2;
}

.uxb-product-title {
  display: -webkit-box;
  min-height: 45px;
  margin: 0 0 6px;
  overflow: hidden;
  color: #0f172a;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.32;
  letter-spacing: -.015em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.uxb-product-title a {
  color: inherit;
  text-decoration: none;
}

.uxb-product-model {
  min-height: 18px;
  margin-bottom: 14px;
  overflow: hidden;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uxb-product-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
  margin-bottom: 12px;
}

.uxb-product-spec {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  padding: 9px;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  background: #f8fafc;
}

.uxb-product-spec-icon {
  display: inline-flex;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #fff;
  color: #2563eb;
  font-size: 12px;
}

.uxb-product-spec-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.uxb-product-spec-label {
  color: #94a3b8;
  font-size: 9px;
  font-weight: 650;
  line-height: 1.15;
  text-transform: uppercase;
}

.uxb-product-spec-value {
  overflow: hidden;
  color: #1e293b;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uxb-product-rating {
  display: flex;
  align-items: center;
  min-height: 18px;
  gap: 6px;
  margin-bottom: 10px;
}

.uxb-product-stars {
  display: inline-flex;
  gap: 2px;
  font-size: 12px;
}

.uxb-product-rating-count {
  color: #94a3b8;
  font-size: 11px;
}

.uxb-product-price {
  margin: 0 0 12px;
  color: #2563eb;
  font-size: 23px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.uxb-product-price .currency { font-size: .78em; }

.uxb-product-card .cart-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  gap: 8px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}

.uxb-product-card .cart-button:hover {
  transform: none;
  background: #1d4ed8;
}

.uxb-product-card .buy-now-btn {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.uxb-product-card .buy-now-btn:hover {
  border-color: #93c5fd;
  background: #dbeafe;
}

@media (max-width: 640px) {
  .uxb-product-card { border-radius: 18px; }
  .uxb-product-media { min-height: 175px; }
  .uxb-product-media-link { padding: 18px 14px 12px; }
  .uxb-product-content { padding: 15px; }
  .uxb-product-title { min-height: 42px; font-size: 16px; }
  .uxb-product-price { font-size: 21px; }
  .uxb-product-spec { padding: 8px; }
}

/* Перебиваем старые глобальные стили base.html только внутри UX-карточек. */
.uxb-product-item .uxb-product-card {
  margin-bottom: 0;
  transform: none !important;
}
.uxb-product-item .uxb-product-card:hover { transform: none !important; }
.uxb-product-item .uxb-product-media { height: auto; }
.uxb-product-item .uxb-product-content { padding: 17px 18px 18px; }
.uxb-product-item .uxb-product-title { font-size: 17px; }
.uxb-product-item .uxb-product-price { margin-top: 0 !important; }
@media (max-width: 640px) {
  .uxb-product-item .uxb-product-content { padding: 15px; }
  .uxb-product-item .uxb-product-title { font-size: 16px; }
}
