body.cpap-mask-quantity-offer-active .summary form.cart > .quantity,
body.cpap-mask-quantity-offer-active .summary form.cart > .single_add_to_cart_button,
body.cpap-mask-quantity-offer-active .summary form.variations_form .single_variation_wrap .quantity,
body.cpap-mask-quantity-offer-active .summary form.variations_form .single_variation_wrap .single_add_to_cart_button {
    display: none !important;
}

/*
 * Keep the full quantity offer in the normal PDP position. When the site's
 * existing sticky-cart treatment takes over, restore WooCommerce's original
 * quantity-one controls instead of pinning (or duplicating) the offer cards.
 * The body class limits this override to products where this feature is active.
 */
body.cpap-mask-quantity-offer-active .single form.cart.cpap-mask-quantity-offer-sticky-mode .cpap-mask-quantity-offer,
body.cpap-mask-quantity-offer-active .cpap-desktop-sticky-cart .cpap-mask-quantity-offer,
.cpap-mask-quantity-offer[hidden] {
    display: none !important;
}

body.cpap-mask-quantity-offer-active .single .summary form.cart.sticky > .quantity,
body.cpap-mask-quantity-offer-active .single .summary form.variations_form.sticky .single_variation_wrap .quantity,
body.cpap-mask-quantity-offer-active .single .summary form.cart.cpap-mask-quantity-offer-sticky-mode > .quantity,
body.cpap-mask-quantity-offer-active .single .summary form.variations_form.cpap-mask-quantity-offer-sticky-mode .single_variation_wrap .quantity,
body.cpap-mask-quantity-offer-active .cpap-desktop-sticky-cart form.cart > .quantity,
body.cpap-mask-quantity-offer-active .cpap-desktop-sticky-cart form.variations_form .single_variation_wrap .quantity {
    display: inline-flex !important;
}

/*
 * Woo Boost Sales can output an AJAX button beside WooCommerce's original
 * button. Show the first available ATC implementation and suppress repeats;
 * this also preserves the standard-button fallback used by the mobile form.
 */
body.cpap-mask-quantity-offer-active .single .summary form.cart.sticky .single_add_to_cart_button,
body.cpap-mask-quantity-offer-active .single .summary form.cart.cpap-mask-quantity-offer-sticky-mode .single_add_to_cart_button,
body.cpap-mask-quantity-offer-active .cpap-desktop-sticky-cart .single_add_to_cart_button {
    display: inline-flex !important;
}

body.cpap-mask-quantity-offer-active .single .summary form.cart.sticky .single_add_to_cart_button ~ .single_add_to_cart_button,
body.cpap-mask-quantity-offer-active .single .summary form.cart.cpap-mask-quantity-offer-sticky-mode .single_add_to_cart_button ~ .single_add_to_cart_button,
body.cpap-mask-quantity-offer-active .cpap-desktop-sticky-cart .single_add_to_cart_button ~ .single_add_to_cart_button {
    display: none !important;
}

@media only screen and (max-width: 1000px) {
    /*
     * Key this directly off the theme's sticky class so the full offer leaves
     * the fixed form in the same frame. Waiting for the feature observer to
     * add its helper class briefly changes the document height while scrolling.
     */
    body.cpap-mask-quantity-offer-active form.cpap-mask-quantity-offer-form.sticky .cpap-mask-quantity-offer {
        display: none !important;
    }

    /* Keep the variation picker, then show only the original one-item controls. */
    body.cpap-mask-quantity-offer-active form.cpap-mask-quantity-offer-form.variations_form.sticky .single_variation_wrap > .woocommerce-variation,
    body.cpap-mask-quantity-offer-active form.cpap-mask-quantity-offer-form.variations_form.sticky .cpap-free-shipping-stock-row,
    body.cpap-mask-quantity-offer-active form.cpap-mask-quantity-offer-form.variations_form.sticky p.stock {
        display: none !important;
    }

    body.cpap-mask-quantity-offer-active .single .summary form.variations_form.sticky > .single_variation_wrap,
    body.cpap-mask-quantity-offer-active .single .summary form.variations_form.cpap-mask-quantity-offer-sticky-mode > .single_variation_wrap {
        display: flex !important;
        flex-flow: row wrap;
        width: 100% !important;
    }

    body.cpap-mask-quantity-offer-active .single .summary form.variations_form.sticky .woocommerce-variation-add-to-cart,
    body.cpap-mask-quantity-offer-active .single .summary form.variations_form.cpap-mask-quantity-offer-sticky-mode .woocommerce-variation-add-to-cart {
        display: flex !important;
        flex-flow: row-reverse nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        min-width: 100% !important;
    }
}

