/* Charoal product carousels v13 — 4/3/2 cards with accessible paging. */

html.charoal-redesign .products-block.charoal-product-carousel-v13 {
  position: relative;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: clamp(14px, 1.45vw, 22px) !important;
  width: 100% !important;
  margin: 0 !important;
  overflow: visible !important;
}

html.charoal-redesign .products-block.charoal-product-carousel-v13::before,
html.charoal-redesign .products-block.charoal-product-carousel-v13::after {
  content: none !important;
  display: none !important;
}

/* Replace the original Shoptet next/previous overlay with the v13 controls. */
html.charoal-redesign body.type-detail
  .products-block.charoal-product-carousel-v13 + .browse-p {
  display: none !important;
}

html.charoal-redesign .products-block.charoal-product-carousel-v13 > .product {
  display: none !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

html.charoal-redesign .products-block.charoal-product-carousel-v13
  > .product.charoal-carousel-item-visible {
  display: block !important;
  animation: charoal-carousel-in-next .28s ease both;
}

html.charoal-redesign .products-block.charoal-product-carousel-v13[data-charoal-direction="prev"]
  > .product.charoal-carousel-item-visible {
  animation-name: charoal-carousel-in-prev;
}

html.charoal-redesign .products-block.charoal-product-carousel-v13 > .product > .p {
  min-height: 490px !important;
  height: 100% !important;
  padding: 15px !important;
}

html.charoal-redesign .products-block.charoal-product-carousel-v13 .product .image {
  height: clamp(210px, 18vw, 270px) !important;
}

html.charoal-redesign .products-block.charoal-product-carousel-v13 .product .name {
  min-height: 46px !important;
  font-size: 16px !important;
  line-height: 1.3 !important;
}

.charoal-carousel-controls-v13 {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-height: 44px;
  margin: -56px 0 14px;
  pointer-events: none;
}

.charoal-carousel-controls-v13.charoal-carousel-controls-no-heading {
  margin-top: 6px;
}

.charoal-carousel-controls-v13[hidden] {
  display: none !important;
}

.charoal-carousel-counter-v13 {
  min-width: 64px;
  color: #746b76;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  pointer-events: auto;
}

.charoal-carousel-arrow-v13 {
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: #75278d;
  background: #fff;
  border: 1px solid #dfd3dd;
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(48, 21, 47, .1);
  cursor: pointer;
  pointer-events: auto;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease,
    box-shadow .18s ease, transform .18s ease;
}

.charoal-carousel-arrow-v13 svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.charoal-carousel-arrow-v13:hover:not(:disabled) {
  color: #fff;
  background: linear-gradient(135deg, #d72f93, #75278d);
  border-color: transparent;
  box-shadow: 0 10px 26px rgba(117, 39, 141, .23);
  transform: translateY(-1px);
}

.charoal-carousel-arrow-v13:focus-visible {
  outline: 3px solid rgba(215, 47, 147, .3);
  outline-offset: 3px;
}

.charoal-carousel-arrow-v13:disabled {
  color: #bcb4bd;
  background: #faf8fa;
  box-shadow: none;
  cursor: default;
  opacity: .62;
}

/* Homepage product imagery stays clean white, including all future blocks. */
html.charoal-redesign body.id-1.type-index .products-block .product .image,
html.charoal-redesign body.id-1.type-index .products-block .product .image > a,
html.charoal-redesign body.id-1.type-index .products-block .product .image img {
  background: #fff !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

html.charoal-redesign body.id-1.type-index .products-block .product .image::before,
html.charoal-redesign body.id-1.type-index .products-block .product .image::after {
  content: none !important;
  display: none !important;
}

@keyframes charoal-carousel-in-next {
  from { opacity: .25; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes charoal-carousel-in-prev {
  from { opacity: .25; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 1099px) {
  html.charoal-redesign .products-block.charoal-product-carousel-v13 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 13px !important;
  }

  html.charoal-redesign .products-block.charoal-product-carousel-v13 > .product > .p {
    min-height: 430px !important;
    padding: 12px !important;
  }

  html.charoal-redesign .products-block.charoal-product-carousel-v13 .product .image {
    height: clamp(190px, 26vw, 235px) !important;
  }
}

@media (max-width: 767px) {
  html.charoal-redesign .products-block.charoal-product-carousel-v13 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  html.charoal-redesign .products-block.charoal-product-carousel-v13 > .product > .p {
    min-height: 370px !important;
    padding: 9px !important;
  }

  html.charoal-redesign .products-block.charoal-product-carousel-v13 .product .image {
    height: clamp(150px, 45vw, 190px) !important;
  }

  html.charoal-redesign .products-block.charoal-product-carousel-v13 .product .name {
    min-height: 40px !important;
    font-size: 13px !important;
  }

  .charoal-carousel-controls-v13,
  .charoal-carousel-controls-v13.charoal-carousel-controls-no-heading {
    min-height: 40px;
    margin: 0 0 10px;
    gap: 7px;
  }

  .charoal-carousel-arrow-v13 {
    width: 40px;
    height: 40px;
  }

  .charoal-carousel-counter-v13 {
    min-width: 58px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.charoal-redesign .products-block.charoal-product-carousel-v13
    > .product.charoal-carousel-item-visible {
    animation: none !important;
  }

  .charoal-carousel-arrow-v13 {
    transition: none !important;
  }
}
