/* Alphalete-style product carousel overrides */

.alpha-carousel {
  --alpha-gap: 12px;
  --alpha-card: clamp(180px, 22vw, 280px);
  --alpha-radius: 12px;
  padding: 28px 0 40px;
}

/* the class sits on both the section wrapper and its inner block: keep the
   padding on the inner one only, and stack homepage carousels closely */
.page-section.alpha-carousel {
  padding: 0;
}

.page-section.index-section.alpha-carousel {
  margin-bottom: 0;
}

.page-section.alpha-carousel > .alpha-carousel {
  padding: 12px 0 16px;
}

.alpha-carousel .page-width,
.alpha-carousel .page-width--flush-small {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

.alpha-carousel .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px;
  padding: 0 clamp(16px, 3vw, 40px);
  text-align: left !important;
}

.alpha-carousel .section-header__title,
.alpha-carousel .alpha-carousel__title,
.alpha-carousel .section-header__title .animation-contents {
  margin: 0;
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
  font-style: normal !important;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}

.alpha-carousel__controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.alpha-carousel__shop-link {
  color: #111;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  white-space: nowrap;
}

.alpha-carousel__shop-link:hover {
  opacity: 0.65;
}

.alpha-carousel__arrows {
  display: flex;
  align-items: center;
  gap: 4px;
}

.alpha-carousel__arrow {
  appearance: none;
  border: 0;
  background: transparent;
  width: 32px;
  height: 32px;
  padding: 0;
  cursor: pointer;
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.alpha-carousel__arrow:hover:not(:disabled) {
  opacity: 0.45;
}

.alpha-carousel__arrow:disabled {
  opacity: 0.25;
  cursor: default;
}

.alpha-carousel__arrow svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

.alpha-carousel .grid-overflow-wrapper {
  overflow: visible !important;
  margin: 0 !important;
}

.alpha-carousel .grid.grid--uniform,
.alpha-carousel .grid.grid--uniform.aos-init,
.alpha-carousel .grid.grid--uniform.aos-animate,
.alpha-carousel [data-aos="overflow__animation"] {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: var(--alpha-gap);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 clamp(16px, 3vw, 40px) 8px;
  /* snap to the padded edge, otherwise the first card snaps under the gutter */
  scroll-padding-inline: clamp(16px, 3vw, 40px);
  margin: 0 !important;
  transform: none !important;
  translate: none !important;
  opacity: 1 !important;
}

.alpha-carousel .grid.grid--uniform::-webkit-scrollbar {
  display: none;
}

/* cards keep their width and scroll when they overflow; when every card
   fits in one row they grow to fill it instead of leaving a gap (no JS needed) */
.alpha-carousel .grid__item.grid-product {
  flex: 1 0 var(--alpha-card) !important;
  max-width: none !important;
  width: var(--alpha-card) !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none !important;
  scroll-snap-align: start;
}

.alpha-carousel .grid-product__content {
  position: relative;
  height: 100%;
}

.alpha-carousel .grid-product__tag {
  display: none !important;
}

.alpha-carousel .grid__item-image-wrapper {
  margin: 0;
}

.alpha-carousel .grid-product__image-mask {
  position: relative;
  border-radius: var(--alpha-radius) !important;
  overflow: hidden;
  background: #ececec;
  height: auto !important;
}

.alpha-carousel .grid__image-ratio,
.alpha-carousel .grid__image-ratio--portrait {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: 0 !important;
  padding: 0 0 125% !important; /* ~4:5 Alphalete card */
  overflow: hidden !important;
  background: #ececec;
}

.alpha-carousel image-element,
.alpha-carousel [data-aos="image-fade-in"],
.alpha-carousel .aos-init,
.alpha-carousel .image-element,
.alpha-carousel .grid__image-ratio img,
.alpha-carousel .grid__image-ratio .image-element,
.alpha-carousel .grid-product__image-mask img,
.alpha-carousel .grid-product__secondary-image img {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

.alpha-carousel .grid__image-ratio img,
.alpha-carousel .grid__image-ratio .image-element,
.alpha-carousel .grid-product__image-mask > .grid__image-ratio img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  border-radius: 0 !important;
  z-index: 1;
}

.alpha-carousel .grid-product__content {
  position: relative;
}

.alpha-carousel .grid-product__link.alpha-card-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block !important;
  padding: 0 !important;
  text-indent: -9999px;
  overflow: hidden;
}

.alpha-carousel .grid-product__meta {
  position: relative;
  z-index: 3;
  pointer-events: none;
}

.alpha-carousel .alpha-swatches {
  position: relative;
  z-index: 4;
  pointer-events: auto;
}

