html, body { overflow-x: hidden; }
/* ====== Карточка товара ====== */
.product-container {
  width: 1300px;
  box-sizing: border-box;
  margin:0 auto;
  margin-bottom: 24px;margin-top: 24px;
}

.product-wrapper {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

/* Левая колонка — галерея */
.product-gallery {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  width: 50%;
}

.product-thumbs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  min-width:8%;
}
.product-thumbs img,
.product-thumbs .thumb-video {
  cursor: pointer;
  object-fit: cover;
  border: 2px solid transparent;
  transition: border 0.2s ease, transform 0.2s ease;
}

.active-thumb {
  border: 2px solid #ff7018 !important;
}

.thumb-video {
  position: relative;
  background: #222;
}
.thumb-video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-video .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  color: white;
  background: rgba(0,0,0,0.5);
  padding: 3px 6px;
  border-radius: 50%;
}
.thumbs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 700px;
  overflow: hidden;
 max-width:80px;
}
.thumbs-arrow {
  cursor: pointer;
  color: #fff;
  background: #f29100;
  padding: 6px 10px;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  transition: background 0.2s, color 0.2s;
}

.thumbs-arrow:hover {
  background: #ff9f1c;
}

.thumbs-arrow.disabled {
  background: #3a414b;
  cursor: default;
}
/* Главное изображение */
.product-main-img {
  max-width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width:47%;
  background: white;
}
.product-main-img img,
.product-main-img video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
/* .product-main-img:hover img {
  transform: scale(1.03);
  opacity: 0.95;
} */

.product-main-img:hover::after {
  opacity: 1;
}
@media (max-width: 768px) {
  .product-gallery {
    flex-direction: column;
    width: 100%;
    align-items: center;
  }
.thumbs-list {max-width:100%;}
  .product-main-img {
    order: 1; /* главное изображение первым */
    width: 100%;
    margin-bottom: 12px;
  }

   .product-thumbs {
    order: 2;
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 20px;
    margin: 0;
    justify-content: flex-start;
  }

  .product-thumbs::-webkit-scrollbar {
    display: none;
  }

  .product-thumbs img,
  .product-thumbs .thumb-video {
    flex: 0 0 auto;
    width: 70px;
    height: 100%;
    object-fit: cover;
	max-width:70px;
  }
    .thumbs-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    gap: 10px;
    padding-bottom: 5px;
  }
 }
 /*
.product-main-img::after {
  content: "";
  position: absolute;
  bottom: 15px;
  right: 15px;
  width: 24px;
  height: 24px;
  background: rgba(0,0,0,0.6) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'><path d='M10 2a8 8 0 105.293 14.293l4.707 4.707 1.414-1.414-4.707-4.707A8 8 0 0010 2zm0 2a6 6 0 110 12 6 6 0 010-12z'/></svg>") no-repeat center;
  background-size: 14px 14px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}
*/
/* Лайтбокс */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  top:0; left:0; right:0; bottom:0;
  background: rgba(0,0,0,0.9);
  align-items: center;
  justify-content: center;
}
@media (max-width: 768px) {
  .desktop-only { display: none; }
}
#lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox-content img,
#lightbox-content video {
  max-width: 80vw;
  max-height: 80vh;
  object-fit: contain;
}
@media (max-width: 768px){#lightbox-content img,
#lightbox-content video {
  max-width: 100vw;
  max-height: 100vh;
object-fit: contain;}
  #lightbox-content {
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-main-img {min-height:auto;min-width:auto;}
.product-main-img video {width: auto;height: auto;}
  }
.lightbox-close {
  position: absolute;
  top:20px;
  right:20px;
  font-size:30px;
  color:white;
  cursor:pointer;
}

/* Правая колонка — инфо */
.product-info {
  flex: 0 0 45%;
}

.product-info h1.product-title {
  font-size: 32px;
  margin-bottom: 20px;
  color: #3a414b;
  margin-top:0px;
}

.product-details h3 {
  font-size: 20px;
  margin: 20px 0 10px;
}

.product-details ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-details li {
  margin-bottom: 8px;
}

/* ====== Маркетплейсы ====== */
.product-marketplaces {
  margin-top: 30px;
}

.product-marketplaces h3 {
  font-size: 22px;
  margin-bottom: 15px;
  color: #3a414b;
}

