/**
 * Карточка товара: галерея и lightbox.
 */

.product-detail__crumb {
  margin: 0 0 0.75rem;
}

.product-detail__crumb a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.product-detail__crumb a:hover,
.product-detail__crumb a:focus-visible {
  color: #fff;
  text-decoration: underline;
  outline: none;
}

.wl-page-head--compact .wl-page-head__title {
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
}

.product-detail__body {
  padding: var(--section-pt, 2.5rem) 0 var(--section-pb, 4rem);
  background:
    radial-gradient(ellipse 60% 40% at 10% 0%, rgba(109, 216, 159, 0.12), transparent 55%),
    #fcfaf8;
}

.product-detail__info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-detail__gallery-desc {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.product-detail__price {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  margin: 0;
  padding: 0.7rem 1.15rem 0.75rem;
  color: #004c3f;
  font-family: Lora, Georgia, serif;
  font-size: clamp(1.85rem, 3.2vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  border-radius: 14px;
  border: 1px solid rgba(0, 76, 63, 0.14);
  border-top: 3px solid #c4a35a;
  background:
    linear-gradient(145deg, rgba(255, 247, 214, 0.55) 0%, rgba(255, 255, 255, 0.98) 42%, #ffffff 100%);
  box-shadow: 0 10px 28px rgba(0, 76, 63, 0.1);
}

.product-detail__lead {
  margin: 0;
  color: #5a6b66;
  font-size: 1.05rem;
  line-height: 1.5;
}

.product-detail__richtext {
  color: #37383a;
  font-size: 1rem;
  line-height: 1.65;
}

.product-detail__order-card {
  margin-top: 0.5rem;
  padding: 1.25rem 1.35rem 1.4rem;
  border: 1px solid rgba(0, 76, 63, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 247, 214, 0.35) 0%, rgba(255, 255, 255, 0.98) 38%, #ffffff 100%);
  box-shadow: 0 12px 32px rgba(0, 76, 63, 0.08);
}

.product-detail__order-title {
  margin: 0 0 1rem;
  color: #004c3f;
  font-family: Lora, Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.product-detail__download {
  max-width: 280px;
}

.product-detail-order .product-order-fields {
  margin-bottom: 14px;
}

/* Gallery carousel */
.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.product-gallery__main {
  position: relative;
  border: 1px solid rgba(0, 76, 63, 0.12);
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(252, 250, 248, 0.98));
  box-shadow: 0 12px 28px rgba(0, 76, 63, 0.08);
}

.product-gallery__viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
}

.product-gallery__slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0.75rem;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.product-gallery__slide[hidden] {
  display: none;
}

.product-gallery__slide.is-active {
  animation: product-gallery-fade 0.35s ease;
}

.product-gallery__slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.product-gallery__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(0, 76, 63, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #004c3f;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 16px rgba(0, 76, 63, 0.12);
}

.product-gallery__nav:hover,
.product-gallery__nav:focus-visible {
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 76, 63, 0.18);
  outline: none;
  transform: translateY(-50%) scale(1.05);
}

.product-gallery__nav--prev {
  left: 0.65rem;
}

.product-gallery__nav--next {
  right: 0.65rem;
}

.product-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.55rem;
}

.product-gallery__thumb {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(0, 76, 63, 0.12);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.product-gallery__thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.product-gallery__thumb:hover,
.product-gallery__thumb:focus-visible,
.product-gallery__thumb.is-active {
  border-color: rgba(0, 76, 63, 0.45);
  box-shadow: 0 8px 18px rgba(0, 76, 63, 0.14);
  transform: translateY(-1px);
  outline: none;
}

.product-gallery__empty {
  padding: 2rem;
  border: 1px dashed rgba(0, 76, 63, 0.25);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  color: #6a7572;
  text-align: center;
}

@keyframes product-gallery-fade {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}

/* Lightbox */
.product-lightbox {
  padding: 0;
  border: none;
  background: transparent;
  max-width: none;
  max-height: none;
  width: 100vw;
  height: 100vh;
}

.product-lightbox::backdrop {
  background: rgba(6, 7, 11, 0.82);
}

.product-lightbox__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  padding: 3.5rem 1rem;
  box-sizing: border-box;
}

.product-lightbox__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  max-width: min(96vw, 1180px);
  width: 100%;
}

.product-lightbox__image {
  flex: 1 1 auto;
  max-width: min(88vw, 1100px);
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.product-lightbox__close,
.product-lightbox__nav {
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.product-lightbox__close:hover,
.product-lightbox__close:focus-visible,
.product-lightbox__nav:hover,
.product-lightbox__nav:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  outline: none;
}

.product-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
}

.product-lightbox__close-icon {
  display: block;
  flex-shrink: 0;
}

.product-lightbox__nav {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  font-size: 1.75rem;
  line-height: 1;
  /* оптическое выравнивание глифов ‹ › */
  padding-bottom: 0.12em;
  text-align: center;
}

.product-lightbox__nav:hover,
.product-lightbox__nav:focus-visible {
  transform: scale(1.05);
}

@media (max-width: 767px) {
  .product-lightbox__inner {
    padding: 3rem 0.5rem;
  }

  .product-lightbox__stage {
    gap: 0.35rem;
  }

  .product-lightbox__nav {
    width: 40px;
    height: 40px;
    font-size: 1.45rem;
  }

  .product-gallery__nav {
    width: 36px;
    height: 36px;
    font-size: 1.35rem;
  }

  .product-gallery__nav--prev {
    left: 0.4rem;
  }

  .product-gallery__nav--next {
    right: 0.4rem;
  }

  .product-gallery__thumbs {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-gallery__thumb,
  .product-gallery__nav,
  .product-gallery__slide.is-active,
  .product-lightbox__close,
  .product-lightbox__nav,
  .product-order-submit {
    transition: none;
    animation: none;
  }

  .product-gallery__thumb:hover,
  .product-gallery__thumb:focus-visible,
  .product-gallery__thumb.is-active {
    transform: none;
  }

  .product-gallery__nav:hover,
  .product-gallery__nav:focus-visible {
    transform: translateY(-50%);
  }
}