.alpha-carousel .alpha-wishlist {
  z-index: 5;
  pointer-events: auto;
}

.alpha-carousel .alpha-badge {
  z-index: 4;
  pointer-events: none;
}

.alpha-carousel .grid-product__secondary-image {
  border-radius: inherit;
  position: absolute !important;
  inset: 0 !important;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.alpha-carousel .grid-product__content:hover .grid-product__secondary-image {
  opacity: 1;
}

.alpha-carousel .grid-product__secondary-image img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.alpha-carousel .alpha-wishlist {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: #111;
  transition: transform 0.15s ease;
}

.alpha-carousel .alpha-wishlist:hover {
  transform: scale(1.05);
}

.alpha-carousel .alpha-wishlist svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.alpha-carousel .alpha-wishlist.is-active svg {
  fill: #111;
}

.alpha-carousel .alpha-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 3;
  background: #fff;
  color: #111;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 7px;
  border-radius: 2px;
  line-height: 1;
  pointer-events: none;
}

.alpha-carousel .grid-product__link {
  display: block;
  padding-top: 10px;
  color: inherit;
  text-decoration: none !important;
}

.alpha-carousel .grid-product__meta {
  padding: 12px 0 0 !important;
  text-align: left;
}

.alpha-carousel .alpha-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 8px;
  padding: 4px 0 0 4px;
  min-height: 22px;
}

.alpha-carousel .alpha-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background-size: cover;
  background-position: center;
  padding: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.alpha-carousel .alpha-swatch.is-active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #111;
}

.alpha-carousel .alpha-swatch.is-oos::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top right,
    transparent calc(50% - 0.5px),
    #999 50%,
    transparent calc(50% + 0.5px)
  );
}

.alpha-carousel .grid-product__title {
  font-size: 13px !important;
  font-weight: 700 !important;
  font-style: normal !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.25;
  margin: 0 0 2px;
  color: #111;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}

.alpha-carousel .alpha-category,
.alpha-carousel .alpha-color-name {
  font-size: 12px;
  font-weight: 400;
  color: #6b6b6b;
  line-height: 1.35;
  margin: 0;
}

.alpha-carousel .alpha-color-name {
  margin-bottom: 4px;
}

.alpha-carousel .grid-product__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  font-size: 15px;
  font-weight: 700;
  color: #111;
  letter-spacing: 0;
}

/* sale: new price red, old price struck through after it */
.alpha-carousel .grid-product__price:has(.grid-product__price--original) > .money {
  color: #b91c1c;
}

.alpha-carousel .grid-product__price--original {
  order: 2;
  font-weight: 400;
  color: #8a8a8a;
  text-decoration: line-through;
  font-size: 13px;
}

.alpha-carousel .grid-product__price .money {
  font-weight: inherit;
}

/* all cards fit in one row: stretch them to fill it, no arrows needed */
.alpha-carousel--fit .grid__item.grid-product {
  flex: 1 1 0 !important;
  width: auto !important;
  max-width: none !important;
}

.alpha-carousel--fit .alpha-carousel__arrows {
  display: none;
}

/* the arrows need carousel.js: keep their space so the header lays out the same */
.no-js .alpha-carousel__arrows {
  visibility: hidden;
}

