/* Горизонтальна стрічка мініатюр PDP зі стрілками */

.pdp__thumbs-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  width: 100%;
}

.pdp__thumbs {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--sp-2);
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-x;
  padding: 0.1rem;
}

.pdp__thumbs::-webkit-scrollbar {
  display: none;
}

.pdp__thumbs-nav {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.pdp__thumbs-nav[hidden] {
  display: none;
}

.pdp__thumbs-nav::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-style: solid;
  border-color: currentColor;
  border-width: 0 0 2px 2px;
  transform: rotate(45deg);
  margin-left: 0.15rem;
}

.pdp__thumbs-nav--next::before {
  transform: rotate(225deg);
  margin-left: 0;
  margin-right: 0.15rem;
}

.pdp__thumbs-nav:hover {
  border-color: var(--color-ink);
  background: var(--color-surface-soft, var(--color-surface));
}

.pdp__thumbs-nav:active {
  transform: scale(0.96);
}

.pdp__thumbs-nav:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-ink) 45%, transparent);
  outline-offset: 2px;
}

.pdp__thumb {
  position: relative;
  flex: 0 0 3.5rem;
  width: 3.5rem;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface);
  cursor: pointer;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.pdp__thumb.is-active,
.pdp__thumb:hover {
  border-color: var(--color-ink);
}

.pdp__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.pdp__thumb--video img {
  object-fit: cover;
}

.pdp__thumb-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.pdp__thumb-play::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 0.35rem 0 0.35rem 0.55rem;
  border-color: transparent transparent transparent #fff;
}

@media (max-width: 768px) {
  .pdp__thumbs-nav {
    width: 2.5rem;
    height: 2.5rem;
  }

  .pdp__thumb {
    flex-basis: 3.25rem;
    width: 3.25rem;
  }
}

@media (max-width: 480px) {
  .pdp__thumbs {
    gap: 0.4rem;
  }

  .pdp__thumb {
    flex-basis: 3rem;
    width: 3rem;
  }
}

@supports (-webkit-touch-callout: none) {
  .pdp__thumbs {
    scroll-snap-type: x mandatory;
  }
}
