/* Moved from inline <style> in includes/homepage.product.carousels.cfm. */
.carousel-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  /*max-width: 1200px;*/
  margin: 0 auto;
  padding: 20px 20px 20px 50px;
}

.carousel-container h3 {
    font-size: 200%;
    font-weight: bold;
    margin-bottom: 20px;
    margin-left: 10px;
}

.carousel {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-right: 50px; /* <--- New: allow peek space */
  padding-bottom: 20px; /* allow space to show shadow */
}

.carousel::-webkit-scrollbar {
  display: none;
}

.carousel-item {
  flex: 0 0 auto;
  width: 200px;
  /*height: 300px;*/
  margin-right: 16px;
  background: #f9f9f9;
  border-radius: 8px;
  display: flex;
  flex-direction: column; /* <-- Make it a column! */
  align-items: center;
  justify-content: space-between;
  padding: 0 0 10px 0;
  user-select: none;
  scroll-snap-align: start;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
	text-decoration: none; /* <--- Important: remove underline */
  color: inherit; /* <--- Keep text color same */
  transition: box-shadow 0.3s;
}
.carousel-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.2); /* optional: hover effect */
  transform: translateY(-2px);
}

/* Larger screens (desktops) - more items visible */
@media (min-width: 1200px) {
  .carousel-item {
    width: 22%;
  }
}

/* Medium screens (tablets landscape) */
@media (max-width: 1199px) and (min-width: 768px) {
  .carousel-item {
    width: 180px;
  }
}

/* Small screens (phones + small tablets) */
@media (max-width: 767px) {
  .carousel-container {
    padding-left: 10px;
  }
  .carousel-container h3 {
      text-align: center;
  }
  .carousel {
	  padding-left: 10px;
	}
  .carousel-item {
    width: 70%;
    margin-right: 12px;
	  scroll-snap-align: center;
  }
  .dots-container {
      display: none;
  }
}

/* Very small phones */
@media (max-width: 480px) {
  .carousel-item {
    width: 85%;
    margin-right: 10px;
  }
}

/* Heading */
.item-heading {
  font-size: 1rem;
  font-weight: bold;
  margin-top: 8px;
  color: #333;
  padding: 0 10px;
}

/* Image container */
.item-image {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: 240px;
  background-color: #fff;
  padding-top: 10px;
  position: relative;
}

.item-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.item-logo {
    position: absolute;
    text-align: right;
    top: 20px;
    right: 20px;
    display: flex;
    justify-content: flex-end;
    /*display: none;*/
}
.item-logo img {
    max-width: 50%;
    max-height: 70px;
    border-radius: 0;
}

/* Price / CTA */
.item-price {
  /*margin-top: 8px;
  font-size: 1rem;
  font-weight: bold;
  color: #007BFF;*/
}



.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 0 10px 6px 10px;
  z-index: 10;
  opacity: 1;
  transition: opacity 0.3s;
}

.nav.left {
  left: 10px;
}

.nav.right {
  right: 10px;
}

.nav.hidden {
  opacity: 0; /* fully fade out instead of disable */
  pointer-events: none;
}

.dots-container {
  text-align: center;
  margin-top: 15px;
}

.dot {
  height: 10px;
  width: 10px;
  margin: 0 5px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.3s, transform 0.3s;
	cursor: pointer;
}

.dot.active {
  background-color: #007BFF;
  transform: scale(1.5); /* Grow active dot */
	cursor: initial;
}

/* price display */
.price-gbp,
.price-alt {
  font-size: 1rem;
}

.price-gbp.original,
.price-alt.original {
  text-decoration: line-through;
  color: #888;
  margin-right: 0.5em;
}

.price-gbp.sale,
.price-alt.sale {
  color: #d00;
  font-weight: bold;
}

.discount {
  color: #090;
  font-size: 0.9rem;
  margin-left: 0.5em;
}

.product--label-container {
    position: absolute;
    z-index: 1;
    top: 20px;
    left: 20px;
}

.product--label-container .product--label {
    display: inline-block;
    border-radius: 4px;
    background-color: #007BFF;
    color: #fff;
    font-size: 10px;
    font-weight: 500;
    line-height: 20px;
    padding: 0 10px;
    text-transform: uppercase;
    text-align: center;
    z-index: 2;
}
.product--label-container .product--label.clearance {
    background-color: red;
    color: #fff;
}
.product--label-container .product--label.new {
    background-color: green;
    color: #fff;
}


/* ---------------------------------------------------------------------------
   Brand + fitment lines on the adaptive best-sellers strip
   (includes/homepage.bestsellers.cfm). Tokens from css/foundations.css.
   The fitment line is clamped to two lines; the full list is in the title
   attribute, same convention as the news-parts cards. */
/* WIDTH IS LOAD-BEARING on both of these. .carousel-item is
   `display:flex; flex-direction:column; align-items:center`, so its children
   are shrink-to-fit rather than stretched. A plain block like .item-heading
   copes, but .hb-fits uses `display:-webkit-box` (required by
   -webkit-line-clamp), which is a legacy flex container - at auto width inside
   a centred column it collapses to nearly nothing and `overflow:hidden` then
   clips the text away entirely. The markup was present and correct in the HTML
   but rendered invisible. width:100% + the card's own 10px gutter fixes it. */
.carousel-item .hb-brand,
.carousel-item .hb-fits {
    width: 100%;
    padding: 0 10px;
    text-align: center;
}
.carousel-item .hb-brand {
    font-size: var(--oct-text-xs, 0.8125rem);
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--oct-ink-faint, #8a939f);
    margin-top: 2px;
}
.carousel-item .hb-fits {
    font-size: var(--oct-text-sm, 0.9375rem);
    color: var(--oct-ink-mute, #6b7683);
    line-height: 1.35;
    margin: 4px 0 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.carousel-item .hb-fits-lbl {
    color: var(--oct-ink-faint, #8a939f);
    font-weight: 600;
}
