/* ==========================================================================
   Стилі сторінки товару (Точна відповідність файлу single-product.php)
   ========================================================================== */

/* Загальний контейнер */
.product-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  color: rgba(var(--clr-dark), 1);
}

/* Хлібні крихти RankMath */
.product-breadcrumbs {
  margin-bottom: 25px;
  color: rgba(var(--clr-dark), 0.7);
}
.product-breadcrumbs a {
  color: rgba(var(--clr-secondary), 1);
  text-decoration: none;
  transition: color 0.2s ease;
}
.product-breadcrumbs a:hover {
  color: rgba(var(--clr-accent), 1);
}

/* Головна секція (Фотогалерея + Інформація) */
.product-main-section {
  display: flex;
  gap: 40px;
  margin-bottom: 50px;
}
.product-media {
  flex: 1;
  max-width: 500px;
}
.product-details {
  flex: 1;
}

/* Головне фото та стікери */
.main-image {
  position: relative;
  overflow: hidden;
  background-color: rgba(var(--clr-white), 1);
  border-radius: 4px;
}
.gallery-main-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.product-badges {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.badge {
  display: inline-block;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: bold;
  color: rgba(var(--clr-white), 1);
  border-radius: 3px;
  text-transform: uppercase;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(var(--clr-black), 0.15);
}
.badge-hit {
  background-color: rgba(var(--clr-accent), 1);
}
.badge-sale,
.badge-discount {
  background-color: rgba(var(--clr-secondary), 1);
}

/* Додаткові фото */
.thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 15px;
}
.thumb-item img {
  width: 100%;
  height: auto;
  cursor: pointer;
  border: 2px solid rgba(var(--clr-light), 0.3);
  border-radius: 4px;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
.thumb-item img:hover {
  border-color: rgba(var(--clr-accent), 1);
  transform: translateY(-2px);
}

/* Текстова інформація про товар */
.product-title {
  margin-top: 0;
  font-size: 32px;
  color: rgba(var(--clr-dark), 1);
  line-height: 1.2;
}
.product-sku {
  color: rgba(var(--clr-dark), 0.6);
  margin-bottom: 20px;
  font-size: 14px;
}
.product-sku span {
  color: rgba(var(--clr-black), 1);
  font-weight: 500;
}
.product-price {
  font-size: 32px;
  font-weight: bold;
  color: rgba(var(--clr-accent), 1);
  margin-bottom: 25px;
}
.product-action-zone {
  /* margin-top: 30px; */
}

/* Інтерактивні таби */
.product-tabs-wrapper {
  margin-bottom: 50px;
}
.tabs-navigation {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  border-bottom: 2px solid rgba(var(--clr-light), 0.4);
}
.tab-trigger {
  padding: 12px 30px;
  cursor: pointer;
  font-weight: bold;
  color: rgba(var(--clr-dark), 0.7);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}
.tab-trigger:hover {
  color: rgba(var(--clr-secondary), 1);
}
.tab-trigger.active {
  border-bottom-color: rgba(var(--clr-accent), 1);
  color: rgba(var(--clr-accent), 1);
}
.tab-panel {
  display: none;
  padding: 25px 0;
  line-height: 1.6;
  color: rgba(var(--clr-dark), 0.9);
}
.tab-panel.active {
  display: block;
}
.features-text {
  /* Стилі для контенту всередині таба характеристик */
}

/* Статичні інформаційні блоки */
.product-static-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  background-color: rgba(var(--clr-light), 0.15);
  padding: 30px;
  border-radius: 6px;
  margin-bottom: 60px;
  border: 1px solid rgba(var(--clr-light), 0.3);
}
.info-card h4 {
  margin-top: 0;
  color: rgba(var(--clr-secondary), 1);
  font-size: 18px;
  margin-bottom: 10px;
}
.info-card p {
  font-size: 14px;
  color: rgba(var(--clr-dark), 0.8);
  margin: 0;
  line-height: 1.5;
}

/* Схожі товари */
.related-products-section h2 {
  margin-bottom: 30px;
  font-size: 26px;
  color: rgba(var(--clr-dark), 1);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 25px;
}
.product-card {
  background-color: rgba(var(--clr-white), 1);
  border: 1px solid rgba(var(--clr-light), 0.3);
  padding: 15px;
  border-radius: 6px;
  text-align: center;
  transition:
    box-shadow 0.3s ease,
    transform 0.3s ease;
}
.product-card:hover {
  box-shadow: 0 10px 20px rgba(var(--clr-secondary), 0.08);
  transform: translateY(-4px);
  border-color: rgba(var(--clr-light), 0.6);
}
.card-link {
  text-decoration: none;
  color: rgba(var(--clr-dark), 1);
  display: block;
}

.card-image {
  position: relative;
  overflow: hidden;
  margin-bottom: 15px;
  border-radius: 4px;

  height: 280px;
  width: 100%;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* object-fit-position: center; */

  display: block;
  transition: transform 0.3s ease;
}

/* Масштабування стікерів для карток схожих товарів */
.matrix-badges {
  top: 10px;
  left: 10px;
}
.matrix-badges .badge {
  font-size: 10px;
  padding: 4px 8px;
}