@media only screen and (min-width: 1001px) {
    body.cpap-mask-quantity-offer-active .cpap-desktop-sticky-inside {
        align-items: center !important;
        justify-content: center !important;
    }

    body.cpap-mask-quantity-offer-active .cpap-desktop-sticky-cart form.variations_form.cart.sticky,
    body.cpap-mask-quantity-offer-active .cpap-desktop-sticky-cart .single_variation_wrap,
    body.cpap-mask-quantity-offer-active .cpap-desktop-sticky-cart .woocommerce-variation-add-to-cart {
        align-items: center !important;
    }

    body.cpap-mask-quantity-offer-active .cpap-desktop-sticky-cart table.variations,
    body.cpap-mask-quantity-offer-active .cpap-desktop-sticky-cart .single_variation_wrap,
    body.cpap-mask-quantity-offer-active .cpap-desktop-sticky-cart .woocommerce-variation-add-to-cart {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    body.cpap-mask-quantity-offer-active .cpap-desktop-sticky-cart .woocommerce-variation-availability,
    body.cpap-mask-quantity-offer-active .cpap-desktop-sticky-cart .cpap-free-shipping-stock-row,
    body.cpap-mask-quantity-offer-active .cpap-desktop-sticky-cart p.stock {
        display: none !important;
    }
}

.cpap-mask-quantity-offer,
.cpap-mask-quantity-offer * {
    box-sizing: border-box;
}

.cpap-mask-quantity-offer {
    --quantity-blue: #2f83d8;
    --quantity-blue-line: #62a3e6;
    --quantity-blue-soft: #d9ebff;
    --quantity-green: #8cc63f;
    --quantity-green-soft: #d6f1d1;
    --quantity-green-ink: #17651e;
    --quantity-ink: #101820;
    --quantity-copy: #40474e;
    --quantity-muted: #7a8086;
    --quantity-line: #dce2e7;
    container-type: inline-size;
    width: 100%;
    margin-top: 14px;
    color: var(--quantity-ink);
}

.cpap-mask-quantity-offer__heading {
    margin: 0 0 14px;
    padding: 0;
    color: var(--quantity-ink);
    font-size: 13px !important;
    font-weight: 700;
    line-height: 1.2;
}

.cpap-mask-quantity-offer__options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 10px;
    gap: 12px;
    align-items: stretch;
}

.cpap-mask-quantity-offer__option {
    position: relative;
    display: flex;
    min-width: 0;
    border: 1px solid var(--quantity-line);
    border-radius: 14px;
    background: #fff;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.cpap-mask-quantity-offer__option.is-selected {
    border: 2px solid var(--quantity-blue-line);
    background: var(--quantity-blue-soft);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 25%);
}

.cpap-mask-quantity-offer__option.is-disabled {
    opacity: .48;
}

.cpap-mask-quantity-offer__radio {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.cpap-mask-quantity-offer__radio:focus-visible + .cpap-mask-quantity-offer__card {
    outline: 3px solid rgb(47 131 216 / 28%);
    outline-offset: 3px;
}

.cpap-mask-quantity-offer__card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(50px, 1fr) auto;
    width: 100%;
    min-height: 150px;
    margin: 0;
    padding: 28px 8px 11px;
    align-items: start;
    justify-items: center;
    gap: 6px;
    color: inherit;
    text-align: center;
    cursor: pointer;
}

