/* The two existing customization/factory groups share the approved controls.
   Every rule stays inside these groups; the customer-photo design is untouched. */
body.native-page.buyer-page #gallery .showcase-group { min-width: 0; margin: 0; }
body.native-page.buyer-page #gallery .showcase-group + .showcase-group { margin-block-start: 32px; }
body.native-page.buyer-page #gallery .showcase-group .customer-case-stack {
  box-sizing: border-box; display: flex !important; flex-wrap: nowrap !important;
  position: relative !important; width: 100% !important; min-width: 0; max-width: 100% !important;
  height: auto !important; min-height: 0 !important; margin: 0 !important; padding: 0 0 12px !important;
  gap: 16px !important; align-items: stretch !important;
  overflow-x: auto !important; overflow-y: hidden !important;
  scroll-snap-type: x mandatory !important; scroll-padding-inline: 0 !important;
  overscroll-behavior-x: contain; perspective: none !important; transform-style: flat !important;
  border-radius: 0; background: none !important; box-shadow: none !important;
  scrollbar-width: thin; scrollbar-color: #c4c9d0 transparent;
}
body.native-page.buyer-page #gallery .showcase-group .customer-case-stack::before,
body.native-page.buyer-page #gallery .showcase-group .customer-case-stack::after,
body.native-page.buyer-page #gallery .showcase-group .customer-case-card::before,
body.native-page.buyer-page #gallery .showcase-group .customer-case-card::after {
  content: none !important; display: none !important;
}
body.native-page.buyer-page #gallery .showcase-group .customer-case-card {
  box-sizing: border-box; display: flex !important; flex-direction: column;
  position: relative !important; inset: auto !important;
  flex: 0 0 320px !important; width: 320px !important; min-width: 0 !important; max-width: none !important;
  height: auto !important; min-height: 0 !important; max-height: none !important;
  aspect-ratio: auto !important; align-self: stretch !important; margin: 0 !important;
  transform: none !important; translate: none !important; rotate: none !important; scale: 1 !important;
  opacity: 1 !important; visibility: visible; pointer-events: auto !important;
  filter: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  will-change: auto; transition: none !important;
  overflow: hidden; scroll-snap-align: start !important;
  border: 1px solid #e0e3e7; border-radius: 20px; background: #fff; box-shadow: none !important;
}
body.native-page.buyer-page #gallery .showcase-group .customer-case-photo {
  display: block; flex: none; width: 100%; height: 240px; min-height: 0; background: #fff;
}
body.native-page.buyer-page #gallery .showcase-group .customer-case-photo picture {
  display: block; width: 100%; height: 100% !important;
}
body.native-page.buyer-page #gallery .showcase-group .customer-case-photo img {
  display: block; width: 100%; height: 100% !important; max-height: none !important;
  object-fit: contain !important; vertical-align: middle; border-radius: 0;
  transform: none !important; translate: none !important; rotate: none !important; scale: 1 !important;
  filter: none !important; cursor: default;
}
body.native-page.buyer-page #gallery .showcase-group .customer-case-card > figcaption {
  box-sizing: border-box; display: block !important; flex: none; min-width: 0;
  margin: 0 !important; padding: 12px 16px; background: #fff; font-size: 14px; line-height: 1.6;
  white-space: normal; overflow-wrap: anywhere; word-break: normal;
}
body.native-page.buyer-page #gallery .showcase-group .customer-case-card > figcaption a {
  display: flex; min-height: 44px; align-items: center; max-width: 100%;
  color: #a92722; font-size: inherit; line-height: inherit; text-underline-offset: 4px;
  white-space: normal; overflow-wrap: anywhere; word-break: normal; hyphens: auto;
}
body.native-page.buyer-page #gallery .showcase-group .customer-case-controls { display: none; }
body.native-page.buyer-page #gallery .showcase-group .customer-case-controls button {
  min-width: 0; min-height: 44px; padding: 9px 18px; border: 1px solid #dde1e6;
  border-radius: 999px; color: #252a32; background: #fff;
  font: inherit; font-size: 14px; line-height: 1.5; cursor: pointer;
  white-space: normal; overflow-wrap: anywhere;
}
body.native-page.buyer-page #gallery .showcase-group .customer-case-controls button:disabled { opacity: .42; cursor: default; }
body.native-page.buyer-page #gallery .showcase-group .customer-case-position {
  flex: 0 0 auto; margin: 0; min-width: 84px; color: #606772;
  font-size: 13px; text-align: center; font-variant-numeric: tabular-nums;
}
body.native-page.buyer-page #gallery .showcase-group :is(.customer-case-stack, .customer-case-controls button, figcaption a):focus-visible {
  outline: 3px solid #2563eb; outline-offset: 3px;
}

