.u-modal__close {
    position: fixed;
    top: 10px;
    right: 20px;
    background: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 28px;
    color: #555;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    z-index: 12000; /* выше, чем у модалки */
}

.u-modal__close:hover {
    color: #007BFF;
    background: #f0f8ff;
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}


.gallery-click-area {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.9), transparent);
  transition: background 0.3s ease;
  opacity: 0;
}

@media (max-width: 768px) {
    .gallery-click-area {
        width: 15%;
    }
}

.gallery-click-area.is-hidden {
  display: none;
}

.gallery-click-area.right {
  right: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.05), transparent);
}

.gallery-click-area.left {
  left: 0;
}

.gallery-click-area:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}

.gallery-arrow {
  font-size: 1.5rem;
  color: white;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.01);
  pointer-events: none;
  opacity: 0.8;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.gallery-click-area:hover .gallery-arrow {
  transform: scale(1.1);
  opacity: 1;
  outline: none;
  user-select: none;
}
.gallery-click-area .gallery-arrow:focus {
  outline: none;
}

.gallery-click-area span {
  outline: none;
}

.download-btn {
    position: fixed;
    top: 10px;
    right: 60px;
    background: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    color: #555;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    z-index: 12000; /* выше, чем у модалки */
}

.download-btn:hover {
    background: rgba(0,0,0,0.7);
}

.u-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    z-index: 11000;
}

.zoom-track{
      display: flex;
      height: 100vh;
      width: 100vw;
      will-change: transform;
      transition: transform .25s ease;
      gap: 12px;
}


.media-modal-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90%;
    max-height: 90vh;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: none;
}

/* Контейнер с медиа */
.zoom-media-container-product {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Стили фото и видео */
.zoom-media-container-product img,
.zoom-media-container-product video {
    object-fit: contain;
    border-radius: 6px;
    background-color: transparent;
}

.zoom-media-container-product img {
    max-height: 80vh;
}

.zoom-media-container-product video {
    max-height: 60vh;
}

/* Кнопки навигации */
.zoom-nav-btn {
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    font-size: 32px;
    cursor: pointer;
    padding: 10px 14px;
    margin: 0 8px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.zoom-nav-btn:hover {
    background: rgba(0, 0, 0, 0.5);
}

.zoom-counter-product {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 20;
    pointer-events: none;
}

#zoomMediaContainer {
    touch-action: none;
}

.zoom-slide {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
}

.zoom-video-slide {
    position: relative;
}

.zoom-video-slide .product-video-play {
    position: absolute;
    inset: 0;
    z-index: 20;
}

.zoom-slide:not(.zoom-video-slide) > .product-video-play {
    display: none !important;
}

/* ===== ZOOM ===== */

#zoomModal .modal-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

#zoomModal .zoom-media-container-product {
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#zoomModal .zoom-slide {
    position: relative;
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 60px 90px 70px;
}

#zoomModal .zoom-slide img.zoom-media {
    max-height: calc(100dvh - 130px);
    object-fit: contain;
    aspect-ratio: auto;
}

#zoomModal .zoom-slide video.zoom-media {
    width: min(76vw, 980px);
    max-width: calc(100vw - 180px);
    max-height: calc(100dvh - 150px);
    object-fit: contain;
}

@media screen and (min-width: 769px) {
    #zoomModal .zoom-content {
        max-width: 100vw !important;
        max-height: 100vh !important;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
        position: relative;
    }

    .zoom-media-container-product {
        width: 100vw;
        height: 100vh;
        overflow: hidden;
        touch-action: none;
        position: relative;
    }
}

@media screen and (max-width: 768px) {
    .u-modal {
        position: fixed;
        justify-content: center;
        align-items: center;
        z-index: 2000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.8);
    }

    .u-modal__close {
        position: absolute;
        top: 8px;
        right: 12px;
        font-size: 28px;
        cursor: pointer;
        z-index: 10000;
    }
}

@media (max-width: 768px) {
    #zoomModal .zoom-slide {
        padding: 54px 0px 70px;
    }

    #zoomModal .zoom-slide video.zoom-media {
        width: 100%;
        max-width: calc(100vw - 24px);
        max-height: calc(100dvh - 150px);
    }

    .zoom-counter-product {
        font-size: 10px;
    }
}