.qirun-v6,
.qirun-product-single,
.qirun-products-page {
  max-width: 100%;
}

.qirun-v6 *,
.qirun-product-single *,
.qirun-products-page * {
  min-width: 0;
}

/* Page-hero artwork is meaningful content, so it must remain fully visible. */
.qirun-v6 .qr-page-hero-grid {
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr) !important;
}

.qirun-v6 .qr-page-hero-grid > * {
  min-width: 0;
}

.qirun-v6 .qr-page-hero img {
  width: 100% !important;
  height: min(420px, 34vw) !important;
  max-height: 420px;
  padding: clamp(12px, 1.6vw, 24px);
  object-fit: contain !important;
  object-position: center !important;
  background: #f7efe2 !important;
}

/* Content-bearing site imagery stays complete; only the full-bleed home background may crop. */
.qirun-v6 .qr-family img,
.qirun-v6 .qr-buyer-main img,
.qirun-v6 .qr-buyer-row img,
.qirun-v6 .qr-evidence img,
.qirun-v6 .qr-split img,
.qirun-v6 .qr-gallery img,
.qirun-v6 .qr-product img {
  object-fit: contain !important;
  object-position: center !important;
  background: #f7f8f5;
}

/* Product-series archives are a product-center fallback when a cached term URL is served. */
body.tax-qr_series main {
  max-width: 100%;
  overflow: hidden;
}

body.tax-qr_series .wp-block-query {
  width: min(1180px, calc(100% - 44px));
  max-width: none !important;
  margin-inline: auto;
}

body.tax-qr_series .wp-block-post-template {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 0;
}

body.tax-qr_series .wp-block-post {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dfe5e0;
  border-radius: 10px;
  background: #fff;
}

body.tax-qr_series .wp-block-post-featured-image {
  aspect-ratio: 4 / 3;
  margin: 0;
  overflow: hidden;
  background: #f7f8f5;
}

body.tax-qr_series .wp-block-post-featured-image a {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 16px;
}

body.tax-qr_series .wp-block-post-featured-image img {
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: contain !important;
  object-position: center !important;
}

body.tax-qr_series .wp-block-post-title,
body.tax-qr_series .wp-block-post-excerpt,
body.tax-qr_series .wp-block-post-date {
  margin-inline: 18px;
}

body.tax-qr_series .wp-block-post-title {
  margin-top: 16px;
  margin-bottom: 18px;
  overflow-wrap: anywhere;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.25;
}

.qirun-image-zoomable,
[data-qirun-zoom] {
  cursor: zoom-in;
}

.qirun-image-zoomable:focus-visible,
[data-qirun-zoom]:focus-visible {
  outline: 3px solid #ed6b2d;
  outline-offset: 3px;
}

button.qirun-image-zoomable,
button[data-qirun-zoom] {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
}

.qirun-detail-hero,
[data-qirun-product-zoom-demo] {
  position: relative;
}

.qirun-product-lens-source {
  position: relative;
}

.qirun-product-lens,
.qirun-product-lens-pane {
  display: none;
}

@media (min-width: 961px) and (hover: hover) and (pointer: fine) {
  .qirun-product-lens-source {
    cursor: crosshair;
  }

  .qirun-product-lens {
    position: absolute;
    z-index: 8;
    display: block;
    border: 1px solid rgba(37, 113, 154, .78);
    opacity: 0;
    background: rgba(88, 166, 207, .28);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .38);
    pointer-events: none;
  }

  .qirun-product-lens-pane {
    position: absolute;
    z-index: 18;
    display: block;
    overflow: hidden;
    border-left: 1px solid #d8dfda;
    opacity: 0;
    background-color: #fff;
    background-repeat: no-repeat;
    box-shadow: -12px 0 30px rgba(17, 43, 36, .08);
    pointer-events: none;
  }

  .qirun-product-lens.is-visible,
  .qirun-product-lens-pane.is-visible {
    opacity: 1;
  }
}

.qirun-image-viewer {
  width: min(1180px, calc(100vw - 32px));
  max-width: none;
  height: min(820px, calc(100dvh - 32px));
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  color: #fff;
  background: #112b24;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

.qirun-image-viewer::backdrop {
  background: rgba(5, 17, 14, .82);
  backdrop-filter: blur(4px);
}

.qirun-image-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.qirun-image-viewer__toolbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 10px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.qirun-image-viewer__label {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qirun-image-viewer__close,
.qirun-image-viewer__nav {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .28);
  color: #fff;
  background: rgba(7, 39, 31, .78);
  cursor: pointer;
}

.qirun-image-viewer__close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
}

.qirun-image-viewer__stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 24px 74px;
  overflow: hidden;
  background: #eef1ed;
}

.qirun-image-viewer__stage img {
  position: absolute;
  inset: 24px 74px;
  width: calc(100% - 148px);
  max-width: none;
  height: calc(100% - 48px);
  max-height: none;
  display: block;
  object-fit: contain;
  transform: scale(1);
  transform-origin: var(--qirun-zoom-x, 50%) var(--qirun-zoom-y, 50%);
}

@media (hover: hover) and (pointer: fine) {
  .qirun-image-viewer__stage img {
    transition: transform 160ms cubic-bezier(.2, .7, .2, 1);
  }

  .qirun-image-viewer__stage.is-hover-zooming {
    cursor: zoom-in;
  }

  .qirun-image-viewer__stage.is-hover-zooming img {
    transform: scale(2.2);
  }
}

.qirun-image-viewer__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 26px;
  transform: translateY(-50%);
}

.qirun-image-viewer__nav.previous {
  left: 16px;
}

.qirun-image-viewer__nav.next {
  right: 16px;
}

.qirun-image-viewer__nav[hidden] {
  display: none;
}

@media (max-width: 960px) {
  .qirun-v6 .qr-page-hero-grid {
    grid-template-columns: 1fr !important;
  }

  .qirun-v6 .qr-page-hero img {
    height: auto !important;
    max-height: 390px;
    aspect-ratio: 16 / 10;
  }

  body.tax-qr_series .wp-block-post-template {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  body.tax-qr_series .wp-block-query {
    width: min(100% - 28px, 1180px);
  }

  body.tax-qr_series .wp-block-post-template {
    grid-template-columns: 1fr;
  }

  .qirun-image-viewer {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    border-radius: 8px;
  }

  .qirun-image-viewer__stage {
    padding: 16px 48px;
  }

  .qirun-image-viewer__stage img {
    inset: 16px 48px;
    width: calc(100% - 96px);
    height: calc(100% - 32px);
  }

  .qirun-image-viewer__nav {
    width: 38px;
    height: 38px;
  }

  .qirun-image-viewer__nav.previous {
    left: 6px;
  }

  .qirun-image-viewer__nav.next {
    right: 6px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .qirun-image-viewer::backdrop {
    backdrop-filter: none;
  }

  .qirun-image-viewer__stage img {
    transition: none;
  }
}