@media (min-width: 761px) {
  body.native-page.buyer-page #gallery .showcase-group [data-case-carousel-ready] + .customer-case-controls {
    display: flex; align-items: center; justify-content: center; gap: 14px; margin: 12px 0 0;
  }
}

@media (max-width: 760px) {
  body.native-page.buyer-page #gallery .showcase-group {
    --case-photo-width: min(85vw, 448px, calc((100vh - 190px) * .8));
    --case-photo-width: min(85vw, 448px, calc((100svh - 190px) * .8));
  }
  body.native-page.buyer-page #gallery .showcase-group .customer-case-stack {
    gap: 12px !important; align-items: flex-start !important;
  }
  body.native-page.buyer-page #gallery .showcase-group .customer-case-card {
    flex: 0 0 var(--case-photo-width) !important; width: var(--case-photo-width) !important;
    align-self: start !important; scroll-snap-align: center !important;
  }
  body.native-page.buyer-page #gallery .showcase-group .customer-case-photo {
    height: calc(var(--case-photo-width) * .75);
  }
  body.native-page.buyer-page #gallery .showcase-group .customer-case-card > figcaption {
    display: none !important;
  }
  body.native-page.buyer-page #gallery .showcase-group .customer-case-photo img {
    object-fit: cover !important;
  }
  body.native-page.buyer-page #gallery .showcase-group [data-customer-case-stack][data-case-stack-ready] {
    display: block !important; width: calc(100% + 32px) !important; max-width: none !important;
    height: var(--case-stack-height, 430px) !important; min-height: 0 !important;
    padding: 30px 0 58px !important; margin: 0 -16px !important; gap: 0 !important;
    overflow: hidden !important; scroll-snap-type: none !important;
    perspective: 1200px !important; touch-action: pan-y pinch-zoom !important;
  }
  body.native-page.buyer-page #gallery .showcase-group [data-customer-case-stack][data-case-stack-ready] .customer-case-card {
    display: flex !important; position: absolute !important;
    top: 30px !important; left: 50% !important; right: auto !important; bottom: auto !important;
    flex: none !important; margin: 0 !important; width: var(--case-photo-width) !important;
    height: auto !important; min-height: 0 !important; max-height: none !important;
    transform-origin: 50% 50%;
    transform: translateX(-50%) translate3d(var(--case-x, 0px), var(--case-y, 0px), var(--case-depth, 0px)) rotate(var(--case-rotate, 0deg)) rotateY(var(--case-tilt, 0deg)) scale(var(--case-scale, 1)) !important;
    z-index: var(--case-layer, 1); opacity: var(--case-opacity, 0) !important;
    visibility: hidden; pointer-events: none !important;
    overflow: hidden; overscroll-behavior-y: auto; -webkit-overflow-scrolling: touch;
    touch-action: pan-y pinch-zoom !important;
    border: 2px solid rgba(255, 255, 255, .98); border-radius: 24px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(71, 81, 95, .14), 0 3px 0 #e5e8ec,
      0 8px 14px -7px rgba(32, 44, 59, .24), 0 18px 28px -14px rgba(32, 44, 59, .24) !important;
    transition: transform 350ms cubic-bezier(.22, .7, .22, 1), opacity 220ms ease !important;
  }
  body.native-page.buyer-page #gallery .showcase-group [data-case-stack-ready] .customer-case-card.is-case-near { visibility: visible; }
  body.native-page.buyer-page #gallery .showcase-group [data-case-stack-ready] .customer-case-card.is-active {
    pointer-events: auto !important;
    box-shadow: 0 0 0 1px rgba(71, 81, 95, .13), 0 3px 0 #edf0f3,
      0 7px 0 -2px #dce1e7, 0 14px 20px -10px rgba(25, 37, 54, .3),
      0 30px 38px -18px rgba(25, 37, 54, .34) !important;
  }
  body.native-page.buyer-page #gallery .showcase-group [data-customer-case-stack].is-dragging .customer-case-card.is-active { transition: none !important; }
  body.native-page.buyer-page #gallery .showcase-group [data-case-stack-ready] :is(.customer-case-photo, picture, img, figcaption) {
    touch-action: pan-y pinch-zoom !important;
  }
  body.native-page.buyer-page #gallery .showcase-group [data-case-stack-ready] + .customer-case-controls {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin: 2px 0 10px; padding-inline: 4px;
  }
  body.native-page.buyer-page #gallery .showcase-group .customer-case-controls button {
    max-width: 40%; padding: 9px 14px; font-size: 13px; line-height: 1.35;
  }
  body.native-page.buyer-page #gallery .showcase-group .customer-case-position { min-width: 0; }
}

