.wlvg-gallery,
.wlvg-gallery * {
  box-sizing: border-box;
}

.wlvg-gallery {
  --wlvg-blue: #1479bd;
  margin: 0 auto;
  padding: 42px 0;
  color: #171717;
  font-family: inherit;
}

.wlvg-gallery__heading {
  margin-bottom: 34px;
  text-align: center;
}

.wlvg-gallery__heading h2 {
  margin: 0 0 12px;
  font-family: inherit;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.wlvg-gallery__heading p {
  margin: 0;
  font-size: 13px;
}

.wlvg-gallery__strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  scrollbar-color: rgb(0 0 0 / 22%) transparent;
  scrollbar-width: thin;
}

.wlvg-card {
  position: relative;
  flex: 1 0 calc((100% - 50px) / 6);
  min-width: 0;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #e8e8e8, #c8c8c8);
  cursor: pointer;
  scroll-snap-align: start;
}

.wlvg-card__media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.wlvg-card:hover .wlvg-card__media,
.wlvg-card:focus-visible .wlvg-card__media {
  transform: scale(1.04);
}

.wlvg-card:focus-visible {
  outline: 3px solid var(--wlvg-blue);
  outline-offset: 3px;
}

.wlvg-card__icon {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 25px;
  height: 25px;
  padding: 5px;
  place-items: center;
  color: #fff;
  border-radius: 7px;
  background: rgb(0 0 0 / 55%);
}

.wlvg-card__icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.wlvg-modal[hidden] {
  display: none;
}

.wlvg-modal {
  position: fixed;
  z-index: 999999;
  inset: 0;
  display: grid;
  padding: 12px;
  place-items: center;
}

.wlvg-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 72%);
  animation: wlvg-fade-in .2s ease-out;
}

.wlvg-modal__panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(390px, 1fr);
  width: min(1160px, calc(100vw - 48px));
  height: min(790px, calc(100vh - 48px));
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 80px rgb(0 0 0 / 35%);
  animation: wlvg-modal-in .25s ease-out;
}

.wlvg-modal__close {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 12px;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #222;
  border: 0;
  background: transparent;
  font-size: 39px;
  font-weight: 200;
  line-height: 1;
  cursor: pointer;
}

.wlvg-modal__media {
  min-height: 0;
  overflow: hidden;
  background: #111;
}

.wlvg-modal__media video,
.wlvg-modal__media iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.wlvg-modal__media video[hidden],
.wlvg-modal__media iframe[hidden] {
  display: none;
}

.wlvg-modal__content {
  padding: 38px 26px 28px;
  overflow-y: auto;
}

.wlvg-products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid #e6e6e6;
}

.wlvg-products:empty {
  display: none;
}

.wlvg-product {
  color: inherit;
  text-align: center;
  text-decoration: none;
}

.wlvg-product img {
  display: block;
  width: 100%;
  height: 180px;
  margin: 0;
  object-fit: contain;
  border-radius: 6px;
}

.wlvg-product h3 {
  margin: 18px 0 10px;
  color: inherit;
  font-size: 17px;
  line-height: 1.35;
}

.wlvg-product__price {
  color: inherit;
  font-size: 16px;
  font-weight: 700;
}

.wlvg-product__price del {
  opacity: .55;
}

.wlvg-product__price ins {
  text-decoration: none;
}

.wlvg-description {
  padding-top: 28px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
}

.wlvg-products:empty + .wlvg-description {
  padding-top: 0;
}

.wlvg-description p {
  margin: 0 0 4px;
}

.wlvg-tags {
  color: var(--wlvg-blue);
  font-weight: 700;
}

body.wlvg-modal-open {
  overflow: hidden;
}

@keyframes wlvg-fade-in {
  from { opacity: 0; }
}

@keyframes wlvg-modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.985);
  }
}

@media (max-width: 900px) {
  .wlvg-gallery__strip {
    scrollbar-width: none;
  }

  .wlvg-gallery__strip::-webkit-scrollbar {
    display: none;
  }

  .wlvg-card {
    flex: 1 0 31%;
  }

  .wlvg-modal {
    padding: 0;
  }

  .wlvg-modal__panel {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(330px, 56vh) auto;
    width: 100%;
    height: 100%;
    border-radius: 0;
    overflow-y: auto;
  }

  .wlvg-modal__content {
    overflow: visible;
  }

  .wlvg-modal__close {
    position: fixed;
    color: #fff;
    border-radius: 50%;
    background: rgb(0 0 0 / 55%);
  }
}

@media (max-width: 560px) {
  .wlvg-gallery {
    width: min(100% - 24px, 1140px);
    padding: 30px 0;
  }

  .wlvg-card {
    flex: 1 0 46%;
  }

  .wlvg-modal__panel {
    grid-template-rows: minmax(300px, 53vh) auto;
  }

  .wlvg-modal__content {
    padding: 26px 16px;
  }

  .wlvg-products {
    gap: 12px;
  }

  .wlvg-product img {
    height: 130px;
  }

  .wlvg-product h3 {
    margin-top: 12px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wlvg-gallery *,
  .wlvg-gallery *::before,
  .wlvg-gallery *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
