.product_text {
  display: flex;
  flex-wrap: wrap;
  column-gap: 5px;
}

.onsale {
  display: none;
}

.add_to_cart_wrap {
  display: none;
}

.image-container {
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  height: 250px;
}

.image-container img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.small-images img{
  object-fit: contain !important;
}

.product_text {
  margin-top: 8px;
}

.pr_text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.woocommerce-loop-product__title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-regular);
  color: var(--black);
  line-height: 24px;
  min-height: 48px;
  margin-bottom: 5px;
}

.product-attribute {
  order: 3;
}

.price {
  order: 2;
  display: flex;
  align-items: center;
  column-gap: 5px;

  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  line-height: 28px;
  color: var(--black);
}

.price del {
  order: 2;
  text-decoration: none;
  margin-left: auto;
}

.price del .woocommerce-Price-amount bdi {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  line-height: 18px;
  color: var(--text-light);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--text-light);
  text-align: center;
}

.price ins {
  order: 0;
  text-decoration: none;
}

.price .woocommerce-Price-amount.amount {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: 28px;
  color: var(--black);
  text-decoration: none;
}

.product-attribute {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  line-height: 18px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.product-attribute strong {
  font-weight: var(--font-weight-regular);
}

.add_to_cart_wrap {
  margin-top: 15px;
}

.add_to_cart_button {
  display: none;
  align-items: center;
  column-gap: 15px;

  padding: 8px 16px;
  background: var(--primary-color);
  color: var(--white);
  border-radius: 8px;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-regular);
}

.xoo-qv-button {
  display: none !important;
}

/* === КОНТЕЙНЕР КНОПОК ДЕЙСТВИЙ === */
.product-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: stretch;
  width: 100%;
}

/* === КНОПКА КОРЗИНЫ === */
a.custom-qv-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  column-gap: 8px;
  margin: 0;
  padding: 8px 16px;
  background: var(--primary-color);
  color: var(--white);
  border-radius: 8px;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-regular);
  transition: all 0.3s ease;
  text-decoration: none;
}

a.custom-qv-button:hover {
  background: #917f6e;
  color: #fff;
}

a.added-to-cart {
  background: var(--success);
}

.custom-qv-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0px !important;
}

.custom-qv-text {
  white-space: nowrap;
}

/* === КНОПКИ ИЗБРАННОГО И СРАВНЕНИЯ === */
.product-card-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--white);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 18px;
  color: var(--text-color);
  flex-shrink: 0;
}

.product-card-action-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ИЗБРАННОЕ - АКТИВНОЕ СОСТОЯНИЕ */
.product-card-action-btn.favorites-button.active {
  background: var(--secondary-color);
  border-color: var(--secondary-color);
  color: var(--white);
}

.product-card-action-btn.favorites-button.active i {
  animation: heartBeat 0.3s ease;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(1); }
  75% { transform: scale(1.2); }
}

/* СРАВНЕНИЕ - АКТИВНОЕ СОСТОЯНИЕ */
.product-card-action-btn.compare-button.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white);
}

/* СОСТОЯНИЕ ЗАГРУЗКИ */
.product-card-action-btn.loading {
  opacity: 0.6;
  pointer-events: none;
}

.product-card-action-btn.loading i {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* === КОЛОНКИ === */
.columns-3 .image-container{
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  height: 250px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.columns-3 .image-container img{
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.columns-3 .small-images img{
  object-fit: contain !important;
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 1440px) {
  .product-card-actions {
    gap: 6px;
  }

  a.custom-qv-button {
    padding: 8px 12px;
    font-size: 16px;
  }

  .product-card-action-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .product_text .wc-compare-button-loop {
    padding: 7px 8px;
  }

  .product_text .wc-compare-icon {
    font-size: 14px !important;   
  }

  .product_text .wc-favorites-loop-wrap {
    width: 35px !important;
  }

  .product_text .wc-favorites-icon {
    width: 20px !important;
    height: 18px !important;
  }

  .wc-favorites-button:hover{
    background-color: #fff !important;
    border: 1px solid var(--primary-color) !important;
  }
}

@media (max-width: 768px) {
  .product-card-actions {
    gap: 6px;
  }

  a.custom-qv-button {
    padding: 8px 12px;
    font-size: 14px;
  }

  /* Скрываем текст "В корзину" на мобильных */
  .custom-qv-text {
    display: none;
  }

  .product-card-action-btn {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }
}

@media (max-width: 576px) {
  .product-card-actions {
    gap: 4px;
    flex-wrap: wrap;
  }

  a.custom-qv-button {
    width: 100%;
    order: -1; /* Кнопка корзины всегда первая */
  }

  .custom-qv-text {
    display: inline; /* Показываем текст когда кнопка на всю ширину */
  }

  .product-card-action-btn {
    flex: 1;
    width: auto;
    min-width: 44px;
    height: 44px;
  }

  .product_text .wc-compare-button-loop {
    display: none;
  }

  .product_text .wc-favorites-loop-wrap {
    display: none;
  }

  .price {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .price del {
    margin-left: 0;
  }
}

/* === Touch устройства - увеличиваем область нажатия === */
@media (hover: none) and (pointer: coarse) {
  .product-card-action-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* === СКРЫВАЕМ СТАРЫЕ ПЛАГИНЫ === */
.product_text .wc-compare-button-loop,
.product_text .wc-favorites-loop-wrap {
  display: none !important;
}
