section:last-of-type {
  margin-bottom: 0 !important;
}

.product-view {
  display: flex;
  align-items: flex-start;
  width: 100%;
}

.product-view__gallery {
  width: 50%;
  display: flex;
  flex-direction: column;
}

.product-view__img-link {
  display: block;
  width: 100%;
  cursor: zoom-in;
  background-color: #eeedeb;
}

.product-view__img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.product-view__sidebar {
  width: 50%;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding-top: 60px;
  scrollbar-width: none;
}
.product-view__sidebar::-webkit-scrollbar {
  display: none;
}

.product-view__info {
  max-width: 420px;
  margin: 0 auto;
  padding-bottom: 70px;
  position: relative;
}

.product-view__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  gap: 20px;
  margin-bottom: 15px;
}

.product-view__title {
  font-size: 20px;
  font-weight: 400;
  margin: 0;
}

.product-view__tools {
  display: flex;
  gap: 15px;
  flex-shrink: 0;
  padding-top: 2px;
}

.product-view__tool-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #000;
  width: 20px;
  height: 20px;
  transition:
    transform 0.3s ease,
    color 0.3s ease;
}

.product-view__tool-btn:hover,
.product-view__tool-btn.is-active {
  transform: scale(1.1);
  color: var(--color-secondary-dark);
}

.product-view__tool-btn svg {
  width: 100%;
  height: 100%;
}
.product-view__meta {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #ddbb76;
  margin-bottom: 24px;
}

.product-view__sku {
  font-family: "Switzer", sans-serif;
  color: #bcbcbc;
}

.product-view__size-controls {
  display: flex;
  gap: 30px;
  margin-bottom: 20px;
  position: relative;
  border-top: 0.4px solid #818181;
  border-bottom: 0.4px solid #818181;
}

.product-view__size-dropdown {
  flex: 1;
  position: relative;
}

.product-view__size-btn {
  width: 100%;
  padding: 16px 0;
  background: none;
  border: none;
  color: #000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
}

.product-view__size-arrow {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.3s ease;
}

.product-view__size-dropdown.is-active .product-view__size-arrow {
  transform: translateY(2px) rotate(-135deg);
}

.product-view__size-list {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--color-white);
  border: 1px solid #eaeaea;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  list-style: none;
  padding: 10px 0;
  margin: 0;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.product-view__size-dropdown.is-active .product-view__size-list {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.product-view__size-list a {
  font-family: "Switzer", sans-serif;
  display: block;
  padding: 8px 15px;
  text-decoration: none;
  color: var(--color-primary);
  transition: background 0.3s ease;
}

.product-view__size-list a:hover {
  background: #f8f8f8;
}

.product-view__guide-btn {
  background-color: #fae8c3;
  border: none;
  padding: 16px 25px;
  color: #000;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  transition: filter 0.3s ease;
}

.product-view__guide-btn:hover {
  filter: brightness(0.95);
}

.product-view__variations-slider {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 0.4px solid #818181;
}

.product-view__var {
  display: block;
  width: 120px;
  height: 120px;
  border: 1px solid transparent;
  background-color: #f8f8f8;
  transition: border-color 0.3s ease;
}

.product-view__var img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-view__var:hover,
.product-view__var.active {
  border-color: #000;
}

.product-view__price-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}

.product-view__price {
  font-family: "Switzer", sans-serif;
  font-size: 24px;
  text-align: center;
  margin-bottom: 5px;
}

.product-view__qty-badge {
  font-size: 13px;
  color: #8e8e8e;
}

.product-view__qty-badge span {
  font-family: "Switzer", sans-serif;
  color: #000;
  font-weight: 500;
}

.product-view__cart-action {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background-color: #fff2d6;
  padding: 5px;
  border-radius: 50px;
  margin-bottom: 30px;
}