/* the homepage rows (3-4 cards) fit on wide screens, where carousel.js hides the arrows */
@media (min-width: 769px) {
  .no-js .alpha-carousel:not(.alpha-pdp__recs) > .alpha-carousel .alpha-carousel__arrows {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
   Collection pages: full-width product grid, no sidebar (.alpha-grid)
   --------------------------------------------------------------------------- */
.alpha-carousel.alpha-grid {
  --alpha-side: clamp(16px, 3vw, 40px);
  padding: 0 0 64px;
}

.alpha-grid__sort {
  flex: 0 0 auto;
  margin: 0;
}

.alpha-grid .grid__item--sidebar,
.alpha-grid #CollectionSidebar,
.alpha-grid .collection-filter {
  display: none !important;
}

.alpha-grid .page-width > .grid {
  margin: 0 !important;
}

.alpha-grid .grid__item--content {
  width: 100% !important;
  float: none !important;
  padding: 0 !important;
}

.alpha-grid__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px var(--alpha-side) 24px;
}

.alpha-grid__eyebrow {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b6b6b;
}

.alpha-grid .alpha-grid__title {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  font-size: clamp(30px, 3.7vw, 48px) !important;
  font-weight: 700 !important;
  font-style: normal !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
  line-height: 1;
  color: #111;
}

.alpha-grid__count {
  margin: 12px 0 0;
  font-size: 12px;
  color: #6b6b6b;
}

.alpha-grid__sort select {
  appearance: none;
  -webkit-appearance: none;
  border: 0 !important;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right center / 14px !important;
  padding: 4px 22px 4px 0 !important;
  font-size: 13px;
  font-weight: 600;
  color: #111;
  cursor: pointer;
  width: auto !important;
  max-width: none;
  text-align: right;
  text-align-last: right;
}

.alpha-grid__sort option {
  text-align: left;
}

.alpha-grid .grid.grid--uniform,
.alpha-grid .grid.grid--uniform.aos-init,
.alpha-grid .grid.grid--uniform.aos-animate {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 36px;
  overflow: visible;
  scroll-snap-type: none;
  padding: 0 var(--alpha-side) !important;
}

.alpha-grid .grid__item.grid-product {
  flex: none !important;
  width: auto !important;
  max-width: none !important;
}

.alpha-grid .grid-product__image-mask {
  border-radius: 8px !important;
  background: #f8f8f8;
}

.alpha-grid .grid__image-ratio,
.alpha-grid .grid__image-ratio--portrait {
  padding-bottom: 133.333% !important; /* 3:4 */
  background: #f8f8f8;
}

.alpha-grid .alpha-swatches {
  margin-top: 10px;
}

.alpha-grid .alpha-swatch {
  width: 20px;
  height: 20px;
}

@media (max-width: 1100px) {
  .alpha-grid .grid.grid--uniform {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .alpha-carousel.alpha-grid {
    padding: 0 0 40px;
  }

  .alpha-grid__header {
    padding: 20px 16px 18px;
    align-items: flex-end;
  }

  .alpha-grid .grid.grid--uniform {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 8px;
    row-gap: 28px;
    padding: 0 16px !important;
  }

  .alpha-grid .alpha-wishlist {
    width: 30px;
    height: 30px;
    top: 8px;
    right: 8px;
  }

  .alpha-grid .alpha-swatch {
    width: 16px;
    height: 16px;
  }
}

.alpha-carousel .alpha-sizes {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-height: 42%;
  overflow: hidden;
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

.alpha-carousel .grid-product__content:hover .alpha-sizes,
.alpha-carousel .grid-product__content:focus-within .alpha-sizes {
  opacity: 1;
  transform: none;
}

.alpha-carousel .grid-product__content:hover .alpha-badge {
  opacity: 0;
}

.alpha-carousel .alpha-size {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(17, 17, 17, 0.1), 0 1px 2px rgba(17, 17, 17, 0.06);
  color: #111;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.alpha-carousel .grid-product__content:hover .alpha-size,
.alpha-carousel .grid-product__content:focus-within .alpha-size {
  opacity: 1;
  transform: none;
}

/* Stagger chips in as the panel slides up. */
.alpha-carousel .alpha-size:nth-child(1) { transition-delay: 0.04s; }
.alpha-carousel .alpha-size:nth-child(2) { transition-delay: 0.07s; }
.alpha-carousel .alpha-size:nth-child(3) { transition-delay: 0.1s; }
.alpha-carousel .alpha-size:nth-child(4) { transition-delay: 0.13s; }
.alpha-carousel .alpha-size:nth-child(5) { transition-delay: 0.16s; }
.alpha-carousel .alpha-size:nth-child(n + 6) { transition-delay: 0.19s; }

.alpha-carousel .alpha-size.is-sold-out {
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 1px rgba(17, 17, 17, 0.08);
  color: #a3a3a3;
  overflow: hidden;
}

.alpha-carousel .alpha-size.is-sold-out::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top right, transparent calc(50% - 0.5px), rgba(17, 17, 17, 0.22) 50%, transparent calc(50% + 0.5px));
}

@media (max-width: 768px) {
  .alpha-carousel .alpha-sizes {
    display: none !important;
  }

  .alpha-carousel:not(.alpha-grid) .grid__image-ratio,
  .alpha-carousel:not(.alpha-grid) .grid__image-ratio--portrait {
    padding: 0 0 150% !important;
  }

  .alpha-grid .grid__image-ratio,
  .alpha-grid .grid__image-ratio--portrait {
    padding-bottom: 160% !important;
  }

  .alpha-carousel {
    --alpha-card: 68vw;
    --alpha-gap: 10px;
    padding: 20px 0 28px;
  }

  .alpha-carousel .section-header {
    padding: 0 16px;
    margin-bottom: 14px;
  }

  .alpha-carousel .grid.grid--uniform {
    padding: 0 16px 6px;
  }

  .alpha-carousel .alpha-carousel__shop-link {
    font-size: 11px;
  }
}
