@media (max-width: 1023px) {
    /* Keep fixed positioning relative to the viewport while the drawer is closed. */
    html:not(.sb-active, .umn-open) #sb-site:has(#infoItem .product-detail-card[data-mobile-layout]) {
        transform: none !important;
        will-change: auto !important;
    }

    #infoItem > .innerblock:has(> .product-detail-card[data-mobile-layout]) {
        width: calc(100% - 24px);
        max-width: 680px;
    }

    #infoItem .product-detail-card[data-mobile-layout] {
        display: flex !important;
        flex-direction: column;
        direction: rtl;
        gap: 10px;
        overflow: visible !important;
        box-sizing: border-box;
        background: transparent;
        box-shadow: none;
        --product-top: 0px;
        --product-bottom: 0px;
    }

    #infoItem .product-detail-card[data-mobile-layout] > .breadCrumbHolder { order: var(--section-breadcrumb, 0); }
    #infoItem .product-detail-card[data-mobile-layout] > .tit { order: var(--section-heading, 1); }
    #infoItem .product-detail-card[data-mobile-layout] > #gallery { order: var(--section-gallery, 2); }
    #infoItem .product-detail-card[data-mobile-layout] > #gallery-toolbar-wrap { order: var(--section-actions, 3); }
    #infoItem .product-detail-card[data-mobile-layout] :is(.product-detail-info, .hashtags) { order: var(--section-info, 3); }
    #infoItem .product-detail-card[data-mobile-layout] .product-detail-options { order: var(--section-options, 4); }
    #infoItem .product-detail-card[data-mobile-layout] .product-purchase-slot { order: var(--section-purchase, 5); }
    #infoItem .product-detail-card[data-mobile-layout] > .showmore_one { order: var(--section-description, 6); }
    #infoItem .product-detail-card[data-mobile-layout] > :is(.tab-tools, .groupDV) { order: var(--section-specs, 7); }
    #infoItem .product-detail-card[data-mobile-layout] > .product-detail-related { order: var(--section-related, 8); }

    #infoItem .product-detail-card[data-mobile-layout] > :is(.breadCrumbHolder, .tit, #gallery, #gallery-toolbar-wrap, .showmore_one, .tab-tools, .product-detail-related, .hashtags) {
        position: relative !important;
        inset: auto !important;
        float: none !important;
        width: 100% !important;
        min-width: 0;
        height: auto !important;
        margin: 0 !important;
        box-sizing: border-box;
    }

    #infoItem .product-detail-card[data-mobile-layout] > #gallery {
        padding: 12px;
        border: 1px solid var(--color--Theme--Base--Completement-3, #e4e4e4);
        border-radius: 14px;
        background: var(--color--Theme--Base--Completement-1, #fff);
        box-shadow: none;
    }

    #infoItem .product-detail-card[data-mobile-layout] #rg-gallery {
        position: relative;
        height: auto !important;
        max-height: none !important;
    }

    #infoItem .product-detail-card[data-mobile-layout] #gallery :is(.rg-image-wrapper, .rg-image) {
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none !important;
    }

    #infoItem .product-detail-card[data-mobile-layout] #gallery .rg-image {
        display: grid;
        place-items: center;
        width: 100%;
        aspect-ratio: 1 / 1.03;
        max-height: 440px;
    }

    #infoItem .product-detail-card[data-mobile-layout] #gallery .rg-image > img {
        display: block;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    #infoItem .product-detail-card[data-mobile-layout] #rg-gallery > :is(.newprod, .pishnahad) {
        top: 8px;
        right: -4px;
    }

    #infoItem .product-detail-card[data-mobile-layout] #rg-gallery > .newprod + .pishnahad {
        top: 50px;
    }

    #infoItem .product-detail-card[data-mobile-layout] > .tit {
        display: block !important;
    }

    #infoItem .product-detail-card[data-mobile-layout] > #gallery-toolbar-wrap {
        display: flex !important;
        align-self: center;
        width: fit-content !important;
        max-width: 100%;
        border: 1px solid var(--color--Theme--Base--Completement-3, #e4e4e4);
        border-radius: 999px;
        background: var(--color--Theme--Base--Completement-1, #fff);
        box-shadow: none;
    }

    #infoItem .product-detail-card[data-mobile-layout] > #gallery-toolbar-wrap > ul {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: row;
        gap: 2px;
        margin: 0;
        padding: 0 4px;
    }

    #infoItem .product-detail-card[data-mobile-layout] > #gallery-toolbar-wrap > ul::before,
    #infoItem .product-detail-card[data-mobile-layout] > #gallery-toolbar-wrap > ul::after {
        content: none;
    }

    #infoItem .product-detail-card[data-mobile-layout] > #gallery-toolbar-wrap > ul > li {
        margin: 0;
        padding: 0;
    }

    #infoItem .product-detail-card[data-mobile-layout] > #gallery-toolbar-wrap > ul > li > .icon {
        display: grid;
        place-items: center;
        width: 36px;
        height: 36px;
        margin: 0;
        border-radius: 50%;
        box-shadow: none;
        font-size: 17px !important;
        line-height: 1;
    }

    #infoItem .product-detail-card[data-mobile-layout] > #gallery-toolbar-wrap > ul > li > .icon::before {
        margin: 0;
        font-size: inherit !important;
    }

    #infoItem .product-detail-card[data-mobile-layout] > .boxInfo {
        display: contents;
    }

    #infoItem .product-detail-card[data-mobile-layout] .product-detail-info {
        display: flow-root;
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
        padding: 12px 14px;
        border: 1px solid var(--color--Theme--Base--Completement-3, #e4e4e4);
        border-radius: 14px;
        background: var(--color--Theme--Base--Completement-1, #fff);
        text-align: start;
        color: var(--color--Theme--Background--Primary-1, #142c4d);
    }

    #infoItem .product-detail-card[data-mobile-layout] .product-detail-info .lstprice {
        float: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #infoItem .product-detail-card[data-mobile-layout] .product-detail-info .lstprice > li {
        display: grid;
        gap: 6px;
        margin: 0;
        padding: 0;
    }

    #infoItem .product-detail-card[data-mobile-layout] .product-detail-info .lstprice .row-box {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        box-sizing: border-box;
        margin: 0;
        padding: 7px 9px;
        border-radius: 8px;
        background: var(--color--Theme--Base--Completement-2, #f2f2f2);
        color: inherit;
        font-size: 12px;
        line-height: 1.65;
    }

    #infoItem .product-detail-card[data-mobile-layout] .product-detail-info .row-box > div {
        width: auto;
        min-width: 0;
        margin: 0;
        text-align: start;
    }

    #infoItem .product-detail-card[data-mobile-layout] .product-detail-info .row-box > div:last-child {
        font-weight: 700;
    }

    #infoItem .product-detail-card[data-mobile-layout] .product-detail-info .product-unit-profit > div:last-child {
        color: var(--color--Material--Success, #2e7d32);
    }

    #infoItem .product-detail-card[data-mobile-layout] .product-detail-info .row-box:not(:has(*)):empty,
    #infoItem .product-detail-card[data-mobile-layout] .product-detail-info .product-expiry:not(:has(> div:nth-child(2):not(:empty))) {
        display: none;
    }

    #infoItem .product-detail-card[data-mobile-layout] .product-detail-info .unit-price-display {
        width: 100%;
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        color: inherit !important;
    }

    #infoItem .product-detail-card[data-mobile-layout] .product-detail-info .product-report {
        display: flex;
        justify-content: flex-start;
        margin-top: 10px !important;
    }

    #infoItem .product-detail-card[data-mobile-layout] .product-detail-info .btn-ticket {
        min-height: 36px;
        padding: 5px 10px;
        border: 1px solid var(--color--Theme--Border--Primary-8, #c9d5e2);
        border-radius: 8px;
        background: transparent;
        color: var(--color--Theme--Background--Primary-1, #142c4d);
        box-shadow: none;
        font-size: 12px;
    }

    #infoItem .product-detail-card[data-mobile-layout] > .hashtags {
        background: transparent !important;
    }

    #infoItem .product-detail-card[data-mobile-layout] > .hashtags:not(:has(.catalog-alternate-name)) {
        display: none;
    }

    #infoItem .product-detail-card[data-mobile-layout] .catalog-alternate-name {
        border-color: var(--color--Theme--Base--Completement-3, #e4e4e4) !important;
        border-radius: 8px !important;
        background: var(--color--Theme--Base--Completement-2, #f2f2f2) !important;
        color: var(--color--Theme--Background--Primary-1, #142c4d) !important;
    }

    #infoItem .product-detail-card[data-mobile-layout] #model-holder {
        margin: 0 !important;
        padding: 0 !important;
    }

    #infoItem .product-detail-card[data-mobile-layout] #model-holder:not(:has(.mainmodels:not(.hidden) .model + .model)) {
        display: none !important;
    }

    #infoItem .product-detail-card[data-mobile-layout] > .boxInfo:not(:has(.anonymous-price-tag)) #model-holder:has(.mainmodels:not(.hidden) .model + .model),
    #infoItem .product-detail-card[data-mobile-layout] > .boxInfo:not(:has(.anonymous-price-tag)) #model-holder .mainmodels:not(.hidden):has(.model + .model) {
        display: block !important;
    }

    #infoItem .product-detail-card[data-mobile-layout] #model-holder > .grg:empty,
    #infoItem .product-detail-card[data-mobile-layout] > .showmore_one:has(#dvDesc > div:empty) {
        display: none;
    }

    #infoItem .product-purchase-slot:has(.qBox, .addtocart) {
        display: block;
        min-width: 0;
    }

    #infoItem .product-purchase-slot:not(:has(.qBox, .addtocart)) {
        display: none;
    }

    #infoItem .product-detail-card.product-purchase-stuck .product-purchase-slot {
        min-height: var(--purchase-bar-height, 0px);
    }

    #infoItem .product-detail-card.product-purchase-stuck .product-purchase-bar {
        position: fixed;
        top: calc(var(--product-top) + 6px);
        left: var(--purchase-sticky-left);
        width: var(--purchase-sticky-width);
        z-index: 25;
    }

    #infoItem .product-purchase-bar {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        column-gap: 10px;
        direction: rtl;
        box-sizing: border-box;
        width: 100%;
        padding: 8px 12px;
        border: 1px solid var(--color--Theme--Base--Completement-3, #e4e4e4);
        border-radius: 14px;
        background: var(--color--Theme--Base--Completement-1, #fff);
        box-shadow: 0 3px 12px rgb(0 0 0 / 8%);
    }

    #infoItem .product-detail-card:is([data-purchase-position="top"], [data-purchase-position="bottom"]) .product-purchase-slot:has(.qBox, .addtocart) {
        display: contents;
    }

    #infoItem .product-detail-card:is([data-purchase-position="top"], [data-purchase-position="bottom"]) .product-purchase-bar {
        position: fixed;
        z-index: 25;
        inset-inline: 12px;
        width: auto;
    }

    #infoItem [data-purchase-position="top"] .product-purchase-bar {
        top: calc(max(var(--product-top, 0px), env(safe-area-inset-top, 0px)) + var(--purchase-top-margin, 6px));
    }

    #infoItem .product-detail-card.product-purchase-ready[data-purchase-position="top"] {
        padding-top: calc(var(--purchase-bar-height, 0px) + var(--purchase-top-margin, 6px) + 8px);
    }

    #infoItem [data-purchase-position="bottom"] .product-purchase-bar {
        bottom: calc(max(var(--product-bottom, 0px), env(safe-area-inset-bottom, 0px)) + var(--purchase-bottom-margin, 8px));
    }

    #infoItem .product-detail-card.product-purchase-ready[data-purchase-position="bottom"] {
        padding-bottom: calc(var(--purchase-bar-height, 0px) + var(--purchase-bottom-margin, 8px) + 8px);
    }

    #infoItem .product-purchase-price {
        grid-area: 1 / 2;
        z-index: 1;
        min-width: 0;
        color: #137746;
        line-height: 1.45;
        text-align: left;
        overflow-wrap: anywhere;
    }

    #infoItem .product-purchase-price[hidden] { display: none; }
    #infoItem .product-purchase-price strong { font-size: clamp(17px, 4.8vw, 23px); font-weight: 700; }

    #infoItem .product-purchase-source {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        overflow: hidden !important;
        clip-path: inset(50%);
    }

    #infoItem .product-purchase-bar .qBox,
    #infoItem .product-purchase-bar .addtocart {
        position: static !important;
        inset: auto !important;
        float: none !important;
        width: auto !important;
        max-width: 100%;
        min-width: 0;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    #infoItem .product-purchase-bar .addtocart { grid-area: 1 / 1; }

    #infoItem .product-purchase-bar .qBox {
        display: grid;
        grid-area: 1 / 1 / 4 / -1;
        grid-template-columns: subgrid;
        grid-template-rows: subgrid;
    }

    #infoItem .product-purchase-bar .qBox .boxinput {
        grid-area: 1 / 1 / 3 / 2;
        justify-self: start;
        align-self: center;
        margin: 0 !important;
    }
    #infoItem .product-purchase-bar .qBox .quant {
        min-width: 0;
        width: auto;
        margin: 0;
        flex-wrap: nowrap;
        gap: 4px;
    }

    #infoItem .product-purchase-bar .qBox.activeC .inputBox {
        position: static;
        width: clamp(48px, 18vw, 108px) !important;
        min-width: 0;
        height: 28px !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        color: var(--color--Theme--Background--Primary-1, #142c4d);
        text-align: center;
        font-size: 15px;
        box-shadow: none !important;
    }

    #infoItem .product-purchase-bar .qBox.activeC .quant {
        gap: 0;
        border-radius: 999px;
        background: var(--color--Theme--Base--Completement-3, #e4e4e4);
    }

    #infoItem .product-purchase-bar .qBox.activeC .quant > button.red {
        position: static;
        inset: auto;
    }

    #infoItem .product-purchase-bar .qBox .quant > :is(button.green, button.red) {
        flex-shrink: 0;
        width: 37px;
        height: 37px;
    }

    #infoItem .product-purchase-bar .qBox.activeC .quant > button.green { width: 35px; }

    #infoItem .product-purchase-bar .qBox .box-mode-selector {
        grid-area: 2 / 2;
        width: auto !important;
        justify-self: end;
        text-align: left;
        margin: 2px 0 0 !important;
        padding: 0 !important;
    }

    #infoItem .product-purchase-bar .qBox .mixed-quantity-summary { grid-area: 3 / 1 / 4 / -1; }
    #infoItem .product-purchase-bar .qBox .box-mode-ratio { display: none; }
    #infoItem .product-purchase-bar .qBox .box-mode-toggle { min-width: 54px; min-height: 27px; padding-inline: 8px; }
    #infoItem .product-purchase-bar .qBox .unitspan:empty { display: none; }
}
