/* REP PDP layout v3
 * This file is the sole owner of page-level product layout.
 * Child components may use grid/flex internally, but do not position sibling sections.
 */
.rep-single-product div.product {
  display: block !important;
  max-width: 100% !important;
  min-width: 0 !important;
  width: 100% !important;
}

.rep-single-product .rep-pdp-product-header,
.rep-single-product .rep-pdp-layout,
.rep-single-product .rep-pdp-layout > *,
.rep-single-product .rep-pdp-layout__purchase > * {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

.rep-single-product .rep-pdp-layout {
  align-items: start;
  display: grid !important;
  gap: 1.5rem;
  grid-template-areas:
    "media"
    "details"
    "purchase"
    "related"
    "description"
    "reviews";
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
}

.rep-pdp-layout__media { grid-area: media; }
.rep-pdp-layout__details { grid-area: details; }
.rep-pdp-layout__purchase { grid-area: purchase; }
.rep-pdp-layout__related { grid-area: related; }
.rep-pdp-layout__description { grid-area: description; }
.rep-pdp-layout__reviews { grid-area: reviews; }

.rep-single-product .rep-pdp-layout__media,
.rep-single-product .rep-pdp-layout__details,
.rep-single-product .rep-pdp-layout__purchase,
.rep-single-product .rep-pdp-layout__related,
.rep-single-product .rep-pdp-layout__description,
.rep-single-product .rep-pdp-layout__reviews {
  margin: 0 !important;
  position: static !important;
  width: 100% !important;
}

/* Media owns only gallery layout. */
.rep-single-product .rep-pdp-layout__media .woocommerce-product-gallery {
  box-sizing: border-box;
  float: none !important;
  margin: 0 !important;
  max-width: 100% !important;
  min-width: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}
.rep-single-product .rep-pdp-layout__media .woocommerce-product-gallery__wrapper,
.rep-single-product .rep-pdp-layout__media .woocommerce-product-gallery__image,
.rep-single-product .rep-pdp-layout__media .woocommerce-product-gallery__image > a {
  box-sizing: border-box;
  max-width: 100% !important;
  min-width: 0 !important;
  width: 100% !important;
}
.rep-single-product .rep-pdp-layout__media .woocommerce-product-gallery__image {
  min-height: 0 !important;
}
.rep-single-product .rep-pdp-layout__media .flex-control-thumbs {
  box-sizing: border-box;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: .65rem;
  inset: auto !important;
  margin: .75rem 0 0 !important;
  max-width: 100% !important;
  min-width: 0 !important;
  position: static !important;
  width: 100% !important;
}
.rep-single-product .rep-pdp-layout__media .flex-control-thumbs li {
  flex: 0 0 4.25rem;
  width: 4.25rem !important;
}

/* Details and purchase are independent vertical components. */
.rep-single-product .rep-pdp-layout__details,
.rep-single-product .rep-pdp-layout__purchase {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.rep-single-product .rep-pdp-layout__details > *,
.rep-single-product .rep-pdp-layout__purchase > *,
.rep-single-product .rep-pdp-buybox-group,
.rep-single-product .rep-pdp__buybox,
.rep-single-product .rep-pdp-open-box {
  box-sizing: border-box;
  margin: 0 !important;
  max-width: 100% !important;
  min-width: 0 !important;
  position: static !important;
  width: 100% !important;
}
.rep-single-product .rep-pdp-open-box { margin-top: 1rem !important; }

/* Documents grid is internal to Documents & Resources only. */
.rep-single-product .rep-pdp-documents-resources {
  background: #fff;
  border: 1px solid #d7e0ec;
  border-radius: 8px;
  padding: 1rem;
}
.rep-single-product .rep-pdp-documents-resources > h2 { margin: 0 0 .8rem; }
.rep-single-product .rep-pdp-documents__grid {
  display: grid !important;
  gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  margin: 0 !important;
  width: 100%;
}
.rep-single-product .rep-pdp-documents__card { min-width: 0; }

/* Carousels scroll internally and can never widen the page. */
.rep-single-product .rep-pdp-layout__related,
.rep-single-product .rep-pdp-related,
.rep-single-product .rep-pdp-related__viewport,
.rep-single-product .rep-pdp-related__rail {
  box-sizing: border-box;
  max-width: 100% !important;
  min-width: 0 !important;
  width: 100% !important;
}
.rep-single-product .rep-pdp-related,
.rep-single-product .rep-pdp-related__viewport { overflow: hidden !important; }
.rep-single-product .rep-pdp-related__rail { overflow-x: auto !important; }

/* Header metadata may wrap; it must not define page width. */
.rep-single-product .rep-pdp-product-header .product_title {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal !important;
  word-break: normal;
}
.rep-single-product .rep-pdp-product-header .rep-pdp__identity { flex-wrap: wrap !important; }
.rep-single-product .rep-pdp-product-header .rep-pdp__identity > * {
  max-width: 100%;
  white-space: normal !important;
}

/* Tablet: media left, details and purchase right. */
@media (min-width: 48rem) and (max-width: 73.75rem) {
  .rep-single-product .rep-pdp-layout {
    grid-template-areas:
      "media details"
      "media purchase"
      "related related"
      "description description"
      "reviews reviews";
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  }
  .rep-single-product .rep-pdp-documents__grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* Desktop: media, details, and purchase each own one column. */
@media (min-width: 73.76rem) {
  .rep-single-product .rep-pdp-layout {
    grid-template-areas:
      "media details purchase"
      "related related purchase"
      "description description purchase"
      "reviews reviews reviews";
    grid-template-columns: minmax(400px, .85fr) minmax(280px, 1fr) 350px;
  }
}

@media (max-width: 47.99rem) {
  body.rep-single-product { overflow-x: hidden; }
  .rep-single-product .rep-pdp-layout { gap: 1rem; }
  .rep-single-product .rep-pdp-layout__media .flex-control-thumbs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .rep-single-product .rep-pdp-documents__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
body.rep-single-product { overflow-x: clip; }

/* Width guards for legacy Woo wrappers and narrow purchase controls. */
.rep-single-product .site-main,
.rep-single-product .site-main > .woocommerce,
.rep-single-product .site-main > .woocommerce > .product {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 47.99rem) {
  .rep-single-product .site-main,
  .rep-single-product .site-main > .woocommerce,
  .rep-single-product .site-main > .woocommerce > .product,
  .rep-single-product .rep-pdp-product-header,
  .rep-single-product .rep-pdp-layout {
    max-width: 100vw !important;
    min-width: 0 !important;
  }
  .rep-single-product .rep-pdp-specifications__shipping .ups-pcalc__row {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .rep-single-product .rep-pdp-specifications__shipping .ups-pcalc__btn {
    grid-column: auto !important;
    width: 100% !important;
  }
}
/* Branded primary action in the independent purchase section. */
.rep-single-product .rep-pdp-layout__purchase .rep-pdp__buybox .single_add_to_cart_button,
.rep-single-product .rep-pdp-layout__purchase .rep-pdp__buybox .single_add_to_cart_button:visited {
  background: #075ff7 !important;
  border-color: #075ff7 !important;
  color: #fff !important;
}

.rep-single-product .rep-pdp-layout__purchase .rep-pdp__buybox .single_add_to_cart_button:hover,
.rep-single-product .rep-pdp-layout__purchase .rep-pdp__buybox .single_add_to_cart_button:focus-visible {
  background: #064dcc !important;
  border-color: #064dcc !important;
  color: #fff !important;
}
/* Wide tablets: show three related-product cards; iPad Mini keeps two. */
@media (min-width: 53.81rem) and (max-width: 64rem) {
  .rep-single-product .rep-pdp-layout__related .rep-pdp-related__rail {
    gap: 1rem;
  }
  .rep-single-product .rep-pdp-layout__related .rep-pdp-related__item {
    flex: 0 0 calc((100% - 2rem) / 3) !important;
    width: calc((100% - 2rem) / 3) !important;
  }
  .rep-single-product .rep-pdp-layout__related .rep-product-card {
    margin-inline: 0;
    max-width: none;
    width: 100%;
  }
}

/* Product gallery thumbnail carousel controls. */
.rep-single-product .rep-pdp-thumbs {
  align-items: center;
  display: grid;
  gap: .5rem;
  grid-template-columns: 2.25rem minmax(0, 1fr) 2.25rem;
  margin-top: .75rem;
  max-width: min(100%, 23rem);
  width: 100%;
}
.rep-single-product .rep-pdp-thumbs__viewport {
  min-width: 0;
  overflow: hidden;
  position: relative;
  width: 100%;
}
.rep-single-product .rep-pdp-thumbs .flex-control-thumbs {
  flex-wrap: nowrap !important;
  margin: 0 !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  scroll-behavior: smooth;
  width: 100% !important;
  scrollbar-width: none;
}
.rep-single-product .rep-pdp-thumbs .flex-control-thumbs > li,
.rep-single-product .rep-pdp-thumbs .flex-control-thumbs > li:nth-child(n) {
  display: flex !important;
}
.rep-single-product .rep-pdp-thumbs .flex-control-thumbs::-webkit-scrollbar {
  display: none;
}
.rep-single-product .rep-pdp-thumbs__arrow {
  align-items: center;
  background: #eef1f5;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  box-sizing: border-box;
  box-shadow: 0 3px 9px rgba(15, 35, 60, .1);
  color: #1e3a5f;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 2.25rem;
  height: 2.25rem !important;
  justify-content: center;
  max-height: 2.25rem;
  max-width: 2.25rem !important;
  min-height: 2.25rem !important;
  min-width: 2.25rem !important;
  padding: 0;
  position: relative;
  width: 2.25rem !important;
  z-index: 2;
}
.rep-single-product .rep-pdp-thumbs__arrow:hover:not(:disabled),
.rep-single-product .rep-pdp-thumbs__arrow:focus-visible:not(:disabled) {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #075ff7;
}
.rep-single-product .rep-pdp-thumbs__arrow:disabled {
  background: #f3f4f6;
  color: #94a3b8;
  cursor: default;
  opacity: .65;
}
.rep-single-product .rep-pdp-thumbs__arrow svg {
  fill: none;
  height: 1rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 1rem;
}