.card-title {
  font-size: 16px;
  margin: 12px 0 8px 0;
  color: rgba(var(--clr-dark), 1);
  font-weight: 600;
  line-height: 1.4;
}
.card-price {
  font-weight: bold;
  color: rgba(var(--clr-accent), 1);
  font-size: 18px;
}

/* ==========================================================================
   Адаптивність (Responsive)
   ========================================================================== */
@media (max-width: 992px) {
  .product-main-section {
    flex-direction: column;
    gap: 30px;
  }
  .product-media {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .product-static-info {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
  }
  .product-title {
    font-size: 26px;
  }
  .tab-trigger {
    padding: 10px 15px;
    font-size: 15px;
  }
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .related-grid {
    grid-template-columns: 1fr;
  }
}

/* Додаткові та оновлені класи під нові вимоги */

/* Активна мініатюра */
.thumb-item {
  border: 2px solid rgba(var(--clr-light), 0.3);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}
.thumb-item.active-thumb {
  border-color: rgba(var(--clr-accent), 1);
}

/* Обмеження висоти табів та кнопка */
.tab-scroll-wrapper {
  position: relative;
  max-height: none;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

/* Ефект плавного згасання тексту знизу, якщо він не розкритий */
/* .tab-scroll-wrapper:not(.expanded)::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: linear-gradient(transparent, rgba(var(--clr-white), 1));
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.tab-scroll-wrapper.expanded::after {
  opacity: 0;
} */

/* Ефект плавного згасання тексту знизу, ТІЛЬКИ якщо текст дійсно великий */
.tab-scroll-wrapper.has-fade::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: linear-gradient(transparent, rgba(var(--clr-white), 1));
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Якщо блок розгорнули — ховаємо градієнт */
.tab-scroll-wrapper.expanded::after {
  opacity: 0;
  display: none; /* повністю прибираємо, щоб не заважав клікам */
}

.read-more-btn {
  display: inline-block;
  margin: 15px auto 0;
  background-color: rgba(var(--clr-white), 1);
  color: rgba(var(--clr-white), 1);
  color: rgba(var(--clr-accent), 1);
  /* border: none; */
  padding: 8px 15px;
  font-size: 12px;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  border: 1px solid rgba(var(--clr-accent), 1);
}

.read-more-btn:hover {
  background-color: rgba(var(--clr-accent), 1);
  color: rgba(var(--clr-white), 1);
}

/* Форма Forminator */
.product-action-zone {
  /* margin-top: 35px;
  padding: 20px;
  background-color: rgba(var(--clr-light), 0.1);
  border-radius: 6px;
  border: 1px solid rgba(var(--clr-light), 0.2); */
}

/* Оновлена права колонка: тепер таби всередині неї */
.product-details .product-tabs-wrapper {
  margin-top: 25px;
  margin-bottom: 25px;
}



/* POPUP */
/* Кнопка поп-апу */
.product-order-popup-btn {
    display: inline-block;
    text-align: center;
    text-decoration: none;
    min-width: 250px;
    background-color: rgba(var(--clr-accent), 1);
    color: rgba(var(--clr-white), 1);
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(var(--clr-black), 0.1);
    transition: background-color 0.2s, transform 0.1s;
}
.product-order-popup-btn:hover {
    background-color: rgba(var(--clr-secondary), 1);
    color: rgba(var(--clr-white), 1);
}
.product-order-popup-btn:active {
    transform: scale(0.98);
}

/* Стилізація самого вікна, коли воно відкриється */
.product-popup-form-content {
    max-width: 500px;
    width: 100%;
    padding: 30px !important;
    border-radius: 8px;
    background-color: rgba(var(--clr-white), 1);
}
.product-popup-form-content h3 {
    margin-top: 0;
    color: rgba(var(--clr-dark), 1);
    font-size: 22px;
}
.product-popup-form-content p {
    font-size: 14px;
    color: rgba(var(--clr-dark), 0.6);
    margin-bottom: 20px;
}

#order-popup.product-popup-form-content {
    max-width: 450px !important; /* Фіксуємо акуратну ширину на десктопі */
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 35px !important;    /* Акуратні внутрішні відступи */
    border-radius: 8px !important;
    background-color: rgba(var(--clr-white), 1) !important;
    margin: 0 auto !important;
}

/* Налаштування заголовків всередині поп-апу */
#order-popup.product-popup-form-content h3 {
    margin-top: 0;
    margin-bottom: 8px;
    color: rgba(var(--clr-dark), 1);
    font-size: 24px;
    font-weight: bold;
    text-align: center; /* Центруємо для краси */
}

#order-popup.product-popup-form-content p {
    font-size: 14px;
    color: rgba(var(--clr-dark), 0.6);
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
    line-height: 1.4;
}

/* Стилізуємо хрестик закриття Fancybox, якщо він налазить на форму */
.fancybox__content .f-button.is-close-btn {
    top: 12px !important;
    right: 12px !important;
    color: rgba(var(--clr-dark), 0.5) !important;
}

/* Окремо підкоригуємо відступи для елементів Forminator всередині поп-апу */
#order-popup .forminator-custom-form {
    padding: 0 !important; /* прибираємо подвійні паддінги самої форми */
}
/* POPUP */