.product-index__inner,
.catalog-shell__inner,
.single-product {
  width: min(var(--bte-max), calc(100% - 96px));
  margin: 0 auto;
}

.product-index__inner {
  height: auto;
  padding: clamp(24px, 2.2vw, 34px) 0 clamp(54px, 4.8vw, 76px);
  display: grid;
  grid-template-rows: auto auto;
  gap: clamp(28px, 2.8vw, 42px);
}

.product-index,
.catalog-shell {
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%, cover;
}

.product-index {
  height: auto;
  min-height: calc(100svh - var(--bte-header-height));
  border-bottom: 0;
}

.category-feature,
.category-tile {
  min-width: 0;
  min-height: 0;
  margin: 0;
  display: block;
}

.category-heading {
  min-height: 54px;
  padding: 0 2px 10px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  border-bottom: 1px solid rgb(23 24 25 / 18%);
}

.category-heading__order {
  position: relative;
  padding-bottom: 8px;
  color: var(--bte-muted);
  font-size: 13px;
  font-weight: 540;
  line-height: 1;
}

.category-heading__order::after {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 30px;
  height: 2px;
  content: "";
  background: var(--bte-red);
  transform-origin: left center;
  transition: transform .3s var(--bte-ease);
}

.category-heading h2 {
  margin: 0;
  padding-bottom: 3px;
  font-size: clamp(20px, 1.55vw, 23px);
  font-weight: 590;
  line-height: 1.08;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.category-heading .dashicons {
  width: 24px;
  height: 24px;
  margin-bottom: 1px;
  color: #34373a;
  font-size: 24px;
  transition: color .24s ease, transform .3s var(--bte-ease);
}

.category-heading:hover .dashicons {
  color: var(--bte-red);
  transform: translateX(4px);
}

.category-heading:hover .category-heading__order::after {
  transform: scaleX(1.45);
}

.category-feature__media,
.category-tile__media {
  position: relative;
  width: 100%;
  min-height: 0;
  height: auto;
  overflow: hidden;
  display: block;
  background: #d7d5d2;
}

.category-feature__media {
  width: 100%;
  height: auto;
  aspect-ratio: 4096 / 1365;
  margin-top: 12px;
}

.category-feature__media img,
.category-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  transition: filter .35s ease;
}

.category-feature__media:hover img,
.category-tile__media:hover img {
  filter: brightness(1.015);
}

.category-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(18px, 1.8vw, 28px);
}

.category-heading--compact {
  min-height: 66px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
}

.category-heading--compact h2 {
  font-size: clamp(17px, 1.25vw, 19px);
}

.category-heading--compact .category-heading__order::after {
  width: 22px;
}

.category-tile__media {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  margin-top: 12px;
  justify-self: center;
}

.catalog-back {
  width: fit-content;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--bte-body);
  font-size: 14px;
  font-weight: 590;
  line-height: 1.2;
  letter-spacing: -.012em;
  transition: color .22s ease, transform .22s var(--bte-ease);
}

.catalog-back span {
  color: var(--bte-red);
  font-size: 19px;
  line-height: 1;
}

.catalog-back:hover {
  color: var(--bte-ink);
  transform: translateX(-2px);
}

.bte-products-area .page-hero__inner {
  height: auto;
  min-height: 204px;
}

.bte-products-area .page-hero h1 {
  font-size: clamp(44px, 4vw, 64px);
  font-weight: 590;
  line-height: .98;
}

.bte-products-area .page-hero__summary {
  font-size: clamp(17px, 1.25vw, 19px);
  line-height: 1.55;
}

.catalog-shell__inner {
  min-height: max(560px, calc(100svh - var(--bte-header-height)));
  padding: clamp(28px, 3vw, 44px) 0 clamp(78px, 7vw, 108px);
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  gap: clamp(48px, 5vw, 76px);
  align-items: start;
}

.catalog-rail {
  position: sticky;
  top: calc(var(--bte-header-height) + 30px);
  max-height: calc(100svh - var(--bte-header-height) - 60px);
  overflow: hidden;
  border-right: 1px solid rgb(23 24 25 / 18%);
}

.catalog-rail__viewport {
  max-height: inherit;
  padding: 2px 28px 2px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgb(23 24 25 / 28%) transparent;
}

.catalog-rail__item {
  position: relative;
  width: 100%;
  min-height: 52px;
  padding: 12px 0 12px 20px;
  border: 0;
  display: block;
  color: var(--bte-body);
  background: transparent;
  font-size: 16px;
  font-weight: 470;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: color .22s ease, transform .22s var(--bte-ease);
}

