.single-product {
  padding: 0 0 10px 0;
  margin-top: 15px;
  background: #f8f8f8;
}

.product-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 4vw, 40px);
}

.left-column {
  min-width: 0;
}

/* =========     ГАЛЕРЕЯ ТОВАРУ ===============*/
.product-gallery {
  position: relative;
}

.product-main-image {
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 7 / 4;
  max-width: 700px;
  margin: 0 auto;
}

.product-main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  transition: transform 0.3s ease;
  transform-origin: center center;
}

/* Стрілки в слайдері головного фото товару */
.product-gallery-btn {
  background: rgba(255, 255, 255, 0.726);
  color: #790000;
  width: 44px;
  height: 44px;
  font-size: 42px;
  cursor: pointer;
  border-radius: 50%;

  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;

  display: flex;
  justify-content: center;
  align-items: center;
  transition:
    background 0.3s ease,
    transform 0.3s ease,
    color 0.3s ease;
}

.product-gallery-btn:hover {
  background: #af0b0b;
  border-color: #ffffff;
  color: #ffffff;
  transform: translateY(-50%) scale(1.1);
}

.product-gallery-btn--prev {
  left: 10px;
}

.product-gallery-btn--next {
  right: 10px;
}

/*======== Кнопка лупи ======*/
.zoom-icon {
  position: absolute;
  right: 12px;
  top: 12px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* ============ Мініатюри під головним фото ========= */
.product-thumbs-wrapper {
  position: relative;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  overflow: hidden;
}

.product-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 5px 0;
  scrollbar-width: none;
  max-width: 100%;
  justify-content: flex-start;
  white-space: nowrap;
}
.product-thumbs::-webkit-scrollbar {
  display: none;
}

.product-thumbs img {
  flex: 0 0 clamp(75px, 10vw, 140px);
  height: clamp(75px, 10vw, 140px);
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.product-thumbs img:hover,
.product-thumbs img.active {
  border-color: #b22222;
  transform: scale(1.01);
}

/* ========= Скролбар під мініатюрами ============*/
.thumbs-scrollbar {
  margin-top: 12px;
  display: flex;
  align-items: center;
  width: 100%;
}

.thumbs-arrow {
  width: 28px;
  height: 14px;
  background: #e0e0e0;
  border-radius: 6px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

.thumbs-arrow::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: #444;
  border-top: 3px solid #555;
  border-right: 3px solid #555;
  top: 50%;
  left: 50%;
}

.thumbs-arrow.left::before {
  transform: translate(-50%, -50%) rotate(-135deg);
}
.thumbs-arrow.right::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
.thumbs-arrow:hover {
  background: #d5d5d5;
}

.thumbs-track {
  flex: 1;
  height: 14px;
  background: #e0e0e0;
  border-radius: 8px;
  position: relative;
  margin: 0 4px;
}

.thumbs-thumb {
  height: 14px;
  background: #777;
  border-radius: 4px;
  position: absolute;
  left: 0;
  top: 0;
}

/* ======== Модальне вікно при кліку на головному фото ======*/
.image-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  cursor: zoom-out;
  align-items: center;
  justify-content: center;
}

/* Стилі для зображення в модальному вікні */
.modal-image {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: default;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Скидання стилів кнопок модалки (вони стали <button>, треба прибрати дефолтні рамки/фон) */
.close-modal,
.modal-prev,
.modal-next {
  background: none;
  border: none;
  cursor: pointer;
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  color: white;
}

.modal-prev,
.modal-next {
  position: absolute;
  top: 50%;
  color: white;
  font-size: 50px;
  user-select: none;
  padding: 10px;
}

.modal-prev {
  left: 30px;
}
.modal-next {
  right: 30px;
}

/* Фокус для кнопок модалки (видимий на темному фоні) */
.close-modal:focus-visible,
.modal-prev:focus-visible,
.modal-next:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  border-radius: 4px;
}

/* =====================================================
   WOOCOMMERCE ВАРІАЦІЇ: УПРАВЛІННЯ ЗА ТИПОМ ТОВАРУ
   ===================================================== */

/* --- ТКАНИНИ: ховаємо стандартний WC select та кнопку reset --- */
.product-display-fabric .variations,
.product-display-fabric .variations_form .reset_variations {
  display: none;
}

/*
  .woocommerce-variation ховаємо візуально, але залишаємо для JS
*/
.product-display-fabric .woocommerce-variation {
  visibility: hidden;
  height: 0;
  overflow: hidden;
}

/* --- ІНШІ ТИПИ: стандартне відображення --- */
.product-display-foam .variations,
.product-display-accessories .variations,
.product-display-simple .variations {
  display: table;
}

/* --- КРУЖЕЧКИ (.product-colors): тільки для тканин --- */
.product-display-fabric .product-colors {
  display: block;
}

.product-display-foam .product-colors,
.product-display-accessories .product-colors,
.product-display-simple .product-colors {
  display: none;
}

