/* ================================================
   КАРТКИ ТОВАРІВ — РЕДИЗАЙН v2.1
   GoraFish | product-card-global.css
   ================================================ */

/* --------------------------------------------------
   1. СІТКА
   -------------------------------------------------- */
.product-card__grid,
ul.products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 16px !important;
  align-items: stretch !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* --------------------------------------------------
   2. КАРТКА
   -------------------------------------------------- */
.product-card {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  background: #fff !important;
  border: 1px solid #ebebeb !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  position: relative !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease !important;
}

/* --------------------------------------------------
   3. ЗОБРАЖЕННЯ — aspect-ratio 4/3
   -------------------------------------------------- */
.product-card__wrap-image {
  position: relative !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  background: #f9f9f9 !important;
  aspect-ratio: 4 / 5 !important;
  width: 100% !important;
}

.product-card__wrap-image img,
.product-card__image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  display: block !important;
  padding: 8px !important;
  transition: transform 0.35s ease !important;
}

/* --------------------------------------------------
   4. БЕЙДЖІ — перекриваємо весь блок зображення
   щоб можна було позиціонувати дочірні елементи
   і зліва (sale/new) і справа (like)
   -------------------------------------------------- */
.product-card__badge {
  position: absolute !important;
  inset: 0 !important;           /* розтягуємо на весь .product-card__wrap-image */
  pointer-events: none !important;
  display: block !important;
  z-index: 2 !important;
}

/* Усі дочірні елементи бейджа — абсолютні */
.product-card__badge--sale,
.product-card__badge--new,
.product-card__badge .icon__like {
  pointer-events: auto !important;
  position: absolute !important;
}

/* Знижка — лівий верхній кут */
.product-card__badge--sale {
  top: 8px !important;
  left: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 2px 7px !important;
  border-radius: 5px !important;
  background: #e53935 !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.5 !important;
  letter-spacing: 0.02em !important;
}

.product-card__badge--sale:empty {
  display: none !important;
}

/* Новинка — під бейджем знижки */
.product-card__badge--new {
  top: 34px !important;   /* 8px відступ + ~20px висота sale + 6px gap */
  left: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
}

/* Якщо знижки немає — новинка іде нагору */
.product-card__badge--sale:empty ~ .product-card__badge--new {
  top: 8px !important;
}

.product-card__badge--new .badge.new,
.product-card__badge--new .badge {
  display: inline-flex !important;
  align-items: center !important;
  padding: 2px 7px !important;
  border-radius: 5px !important;
  background: var(--primary) !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.5 !important;
}

/* --------------------------------------------------
   5. КНОПКА ВІШЛІСТА (лайк) — правий верхній кут
   -------------------------------------------------- */
.product-card__badge .icon__like {
  top: 8px !important;
  right: 8px !important;
  left: auto !important;
}

/* Прибираємо зайві стилі обгортки */
.icon__like .tinv-wraper {
  position: relative !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Кнопка — кружечок з серцем */
.icon__like .tinvwl_add_to_wishlist_button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid #e0e0e0 !important;
  cursor: pointer !important;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease !important;
  text-decoration: none !important;
}

/* Іконка серця (шрифт TI Wishlist) */
.icon__like .tinvwl_add_to_wishlist_button::before {
  font-size: 13px !important;
  color: #bbb !important;
  line-height: 1 !important;
  transition: color 0.2s ease !important;
}

/* Hover */
.icon__like .tinvwl_add_to_wishlist_button:hover {
  background: #fff !important;
  border-color: #e53935 !important;
  transform: scale(1.08) !important;
}

.icon__like .tinvwl_add_to_wishlist_button:hover::before {
  color: #e53935 !important;
}

/* Товар вже у вішлісті */
.icon__like .tinvwl_add_to_wishlist_button.tinvwl-product-in-list {
  background: #fff !important;
  border-color: #e53935 !important;
}

.icon__like .tinvwl_add_to_wishlist_button.tinvwl-product-in-list::before {
  color: #e53935 !important;
}

/* Тултіп — ховаємо, він перекриває картку */
.icon__like .tinvwl-tooltip {
  display: none !important;
}

/* --------------------------------------------------
   6. ТІЛО КАРТКИ
   -------------------------------------------------- */
.product-card__body {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 10px 12px 12px !important;
  border-top: 1px solid #f0f0f0 !important;
}

.product-card__body-wrap {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}

/* --------------------------------------------------
   7. НАЗВА
   -------------------------------------------------- */
.product-card__name {
  margin: 0 0 10px !important;
  flex-shrink: 0 !important;
}

.product-card__name a {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  font-variation-settings: "wght" 625;
  line-height: 1.45 !important;
  color: var(--title) !important;
  text-decoration: none !important;
  min-height: calc(13px * 1.45 * 2) !important;
  transition: color 0.2s ease !important;
}

.product-card__name a:hover {
  color: var(--primary) !important;
}


/* --------------------------------------------------
   БРЕНД під назвою товару
   -------------------------------------------------- */
.product-card__body .meta__brand {
  margin: -6px 0 8px !important;
  line-height: 1 !important;
}

.product-card__body .meta__brand .item {
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
}

/* "Бренд:" — ховаємо або робимо сірим */
.product-card__body .meta__brand .prefix {
  display: none !important;
}

/* Назва бренду */
.product-card__body .meta__brand .text a {
  font-size: 11px !important;
  font-weight: 500 !important;
  font-variation-settings: "wght" 525;
  color: var(--title) !important;
  text-decoration: none !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  transition: color 0.2s ease !important;
}

.product-card__body .meta__brand .text a:hover {
  color: var(--primary) !important;
}

/* --------------------------------------------------
   8. ЦІНА
   -------------------------------------------------- */
