/* mobile footer cart UI start */
@media only screen and (max-width: 767px) {
    #mstore-footer-cart-wrapper {
        font-family: Arial, Helvetica, sans-serif;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-container {
        width: 100%;
        max-width: none;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content {
        width: 100%;
        height: 80vh;
        height: 80dvh;
        max-height: 80vh;
        max-height: 80dvh;
        padding: 0;
        overflow: hidden;
        border: 0;
        border-radius: 22px 22px 0 0;
        background: #f5f6f8;
        box-shadow: 0 -14px 40px rgba(16, 24, 40, 0.2);
        transform-origin: bottom center;
        will-change: transform, opacity;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content.opened {
        display: flex;
        flex-direction: column;
        animation: raragit-mobile-cart-sheet-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    @keyframes raragit-mobile-cart-sheet-in {
        from {
            opacity: 0;
            transform: translateY(44px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .hd {
        position: relative;
        flex: 0 0 auto;
        min-height: 48px;
        padding: 8px 12px 6px 14px;
        border-bottom: 1px solid #e8e9ed;
        background: #fff;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .hd h2 {
        margin: 0;
        color: #202124;
        font-size: 18px;
        font-weight: 700;
        line-height: 1.2;
        letter-spacing: -0.2px;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .hd .close-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        margin-top: 1px;
        border-radius: 50%;
        background: #f1f2f4;
        color: #292b2f;
        transition: background-color 0.2s ease;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .bd {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none !important;
        padding: 10px 12px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
        margin: 0;
        padding: 0;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-card-item {
        display: grid;
        grid-template-columns: 96px minmax(0, 1fr);
        column-gap: 14px;
        row-gap: 9px;
        margin: 0;
        padding: 14px;
        overflow: hidden;
        border: 1px solid #e7e8ec;
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 4px 16px rgba(26, 31, 44, 0.06);
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-card-item > div {
        min-width: 0;
        margin: 0;
        grid-column: 2;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-card-item > div:nth-child(2) {
        padding-right: 32px;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-card-item .image-wrapper {
        grid-column: 1;
        grid-row: 1 / span 5;
        width: 96px;
        min-width: 0;
        height: 118px;
        max-height: none;
        overflow: hidden;
        border-radius: 12px;
        background: #f6f6f6;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .image-wrapper a,
    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .image-wrapper img {
        display: block;
        width: 100%;
        height: 100%;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .image-wrapper img {
        object-fit: contain;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-card-item > div .title {
        display: block;
        margin-bottom: 2px;
        color: #8a8e98;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.3;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        opacity: 1;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-card-item > div .content {
        color: #292b2f;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-card-item > div .content p {
        font-size: inherit;
        line-height: inherit;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-card-item > div.prices {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding-top: 8px;
        border-top: 1px solid #eff0f2;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-card-item > div.prices > div {
        min-width: 0;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-item-prices,
    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .sub-total .content {
        color: #a4004f;
        font-size: 14px;
        font-weight: 700;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-item-prices del {
        margin-top: 3px;
        color: #8a8e98;
        font-size: 11px;
        font-weight: 500;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-card-item form {
        display: flex !important;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-card-item .quantity {
        width: 120px;
        height: 38px;
        margin: 0;
        border: 1px solid #dedfe3;
        border-radius: 999px;
        background: #fff;
        box-shadow: inset 0 1px 2px rgba(20, 24, 32, 0.04);
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-card-item .quantity .minus,
    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-card-item .quantity .plus,
    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-card-item .quantity input {
        height: 36px;
        background: transparent;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-card-item .mstore-cart-item-del-icon {
        top: 10px;
        right: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border-radius: 50%;
        background: #f2f3f5;
        opacity: 1;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-card-item .mstore-cart-item-del-icon svg {
        width: 14px;
        height: 16px;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .ft {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
        border-top: 1px solid #e6e7eb;
        background: #fff;
        box-shadow: 0 -8px 24px rgba(27, 31, 41, 0.08);
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .ft .right {
        order: 1;
        padding: 6px 10px;
        border: 1px solid #eadde3;
        border-radius: 12px;
        background: #fbf7f9;
        color: #4a4145;
        font-size: 12px;
        font-weight: 700;
        line-height: 1.35;
        text-transform: uppercase;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .ft .right > div {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .ft .right > div + div {
        margin-top: 4px;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .ft .right .cart-sub-total,
    #mstore-footer-cart-wrapper .mstore-footer-cart-content .ft .right .cart-discount-total {
        margin-left: auto;
        padding-left: 0;
        color: #a4004f;
        font-size: 15px;
        font-weight: 800;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .ft .right .discount_rate {
        flex: 0 0 auto;
        margin-left: 0 !important;
        font-family: inherit;
        font-size: 12px !important;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .ft .left {
        order: 2;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin: 0;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .ft .left .go-to-checkout-btn,
    #mstore-footer-cart-wrapper .mstore-footer-cart-content .ft .left .mstore-save-cart-btn,
    #mstore-footer-cart-wrapper .mstore-footer-cart-content .ft .left .clear-cart-btn {
        width: 100%;
        min-width: 0;
        max-width: none;
        height: 36px;
        min-height: 36px;
        max-height: 36px;
        flex: 0 0 auto;
        margin: 0;
        border-radius: 10px;
        font-family: inherit;
        font-size: 11px;
        font-weight: 800;
        line-height: 1;
        letter-spacing: 0.03em;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .ft .left .go-to-checkout-btn {
        grid-column: 1 / -1;
        background: #a4004f !important;
        box-shadow: 0 7px 18px rgba(164, 0, 79, 0.22);
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .ft .left .mstore-save-cart-btn {
        background: #26282c !important;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .ft .left .clear-cart-btn {
        border: 1px solid #d9dbe0 !important;
        background: #fff !important;
        color: #34363b !important;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-minimal {
        min-height: 68px;
        padding: 11px 14px calc(11px + env(safe-area-inset-bottom));
        align-items: center;
        gap: 12px;
        background: linear-gradient(135deg, #25272b 0%, #18191c 100%);
        box-shadow: 0 -8px 24px rgba(16, 20, 28, 0.2);
        font-size: 13px;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-minimal .left {
        min-width: 0;
        color: #fff;
        font-size: 12px;
        line-height: 1.45;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-minimal .left .cart-items-count,
    #mstore-footer-cart-wrapper .mstore-footer-cart-minimal .left .cart-total-price {
        font-weight: 800;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-minimal .left .cart-all-total-price {
        color: #c7c9ce;
        font-size: 11px;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-minimal .right {
        flex: 0 0 auto;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-minimal .mstore-footer-cart-folder-btn {
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 152px;
        min-width: 152px;
        min-height: 42px;
        padding: 0 16px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.09);
        color: #fff;
        font-size: 10px;
        font-weight: 800;
        line-height: 1.15;
        letter-spacing: 0.03em;
        white-space: nowrap;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-container .mstore-footer-cart-minimal .mstore-footer-cart-folder-btn::after {
        display: none !important;
        content: none !important;
    }

    body:has(#mstore-footer-cart-wrapper .mstore-footer-cart-content.opened) .back-top {
        bottom: 82px;
    }
}

@media only screen and (max-width: 380px) {
    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-card-item {
        grid-template-columns: 82px minmax(0, 1fr);
        column-gap: 11px;
        padding: 12px;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-content .mstore-cart-item-list-container .mstore-cart-card-item .image-wrapper {
        width: 82px;
        height: 104px;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-minimal .mstore-footer-cart-folder-btn {
        width: 146px;
        min-width: 146px;
        padding-right: 12px;
        padding-left: 12px;
        font-size: 9px;
    }
}

/* mobile footer cart two-row action layout start */
@media only screen and (max-width: 767px) {
    #mstore-footer-cart-wrapper .mstore-footer-cart-container .mstore-footer-cart-content {
        box-sizing: border-box;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-container .mstore-footer-cart-content.opened {
        display: flex;
        flex-direction: column;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-container .mstore-footer-cart-content .bd {
        flex: 1 1 0;
        min-height: 0;
        max-height: none !important;
        overflow-y: auto;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-container .mstore-footer-cart-content .ft {
        box-sizing: border-box;
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin: 0;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-container .mstore-footer-cart-content .ft .left {
        order: 2;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        min-height: 78px;
        margin: 0;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-container .mstore-footer-cart-content .ft .left .go-to-checkout-btn,
    #mstore-footer-cart-wrapper .mstore-footer-cart-container .mstore-footer-cart-content .ft .left .mstore-save-cart-btn,
    #mstore-footer-cart-wrapper .mstore-footer-cart-container .mstore-footer-cart-content .ft .left .clear-cart-btn {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        max-width: none;
        height: 36px;
        min-height: 36px;
        max-height: 36px;
        flex: 0 0 auto;
        margin: 0;
    }

    #mstore-footer-cart-wrapper .mstore-footer-cart-container .mstore-footer-cart-content .ft .left .go-to-checkout-btn {
        grid-column: 1 / -1;
    }
}
/* mobile footer cart two-row action layout end */

@media (prefers-reduced-motion: reduce) and (max-width: 767px) {
    #mstore-footer-cart-wrapper .mstore-footer-cart-container .mstore-footer-cart-content.opened {
        animation: none;
    }
}

/* hide duplicate minimal cart bar while mobile cart is open start */
@media only screen and (max-width: 767px) {
    #mstore-footer-cart-wrapper:has(.mstore-footer-cart-content.opened) .mstore-footer-cart-minimal {
        display: none !important;
    }
}
/* hide duplicate minimal cart bar while mobile cart is open end */

/* mobile cart outside-click backdrop start */
@media only screen and (max-width: 767px) {
    #mstore-footer-cart-wrapper .mstore-footer-cart-container {
        position: relative;
        z-index: 1;
    }

    #mstore-footer-cart-wrapper .raragit-mobile-cart-backdrop {
        position: fixed;
        z-index: 0;
        inset: 0;
        display: none;
        background: rgba(16, 24, 40, 0.14);
    }

    #mstore-footer-cart-wrapper:has(.mstore-footer-cart-content.opened) .raragit-mobile-cart-backdrop {
        display: block;
    }
}
/* mobile cart outside-click backdrop end */

/* align mobile floating controls start */
@media only screen and (max-width: 767px) {
    body:not(:has(#mstore-footer-cart-wrapper .mstore-footer-cart-content.opened)) .back-top {
        bottom: 122px !important;
    }
}

@media only screen and (max-width: 480px) {
    body:not(:has(#mstore-footer-cart-wrapper .mstore-footer-cart-content.opened)) .back-top {
        bottom: 144px !important;
    }
}
/* align mobile floating controls end */

/* hide AI chat launcher while mobile cart is open start */
@media only screen and (max-width: 767px) {
    body:has(#mstore-footer-cart-wrapper .mstore-footer-cart-content.opened)
        .mwai-chatbot-container.rara-ai-customer-service .mwai-trigger {
        opacity: 0;
        visibility: hidden;
        pointer-events: none !important;
        transform: translateY(12px) scale(0.92);
    }
}
/* hide AI chat launcher while mobile cart is open end */

/* hide back-to-top control while mobile cart is open start */
@media only screen and (max-width: 767px) {
    body:has(#mstore-footer-cart-wrapper .mstore-footer-cart-content.opened) .back-top {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transform: translateY(12px) scale(0.92);
    }
}
/* hide back-to-top control while mobile cart is open end */
/* mobile footer cart UI end */
