/* All storefront overrides require the server-added eligible-PDP body class. */
body.cpap-mask-backup-upsell-page #wbs-content-upsells {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Restore the standard PDP controls only when the mask-bundle UI is inactive. */
body.cpap-mask-backup-upsell-page:not(.cpap-mask-bundle-active) .cpap-mask-bundle-form > .single_variation_wrap {
    display: block !important;
}

body.cpap-mask-backup-upsell-page:not(.cpap-mask-bundle-active) .cpap-mask-bundle-form > .quantity {
    display: inline-flex !important;
}

body.cpap-mask-backup-upsell-page:not(.cpap-mask-bundle-active) .cpap-mask-bundle-form > .wbs-ajax-add-to-cart,
body.cpap-mask-backup-upsell-page:not(.cpap-mask-bundle-active) .cpap-mask-bundle-form .single_variation_wrap .wbs-ajax-add-to-cart {
    display: inline-flex !important;
}

html.cpap-mask-backup-open,
html.cpap-mask-backup-open body {
    overflow: hidden;
}

.cpap-mask-backup-overlay,
.cpap-mask-backup-overlay * {
    box-sizing: border-box;
}

.cpap-mask-backup-overlay[hidden] {
    display: none !important;
}

.cpap-mask-backup-overlay {
    position: fixed;
    z-index: 100100;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: auto;
    padding: 24px;
    background: rgb(17 24 39 / 48%);
    opacity: 0;
    transition: opacity 220ms ease;
}

.cpap-mask-backup-overlay.is-visible {
    opacity: 1;
}

.cpap-mask-backup-modal {
    --cpap-mask-backup-green: #8cc63f;
    --cpap-mask-backup-blue: #2f7fdf;
    --cpap-mask-backup-blue-soft: #84b6ff;
    --cpap-mask-backup-blue-badge: #cfe2ff;
    width: min(510px, 100%);
    max-height: calc(100vh - 48px);
    margin: auto;
    overflow: auto;
    padding: 26px 24px 23px;
    border: 1px solid #dedede;
    border-radius: 20px;
    outline: 0;
    background: #fff;
    box-shadow: 0 18px 64px rgb(0 0 0 / 22%);
    color: #111;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.35;
    transform: translateY(12px) scale(.98);
    transition: transform 240ms cubic-bezier(.2, .75, .25, 1);
}

.cpap-mask-backup-overlay.is-visible .cpap-mask-backup-modal {
    transform: translateY(0) scale(1);
}

.cpap-mask-backup-modal button,
.cpap-mask-backup-modal a {
    font-family: inherit;
    font-style: normal;
    letter-spacing: normal;
    text-transform: none;
}

.cpap-mask-backup-modal p,
.cpap-mask-backup-modal h2,
.cpap-mask-backup-modal h3 {
    padding: 0;
}

.cpap-mask-backup-modal__header {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 0 0 20px;
}

.cpap-mask-backup-modal__success {
    display: grid;
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
    place-items: center;
    border: 2px solid #008f15;
    border-radius: 50%;
    color: #008f15;
}

.cpap-mask-backup-modal__success svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.5;
}

.cpap-mask-backup-modal .cpap-mask-backup-modal__heading {
    margin: 0;
    color: #111;
    font-size: 21px;
    font-weight: 400;
    line-height: 1.2;
}

.cpap-mask-backup-modal .cpap-mask-backup-modal__close {
    display: grid;
    width: 34px;
    height: 34px;
    min-width: 34px;
    margin: -5px -5px -5px auto;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 4px;
    background: transparent;
    box-shadow: none;
    color: #334155;
    cursor: pointer;
}

.cpap-mask-backup-modal__close svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
}

.cpap-mask-backup-product {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 15px;
    align-items: center;
    padding: 0 0 20px;
    border-bottom: 1px solid #e3e3e3;
}

.cpap-mask-backup-product__image,
.cpap-mask-backup-offer__image {
    display: block;
    margin: 0;
    border: 0;
    border-radius: 8px;
    background: #f5f5f5;
    object-fit: cover;
}

.cpap-mask-backup-product__image {
    width: 56px;
    height: 56px;
}

.cpap-mask-backup-modal .cpap-mask-backup-product__name,
.cpap-mask-backup-modal .cpap-mask-backup-product__variation {
    margin: 0;
    color: #111;
    font-size: 18px;
    line-height: 1.28;
}

.cpap-mask-backup-modal .cpap-mask-backup-product__variation {
    margin-top: 2px;
    color: #3f3f3f;
}

.cpap-mask-backup-product__price {
    align-self: center;
    padding-left: 8px;
    font-size: 20px;
    white-space: nowrap;
}

.cpap-mask-backup-offer {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr) auto;
    gap: 9px 16px;
    margin-top: 18px;
    padding: 18px 16px 17px;
    border: 3px solid var(--cpap-mask-backup-blue-soft);
    border-radius: 18px;
    opacity: 0;
    transform: translateY(7px);
}

.cpap-mask-backup-overlay.is-visible .cpap-mask-backup-offer {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 220ms ease 70ms, transform 260ms cubic-bezier(.2, .75, .25, 1) 70ms;
}

.cpap-mask-backup-offer__image {
    grid-row: 1 / span 2;
    width: 104px;
    height: 104px;
}

.cpap-mask-backup-modal .cpap-mask-backup-offer__title {
    margin: 1px 0 0;
    color: #111;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.1;
}

.cpap-mask-backup-offer__badge {
    display: table;
    margin-top: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--cpap-mask-backup-blue-badge);
    color: #0758a9;
    font-size: 14px;
    line-height: 1.2;
}

.cpap-mask-backup-offer__price {
    margin-top: 2px;
    color: #111;
    font-size: 20px;
    line-height: 1.1;
    white-space: nowrap;
}