.catalog-rail__item::before {
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 2px;
  content: "";
  background: var(--bte-red);
  transform: translateY(-50%);
  transition: width .24s var(--bte-ease);
}

.catalog-rail__item:hover {
  color: var(--bte-ink);
  transform: translateX(2px);
}

.catalog-rail__item.is-active {
  color: var(--bte-ink);
  font-weight: 650;
}

.catalog-rail__item.is-active::before {
  width: 11px;
}

.catalog-content {
  min-width: 0;
}

.catalog-content__header {
  min-height: 58px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-end;
  gap: 28px;
  border-bottom: 1px solid rgb(23 24 25 / 24%);
}

.catalog-content__header .catalog-back {
  justify-self: end;
  margin-bottom: 2px;
}

.catalog-shell {
  min-height: max(560px, calc(100svh - var(--bte-header-height)));
  border-bottom: 0;
}

.catalog-content__title {
  margin: 0;
  font-size: clamp(28px, 2.4vw, 40px);
  font-weight: 590;
  line-height: 1.08;
  letter-spacing: -.033em;
  text-wrap: balance;
}

.catalog-status {
  min-height: 0;
  color: var(--bte-body);
  font-size: 14px;
}

.catalog-status:not(:empty) {
  min-height: 24px;
  margin-bottom: 12px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(24px, 2.2vw, 36px) clamp(16px, 1.6vw, 24px);
}

.product-card {
  min-width: 0;
  margin: 0;
}

.product-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  overflow: hidden;
  display: block;
  color: var(--bte-ink);
  background: #fff;
  cursor: zoom-in;
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .4s var(--bte-ease), filter .4s var(--bte-ease);
}

.product-card__media:hover img {
  transform: scale(1.025);
  filter: brightness(1.02);
}

.product-card__media .dashicons {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: rgb(23 24 25 / 72%);
  font-size: 21px;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity .25s ease, transform .25s var(--bte-ease);
}

.product-card__media:hover .dashicons,
.product-card__media:focus-visible .dashicons {
  opacity: 1;
  transform: none;
}

.product-card h3 {
  margin: 10px 0 0;
  padding-top: 9px;
  border-top: 1px solid rgb(23 24 25 / 18%);
  font-size: 16px;
  font-weight: 590;
  line-height: 1.3;
  letter-spacing: -.012em;
  overflow-wrap: anywhere;
}

.catalog-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 46px 0;
  border-top: 1px solid rgb(23 24 25 / 15%);
  border-bottom: 1px solid rgb(23 24 25 / 15%);
  color: var(--bte-body);
  font-size: 16px;
  line-height: 1.55;
}

.catalog-load-more {
  min-width: 134px;
  min-height: 46px;
  margin-top: 34px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  color: var(--bte-white);
  background: var(--bte-ink);
  font-size: 14px;
  font-weight: 640;
  cursor: pointer;
  transition: background-color .22s ease, transform .22s var(--bte-ease);
}

.catalog-load-more:hover {
  background: #2c2e30;
  transform: translateY(-1px);
}

.catalog-load-more:active {
  transform: translateY(0);
}

.catalog-load-more[hidden] {
  display: none;
}

.catalog-skeleton {
  min-width: 0;
}

.catalog-skeleton__image {
  aspect-ratio: 1;
  background: rgb(255 255 255 / 72%);
}

.catalog-skeleton__line {
  width: 56%;
  height: 13px;
  margin-top: 12px;
  background: rgb(23 24 25 / 10%);
}

@media (prefers-reduced-motion: no-preference) {
  .catalog-skeleton__image,
  .catalog-skeleton__line {
    background-image: linear-gradient(90deg, transparent, rgb(255 255 255 / 58%), transparent);
    background-size: 220% 100%;
    animation: bte-skeleton 1.5s ease-in-out infinite;
  }
}

@keyframes bte-skeleton {
  from {
    background-position: 180% 0;
  }
  to {
    background-position: -40% 0;
  }
}

.product-lightbox {
  width: min(92vw, 1180px);
  max-width: none;
  max-height: 92svh;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: visible;
  color: var(--bte-ink);
  background: var(--bte-white);
  box-shadow: 0 16px 48px rgb(18 20 22 / 24%);
}

.product-lightbox::backdrop {
  background: rgb(18 20 22 / 72%);
}

.product-lightbox__close {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--bte-white);
  background: rgb(23 24 25 / 84%);
  cursor: pointer;
}

.product-lightbox__close .dashicons {
  width: 28px;
  height: 28px;
  font-size: 28px;
}

.product-lightbox figure {
  margin: 0;
}

.product-lightbox img {
  width: 100%;
  max-height: calc(92svh - 52px);
  object-fit: contain;
  background: #fff;
}

