/* N3D mobile presentation. Remove this stylesheet's enqueue to revert. */
@media (max-width: 780px) {
    /* Checkout is a normal page on mobile, never a second Fly Cart surface. */
    body.woocommerce-checkout:not(.woocommerce-order-received) .wfc-widget-sidebar,
    body.woocommerce-checkout:not(.woocommerce-order-received) .wfc-overlay,
    body.woocommerce-checkout:not(.woocommerce-order-received) .wfc-cart-icon {
        display: none !important;
    }
    /* A closed StoreGrowth panel lives 800px off-screen. Remove that box
       instead of clipping checkout/payment content at the page root. */
    .wfc-widget-sidebar.wfc-slide {
        display: none !important;
    }
    .wfc-widget-sidebar {
        max-width: 100%;
        box-sizing: border-box;
    }
    .wfc-widget-sidebar .qc-close-nav {
        display: none !important;
    }
    html {
        overscroll-behavior-x: none;
    }
    html.n3d-overlay-lock {
        overflow: hidden !important;
        overscroll-behavior: none;
    }
    html.n3d-overlay-lock #wpadminbar {
        position: fixed !important;
        top: 0 !important;
    }
    .n3d-mobile nav,
    .wfc-widget-sidebar .spsg-widget-shopping-cart-content-wrapper {
        overscroll-behavior-y: contain;
    }
    .n3d-mobile nav {
        box-sizing: border-box;
        max-width: calc(100vw - 36px);
        max-height: calc(100dvh - 180px);
        overflow-y: auto;
    }
    /* Official Mercado Pago markup and copy handler are preserved. */
    body.woocommerce-order-received .mp-details-pix,
    body.woocommerce-order-received .mp-details-pix * {
        box-sizing: border-box;
    }
    body.woocommerce-order-received .mp-details-pix {
        display: block;
        width: 100%;
        max-width: 480px;
        min-width: 0;
        margin: 0 auto 24px;
    }
    body.woocommerce-order-received .mp-details-pix .mp-row-checkout-pix,
    body.woocommerce-order-received .mp-details-pix .mp-pix-right,
    body.woocommerce-order-received .mp-details-pix .mp-details-pix-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        float: none;
        margin-inline: 0;
    }
    body.woocommerce-order-received .mp-details-pix .mp-pix-right {
        padding: 20px 16px;
        margin-bottom: 0;
        text-align: center;
    }
    body.woocommerce-order-received .mp-details-pix .mp-details-pix-amount {
        margin-top: 0;
    }
    body.woocommerce-order-received .mp-details-pix .mp-details-pix-qr-img {
        width: 152px !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 16px auto 0;
        object-fit: contain;
    }
    body.woocommerce-order-received .mp-details-pix .mp-details-pix-qr-subtitle {
        margin-bottom: 20px;
    }
    body.woocommerce-order-received .mp-details-pix .mp-details-pix-qr-description {
        margin: 0 0 12px;
        overflow-wrap: anywhere;
    }
    body.woocommerce-order-received .mp-details-pix .mp-row-checkout-pix-container {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 0;
    }
    body.woocommerce-order-received .mp-details-pix #mp-qr-code,
    body.woocommerce-order-received .mp-details-pix .mp-details-pix-button {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
        min-height: 48px;
        height: auto;
        margin: 0;
        padding: 12px;
        font-size: 16px;
        line-height: 1.4;
    }

    /* Compact corner control; retain the native counter and click target. */
    body:has(.wfc-cart-icon) {
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }
    .wfc-cart-icon.bottom-right {
        top: auto !important;
        left: auto !important;
        right: max(12px, env(safe-area-inset-right, 0px)) !important;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
        width: 48px;
        height: 48px;
        margin: 0 !important;
    }
    .wfc-cart-icon .wfc-open-btn {
        display: block;
        width: 48px;
        height: 48px;
    }
    .wfc-cart-icon .wfc-icon svg {
        box-sizing: border-box;
        width: 48px !important;
        height: 48px !important;
        padding: 9px !important;
    }
    .wfc-cart-icon .wfc-cart-countlocation {
        top: -6px;
        right: -4px;
        width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 11px;
    }

    /* Keep FlexSlider's slide widths/transforms; only frame the gallery. */
    body.single-product .woocommerce-product-gallery {
        width: min(100%, 320px) !important;
        max-width: 100%;
        float: none !important;
        margin: 0 auto 18px !important;
    }
    body.single-product .woocommerce-product-gallery .flex-viewport {
        height: auto !important;
        aspect-ratio: 1;
        border-radius: 16px;
    }
    body.single-product .woocommerce-product-gallery__image > a > img {
        display: block;
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        object-fit: contain;
        border-radius: 16px;
    }
    body.single-product .woocommerce-product-gallery .flex-control-thumbs {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 8px;
        width: 100%;
        max-width: 100%;
        padding: 0 0 6px !important;
        margin: 10px 0 0 !important;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        list-style: none;
        scrollbar-width: thin;
    }
    body.single-product .woocommerce-product-gallery .flex-control-thumbs li {
        float: none !important;
        flex: 0 0 60px;
        width: 60px !important;
        height: 60px;
        padding: 0 !important;
        margin: 0 !important;
    }
    body.single-product .woocommerce-product-gallery .flex-control-thumbs img {
        display: block;
        width: 60px !important;
        height: 60px !important;
        object-fit: cover;
        border-radius: 10px;
        box-sizing: border-box;
        border: 2px solid transparent;
    }
    body.single-product .woocommerce-product-gallery .flex-control-thumbs img.flex-active {
        border-color: var(--n3d-pink, #c62b9e);
    }
    body.single-product .n3d-product > .wp-block-columns {
        gap: 18px;
    }

    body.single-product form.cart {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
        max-width: 100%;
    }
    body.single-product form.cart .quantity:has(input[type="hidden"]) {
        display: none;
    }
    body.single-product form.cart .single_add_to_cart_button,
    body.single-product form.cart .spsg_buy_now_button_product_page {
        box-sizing: border-box;
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 100% !important;
        max-width: 100%;
        min-height: 50px;
        margin: 0 !important;
        padding: 13px 18px !important;
        border: 1px solid transparent !important;
        border-radius: 12px !important;
        font-family: inherit !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        line-height: 1.4 !important;
        letter-spacing: 0 !important;
        text-align: center;
        text-decoration: none;
        white-space: normal;
        background: var(--n3d-pink, #c62b9e) !important;
        color: #fff !important;
    }
    body.single-product form.cart .spsg_buy_now_button_product_page {
        background: var(--n3d-purple, #632d81) !important;
    }
    body.single-product form.cart .single_add_to_cart_button:focus-visible,
    body.single-product form.cart .spsg_buy_now_button_product_page:focus-visible {
        outline: 3px solid #c62b9e;
        outline-offset: 3px;
    }
}