/* =====================================================
   КРУЖЕЧКИ ВИБОРУ КОЛЬОРУ ТКАНИНИ
   ===================================================== */

.product-colors {
  margin-bottom: 30px;
}

.product-colors h4 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #333;
}

.color-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.color-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 60px;
}

.color {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #ccc;
  overflow: hidden;
  padding: 0;
  background: none;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.color img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.color:hover {
  transform: scale(1.15);
  border-color: #000;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.25);
}

.color.active {
  transform: scale(1.15);
  outline: 1px solid #767677;
  outline-offset: 1px;
}

/* Кружечок — відсутній колір */
.color.is-out-of-stock {
  opacity: 0.4;
  cursor: not-allowed;
  position: relative;
}

.color.is-out-of-stock::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    transparent calc(50% - 1px),
    #b22222 calc(50% - 1px),
    #b22222 calc(50% + 1px),
    transparent calc(50% + 1px)
  );
  pointer-events: none;
}

/* Повідомлення "Цей колір тимчасово відсутній" */
.stock-notice {
  font-size: 14px;
  color: #b22222;
  background: #fff0f0;
  border: 1px solid #f5c6c6;
  border-radius: 6px;
  padding: 8px 14px;
  margin-top: 10px;
  animation: fadeInNotice 0.2s ease;
}

@keyframes fadeInNotice {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.color-name {
  margin-top: 6px;
  font-size: 13px;
  color: #555;
  text-align: center;
  line-height: 1.2;
  user-select: none;
}

/* =======================Блок з інформацією===================================*/
.single-product-info {
  min-width: 0;
}

.single-product {
  margin-bottom: 10px;
}

.single-product-info .product-title--single {
  font-size: clamp(20px, 4vw, 30px);
  font-weight: 700;
}
.product-status {
  color: #2e7d32;
  font-size: 16px;
  font-weight: 600;

  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.product-status::before {
  content: "✓";
  color: #2e7d32;
  font-weight: bold;
}

.product-specs-title {
  font-size: 18px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 10px;
  color: #222;
}

.product-specs {
  list-style: none;
  padding: 0;
  margin-bottom: clamp(10px, 3vw, 20px);
  font-size: 15px;
}

.product-specs li {
  margin-bottom: 4px;
}

.product-price {
  margin-bottom: 15px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

#price-display {
  color: #790000;
  font-size: clamp(18px, 4vw, 22px);
  font-weight: 700;
}

#price-display del {
  color: #999;
  font-size: 16px;
  font-weight: 400;
  text-decoration: line-through;
  margin-right: 4px;
}

#price-display ins {
  color: #790000;
  font-size: clamp(18px, 4vw, 22px);
  font-weight: 700;
  text-decoration: none;
}

.product-price .price-unit {
  color: #790000;
  font-size: 20px;
  font-weight: 600;
}

/* приховую значок гривні (для не-варіативних товарів) */
.product-price .woocommerce-Price-currencySymbol {
  display: none;
}
/* ======== Кількість товару (woo + кастомні кнопки) ==================*/
.quantity,
.product-quantity {
  display: flex;
  gap: 10px;
  align-items: center;
}
.product-quantity {
  margin-bottom: 20px;
}
.quantity input,
.product-quantity input {
  width: 80px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  text-align: center;
  -moz-appearance: textfield;
}

.quantity input::-webkit-outer-spin-button,
.quantity input::-webkit-inner-spin-button,
.product-quantity input::-webkit-outer-spin-button,
.product-quantity input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-btn {
  width: 42px;
  height: 42px;
  border: 1px solid #ccc;
  background: #f8f8f8;
  border-radius: 6px;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

.qty-btn:hover {
  background: #eaeaea;
}

/* Кнопка "Додати до кошика" */
.single-product .btn-add {
  background: #b22222;
  color: #fff;
  padding: 10px clamp(14px, 5vw, 32px);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
}

.single-product .btn-add:hover {
  background: #921c1c;
}
/* ============================================ */
.product-description,
.product-features,
.product-delivery {
  margin-top: 10px;
}

/* ========= Блок з оплатою/доставкою та відео =============*/
.product-extra {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0;
}

.info-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ========= Блок з Увага колір! =============*/
.product-warning {
  border: 1px solid #b22222;
  padding: clamp(5px, 2vw, 10px);
  border-radius: 6px;
  font-size: clamp(12px, 2vw, 14px);
}

.product-warning--desktop {
  display: block;
  margin-top: 38px;
}

.product-warning--mobile {
  display: none;
}
/* ========= Блок з іконками догляду =============*/
.product-care {
  margin-top: 30px;
}

.care-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
}

.care-list {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.care-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100px;
}

.care-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 8px;
  transition: transform 0.2s;
}

.care-item span {
  font-size: 14px;
  color: #333;
}

.care-item:hover img {
  transform: scale(1.1);
}

