/* product-family-card — comparison section scoped styles */

.pfc-comparison {
  &.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: 20px;

    @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: 50px;

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

      &.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;
    }
  }

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

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

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

    & .product-family-card-button {
      cursor: default;

      & > *:not(.product-family-card-image-wrapper) {
        margin-left: 5px;
        margin-right: 5px;
      }
    }

    & 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: 0;

      @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: 1300px;

    & .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: 220px;
      }

      & .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.9;
    }
  }

  /* 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;
  }

  & .pfc-comparison__title {
    font-size: 30px;
    font-weight: bold;
    text-align: center;
    margin: 30px 0 10px 0;
  }

  & .pfc-comparison__shop-now-container {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  & .pfc-comparison__shop-now {
    text-transform: capitalize;
    background-color: #0c0a09;
    color: #fff;
    border-radius: 5px;
    padding: 10px 40px;
    font-weight: 700;
    font-size: 16px;
    width: max-content;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
    cursor: pointer;
  }

  & .product-family-card .pfc-comparison__subtitle {
    display: block;
    font-size: 14px;
    color: var(--brand-gray-dark);
    margin-top: 8px;
  }

  & .product-family-card h3 {
    text-decoration: underline;
    font-size: 20px;
    margin-top: 10px;
    text-align: left;
    cursor: pointer;
  }

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

  & .product-family-card p {
    margin-top: 18px;
  }

  & .product-family-card .reviews-wrapper {
    margin-top: 12px;
  }

  /* Labels column sits left of the swiper */
  & .pfc-comparison-layout {
    display: flex;
    align-items: flex-end;
  }

  & .pfc-comparison-labels-column {
    flex-shrink: 0;
    padding-left: 16px;

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

  & .pfc-comparison-layout > .product-family-cards__swiper-container {
    flex: 1;
    min-width: 0;
  }

  & .pfc-comparison-grid__column {
    margin-top: 6px;
  }

  & .pfc-comparison-grid__cell--fabric-colors {
    @media (max-width: 768px) {
      flex-direction: column;
      align-items: flex-start !important;
      justify-content: flex-start !important;
      gap: 5px;
      height: max-content !important;
      min-height: 45px;
      padding-top: 8px;
      padding-bottom: 8px !important;
    }
  }

  & .pfc-comparison__dot {
    padding: 0 4px;

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

  & .pfc-comparison-layout .product-family-card.active {
    background-color: #f9f9f9;
  }

  & .pfc-comparison-grid__cell {
    height: 32px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    padding: 0 6px;
  }

  & .pfc-comparison-grid__cell--label {
    color: var(--brand-black);
    font-weight: bold;
    font-size: 13px;
    line-height: 1.1;
    padding-right: 8px;

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

  & .pfc-comparison-grid__cell--value {
    justify-content: flex-start;
    font-size: 14px;
    text-align: left;
    line-height: 1.1;
    color: var(--brand-black);
    padding: 0 5px;

    &:not(.pfc-comparison-grid__cell--fabric-colors) {
      gap: 6px;

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

    & svg {
      width: 20px;
      height: 20px;
      flex-shrink: 0;
    }
  }

  & .pfc-comparison-grid__cell--bold {
    font-weight: 700;
  }
}

/* Template-level overrides scoped to comparison section */
.template-product .pfc-comparison .product-family-card,
.template-multi_family_lp .pfc-comparison .product-family-card,
.template-collection .pfc-comparison .product-family-card {
  position: relative;
  width: 270px;

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

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

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