.product-lightbox figcaption {
  min-height: 52px;
  padding: 15px 20px;
  color: var(--bte-body);
  font-size: 14px;
  line-height: 1.4;
}

.single-product {
  min-height: 640px;
  padding: 64px 0 96px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: clamp(48px, 6vw, 96px);
}

.single-product__media {
  background: #fff;
}

.single-product__media img {
  width: 100%;
  height: auto;
}

.single-product__content {
  color: var(--bte-body);
  font-size: 16px;
  line-height: 1.65;
}

@media (max-width: 1180px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .product-index__inner,
  .catalog-shell__inner,
  .single-product {
    width: calc(100% - 48px);
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px 20px;
  }

  .product-index {
    height: auto;
    min-height: 0;
  }

  .product-index__inner {
    height: auto;
    padding-block: 30px 64px;
    display: block;
  }

  .category-feature,
  .category-tile {
    display: block;
  }

  .category-feature__media {
    width: 100%;
    height: auto;
    aspect-ratio: 4096 / 1365;
  }

  .category-grid {
    margin-top: 30px;
  }

  .category-tile__media {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  .catalog-shell__inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .catalog-rail {
    position: sticky;
    z-index: 10;
    top: var(--bte-header-height);
    max-height: none;
    margin-inline: -24px;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid rgb(23 24 25 / 18%);
    background: rgb(233 235 236 / 96%);
  }

  .catalog-rail__viewport {
    max-height: none;
    padding: 0 24px;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .catalog-rail__viewport::-webkit-scrollbar {
    display: none;
  }

  .catalog-rail__item {
    flex: 0 0 auto;
    width: auto;
    min-height: 56px;
    padding: 14px 18px;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .catalog-rail__item::before {
    left: 18px;
    top: auto;
    bottom: 0;
    transform: none;
  }

  .catalog-rail__item.is-active::before {
    width: calc(100% - 36px);
  }

  .single-product {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 14px;
  }
}

@media (max-width: 640px) {
  .product-index__inner,
  .catalog-shell__inner,
  .single-product {
    width: calc(100% - 36px);
  }

  .product-index__inner { padding: 24px 0 58px; }

  .category-heading {
    grid-template-columns: 30px minmax(0, 1fr) auto;
  }

  .category-heading h2 {
    font-size: 20px;
  }

  .category-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .category-heading--compact {
    min-height: 54px;
  }

  .catalog-shell__inner {
    padding: 30px 0 72px;
  }

  .catalog-rail {
    margin-inline: -18px;
  }

  .catalog-rail__viewport {
    padding-inline: 18px;
  }

  .catalog-content__header {
    min-height: 52px;
    align-items: flex-start;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .catalog-content__header .catalog-back {
    grid-row: 1;
    justify-self: end;
    margin-bottom: 0;
  }

  .catalog-content__header .catalog-content__title {
    grid-row: 2;
  }

  .catalog-content__title {
    font-size: 27px;
  }

  .product-card h3 {
    font-size: 14px;
  }

  .product-lightbox {
    width: calc(100vw - 24px);
  }
}

@media (max-width: 420px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 12px;
  }
}

/*
 * Product landing and catalogue entrance
 * Reuses the shared subpage motion so every product route feels related.
 */
@media (prefers-reduced-motion: no-preference) {
  .bte-products-area .category-feature .category-heading,
  .bte-products-area .category-feature__media,
  .bte-products-area .category-tile,
  .bte-products-area .catalog-rail,
  .bte-products-area .catalog-content__header,
  .bte-products-area .product-card,
  .bte-products-area .catalog-load-more:not([hidden]) {
    animation: bte-content-enter 560ms var(--bte-ease) both;
  }

  .bte-products-area .category-feature .category-heading,
  .bte-products-area .catalog-rail {
    animation-delay: 40ms;
  }

  .bte-products-area .category-feature__media,
  .bte-products-area .catalog-content__header {
    animation-delay: 100ms;
  }

  .bte-products-area .category-tile:nth-child(1),
  .bte-products-area .product-card:nth-child(4n + 1) {
    animation-delay: 165ms;
  }

  .bte-products-area .category-tile:nth-child(2),
  .bte-products-area .product-card:nth-child(4n + 2) {
    animation-delay: 210ms;
  }

  .bte-products-area .category-tile:nth-child(3),
  .bte-products-area .product-card:nth-child(4n + 3) {
    animation-delay: 255ms;
  }

  .bte-products-area .category-tile:nth-child(4),
  .bte-products-area .product-card:nth-child(4n) {
    animation-delay: 300ms;
  }

  .bte-products-area .catalog-load-more:not([hidden]) {
    animation-delay: 340ms;
  }
}
