.brand-bundle {
  padding-block: 24px 40px;
  background: #f6f4ef;
}

/* Best sellers three at a time: pick color + size on each card, add all with one button, refresh for the next three */
.bs-bundle {
  display: grid;
  grid-template-areas:
    "copy items"
    "foot items";
  grid-template-rows: auto 1fr;
  grid-template-columns: minmax(0, 3fr) minmax(0, 8fr);
  gap: 0 28px;
  align-items: start;
  padding: 28px;
  color: #f6f4ef;
  background: #1e2a38;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgb(28 29 31 / 15%);
}

.bs-bundle__copy {
  grid-area: copy;
}

.bs-bundle__items {
  grid-area: items;
  align-self: center;
}

/* Left column: intro on top, "Your set" + total + buttons pinned to the bottom, level with the cards */
.bs-bundle__foot {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-self: stretch;
  grid-area: foot;
  padding-top: 16px;
}

.bs-bundle__summary {
  padding: 12px 14px;
  background: rgb(255 255 255 / 5%);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 12px;
}

.bs-bundle__summary-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c19a6b;
}

.bs-bundle__summary-list {
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: bs-set;
}

.bs-bundle__summary-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 2px 8px;
  padding: 8px 0;
  font-size: 13px;
  color: #fff;
  counter-increment: bs-set;
  border-top: 1px solid rgb(255 255 255 / 10%);
}

.bs-bundle__summary-row:first-child {
  border-top: 0;
}

.bs-bundle__summary-row::before {
  grid-row: span 2;
  font-weight: 700;
  color: rgb(234 229 220 / 60%);
  content: counter(bs-set);
}

.bs-bundle__summary-row.is-off {
  opacity: 0.45;
}

.bs-bundle__summary-name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bs-bundle__summary-price {
  font-family: var(--bs-ui);
  font-weight: 700;
}

.bs-bundle__summary-picks {
  grid-column: 2 / 4;
  font-size: 12px;
  color: rgb(234 229 220 / 75%);
}

.bs-bundle__summary-picks.is-missing {
  color: #ffb08a;
}

.bs-bundle__tag {
  display: inline-block;
  padding: 4px 12px;
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: #b4532a;
  border-radius: 999px;
}

.bs-bundle .bs-bundle__title {
  margin: 0 0 10px;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: none;
  color: #fff;
}

.bs-bundle__text,
.bs-bundle__text p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgb(234 229 220 / 90%);
}

.bs-bundle__text ul {
  padding: 0;
  margin: 10px 0 0;
  list-style: none;
}

.bs-bundle__text li {
  position: relative;
  padding-left: 24px;
  margin-top: 6px;
}

.bs-bundle__text li::before {
  position: absolute;
  top: 2px;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  font-size: 10px;
  font-weight: 700;
  color: #c19a6b;
  content: "✓";
  background: rgb(193 154 107 / 20%);
  border-radius: 50%;
}

.bs-bundle__total {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  align-items: baseline;
  padding-top: 14px;
  margin-top: 16px;
  border-top: 1px solid rgb(255 255 255 / 15%);
}

.bs-bundle__total-label {
  flex-basis: 100%;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(234 229 220 / 75%);
}

.bs-bundle__total-price {
  font-family: var(--bs-ui);
  font-size: 26px;
  font-weight: 700;
  color: #fff;
}

.bs-bundle__total-compare {
  font-size: 13px;
  color: rgb(234 229 220 / 60%);
}

.bs-bundle__note {
  flex-basis: 100%;
  font-size: 12px;
  font-weight: 600;
  color: #c19a6b;
}