/* ========= Іконки оплати ================*/
.payment-icons {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.payment-icons img {
  width: 46px;
  height: 30px;
}

/* ========= Іконки доставки ============*/
.delivery-icons {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.delivery-icons .logo-nova-poshta {
  height: 25px;
  width: auto;
}

.delivery-icons .logo-ukrposhta {
  height: 18px;
  width: auto;
}

.delivery-icons .logo-meest {
  height: 15px;
  width: auto;
}

/* ========= Стилі ДОСТАВКИ/ОПЛАТИ =============*/
.order-info {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* =============================== */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 12px;
  overflow: hidden;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.video-title {
  font-size: clamp(18px, 4vw, 20px);
  font-weight: 600;
  margin: 0 0 15px 0;
  color: #222;
  line-height: 1.3;
}

/* ===== СТИЛІ ДЛЯ ПОВІДОМЛЕНЬ про успішне додавання до кошика ===== */
.woocommerce-notices-wrapper {
  position: fixed;
  top: 50px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
  width: calc(100% - 40px);
  pointer-events: none;
}

.woocommerce-message,
.woocommerce-error {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 20px;
  margin-bottom: 10px;
  border-radius: 8px;
  opacity: 0;
  transform: translateX(30px);
  animation: slideInRight 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  will-change: transform, opacity;
  transition: all 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.woocommerce-message {
  background-color: #e8f5e9;
  border-left: 1px solid #b22222;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.woocommerce-error {
  background-color: #fff0f0;
  border-left: 4px solid #d32f2f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.woocommerce-message:focus,
.woocommerce-message:focus-visible,
.woocommerce-error:focus,
.woocommerce-error:focus-visible,
.woocommerce-notices-wrapper:focus,
.woocommerce-notices-wrapper:focus-visible {
  outline: none;
  box-shadow: none;
}

.woocommerce-message::before {
  content: "✓";
  font-weight: bold;
  font-size: 18px;
  background-color: #2e7d32;
  color: white;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
}

.woocommerce-error::before {
  content: "✕";
  font-weight: bold;
  font-size: 18px;
  background-color: #d32f2f;
  color: white;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
}

.woocommerce-message .button,
.woocommerce-error .button {
  background-color: #b22222;
  color: #fff;
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
  display: inline-block;
  line-height: 1.4;
  cursor: pointer;
  margin-left: 10px;
}

.woocommerce-message .button:hover {
  background-color: #921c1c;
}

.woocommerce-error .button {
  background-color: #d32f2f;
}

.woocommerce-error .button:hover {
  background-color: #b71c1c;
}

.woocommerce-error li {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
}

/* Стиль фокусу для кнопок галереї, кружечків, скролбару */
.product-gallery-btn:focus-visible,
.color:focus-visible,
.thumbs-arrow:focus-visible {
  outline: 2px solid #b22222;
  outline-offset: 2px;
}

/* ===== АНІМАЦІЯ ===== */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==========АДАПТИВ========*/
@media (max-width: 768px) {
  .product-wrapper {
    grid-template-columns: 1fr;
  }
  .product-extra {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 2rem 0;
  }
  .media-column {
    order: 1;
  }
  .info-column {
    order: 2;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
  .product-care {
    order: 1;
    margin-top: 0;
  }
  .order-info {
    order: 2;
    gap: 30px;
  }
  .video-title {
    margin-bottom: 12px;
  }
  .woocommerce-notices-wrapper {
    top: 70px;
    left: 10px;
    right: 10px;
    width: auto;
  }
  .woocommerce-message,
  .woocommerce-error {
    width: auto;
    max-width: 100%;
    font-size: 14px;
    padding: 10px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .woocommerce-message .button,
  .woocommerce-error .button {
    align-self: flex-end;
  }
  .product-warning--desktop {
    display: none;
  }
  .product-warning--mobile {
    display: block;
    margin-top: 12px;
  }
  .single-product-info {
    display: flex;
    flex-direction: column;
  }
  .product-title {
    order: 1;
  }
  .product-status {
    order: 2;
    margin-bottom: 12px;
  }
  .product-price {
    order: 3;
  }
  .product-colors {
    order: 4;
  }
  .cart {
    order: 5;
  }
  .product-short-description {
    order: 6;
  }
  .product-warning--mobile {
    order: 7;
  }
  .product-specs-title,
  .product-specs {
    order: 8;
  }
  .product-title--single {
    margin-bottom: 8px;
  }
}

@media (min-width: 769px) and (max-width: 870px) {
  .quantity,
  .product-quantity {
    gap: 6px;
  }
  .single-product .btn-add {
    padding: 10px;
  }
}

@media (min-width: 871px) {
  .single-product .btn-add {
    padding: 10px 32px;
  }
}

@media (max-width: 415px) {
  .quantity,
  .product-quantity {
    gap: 4px;
  }
  .single-product .btn-add {
    font-size: 15px;
    padding: 10px 7px;
  }
}
