.fbt-bundle {
    box-sizing: border-box;
    width: auto;
    max-width: min(100%, 1152px);
    margin: 24px 0;
    color: #2b2226;
    font-family: inherit;
}

.fbt-bundle * { box-sizing: border-box; }

.fbt-bundle__title {
    margin: 0 0 18px;
    font-size: 22px;
    font-weight: 500;
}

.fbt-bundle__content {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 24px 32px;
}

.fbt-bundle__products {
    display: flex;
    flex: 1 1 640px;
    flex-wrap: wrap;
    align-items: flex-start;
    min-width: 0;
    gap: 16px 32px;
}

.fbt-bundle__item {
    position: relative;
    flex: 1 1 0;
    min-width: 160px;
    max-width: 240px;
    transition: opacity .15s ease;
}

.fbt-bundle__item--unselected {
    opacity: .45;
}

/* The image is a square as wide as the card, so half the card's width (a padding
   percentage) is the image's middle, whatever the price and name below it take. */
.fbt-bundle__plus {
    position: absolute;
    inset-inline-start: -26px;
    top: 0;
    width: 20px;
    padding-top: calc(50% - 11px);
    color: #8b8286;
    font-size: 22px;
    line-height: 22px;
    text-align: center;
}

.fbt-bundle__image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid #ece7e9;
    border-radius: 8px;
    background: #faf8f9;
}

.fbt-bundle__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.fbt-bundle__checkbox {
    position: absolute;
    z-index: 1;
    inset-block-start: 10px;
    inset-inline-end: 10px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1.5px solid #f72a89;
    border-radius: 5px;
    background: #f72a89;
    color: #fff;
    cursor: pointer;
}

.fbt-bundle__checkbox[aria-checked="false"] {
    border-color: #c9c1c5;
    background: #fff;
    color: transparent;
}

/* Out of stock, or its last units already in the cart: unticked, greyed, cannot be ticked. */
.fbt-bundle__item--locked .fbt-bundle__checkbox {
    border-color: #ddd8da;
    background: #f1eef0;
    cursor: not-allowed;
}

.fbt-bundle__item--locked .fbt-bundle__image-wrap {
    filter: grayscale(1);
}

.fbt-bundle__locked {
    margin-top: 4px;
    color: #8b8286;
    font-size: 12px;
    font-weight: 600;
}

.fbt-bundle__locked[hidden] {
    display: none;
}

.fbt-bundle__price {
    margin-top: 12px;
    font-size: 19px;
    font-weight: 500;
}

.fbt-bundle__currency {
    margin-inline-start: 2px;
    font-size: 11px;
}

.fbt-bundle__name {
    display: -webkit-box;
    min-height: 40px;
    margin-top: 8px;
    overflow: hidden;
    color: #4a4045;
    font-size: 14px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.fbt-bundle__name:hover { color: #2abaff; }
.fbt-bundle__current { color: #2b2226; font-weight: 600; }

.fbt-bundle__summary {
    display: flex;
    flex-direction: column;
    flex: 0 1 280px;
    gap: 12px;
    min-width: 240px;
    padding-top: 24px;
}

.fbt-bundle__total {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    font-size: 15px;
}

.fbt-bundle__total-value { font-size: 22px; font-weight: 600; }
.fbt-bundle__button {
    min-height: 44px;
    border: 0;
    border-radius: 999px;
    background: #f72a89;
    color: #fff;
    font: 600 15px/1 inherit;
    cursor: pointer;
}
.fbt-bundle__button:hover { filter: brightness(.94); }
.fbt-bundle__button:disabled { background: #e3dce0; cursor: default; filter: none; }
.fbt-bundle__message { min-height: 18px; color: #f72a89; font-size: 13px; text-align: center; }
.fbt-bundle__message--error { color: #b42318; }

#custom-notification .fbt-notification-stack {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    height: 110px;
}

#custom-notification .fbt-notification-stack img {
    position: relative;
    width: 66px;
    height: 66px;
    object-fit: contain;
    border: 1px solid #ece7e9;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

#custom-notification .fbt-notification-stack img + img { margin-inline-start: -20px; }
#custom-notification .fbt-notification-stack img:nth-child(1) { z-index: 3; }
#custom-notification .fbt-notification-stack img:nth-child(2) { z-index: 2; }
#custom-notification .fbt-notification-stack img:nth-child(3) { z-index: 1; }

@media (max-width: 600px) {
    #custom-notification .fbt-notification-stack { height: 140px; }
    #custom-notification .fbt-notification-stack img { width: 72px; height: 72px; }
    #custom-notification .fbt-notification-stack img + img { margin-inline-start: -22px; }
}

/* Desktop: centre the Add button on the product images; the total sits just above it.
   frequently-bought-together.js measures the images and sets --fbt-button-top; 98px is the
   offset for the 240px images of a full-width row, used until the script has measured. */
@media (min-width: 760px) {
    .fbt-bundle__summary { position: relative; padding-top: var(--fbt-button-top, 98px); }
    .fbt-bundle__total {
        position: absolute;
        inset-inline: 0;
        top: calc(var(--fbt-button-top, 98px) - 12px);
        transform: translateY(-100%);
    }
}

@media (max-width: 759px) {
    #people-also-bought.fbt-bundle {
        width: 100vw;
        max-width: 100vw;
        margin: 20px calc(50% - 50vw) !important;
        padding: 0 16px;
        overflow: hidden;
    }
    .fbt-bundle__title { font-size: 20px; }
    .fbt-bundle__content { display: block; }
    .fbt-bundle__products {
        display: grid;
        gap: 20px;
        width: 100%;
    }
    /* Every product on one row, the total and the button under them, as in the app. */
    .fbt-bundle__products--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fbt-bundle__products--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
    /* Visible: the "+" sits in the gap, outside the card. */
    .fbt-bundle__item { min-width: 0; max-width: 100%; overflow: visible; }
    /* The image is a square as wide as the card, so half the card's width (a padding
       percentage) is the image's middle. */
    .fbt-bundle__plus {
        inset-inline-start: -20px;
        top: 0;
        width: 20px;
        padding-top: calc(50% - 10px);
        font-size: 19px;
        line-height: 20px;
    }
    .fbt-bundle__products--3 .fbt-bundle__plus {
        inset-inline-start: -14px;
        width: 14px;
        padding-top: calc(50% - 9px);
        font-size: 16px;
        line-height: 18px;
    }
    .fbt-bundle__checkbox { inset-block-start: 6px; inset-inline-end: 6px; width: 21px; height: 21px; }
    .fbt-bundle__products--3 .fbt-bundle__checkbox {
        inset-block-start: 5px;
        inset-inline-end: 5px;
        width: 19px;
        height: 19px;
        font-size: 11px;
    }
    .fbt-bundle__price { margin-top: 8px; font-size: 16px; }
    .fbt-bundle__products--3 .fbt-bundle__price { font-size: 14px; }
    .fbt-bundle__name { margin-top: 5px; min-height: 34px; font-size: 12px; overflow-wrap: anywhere; }
    .fbt-bundle__products--3 .fbt-bundle__name { min-height: 31px; font-size: 11px; }
    .fbt-bundle__summary { position: relative; width: 100%; padding-top: 20px; }
    .fbt-bundle__button { width: 100%; }
}