.product-view__qty-btn {
  width: 37px;
  height: 37px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.product-view__add-btn {
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  height: 37px;
  width: 100%;
  max-width: 315px;
  padding: 0 40px;
  border-radius: 20px;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.product-view__qty-btn:hover,
.product-view__add-btn:hover {
  transform: scale(1.05);
}

.product-view__description {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.js-desc-text {
  font-family: "Switzer", sans-serif;
  color: #535353;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 5px;
  transition: all 0.3s ease;
}

.js-desc-text.is-expanded {
  -webkit-line-clamp: unset;
}

.product-view__read-more {
  font-family: "Switzer", sans-serif;
  background: none;
  border: none;
  color: #dfbf7e;
  padding: 0;
  cursor: pointer;
  font-size: 14px;
}

.product-view__accordions {
  border-top: 0.4px solid #818181;
}

.product-accordion {
  border-bottom: 0.4px solid #818181;
}

.product-accordion__title {
  padding: 12px 0;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
}

.product-accordion__title::-webkit-details-marker {
  display: none;
}

.product-accordion__icon {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.3s ease;
  margin-right: 5px;
}

.product-accordion__icon::before,
.product-accordion__icon::after {
  display: none !important;
}

.product-accordion[open] .product-accordion__icon {
  transform: translateY(2px) rotate(-135deg);
}

.product-accordion__title::-webkit-details-marker {
  display: none;
}

.product-accordion__content {
  font-family: "Switzer", sans-serif;
  padding-bottom: 15px;
  padding-left: 15px;
  font-size: 14px;
  line-height: 1.5;
  color: #000;
}

/* =================================================_
   СХОЖИЕ ТОВАРЫ (СЕТКА)
   ================================================= */
.related-products {
  background-color: #fff2d6;
  padding: 20px 0;
}

.related-products__title {
  font-size: 24px;
  margin-bottom: 20px;
}

.related-grid {
  display: grid;
  gap: 25px;
}

/* Если ровно 5 товаров */
.related-grid--count-5 {
  grid-template-columns: repeat(4, 1fr);
}
.related-grid--count-5 .product-card--large {
  grid-column: span 2;
  grid-row: span 2;
}
.related-grid--count-5 .product-card--large .product-card__image-wrap {
  height: 100%;
  aspect-ratio: auto;
}

/* Если товаров меньше 5 - обычная сетка */
.related-grid--count-4 {
  grid-template-columns: repeat(4, 1fr);
}
.related-grid--count-3 {
  grid-template-columns: repeat(3, 1fr);
}
.related-grid--count-2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 800px;
}
.related-grid--count-1 {
  grid-template-columns: 1fr;
  max-width: 350px;
}

/* Карточка товара */
.product-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.product-card__global-link {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
}

.product-card__image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background-color: #f8f8f8;
  overflow: hidden;
}

.product-card__badge {
  position: absolute;
  top: 15px;
  left: 15px;
  font-size: 10px;
  z-index: 3;
}

.product-card__badge--sale {
  color: #d9534f;
  font-weight: 500;
}

.product-card__favorite {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-primary);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 3;
  padding: 0;
}

.product-card__favorite svg {
  width: 16px;
  height: 16px;
  display: block;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-fav__outline {
  transition: opacity 0.3s ease;
  opacity: 1;
}
.icon-fav__solid {
  transition: opacity 0.3s ease;
  opacity: 0;
}

.product-card:hover .product-card__favorite,
.product-card__favorite.is-active {
  opacity: 1;
  transform: translateY(0);
}
.product-card__favorite:hover svg {
  transform: scale(1.15);
}
.product-card__favorite.is-active {
  color: var(--color-secondary-dark);
}
.product-card__favorite.is-active .icon-fav__outline {
  opacity: 0;
}
.product-card__favorite.is-active .icon-fav__solid {
  opacity: 1;
}

.product-card__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.5s ease;
}

.product-card__img--secondary {
  opacity: 0;
}
.product-card:hover .product-card__img--secondary {
  opacity: 1;
}

.product-card__info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

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

.product-card__name {
  font-size: 14px;
  color: var(--color-primary);
}

.product-card__price-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-card__price {
  font-family: "Switzer", sans-serif;
  font-size: 12px;
}
.product-card__price-old {
  font-family: "Switzer", sans-serif;
  font-size: 10px;
  color: #8e8e8e;
  text-decoration: line-through;
}

.product-card__add {
  background: none;
  border: none;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  z-index: 3;
}