.marketplaces-list {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.marketplaces-list a {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 12px;
  padding: 12px 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.marketplaces-list a:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.marketplaces-list img {
  max-height: 32px;
  max-width: 100px;
  object-fit: contain;
}

/* ====== Контентная часть ====== */
.product-content {
  background: #fff;
  padding: 60px 20px;
}

.product-content-inner {
  max-width: 1300px;
  margin: 0 auto;
  line-height: 161%;
}

.product-content h2 {
  font-size: 28px;
  margin-bottom: 20px;
  color: #3a414b;
}

/* ====== Инструкция ====== */
.product-instruction {
  margin-top: 25px;
}

.instruction-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.instruction-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  font-size: 15px;
  transition: all 0.3s ease;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.instruction-link .icon {
  width: 20px;
  height: 20px;
}

.instruction-link.download {
  background: #f29100;
  color: #fff;
}

.instruction-link.download:hover {
  background: #ffa733;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.instruction-link.view {
  background: #3a414b;
  color: #fff;
}

.instruction-link.view:hover {
  background: #4f5865;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Мобильная версия */
@media (max-width: 600px) {
  .instruction-buttons {
    flex-direction: column;
  }
  .instruction-link {
    justify-content: center;
    width: 100%;
  }
}

/* ====== Рекомендации ====== */
.recommendations {
  padding: 60px 20px;
  max-width: 1300px;
  margin: 0 auto;
}

.recommendations h2 {
  font-size: 28px;
  margin-bottom: 30px;
  text-align: center;
}

.subsection-posts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.sub-post {
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.sub-post-preview {
  position: relative;
  overflow: hidden;
}

.sub-post-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  color: #fff;
  padding: 10px;
}

.sub-post-overlay h4 {
  margin: 0 0 5px;
  font-size: 16px;
}

.sub-post-overlay p {
  margin: 0;
  font-size: 14px;
  color: #f29100;
}

/* ====== Адаптив ====== */
@media (max-width: 1024px) {
  .product-wrapper {
    gap: 20px;
  }
  .subsection-posts {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .product-wrapper {
    flex-direction: column;
  }
.breadcrumbs {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  line-height: 1.4;
  padding:20px;
  padding-top:44px;
}
  .product-gallery,
  .product-info {
    flex: 0 0 100%;
  }
  .product-info {padding: 0 20px;}
.thumbs-arrow {display:none;}
  .product-info h1.product-title {
    text-align: center;
    font-size: 26px;
  }

  .subsection-posts {
    grid-template-columns: 1fr;
  }

  .recommendations h2 {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .instruction-link {
    padding: 10px 18px;
    font-size: 14px;
  }
}
.product-excerpt {
  font-size: 16px;
  color: #555;
  margin: -10px 0 20px;
}

.product-params {
  list-style: none;
  margin: 0;
  padding: 0;
}

.product-params li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
  border-bottom: 1px dashed #bfbfbf;
}

.param-char {
  white-space: nowrap;
  flex: 0 0 auto;
  padding-right: 8px;
  position: relative;
}

.param-value {
  flex: 1 1 auto;
  text-align: right;
  white-space: normal;
  word-break: break-word;
}
.breadcrumbs {
  margin: 0 auto;
  font-size: 14px;
  color: #666;
  width: 1300px;
  padding-top: 24px;
}
.breadcrumbs ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.breadcrumbs li {
  display: flex;
  align-items: center;
}
.breadcrumbs li.separator {
  margin: 0 6px;
  color: #aaa;
}
.breadcrumbs a {
  text-decoration: none;
  color: #f29100;
  transition: color 0.2s;
}
.breadcrumbs a:hover {
  color: #d97900;
}
@media (max-width: 768px) {
  .breadcrumbs {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    padding: 20px;
    padding-top: 64px;
  }
  .product-container {padding:0;}
  .marketplaces-list {display:block; width:100%;}
  .marketplaces-list a {margin-bottom:10px;}
}
/* по умолчанию показываем десктоп */
.product-main-img {
  position: relative;
  height: auto;
  overflow: hidden; /* главное — режет всё лишнее */
}
.product-main-img {
  position: relative;
  overflow: hidden;
}
.media-track {
  height: 100%;
}
.slide img,
.slide video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
#desktop-image,
#desktop-video,
#mobile-media img,
#mobile-media video {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain; /* держит пропорции */
  max-width: 100%;
  max-height: 100%;
}
#desktop-image,
#desktop-video { display: block; }
#mobile-media { display: none; }
.media-track {height: 777px !important;}
/* на мобилках скрываем десктоп, включаем свайп-контейнер */
@media (max-width: 768px) {
  #desktop-image,
  #desktop-video { display: none; }
  #mobile-media { display: block; }
.product-container {width:100%;margin-top:0;}
  /* ограничиваем сам контейнер */
  #mobile-media {
    position: relative;
    width: 100%;
    overflow: hidden;
  }
.media-track {height: 520px !important;}
  .slide img,
  .slide video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
}
/* Ограничение блока */
.product-details.limited {
  max-height: 400px; /* высота предпросмотра */
  overflow: hidden;
  position: relative;
}

/* Стилизация кнопки Подробнее под стиль инструкций */
.details-more {
  margin-top: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  text-decoration: none;
  font-size: 15px;
  transition: all 0.3s ease;
  background: none;
  text-decoration:underline;
  color: #f29100;
  cursor: pointer;
  border:none;
  padding:0;
  }

.details-more:hover {
	text-decoration:none;
}

/* На мобильных ограничение и кнопка отключаются */
@media (max-width: 768px) {
  .product-details.limited {
    max-height: none;
    overflow: visible;
  }
  .details-more {
    display: none;
  }
}

/* Popup */
.details-popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.details-popup-content {
  background: #fff;
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  padding: 20px;
  border-radius: 8px;
  position: relative;
}

.details-popup-body {
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 10px;
}

.popup-close {
  position: absolute;
  right: 15px;
  top: 10px;
  cursor: pointer;
  font-size: 24px;
}

.video-container {
  position: relative;
  display: inline-block;
}

.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  padding: 20px;
  cursor: pointer;
  transition: opacity 0.3s;
  width: 200px;
  height: 200px;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}

.video-container:hover .video-play-btn:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

.video-play-btn.hidden {
  opacity: 0 !important;
  pointer-events: none;
}