.product-card__price {
  margin-top: auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
}

.product-card__price-wrap {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}

.product-card__price-current .price {
  margin: 0 !important;
  display: flex !important;
  align-items: baseline !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
}

.product-card__price-current .price ins {
  text-decoration: none !important;
}

.product-card__price-current .price ins .woocommerce-Price-amount,
.product-card__price-current .price > .woocommerce-Price-amount {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: var(--primary) !important;
  line-height: 1 !important;
}

.product-card__price-current .price del {
  opacity: 1 !important;
}

.product-card__price-current .price del .woocommerce-Price-amount {
  font-size: 16px !important;
  font-weight: 400 !important;
  color: #0070c9 !important;
  text-decoration: line-through !important;
}

.product-card__price-current .woocommerce-Price-currencySymbol {
  font-size: 0.8em !important;
}

/* --------------------------------------------------
   9. НАЯВНІСТЬ
   -------------------------------------------------- */
.product-card__stock .stock {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--bricks-color-green) !important;
  margin: 0 !important;
}

.product-card__stock .low-stock {
  color: #e65100 !important;
}

.product-card__stock .out-of-stock {
  color: #c62828 !important;
}

/* --------------------------------------------------
   10. РЕЙТИНГ — ховаємо якщо 0
   -------------------------------------------------- */
.product-card__rating {
  display: flex !important;
  align-items: center !important;
}

.product-card__rating .star-rating {
  font-size: 11px !important;
}

.product-card__rating:has([style*="width:0%"]) {
  display: none !important;
}



/* --------------------------------------------------
   ЛІЧИЛЬНИК КІЛЬКОСТІ НА КАРТЦІ КАТАЛОГУ
   -------------------------------------------------- */
.gf-card-qty {
   width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border: 1.5px solid #e8e8e8 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    margin-bottom: 8px !important;
    height: 36px !important;
}

.gf-card-qty__btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 100% !important;
    background: none !important;
    border: none !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    color: var(--title) !important;
    cursor: pointer !important;
    transition: background 0.15s, color 0.15s !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
    padding: 0 !important;
}

.gf-card-qty__btn:hover {
    background: #f5f5f5 !important;
    color: var(--primary) !important;
}

.gf-card-qty__val {
    flex: 1 !important;
    text-align: center !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--title) !important;
    border-left: 1.5px solid #e8e8e8 !important;
    border-right: 1.5px solid #e8e8e8 !important;
    line-height: 36px !important;
    user-select: none !important;
}

/* Мобільний — трохи менший */
@media (max-width: 600px) {
    .gf-card-qty {
        height: 32px !important;
    }

    .gf-card-qty__btn {
        width: 32px !important;
        font-size: 16px !important;
    }

    .gf-card-qty__val {
        font-size: 13px !important;
        line-height: 32px !important;
    }
}





/* --------------------------------------------------
   11. КНОПКА "КУПИТИ"
   -------------------------------------------------- */
.product-card__actions-wrap {
  margin-top: 10px !important;
  flex-shrink: 0 !important;
}

.product-card__actions-wrap .button,
.product-card__actions-wrap .btn,
.product-card__actions-wrap a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  padding: 9px 14px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-align: center !important;
  text-decoration: none !important;
  cursor: pointer !important;
  border: none !important;
  background: var(--primary) !important;
  color: #fff !important;
  transition: background 0.2s ease, transform 0.12s ease !important;
  white-space: nowrap !important;
  letter-spacing: 0.01em !important;
}

.product-card__actions-wrap .button:hover,
.product-card__actions-wrap .btn:hover,
.product-card__actions-wrap a:hover {
  background: var(--primary-l-1) !important;
  color: #fff !important;
}


/* --- Стан: товар додано в кошик --- */

/* Ховаємо кнопку "Переглянути кошик" */
.product-card__actions-wrap a.added_to_cart {
  display: none !important;
}

/* Кнопка після додавання — сіра, недоступна */
.product-card__actions-wrap .button.added {
  background: var(--title) !important;
  color: #fff !important;
  pointer-events: none !important;
  opacity: 0.75 !important;
  font-size: 0 !important;        /* ховаємо оригінальний текст WC */
}

.product-card__actions-wrap .button.added::before {
  content: "✓ В кошику" !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}




/* --------------------------------------------------
   12. HOVER-АНІМАЦІЇ (тільки миша)
   -------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {

  .product-card:hover {
    border-color: #d8d8d8 !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-3px) !important;
    z-index: 1 !important;
  }

  .product-card:hover .product-card__wrap-image img,
  .product-card:hover .product-card__image img {
    transform: scale(1.04) !important;
  }

  .product-card:hover .product-card__name a {
    color: var(--primary) !important;
  }

  .product-card__actions-wrap .button:active,
  .product-card__actions-wrap .btn:active,
  .product-card__actions-wrap a:active {
    transform: scale(0.97) !important;
  }
}

/* --------------------------------------------------
   13. АДАПТИВ
   -------------------------------------------------- */
@media (max-width: 1024px) {
  .product-card__grid,
  ul.products {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)) !important;
    gap: 12px !important;
  }
}

@media (max-width: 600px) {
  .product-card__grid,
  ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .product-card__body {
    padding: 8px 10px 10px !important;
  }

  .product-card__name a {
    font-size: 12px !important;
  }

  .product-card__price-current .price ins .woocommerce-Price-amount,
  .product-card__price-current .price > .woocommerce-Price-amount {
    font-size: 15px !important;
  }

  .product-card__actions-wrap .button,
  .product-card__actions-wrap .btn,
  .product-card__actions-wrap a {
    padding: 8px 10px !important;
    font-size: 12px !important;
  }
}