.gallery-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}


.gallery-scroll {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: var(--gallery-height);;
  overflow-y: hidden;
  overflow-x: auto;
  /* transform: rotate(-90deg) translateX(-100%); */
  transform-origin: top left;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior: contain;
}
.gallery-scroll::-webkit-scrollbar { display: none; }

.gallery-grid {
  display: flex;
  flex-direction: row;

  width: 100%;
  height: 100%;

  gap: var(--gallery-gap);

  padding-left: var(--page-gap);
  padding-right: 0;
}

.gallery-grid::after {
  content: "";
  flex: 0 0 calc(var(--page-gap) - var(--gallery-gap));
}


.gallery-item {
    position: relative;
    flex: 0 0 auto;

    height: var(--gallery-height);
    width: auto;
}

.gallery-card {
    position: relative;
    display: block;

    width: auto;
    height: 100%;

    overflow: hidden;
    background: transparent;
    cursor: pointer;
}

.gallery-card img {
    display: block;

    width: auto;
    height: 100%;

    min-height: 300px;
    min-width: 300px;
    
    max-width: none;

    object-fit: contain;
    object-position: center;

    position: relative;
    z-index: 1;

    transition: opacity 0.2s cubic-bezier(0.65, 0.05, 0.36, 1);
}
.gallery-card .product-name {
    width: 100%;
    position: absolute;
    height: 100%;
    align-content: center;
    text-align: center;
    background: var(--blue-background);
    color: var(--white-text);
    z-index: 0;
    font-size: 24px;
    padding: 60px;
    /* white-space: nowrap; */
    box-sizing: border-box;
    white-space: normal;
}

.gallery-card .product-name span {
    white-space: nowrap;
}


.gallery-card {
    cursor: pointer;
}
@media (max-width: 520px) {
    .gallery-card {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Desktop */
@media (hover: hover) and (pointer: fine) {
    .gallery-card:hover img {
        opacity: 0;
    }
}

/* Mobile */
@media (max-width: 520px) {
    .gallery-card.is-active img {
        opacity: 0;
    }
}

@media (max-width: 520px) {
  .gallery-scroll {
    position: relative;
    width: 100%;
    height: 100%;
    top: auto;
    left: auto;
    transform: none;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

    .gallery-grid::after {
    display: none;
  }

      .gallery-grid {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: auto;
        gap: var(--gallery-gap);
        padding: 0 var(--page-gap);
    }

    .gallery-grid {
        padding-bottom: 30vh;
        box-sizing: border-box;
    }


    .gallery-item {
        width: 100%;
        height: auto;
        aspect-ratio: auto;
    }
    .gallery-card {
        position: relative;
        width: 100%;
        height: auto;
    }
    .gallery-card img {
        position: relative;
        width: 100%;
        height: auto;
        object-fit: contain;
    }
}
