/* Product page on a phone: the price under the title, and the buy bar's quantity stepper + "Add · price".
   Loaded only while the storefront switch is on (App\Support\PdpStickyAdd). The bar itself is the page's
   existing .product__btn (mobile.css section 6); this adds to it. Logical properties only, for RTL. */

.pdp-price-top,
.pdp-qty-pre,
.pdp-basket-link {
    display: none;
}

@media (max-width: 768px) {
    /* Price right under the name, like the app. The old price row further down keeps only its stock
       chip on a phone, so the price is not shown twice; JS keeps updating both, the top one is visible. */
    .product__content__price .price__new,
    .product__content__price .price__old {
        display: none !important;
    }

    .product__content__price:not(:has(.pdp-stock)) {
        display: none;
    }

    .product__content__price {
        margin-block: 4px 8px;
    }

    /* Price right under the name, like the app. */
    .pdp-price-top {
        display: flex;
        align-items: baseline;
        gap: 8px;
        margin-block-start: 4px;
    }

    .pdp-price-top .price__new {
        font-size: 20px;
        font-weight: 700;
        line-height: 1.2;
    }

    .pdp-price-top .price__old {
        font-size: 14px;
    }

    /* Quantity before the first add: shown only beside a live Add button (not Notify me, not once the
       page's in-basket stepper has replaced it, not while the button is hidden). */
    .product__btn #add-to-basket-btn:not(.hidden):not(.btn__notify) ~ .pdp-qty-pre {
        display: flex;
    }

    .pdp-qty-pre {
        order: -1;
        align-items: center;
        justify-content: space-between;
        flex: 0 0 auto;
        height: 46px;
        padding-inline: 4px;
        gap: 2px;
        border-radius: 12px;
        background: #f3effe;
    }

    .pdp-qty-pre button {
        width: 38px;
        height: 38px;
        padding: 0;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: #5c18e4;
        font-size: 22px;
        font-weight: 700;
        line-height: 1;
        cursor: pointer;
    }

    .pdp-qty-pre button:disabled {
        opacity: 0.35;
        cursor: default;
    }

    .pdp-qty-pre__num {
        min-width: 24px;
        margin: 0;
        text-align: center;
        font-size: 16px;
        font-weight: 700;
        color: #1b1530;
    }

    /* In the basket, like the app: the page's own stepper (.add__count, the one whose buttons send the
       increase / decrease requests) becomes the light stepper on the start side, and "View basket · N" fills
       the end side. At 1 the minus is the page's trash (main.js swaps the icon), which removes the line and
       brings the Add button back. The selectors start at body to win over the page's full-width purple pill. */
    body .product__btn .add__count:not(.hidden) {
        flex: 0 0 auto !important;
        width: auto !important;
        height: 46px !important;
        padding: 0 4px !important;
        gap: 2px !important;
        border-radius: 12px !important;
        background: #f3effe !important;
        justify-content: space-between !important;
    }

    body .product__btn .add__count__up,
    body .product__btn .add__count__down {
        width: 44px !important;
        height: 44px !important;
        border-radius: 10px !important;
        background: transparent !important;
    }

    /* mobile.css tints the trash button faint red at 1; the red icon alone is enough here. */
    body .product__btn .add__count.pk-qty-1 .add__count__down {
        background: transparent !important;
    }

    /* Native icon colours: purple minus / plus, red trash (global.css turns them white for the old pill). */
    body .product__btn .add__count button img {
        filter: none !important;
    }

    body .product__btn .add__count .add__count__num {
        flex: 0 0 auto !important;
        min-width: 28px;
        padding: 0 !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        color: #1b1530 !important;
    }

    .product__btn .add__count:not(.hidden) ~ .pdp-basket-link {
        display: flex;
    }

    .pdp-basket-link {
        flex: 1 1 auto;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-width: 0;
        min-height: 46px;
        padding-inline: 12px;
        border-radius: 12px;
        background: #5c18e4;
        color: #fff;
        font-size: 14px;
        font-weight: 700;
        line-height: 1.2;
        text-decoration: none;
        white-space: nowrap;
    }

    /* The price in the Add button, on a phone only: desktop keeps "Add To Basket". */
    .pdp-add__full {
        display: none;
    }

    /* The page's tail stays reachable above the bar and the iPhone home indicator. */
    body:has(.product__btn) main {
        padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    }
}

@media (min-width: 769px) {
    .pdp-add__short {
        display: none;
    }
}
