/* product-family-card */

.product-family-cards-pdp-container.pfc-collection-page:not(.pfc-clearance-page) {
  & button.breadcrumb.crumb-category {
    @media (max-width: 767px) {
      padding: 0;
    }
  }
}

.product-family-cards-container {
  position: relative;

  margin-top: 20px;
  margin-bottom: 10px;

  @media (max-width: 767px) {
    margin-bottom: 20px;
  }

  &.pfc-clearance {
    overflow: hidden;

    & .product-family-cards__swiper-container {
      width: fit-content;
    }
  }

  & .dynamic-breadcrumbs-container {
    height: 21px;

    & .liquid-pdp__breadcrumbs {
      height: 21px;
      padding-bottom: 0;

      opacity: 0;
      animation: fadeIn 0.3s ease forwards;

      @media (max-width: 768px) {
        padding: 0 0 0 2px;
      }
    }
  }

  & button.pfc-swiper-btn {
    @media (max-width: 768px) {
      display: none;
    }

    position: absolute;

    width: 20px;
    height: 60px;
    border: 1px solid #dbdbdb;
    background-color: #fff9;
    color: var(--brand-black);
    border-radius: 6px;
    font-family: swiper-icons;
    text-transform: none !important;
    font-size: 12px;
    letter-spacing: 0;
    font-variant: initial;
    line-height: 1;
    text-rendering: auto;
    z-index: 1;
    top: 25%;

    @media (max-width: 900px) {
      top: 28%;
      width: 16px;
      height: 50px;
    }

    @media (max-width: 800px) {
      top: 28%;
    }

    &.swiper-button-disabled {
      pointer-events: auto;
    }

    &.swiper-button-prev {
      left: 25px;
    }

    &.swiper-button-next {
      right: 35px;
    }

    &:after {
      font-size: 12px;
      font-weight: bold;
      color: black;
    }

    &.loading {
      visibility: hidden;
      opacity: 0;
    }
  }
}

.product-family-cards-header {
  margin: 10px 0 10px 10px;

  &.product-family-cards-header__custom {
    margin: 0;
  }

  & h1 {
    font-size: 26px;
    font-weight: bold;
    line-height: 1;
    color: var(--brand-black);

    &.product-family-cards-header__title-custom {
      font-size: 48px;
      line-height: 1.2;
      text-align: center;
      margin-top: 30px;
      /* margin-bottom: 10px; */

      @media (max-width: 768px) {
        font-size: 26px;
        margin-top: 20px;
        margin-bottom: 4px;
      }
    }
  }

  & p {
    font-size: 16px;
    margin-top: 5px;
    line-height: 1.2;
    padding-right: 70px; /* prevent overlap with arrows */

    @media (max-width: 768px) {
      font-size: 14px;
      padding-right: 10px;
    }
  }

  & .js-footer-link {
    &:hover {
      text-decoration: none !important;
    }
  }
}

p.product-family-cards-header__description-custom {
  font-size: 16px;
  line-height: 1.2;
  text-align: center;
  margin-top: 0;
  margin-bottom: 32px;

  @media (max-width: 768px) {
    font-size: 12px;
    padding: 0 5px;
    margin-bottom: 20px;
    letter-spacing: 0;
  }
}

.product-family-cards {
  &.swiper-loading {
    display: flex;
    flex-direction: row;
    gap: 10px;
  }
}

.template-product .product-family-card,
.template-multi_family_lp .product-family-card,
.template-collection .product-family-card {
  position: relative;
  width: 270px;

  @media (max-width: 768px) {
    width: 120px;
  }
}

.template-product .product-family-card img,
.template-multi_family_lp .product-family-card img,
.template-collection .product-family-card img {
  height: 160px;

  @media (max-width: 768px) {
    height: 85px;
  }
}