.cpap-mask-quantity-offer__copy {
    display: contents;
}

.cpap-mask-quantity-offer__copy > strong,
.cpap-mask-quantity-offer__title-row > strong {
    grid-row: 1;
    align-self: start;
    justify-self: center;
    color: var(--quantity-ink);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.08;
}

.cpap-mask-quantity-offer__copy > span:last-child {
    display: none;
}

.cpap-mask-quantity-offer__title-row {
    display: contents;
}

.cpap-mask-quantity-offer__price {
    display: grid;
    grid-row: 2;
    align-self: center;
    justify-items: center;
    color: var(--quantity-ink);
    text-align: center;
}

.cpap-mask-quantity-offer__price strong {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.15;
    white-space: normal;
}

.cpap-mask-quantity-offer__price small {
    margin-top: 4px;
    color: var(--quantity-muted);
    font-size: 14px;
    line-height: 1.1;
}

.cpap-mask-quantity-offer__saving {
    grid-row: 3;
    align-self: end;
    justify-self: center;
    padding: 4px 8px;
    border-radius: 7px;
    background: var(--quantity-green-soft);
    color: var(--quantity-green-ink);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.05;
}

.cpap-mask-quantity-offer__saving[hidden] {
    display: none;
}

.cpap-mask-quantity-offer__badge {
    position: absolute;
    z-index: 1;
    top: -17px;
    left: 50%;
    padding: 7px 11px;
    border: 1px solid #d3d8dc;
    border-radius: 8px;
    background: #fff;
    color: #4d5358;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transform: translateX(-50%);
    pointer-events: none;
}

.cpap-mask-quantity-offer__badge--popular {
    border-color: var(--quantity-blue);
    background: var(--quantity-blue);
    color: #fff;
}

.cpap-mask-quantity-offer__option[data-quantity-tier="three"] > .cpap-mask-quantity-offer__badge {
    border-color: #b8dfb2;
    background: var(--quantity-green-soft);
    color: var(--quantity-green-ink);
}

.cpap-mask-quantity-offer__details {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 12px;
    align-items: center;
    gap: 12px;
}

.cpap-mask-quantity-offer__selected-description {
    margin: 0;
    padding: 0 !important;
    color: var(--quantity-copy);
    font-size: 14px;
    line-height: 1.35;
}

.cpap-mask-quantity-offer__quantity-row {
    display: block;
    margin: 0;
    padding: 0;
}

.cpap-mask-quantity-offer__quantity-row[hidden] {
    display: none;
}

.cpap-mask-quantity-offer__stepper {
    display: grid;
    grid-template-columns: 42px 46px 42px;
    height: 46px;
    overflow: hidden;
    border: 1px solid #9bbfe0;
    border-radius: 11px;
    background: rgb(255 255 255 / 18%);
}

.cpap-mask-quantity-offer__stepper button,
.cpap-mask-quantity-offer__stepper output {
    display: grid;
    min-width: 0;
    margin: 0;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--quantity-ink);
    font-size: 18px;
    line-height: 1;
}

.cpap-mask-quantity-offer__stepper button {
    cursor: pointer;
}

.cpap-mask-quantity-offer__stepper button:hover:not(:disabled) {
    background: rgb(255 255 255 / 40%);
}

.cpap-mask-quantity-offer__stepper button:disabled {
    color: #91a0ad;
    cursor: not-allowed;
}

.cpap-mask-quantity-offer__stepper output {
    font-weight: 700;
}

.cpap-mask-quantity-offer__guidance {
    margin: 18px 0 0;
    padding: 0 !important;
    color: var(--quantity-muted);
    font-size: 14px;
    line-height: 1.35;
}

