/* Информационная галерея модели — отдельно от фото товара в каталоге */
.model-gallery--info {
  width: 100%;
  max-width: 1200px;
  margin: 10px auto 50px;
  padding: 0 40px;
  box-sizing: border-box;
}

.model-gallery__inner {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 28px 32px 32px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

.model-gallery__header {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid #ececf1;
}

.model-gallery__title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: #111;
}

.model-gallery__title-name {
  color: #374151;
  font-weight: 600;
}

.model-gallery__title-count {
  color: #9ca3af;
  font-weight: 500;
  font-size: 18px;
}

.model-gallery__note {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #6b7280;
}

.model-gallery__heading {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: #111;
}

.model-gallery__count {
  color: #9ca3af;
  font-weight: 500;
}

.model-gallery__panel + .model-gallery__panel {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #ececf1;
}

/* Горизонтальная лента, как на референсе */
.model-gallery__photos {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.model-gallery__photos::-webkit-scrollbar {
  height: 6px;
}

.model-gallery__photos::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}

.model-gallery__photo-btn {
  appearance: none;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0;
  background: #f9fafb;
  overflow: hidden;
  cursor: zoom-in;
  flex: 0 0 min(240px, 72vw);
  aspect-ratio: 4 / 3;
  scroll-snap-align: start;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.model-gallery__photo-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accentColor, #0ea5e9);
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.12);
}

.model-gallery__photo-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.model-gallery__videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.model-gallery__video-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #fafafa;
}

.model-gallery__video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
}

.model-gallery__video-frame iframe,
.model-gallery__video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.model-gallery__video-title {
  padding: 10px 12px;
  font-size: 14px;
  color: #374151;
}

/* Lightbox только для галереи */
.model-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(17, 24, 39, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.model-gallery-lightbox[hidden] {
  display: none !important;
}

.model-gallery-lightbox__figure {
  margin: 0;
  max-width: min(960px, 92vw);
  max-height: 86vh;
  text-align: center;
}

.model-gallery-lightbox__image {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.model-gallery-lightbox__caption {
  margin-top: 12px;
  color: #f3f4f6;
  font-size: 14px;
}

.model-gallery-lightbox__close,
.model-gallery-lightbox__nav {
  position: absolute;
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.model-gallery-lightbox__close:hover,
.model-gallery-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.22);
}

.model-gallery-lightbox__close {
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 1;
}

.model-gallery-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 28px;
}

.model-gallery-lightbox__nav--prev { left: 16px; }
.model-gallery-lightbox__nav--next { right: 16px; }

@media (max-width: 768px) {
  .model-gallery--info {
    padding: 0 16px;
    margin-bottom: 32px;
  }

  .model-gallery__inner {
    padding: 20px 16px 22px;
  }

  .model-gallery__title {
    font-size: 19px;
  }

  .model-gallery__photo-btn {
    flex-basis: min(200px, 78vw);
  }

  .model-gallery__videos {
    grid-template-columns: 1fr;
  }
}