@media (max-width: 760px) and (max-height: 700px) {
  body.native-page.buyer-page #gallery .showcase-group {
    --case-photo-width: min(85vw, 448px, calc((100vh - 255px) * .8));
    --case-photo-width: min(85vw, 448px, calc((100svh - 255px) * .8));
  }
}

@media (prefers-reduced-motion: reduce) {
  body.native-page.buyer-page #gallery .showcase-group [data-customer-case-stack] .customer-case-card { transition: none !important; }
}

/* Desktop only: edge-to-edge 4:3 photos and a raised card edge.
   The existing mobile stack and its gestures remain above without changes. */
@media (min-width: 761px) {
  body.native-page.buyer-page #gallery .showcase-group .customer-case-stack {
    padding: 10px 8px 32px !important; scroll-padding-inline: 8px !important;
  }
  body.native-page.buyer-page #gallery .showcase-group .customer-case-card {
    height: 240px !important; padding: 0 !important;
    border: 1px solid rgba(255, 255, 255, .98);
    box-shadow: 0 0 0 1px rgba(47, 60, 77, .13), 0 3px 0 #edf0f3,
      0 7px 0 -2px #dce1e7, 0 15px 20px -11px rgba(25, 37, 54, .28),
      0 28px 30px -20px rgba(25, 37, 54, .32) !important;
  }
  body.native-page.buyer-page #gallery .showcase-group :is(.customer-case-photo, .customer-case-photo picture) {
    width: 100%; height: 100% !important; margin: 0; padding: 0;
  }
  body.native-page.buyer-page #gallery .showcase-group .customer-case-photo img { object-fit: cover !important; }
  body.native-page.buyer-page #gallery .showcase-group .customer-case-card > figcaption {
    position: absolute; width: 1px; height: 1px; padding: 0 !important;
    margin: -1px !important; overflow: hidden; clip-path: inset(50%);
    white-space: nowrap; border: 0;
  }
  body.native-page.buyer-page #gallery .showcase-group .customer-case-card:focus-within {
    outline: 3px solid #2563eb; outline-offset: 3px;
  }
  body.native-page.buyer-page #gallery .showcase-group .customer-case-card > figcaption:focus-within {
    inset: auto 10px 10px; width: auto; height: auto; margin: 0 !important;
    padding: 6px 12px !important; overflow: visible; clip-path: none;
    white-space: normal; background: #fff; border-radius: 12px;
  }
}