.cpap-mask-quantity-offer__add {
    display: grid !important;
    width: 100% !important;
    min-height: 72px;
    margin: 16px 0 10px !important;
    padding: 10px 18px !important;
    place-items: center;
    border: 0 !important;
    border-radius: 15px !important;
    background: var(--quantity-green) !important;
    box-shadow: none !important;
    color: #10150b !important;
    text-transform: none !important;
    cursor: pointer;
}

.cpap-mask-quantity-offer__add:hover:not(:disabled) {
    background: #82b93a !important;
}

.cpap-mask-quantity-offer__add.is-disabled {
    opacity: .55;
}

.cpap-mask-quantity-offer__add.is-loading {
    cursor: wait;
}

.cpap-mask-quantity-offer__add-main,
.cpap-mask-quantity-offer__add-detail {
    display: block;
}

.cpap-mask-quantity-offer__add-main {
    font-size: 21px;
    font-weight: 400;
    line-height: 1.08;
}

.cpap-mask-quantity-offer__add-detail {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.1;
}

.cpap-mask-quantity-offer__error {
    margin: 11px 0 0;
    padding: 10px 12px !important;
    border: 1px solid #c92a2a;
    border-radius: 8px;
    background: #fff2f2;
    color: #9f1717;
    font-size: 14px;
}

@media (max-width: 690px) {
    .cpap-mask-quantity-offer {
        margin-top: 14px;
    }

    .cpap-mask-quantity-offer__heading {
        margin-bottom: 12px;
        font-size: 13px !important;
    }

    .cpap-mask-quantity-offer__options {
        margin-top: 8px;
        gap: 8px;
    }

    .cpap-mask-quantity-offer__card {
        grid-template-rows: auto minmax(45px, 1fr) auto;
        min-height: 138px;
        padding: 24px 5px 9px;
        gap: 5px;
    }

    .cpap-mask-quantity-offer__copy > strong,
    .cpap-mask-quantity-offer__title-row > strong {
        font-size: 15px;
    }

    .cpap-mask-quantity-offer__copy > span:last-child {
        font-size: 13px;
    }

    .cpap-mask-quantity-offer__title-row {
        gap: 6px 9px;
    }

    .cpap-mask-quantity-offer__saving {
        padding: 3px 6px;
        border-radius: 6px;
        font-size: 11px;
    }

    .cpap-mask-quantity-offer__price strong {
        font-size: 15px;
    }

    .cpap-mask-quantity-offer__price small {
        margin-top: 3px;
        font-size: 12px;
    }

    .cpap-mask-quantity-offer__badge {
        top: -15px;
        left: 50%;
        padding: 5px 7px;
        border-radius: 8px;
        font-size: 11px;
    }

    .cpap-mask-quantity-offer__details {
        margin-top: 10px;
        gap: 8px;
    }

    .cpap-mask-quantity-offer__selected-description {
        font-size: 13px;
    }

    .cpap-mask-quantity-offer__quantity-row {
        margin: 0;
        padding: 0;
    }

    .cpap-mask-quantity-offer__stepper {
        grid-template-columns: 38px 42px 38px;
        height: 42px;
        border-radius: 10px;
    }

    .cpap-mask-quantity-offer__stepper button,
    .cpap-mask-quantity-offer__stepper output {
        font-size: 17px;
    }

    .cpap-mask-quantity-offer__guidance {
        margin-top: 15px;
        font-size: 13px;
    }

    .cpap-mask-quantity-offer__add {
        min-height: 66px;
        margin-top: 14px !important;
        padding: 9px 14px !important;
        border-radius: 13px !important;
    }

    .cpap-mask-quantity-offer__add-main {
        font-size: 20px;
    }

    .cpap-mask-quantity-offer__add-detail {
        margin-top: 3px;
        font-size: 13px;
    }
}

@media (max-width: 390px) {
    .cpap-mask-quantity-offer__card {
        padding-right: 4px;
        padding-left: 4px;
    }

    .cpap-mask-quantity-offer__quantity-row {
        margin-right: 0;
        margin-left: 0;
    }

    .cpap-mask-quantity-offer__price strong {
        font-size: 14px;
    }
}