.bs-bundle__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.bs-bundle__add {
  position: relative;
  min-height: 48px;
  padding: 0 20px;
  font-family: var(--bs-ui);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  background: #2e7d32;
  border: 0;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.bs-bundle__add:hover {
  background: #256628;
}

.bs-bundle__add:disabled {
  cursor: default;
  opacity: 0.6;
}

.bs-bundle__add.is-loading span {
  visibility: hidden;
}

.bs-bundle__add.is-loading::after {
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  margin: auto;
  content: "";
  border: 2px solid rgb(255 255 255 / 35%);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bs-bundle-spin 0.8s linear infinite;
}

@keyframes bs-bundle-spin {
  to {
    transform: rotate(360deg);
  }
}

.bs-bundle__next {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  font-family: var(--bs-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  cursor: pointer;
  background: transparent;
  border: 1.5px solid rgb(255 255 255 / 55%);
  border-radius: 8px;
}

.bs-bundle__next[hidden] {
  display: none;
}

.bs-bundle__next svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 2;
  stroke-linecap: round;
}

.bs-bundle__next:hover {
  color: #1c1d1f;
  background: #fff;
}

/* Product cards (markup shared with the product page's "Frequently bought together") */
.bs-bundle__items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.bs-bundle .brand-fbt__item {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: rgb(255 255 255 / 6%);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 14px;
  transition: opacity 0.2s ease;
}

.bs-bundle .brand-fbt__item[data-fbt-group]:not(.is-visible) {
  display: none;
}

.bs-bundle .brand-fbt__item.is-off {
  opacity: 0.45;
}

.bs-bundle .brand-fbt__check {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.bs-bundle .brand-fbt__check input {
  position: absolute;
  inset: 0;
  margin: 0;
  cursor: pointer;
  opacity: 0;
}

.bs-bundle .brand-fbt__check span {
  display: block;
  width: 24px;
  height: 24px;
  background: #fff;
  border: 1.5px solid #5c5a54;
  border-radius: 6px;
}

.bs-bundle .brand-fbt__check input:checked + span {
  background: #2e7d32 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 14px no-repeat;
  border-color: #2e7d32;
}

/* Product photos are 3:4 portraits; match that shape and never crop, so the whole garment shows */
.bs-bundle .brand-fbt__thumb {
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #fff;
}

.bs-bundle .brand-fbt__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bs-bundle .brand-fbt__info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  padding: 10px 10px 12px;
}

.bs-bundle .brand-fbt__this {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c19a6b;
}

.bs-bundle a.brand-fbt__name {
  display: -webkit-box;
  min-height: 2.7em;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  text-decoration: none;
}

.bs-bundle .brand-fbt__price {
  font-family: var(--bs-ui);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.bs-bundle .brand-fbt__price s {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 400;
  color: rgb(234 229 220 / 60%);
}

.bs-bundle .brand-fbt__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: auto;
}

.bs-bundle .brand-fbt__select {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 24px 0 10px;
  font-family: var(--bs-ui);
  font-size: 12px;
  color: #1c1d1f;
  cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c1d1f' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 8px center / 12px no-repeat;
  border: 1px solid #dcd6cb;
  border-radius: 8px;
  appearance: none;
}

.bs-bundle .brand-fbt__select.is-missing {
  border-color: #ff8a65;
  box-shadow: 0 0 0 2px #ff8a65;
}

@media (max-width: 1199px) {
  /* Stacked: products sit between the intro and the total, so sizes are picked before Add */
  .bs-bundle {
    grid-template-areas:
      "copy"
      "items"
      "foot";
    grid-template-rows: auto;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .bs-bundle__total {
    margin-top: 0;
  }

  .bs-bundle__foot {
    padding-top: 0;
  }

  /* Stacked layout: the cards already show each pick, so skip the list */
  .bs-bundle__summary {
    display: none;
  }

  .bs-bundle__copy {
    max-width: 640px;
  }

  .bs-bundle__actions {
    flex-direction: row;
  }

  .bs-bundle__add {
    flex: 1;
  }
}

@media (max-width: 959px) {
  .brand-bundle {
    padding-block: 16px 28px;
  }

  .bs-bundle {
    padding: 18px 14px;
    border-radius: 16px;
  }

  .bs-bundle__text ul {
    display: none;
  }

  .bs-bundle .bs-bundle__title {
    font-size: 22px;
  }

  /* Three cards in one swipe row; the next card peeks in */
  .bs-bundle__items {
    grid-template-columns: none;
    grid-auto-columns: 72%;
    grid-auto-flow: column;
    padding-bottom: 4px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .bs-bundle__items::-webkit-scrollbar {
    display: none;
  }

  .bs-bundle .brand-fbt__item {
    scroll-snap-align: start;
  }

  .bs-bundle__actions {
    flex-direction: column;
  }
}