.product-family-card {
  position: relative;
  width: 270px;

  @media (max-width: 768px) {
    width: 150px;
  }

  & a:hover {
    text-decoration: none !important;
  }

  & .product-family-card-button {
    cursor: pointer;
  }

  & img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    background-color: var(--brand-gray-light);
    aspect-ratio: 4/5;
    object-fit: cover;
  }

  & h3 {
    position: relative;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.2;
    margin-top: 5px;
    margin-bottom: 0;
    color: var(--brand-black);
  }

  & p {
    font-size: 14px;
    line-height: 1.2;
    margin-top: 3px;
    color: var(--brand-gray-dark);
    letter-spacing: 0px;

    @media (max-width: 999px) {
      font-size: 12px;
      line-height: 1.2;
    }
  }

  & .banner,
  & .badge {
    position: absolute;
    color: var(--brand-white);
    font-size: 14px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 5px;
    z-index: 1;

    @media (max-width: 1199px) {
      font-size: 12px;
      padding: 2px 8px;
    }

    @media (max-width: 500px) {
      font-size: 11px;
      padding: 2px 4px;
    }

    &.badge-1 {
      top: 12px;
      left: 0;
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
    }

    &.badge-2 {
      top: 12px;
      right: 0;
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }

    &.badge-3 {
      bottom: 12px;
      left: 0;
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;

      @media (max-width: 500px) {
        bottom: 8px;
      }
    }
  }

  & .banner {
    --banner-height: 20px;

    position: absolute;
    top: calc(var(--banner-height) * -1);
    left: 0;
    right: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    height: var(--banner-height);
    padding: 2px 0;
    border-radius: 0;
  }
}

.stacked-cards-slide {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: max-content;
}

.product-family-card.product-family-card-alt-styling {
  width: max-content;

  &.product-family-card-stacked-bottom h3 {
    margin-bottom: 0;
  }

  &.active {
    pointer-events: none;

    & .product-family-card-image-wrapper {
      border-color: var(--brand-red-bright);
    }
  }

  & .product-family-card-image-wrapper {
    height: 125px;
    aspect-ratio: 1/1;
    border-radius: 50%;
    border: 3px solid white;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;

    transition: border-color 0.25s;

    @media (max-width: 768px) {
      height: 100px;
    }
  }

  & h3 {
    font-size: 14px;
    font-weight: bold;
    line-height: 1.2;
    text-align: center;
    margin: 5px 0 10px 0;
    color: var(--brand-black);

    @media (max-width: 768px) {
      font-size: 12px;
    }
  }

  & p {
    display: none;
  }
}

.product-family-cards__swiper-container {
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  padding: 0 0.5rem;

  @media (max-width: 768px) {
    padding-right: 0;
    padding-left: 0;
  }

  & .swiper-button-lock {
    opacity: 0;
    visibility: hidden;
  }
}

.product-family-cards-container.pfc-product {
  margin-top: 0;
  max-width: 1100px;

  & .product-family-cards-header {
    margin: 10px 26px 10px 16px;

    @media (max-width: 768px) {
      margin-top: 10px;
      margin-left: 10px;
    }
  }

  & .product-family-cards {
    padding-top: 2px;
  }

  & .product-family-cards__swiper-container {
    padding: 0 26px 0 16px;

    @media (max-width: 768px) {
      padding-right: 0;
      padding-left: 0;
    }

    & .product-family-cards__swiper-arrows {
      right: 16px;
    }
  }

  & .product-family-card {
    @media (min-width: 769px) {
      width: 203px;
    }

    & .product-family-card-image-wrapper {
      position: relative;
    }

    & .active-pfc-outline {
      display: none;
    }

    &.active .active-pfc-outline {
      display: block;
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      border: 2px solid var(--brand-black);
      border-radius: 10px;
      pointer-events: none;
      z-index: 2;
    }
  }

  & h3 {
    border: 1px solid white;
    border-radius: 5px;
    padding: 0;
    line-height: 1;
  }
}

.pfc-clearance-page .pfc-swiper-btn {
  top: 150px !important;

  &.swiper-button-prev {
    left: 15px !important;
  }

  &.swiper-button-next {
    right: 15px !important;
  }
}

.pfc-selected-title__wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 18px 0;

  & h2 {
    transition: opacity 0.125s;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
  }
}

.reviews-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;

  margin-top: 4px;

  & .reviews-value {
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
  }

  & svg {
    height: 12px;
    fill: url(#star-gradient);
  }

  & .reviews-count {
    font-size: 12px;
    color: var(--brand-gray-dark);
    opacity: 0.7;
  }
}

/* Badge styles */
.product-family-card .badge-bestseller {
  background: linear-gradient(135deg, #fac115 0%, #e9b519 100%);
  color: #000;
}

.product-family-card .badge-rank {
  background: linear-gradient(135deg, #dfdfdf 0%, #f3f3f3 100%);
  color: #000;
}
