.ppc-step-gallery {
  margin: 30px 0 36px;
}

.ppc-step-gallery .module-step-gallery-section__title {
  margin: 0 0 10px;
  color: var(--ink, #132238);
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.25;
}

.ppc-step-gallery .module-step-gallery-section__intro {
  margin: 0 0 16px;
  color: var(--ink-muted, #52657d);
  font-size: 15px;
}

.ppc-step-gallery .module-step-gallery-shell {
  position: relative;
  display: grid;
  grid-template-areas:
    ". status previous next"
    "gallery gallery gallery gallery";
  grid-template-columns: minmax(0, 1fr) auto 52px 52px;
  gap: 12px 10px;
  align-items: center;
}

.ppc-step-gallery .module-step-gallery {
  grid-area: gallery;
  display: flex;
  min-width: 0;
  gap: 18px;
  padding: 2px 2px 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: 2px;
  scroll-snap-type: inline mandatory;
  scrollbar-color: color-mix(in srgb, var(--primary-bright, #1673e6) 45%, var(--line, #dce4ee)) transparent;
  scrollbar-width: thin;
}

.ppc-step-gallery .module-step-gallery__nav {
  position: relative;
  z-index: 1;
  display: grid;
  width: 52px;
  height: 52px;
  padding: 0;
  place-items: center;
  color: var(--primary, #124d96);
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--primary-bright, #1673e6) 34%, var(--line, #dce4ee));
  border-radius: 50%;
  box-shadow: 0 10px 26px rgba(31, 57, 87, 0.2);
  cursor: pointer;
  transform: none;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.ppc-step-gallery .module-step-gallery__nav--prev {
  grid-area: previous;
}

.ppc-step-gallery .module-step-gallery__nav--next {
  grid-area: next;
}

.ppc-step-gallery .module-step-gallery__nav > svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.ppc-step-gallery .module-step-gallery__nav:hover:not(:disabled),
.ppc-step-gallery .module-step-gallery__nav:focus-visible {
  color: #fff;
  background: var(--primary, #124d96);
  box-shadow: 0 14px 32px rgba(18, 77, 150, 0.3);
  transform: translateY(-2px);
}

.ppc-step-gallery .module-step-gallery__nav:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary-bright, #1673e6) 42%, transparent);
  outline-offset: 3px;
}

.ppc-step-gallery .module-step-gallery__nav:disabled {
  opacity: 0.4;
  cursor: default;
}

.ppc-step-gallery .module-step-gallery__status {
  grid-area: status;
  padding: 8px 13px;
  color: var(--ink-muted, #52657d);
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  background: var(--card-muted, #f5f8fc);
  border: 1px solid var(--line, #dce4ee);
  border-radius: 999px;
}

.ppc-step-gallery .module-step-gallery:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary-bright, #1673e6) 40%, transparent);
  outline-offset: 4px;
  border-radius: 18px;
}

.ppc-step-gallery .module-step-gallery__item {
  display: flex;
  flex: 0 0 min(760px, calc(100% - 2px));
  flex-direction: column;
  margin: 0;
  padding: 14px;
  overflow: hidden;
  background: linear-gradient(145deg, color-mix(in srgb, var(--primary-bright, #1673e6) 6%, var(--card, #fff)), var(--card-muted, #f5f8fc));
  border: 1px solid var(--line, #dce4ee);
  border-radius: 18px;
  box-shadow: 0 16px 34px rgba(31, 57, 87, 0.09);
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.ppc-step-gallery .module-step-gallery__media {
  display: block;
  overflow: hidden;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--line, #dce4ee) 78%, #fff);
  border-radius: 13px;
  box-shadow: 0 8px 22px rgba(31, 57, 87, 0.08);
}

.ppc-step-gallery .module-step-gallery__media:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary-bright, #1673e6) 48%, transparent);
  outline-offset: 3px;
}

.ppc-step-gallery .module-step-gallery__media img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  transition: transform 180ms ease;
}

@media (hover: hover) {
  .ppc-step-gallery .module-step-gallery__media:hover img {
    transform: scale(1.012);
  }
}

.ppc-step-gallery .module-step-gallery__caption {
  margin: auto 4px 2px;
  padding-top: 14px;
  color: var(--ink-muted, #52657d);
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
}

body.module-gallery-lightbox-open {
  overflow: hidden;
}

.module-gallery-lightbox[hidden] {
  display: none;
}

.module-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  padding: clamp(16px, 3vw, 40px);
  place-items: center;
  color: #fff;
}

.module-gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 18, 0.94);
  backdrop-filter: blur(4px);
}

.module-gallery-lightbox__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  gap: clamp(10px, 2vw, 24px);
  align-items: center;
  width: min(1180px, 100%);
}

.module-gallery-lightbox__figure {
  min-width: 0;
  margin: 0;
}

.module-gallery-lightbox__stage {
  display: grid;
  min-height: min(62vh, 620px);
  padding: clamp(8px, 1.5vw, 18px);
  place-items: center;
  overflow: hidden;
  touch-action: pan-y;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.module-gallery-lightbox__image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 72vh;
  background: #fff;
  border-radius: 10px;
}

.module-gallery-lightbox__caption {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 16px 2px 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
  line-height: 1.5;
}

.module-gallery-lightbox__counter {
  flex: 0 0 auto;
  min-width: 48px;
  color: #fff;
  font-weight: 800;
}

.module-gallery-lightbox__close,
.module-gallery-lightbox__nav {
  display: grid;
  padding: 0;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.module-gallery-lightbox__nav:hover:not(:disabled),
.module-gallery-lightbox__nav:focus-visible {
  background: var(--primary-bright, #1673e6);
  transform: scale(1.07);
}

.module-gallery-lightbox__close:hover,
.module-gallery-lightbox__close:focus-visible {
  background: #e5484d;
  border-color: rgba(255, 145, 149, 0.82);
  box-shadow: 0 0 0 5px rgba(229, 72, 77, 0.16), 0 12px 30px rgba(229, 72, 77, 0.34);
  transform: translateY(-100%) scale(1.07);
}

.module-gallery-lightbox__close:focus-visible,
.module-gallery-lightbox__nav:focus-visible {
  outline: 3px solid rgba(105, 176, 255, 0.62);
  outline-offset: 3px;
}

.module-gallery-lightbox__close {
  position: absolute;
  top: -18px;
  right: 0;
  z-index: 2;
  width: 42px;
  height: 42px;
  transform: translateY(-100%);
}

.module-gallery-lightbox__close > svg,
.module-gallery-lightbox__nav > svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.module-gallery-lightbox__close > svg {
  width: 22px;
  height: 22px;
}

.module-gallery-lightbox__nav {
  width: 54px;
  height: 54px;
}

.module-gallery-lightbox__nav > svg {
  width: 27px;
  height: 27px;
}

.module-gallery-lightbox__nav:disabled {
  opacity: 0.28;
  cursor: default;
}

@media (max-width: 760px) {
  .ppc-step-gallery {
    margin: 24px 0 30px;
  }

  .ppc-step-gallery .module-step-gallery-section__title {
    font-size: 22px;
  }

  .ppc-step-gallery .module-step-gallery-shell {
    display: block;
  }

  .ppc-step-gallery .module-step-gallery {
    gap: 12px;
  }

  .ppc-step-gallery .module-step-gallery__nav,
  .ppc-step-gallery .module-step-gallery__status {
    display: none;
  }

  .ppc-step-gallery .module-step-gallery__item {
    flex-basis: calc(100% - 2px);
    padding: 10px;
    border-radius: 15px;
  }

  .ppc-step-gallery .module-step-gallery__caption {
    padding-top: 12px;
    font-size: 14px;
  }

  .module-gallery-lightbox {
    padding: 12px 8px;
  }

  .module-gallery-lightbox__dialog {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 6px;
  }

  .module-gallery-lightbox__stage {
    min-height: 58vh;
    padding: 6px;
    border-radius: 13px;
  }

  .module-gallery-lightbox__image {
    border-radius: 7px;
  }

  .module-gallery-lightbox__caption {
    display: block;
    margin-top: 12px;
    font-size: 13px;
  }

  .module-gallery-lightbox__counter {
    display: block;
    margin-bottom: 4px;
  }

  .module-gallery-lightbox__nav {
    width: 42px;
    height: 42px;
  }

  .module-gallery-lightbox__nav > svg {
    width: 23px;
    height: 23px;
  }

  .module-gallery-lightbox__close {
    top: -10px;
    right: 4px;
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ppc-step-gallery .module-step-gallery__media img,
  .ppc-step-gallery .module-step-gallery__nav,
  .module-gallery-lightbox__close,
  .module-gallery-lightbox__nav {
    transition: none;
  }
}