.product-card__add-icon {
  position: relative;
  width: 14px;
  height: 14px;
  transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.product-card__add-icon::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  width: 14px;
  height: 1.5px;
  background-color: var(--color-primary);
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.product-card__add-icon::after {
  content: "";
  position: absolute;
  top: 0;
  left: 6px;
  width: 1.5px;
  height: 14px;
  background-color: var(--color-primary);
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.product-card__add.is-added .product-card__add-icon {
  transform: rotate(405deg);
}
.product-card__add.is-added .product-card__add-icon::before {
  width: 5px;
  top: 10px;
  left: 3px;
}
.product-card__add.is-added .product-card__add-icon::after {
  height: 9px;
  top: 2px;
  left: 6.5px;
}

/* МОДАЛЬНОЕ ОКНО */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #fff;
  padding: 30px;
  width: 90%;
  max-width: 600px;
  position: relative;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal-overlay.is-active .modal {
  transform: translateY(0);
}

.modal__title {
  margin-bottom: 20px;
}

.modal__close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal__close::before,
.modal__close::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 1.5px;
  background: var(--color-primary);
  transition: background-color 0.3s ease;
}

.modal__close::before {
  transform: rotate(45deg);
}
.modal__close::after {
  transform: rotate(-45deg);
}

.modal__close:hover {
  transform: rotate(90deg) scale(1.1);
}
.modal__close:hover::before,
.modal__close:hover::after {
  background-color: var(--color-secondary-dark);
}

.wd-sizeguide-table {
  width: 100% !important;
  border-collapse: collapse !important;
  text-align: left;
  font-size: 14px;
  margin-bottom: 0;
}

.wd-sizeguide-table th,
.wd-sizeguide-table td {
  font-family: "Switzer", sans-serif;
  padding: 10px;
  border-bottom: 1px solid #eaeaea;
}

.wd-sizeguide-table th {
  font-weight: 600;
}
.woocommerce a.added_to_cart{
  display: none !important;
}

/* ==========================================
   СТИЛІ ДЛЯ СТАРОЇ (ПЕРЕКРЕСЛЕНОЇ) ЦІНИ
   ========================================== */
.product-view__price del {
  font-family: "Switzer", sans-serif;
  font-size: 14px;
  color: #8e8e8e;
  margin-right: 8px;
  text-decoration: none;
}

.product-view__price del .amount {
  text-decoration: line-through;
}

/* ==========================================
   СТИЛІ ДЛЯ НОВОЇ (АКТУАЛЬНОЇ) ЦІНИ
   ========================================== */
.product-view__price ins {
  text-decoration: none; 
}

.product-view__price ins .amount {
  color: var(--color-primary, #000);
  font-weight: 500;
}

.product-view__price > .amount {
  text-decoration: none;
  font-weight: 500;
}

/* ==========================================
   АДАПТИВНОСТЬ
   ========================================== */
@media (max-width: 992px) {
  .product-view {
    flex-direction: column;
  }
  .product-view__gallery {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .product-view__img-link {
    flex: 0 0 100%;
    scroll-snap-align: start;
  }
  .product-view__sidebar {
    width: 100%;
    position: static;
    height: auto;
    padding-top: 13px;
  }

  .product-view__info {
    max-width: 100%;
    padding: 0 20px 20px;
  }

  /* На планшетах сбрасываем всё в 2 колонки */
  .related-grid--count-5,
  .related-grid--count-4,
  .related-grid--count-3,
  .related-grid--count-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Если карточка большая (при 5 товарах), пусть занимает всю ширину ряда */
  .related-grid--count-5 .product-card--large {
    grid-column: span 2;
    grid-row: auto;
  }
}

@media (max-width: 768px) {
  /* На мобильных всё в 1 колонку */
  .related-grid {
    grid-template-columns: 1fr !important;
  }

  .related-products__title {
    font-size: 20px;
  }

  /* Сбрасываем большую карточку */
  .product-card--large {
    grid-column: span 1 !important;
  }

  .product-card--large .product-card__image-wrap {
    min-height: 367px;
  }

  .product-card__image-wrap {
    max-height: 367px;
  }
}