.cpap-mask-backup-modal .cpap-mask-backup-offer__subline {
    grid-column: 2 / -1;
    margin: -2px 0 0;
    color: #333;
    font-size: 17px;
    line-height: 1.2;
}

.cpap-mask-backup-offer__subline del {
    color: #4c4c4c;
}

.cpap-mask-backup-modal .cpap-mask-backup-offer__reason {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    margin: 5px 0 2px;
    color: #333;
    font-size: 17px;
    line-height: 1.25;
}

.cpap-mask-backup-offer__reason svg {
    width: 20px;
    height: 20px;
    margin-top: 1px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.cpap-mask-backup-modal .cpap-mask-backup-offer__add,
.cpap-mask-backup-modal .cpap-mask-backup-modal__checkout {
    display: flex;
    min-height: 57px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    box-shadow: none !important;
    cursor: pointer;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}

.cpap-mask-backup-modal .cpap-mask-backup-offer__add {
    grid-column: 1 / -1;
    width: 100%;
    margin: 2px 0 0;
    padding: 12px 18px;
    background: var(--cpap-mask-backup-blue) !important;
    color: #fff !important;
    transition: background-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.cpap-mask-backup-modal .cpap-mask-backup-offer__add:hover,
.cpap-mask-backup-modal .cpap-mask-backup-offer__add:focus-visible {
    background: #256fca !important;
}

.cpap-mask-backup-modal .cpap-mask-backup-offer__add[disabled] {
    cursor: wait;
    opacity: .72;
}

.cpap-mask-backup-modal .cpap-mask-backup-offer__add.is-loading::before {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    border: 2px solid rgb(255 255 255 / 35%);
    border-top-color: #fff;
    border-radius: 50%;
    content: '';
    animation: cpap-mask-backup-popup-spin 650ms linear infinite;
}

.cpap-mask-backup-modal .cpap-mask-backup-offer__add.is-success::before {
    margin-right: 9px;
    content: '✓';
    font-size: 21px;
}

.cpap-mask-backup-modal .cpap-mask-backup-offer__error {
    grid-column: 1 / -1;
    margin: 2px 0 0;
    color: #b42318;
    font-size: 15px;
    line-height: 1.35;
}

.cpap-mask-backup-modal .cpap-mask-backup-modal__checkout {
    width: 100%;
    margin-top: 24px;
    padding: 12px 18px;
    background: var(--cpap-mask-backup-green) !important;
    color: #111 !important;
}

.cpap-mask-backup-modal .cpap-mask-backup-modal__checkout:hover,
.cpap-mask-backup-modal .cpap-mask-backup-modal__checkout:focus-visible {
    background: #79b331 !important;
}

.cpap-mask-backup-modal .cpap-mask-backup-modal__continue {
    display: table;
    min-width: 0;
    min-height: 0;
    margin: 14px auto 0;
    padding: 3px 8px;
    border: 0;
    border-radius: 4px;
    background: transparent !important;
    box-shadow: none !important;
    color: #333 !important;
    cursor: pointer;
    font-size: 19px;
    font-weight: 400;
    line-height: 1.25;
}

.cpap-mask-backup-trigger-pending {
    opacity: .72 !important;
    pointer-events: none;
    transition: opacity 160ms ease;
}

@keyframes cpap-mask-backup-popup-spin {
    to { transform: rotate(360deg); }
}

.cpap-mask-backup-modal button:focus-visible,
.cpap-mask-backup-modal a:focus-visible {
    outline: 3px solid #151515;
    outline-offset: 3px;
}

@media (max-width: 520px) {
    .cpap-mask-backup-overlay {
        align-items: start;
        padding: 10px;
    }

    .cpap-mask-backup-modal {
        max-height: calc(100vh - 20px);
        padding: 22px 18px 20px;
        border-radius: 18px;
    }

    .cpap-mask-backup-product {
        grid-template-columns: 52px minmax(0, 1fr) auto;
        gap: 11px;
    }

    .cpap-mask-backup-product__image {
        width: 52px;
        height: 52px;
    }

    .cpap-mask-backup-modal .cpap-mask-backup-product__name,
    .cpap-mask-backup-modal .cpap-mask-backup-product__variation,
    .cpap-mask-backup-modal .cpap-mask-backup-offer__reason {
        font-size: 16px;
    }

    .cpap-mask-backup-offer {
        grid-template-columns: 72px minmax(0, 1fr) auto;
        gap: 8px 12px;
        padding: 16px 14px 15px;
    }

    .cpap-mask-backup-offer__image {
        width: 72px;
        height: 72px;
    }

    .cpap-mask-backup-modal .cpap-mask-backup-offer__title {
        font-size: 19px;
    }

    .cpap-mask-backup-modal .cpap-mask-backup-offer__subline {
        grid-column: 1 / -1;
        margin-top: 2px;
    }
}

@media (max-width: 390px) {
    .cpap-mask-backup-product {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .cpap-mask-backup-product__price {
        grid-column: 2;
        padding-left: 0;
    }

    .cpap-mask-backup-offer {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .cpap-mask-backup-offer__image {
        width: 64px;
        height: 64px;
    }

    .cpap-mask-backup-offer__price {
        grid-column: 2;
    }

    .cpap-mask-backup-modal .cpap-mask-backup-offer__subline {
        grid-column: 1 / -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cpap-mask-backup-overlay,
    .cpap-mask-backup-modal,
    .cpap-mask-backup-overlay.is-visible .cpap-mask-backup-offer,
    .cpap-mask-backup-trigger-pending {
        transition: none;
    }

    .cpap-mask-backup-modal .cpap-mask-backup-offer__add.is-loading::before {
        animation: none;
    }
}
