/* values follow the live AEM tabswithimagecarousel (horizontal variant) on the wall coverings page; desktop layout from 992px like the live site */

/* full page width, like live */
main > .section.tabs-image-carousel-container:has(.tabs-image-carousel) {
  margin: 0 0 10px;
  padding: 0;
}

main > .section > div:has(> .tabs-image-carousel) {
  max-width: none;
  padding: 0;
}

.tabs-image-carousel {
  display: flex;
  flex-direction: column;
}

/* ---------- tabs (mobile: scrolling row) ---------- */
.tabs-image-carousel .tabs-image-carousel-tabs {
  display: flex;
  align-items: center;
  justify-content: safe center;
  gap: 20px;
  height: 40px;
  margin: 15px 16px 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-image-carousel .tabs-image-carousel-tabs::-webkit-scrollbar {
  display: none;
}

.tabs-image-carousel .tabs-image-carousel-tabs[hidden] {
  display: none;
}

.tabs-image-carousel .tabs-image-carousel-tab {
  flex: none;
  margin: 0;
  padding: 1px 6px 1px 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: #000;
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
  white-space: nowrap;
  cursor: pointer;
}

.tabs-image-carousel .tabs-image-carousel-tab[aria-selected="true"] {
  padding: 0;
  font-weight: 700;
  text-align: center;
  cursor: default;
}

/* underline under the active tab */
.tabs-image-carousel .tabs-image-carousel-tab[aria-selected="true"]::after {
  content: "";
  display: block;
  width: 32%;
  height: 2px;
  margin: 3px auto 0;
  border-radius: 999px;
  background: #222;
}

.tabs-image-carousel .tabs-image-carousel-tab:focus-visible {
  outline: 2px solid #000;
  outline-offset: 4px;
}

/* ---------- slider ---------- */
.tabs-image-carousel .tabs-image-carousel-panel[hidden] {
  display: none;
}

.tabs-image-carousel .tabs-image-carousel-slider {
  position: relative;
}

.tabs-image-carousel .tabs-image-carousel-viewport {
  overflow: hidden;
  border-radius: 8px;
  touch-action: pan-y;
}

.tabs-image-carousel .tabs-image-carousel-track {
  display: flex;
  transition: transform 0.3s ease;
}

.tabs-image-carousel .tabs-image-carousel-track.no-animation {
  transition: none;
}

.tabs-image-carousel .tabs-image-carousel-slide {
  position: relative;
  flex: 0 0 100%;
}

.tabs-image-carousel .tabs-image-carousel-media {
  display: block;
}

/* space is kept for the image while it loads (live image shapes), the real shape wins once loaded */
.tabs-image-carousel .tabs-image-carousel-media img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 200px;
  aspect-ratio: auto 722 / 1040;
  object-fit: contain;
  user-select: none;
}

/* optional button, bottom right */
.tabs-image-carousel .tabs-image-carousel-cta {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 16px 16px 0 auto;
  padding: 5.5px 16px;
  border: 1px solid #fff;
  border-radius: 45px;
  background: #fff;
  color: #000;
  font-size: 14px;
  font-weight: 700;
  line-height: 21px;
  text-decoration: none;
}

.tabs-image-carousel .tabs-image-carousel-arrow {
  width: 17px;
  height: 17px;
  background-color: currentcolor;
  mask: url("../../icons/arrow-right.svg") center / 100% 100% no-repeat;
}

/* mobile: dots under the image, no arrows */
.tabs-image-carousel .tabs-image-carousel-prev,
.tabs-image-carousel .tabs-image-carousel-next {
  display: none;
}

.tabs-image-carousel .tabs-image-carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -25px;
  display: flex;
  justify-content: center;
  gap: 7px;
}

.tabs-image-carousel .tabs-image-carousel-dot {
  width: 6px;
  height: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #8c8e90;
  cursor: pointer;
}

.tabs-image-carousel .tabs-image-carousel-dot[aria-current="true"] {
  width: 24px;
  background: #000;
}

@media (width >= 992px) {
  main > .section.tabs-image-carousel-container:has(.tabs-image-carousel) {
    margin-bottom: 80px;
  }

  .tabs-image-carousel {
    gap: 27px;
  }

  .tabs-image-carousel .tabs-image-carousel-tabs {
    align-items: flex-start;
    gap: 50px;
    height: auto;
    margin: 16px 0 0;
    overflow: visible;
  }

  .tabs-image-carousel .tabs-image-carousel-tab {
    margin-bottom: 24px;
    font-size: 20px;
    font-weight: 300;
    line-height: 24px;
  }

  .tabs-image-carousel .tabs-image-carousel-tab[aria-selected="true"] {
    width: 162px;
    font-weight: 700;
  }

  .tabs-image-carousel .tabs-image-carousel-tab[aria-selected="true"]::after {
    width: 60%;
    height: 4px;
    margin-top: 15px;
  }

  .tabs-image-carousel .tabs-image-carousel-media img {
    aspect-ratio: auto 2698 / 1100;
  }

  .tabs-image-carousel .tabs-image-carousel-cta {
    position: absolute;
    right: 40px;
    bottom: 40px;
    margin: 0;
    padding: 10px 20px;
    font-size: 16px;
    line-height: 24px;
  }

  /* round arrows 15px under the image, around the centre */
  .tabs-image-carousel .tabs-image-carousel-prev,
  .tabs-image-carousel .tabs-image-carousel-next {
    position: absolute;
    top: calc(100% + 15px);
    display: block;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: url("../../icons/circle-arrow-next.svg") center / 44px 44px no-repeat;
    cursor: pointer;
  }

  .tabs-image-carousel .tabs-image-carousel-prev {
    left: calc(46.8% - 11px);
    transform: rotate(180deg);
  }

  .tabs-image-carousel .tabs-image-carousel-next {
    left: calc(53.5% - 33px);
  }

  .tabs-image-carousel .tabs-image-carousel-prev:focus-visible,
  .tabs-image-carousel .tabs-image-carousel-next:focus-visible {
    outline: 1px solid #000;
    outline-offset: 2px;
  }

  .tabs-image-carousel .tabs-image-carousel-dots {
    display: none;
  }
}

/* ===== HEADING (optional) START: title above the tabs, like live ===== */
.tabs-image-carousel .tabs-image-carousel-heading {
  margin: 40px 40px -3px;
  color: #222;
  font-size: 24px;
  font-weight: 800;
  line-height: 28.8px;
  letter-spacing: 0.5px;
  text-align: center;
}

@media (width >= 992px) {
  .tabs-image-carousel .tabs-image-carousel-heading {
    margin: 0 0 -19px;
    font-size: 40px;
    line-height: normal;
  }
}

/* ===== HEADING END ===== */