/**
 * Catalogue listing page extras only.
 * Product cards + related-grid styles come from style.css + site-bridge.css
 * (same path as PDP related products).
 * Fit-width zoom is applied by catalogue.js (same as PDP script.js).
 */

.product-listing-root.page {
  width: 100%;
  max-width: 1728px;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 48px;
  overflow: hidden;
  background: #fff;
}

.product-listing-root .related--listing {
  margin-top: 0;
  margin-bottom: 24px;
}

.product-listing-root .related-grid {
  align-items: stretch;
}

.related-grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-family: 'Poppins', Arial, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  padding: 3rem 0;
  color: #5d380f;
}

.catalogue-pagination {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  padding-bottom: 24px;
}

.catalogue-infinite {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 16px 16px 40px;
  color: #5d380f;
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 14px;
}

.catalogue-infinite-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.catalogue-infinite-status[hidden],
.catalogue-infinite-end[hidden] {
  display: none !important;
}

.catalogue-infinite-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(93, 56, 15, 0.2);
  border-top-color: #5d380f;
  border-radius: 50%;
  animation: catalogue-spin 0.7s linear infinite;
}

.catalogue-infinite-end {
  color: rgba(93, 56, 15, 0.7);
}

@keyframes catalogue-spin {
  to { transform: rotate(360deg); }
}

/* Homepage latest products only — shorter media area */
#product-container .pc-media.pc-latest-media,
.product-listing-root--slider .pc-media.pc-latest-media {
  height: 175px !important;
}

/* Homepage latest-products slider: 3 cards / row */
.product-listing-root--slider {
  overflow: visible;
}

.catalogue-slider {
  position: relative;
  display: block;
  width: 100%;
  padding: 0 28px; /* room for prev/next sitting on card borders */
}

.catalogue-slider-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 8px 2px 16px;
}

.catalogue-slider-viewport::-webkit-scrollbar {
  display: none;
}

.catalogue-slider-track.related-grid {
  display: flex !important;
  flex-wrap: nowrap;
  gap: 28px;
  grid-template-columns: none !important;
  width: max-content;
  min-width: 100%;
}

.catalogue-slider-track > .product-card {
  flex: 0 0 calc((100% - 56px) / 3);
  width: calc((100% - 56px) / 3);
  max-width: calc((100% - 56px) / 3);
  scroll-snap-align: start;
}

/* Viewport is 100%; cards sized relative to viewport via container trick */
.catalogue-slider-viewport {
  container-type: inline-size;
  container-name: catalogue-slider;
}

@container catalogue-slider (min-width: 0px) {
  .catalogue-slider-track > .product-card {
    flex-basis: calc((100cqi - 56px) / 3);
    width: calc((100cqi - 56px) / 3);
    max-width: calc((100cqi - 56px) / 3);
  }
}

.catalogue-slider-btn {
  position: absolute;
  top: 50%;
  z-index: 3;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(93, 56, 15, 0.18);
  background: #fff;
  box-shadow: 0 8px 20px rgba(93, 56, 15, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background .2s ease, border-color .2s ease, opacity .2s ease;
}

/* Beat .pdp-v2-root button { background:none; border:none } */
.pdp-v2-root .catalogue-slider-btn,
.product-listing-root .catalogue-slider-btn {
  background: #fff;
  border: 1.5px solid rgba(93, 56, 15, 0.18);
  box-shadow: 0 8px 20px rgba(93, 56, 15, 0.12);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 0;
}

.catalogue-slider-btn:hover:not(:disabled) {
  background: #f8f1e7;
  border-color: #5d380f;
}

.pdp-v2-root .catalogue-slider-btn:hover:not(:disabled),
.product-listing-root .catalogue-slider-btn:hover:not(:disabled) {
  background: #f8f1e7;
  border-color: #5d380f;
}

.catalogue-slider-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.catalogue-slider-btn img {
  width: 14px;
  height: 22px;
  display: block;
}

.catalogue-slider-btn--prev {
  left: 0;
  transform: translate(-50%, -50%);
}

.catalogue-slider-btn--next {
  right: 0;
  transform: translate(50%, -50%);
}

.catalogue-slider-btn--next img {
  transform: scaleX(-1);
}

@media (max-width: 900px) {
  .catalogue-slider-track.related-grid {
    gap: 18px;
  }

  @container catalogue-slider (min-width: 0px) {
    .catalogue-slider-track > .product-card {
      flex-basis: calc(100cqi - 8px);
      width: calc(100cqi - 8px);
      max-width: calc(100cqi - 8px);
    }
  }

  .catalogue-slider-btn {
    width: 38px;
    height: 38px;
  }
}
