/* My Food Basket topping popup refresh v2.42 */
#infopopup .item-option-popup,
.item-option-popup-wrapper.ui-dialog .item-option-popup {
    background: #f7f7f8 !important;
}

#infopopup .modal-dialog,
.item-option-popup-wrapper.ui-dialog {
    width: min(640px, calc(100vw - 18px)) !important;
    max-width: 640px !important;
}

#infopopup .modal-content,
.item-option-popup-wrapper.ui-dialog {
    border: 0 !important;
    border-radius: 12px !important;
    background: #f7f7f8 !important;
    box-shadow: 0 18px 55px rgba(0,0,0,.35) !important;
    overflow: hidden !important;
}

#item-option-popup-inner {
    display: flex !important;
    flex-direction: column;
    max-height: calc(100vh - 32px);
    overflow: hidden !important;
}

#infopopup .modal-header,
.item-option-popup-wrapper.ui-dialog .ui-dialog-titlebar {
    position: sticky !important;
    top: 0 !important;
    z-index: 30 !important;
    min-height: 48px !important;
    margin: 0 0 12px !important;
    padding: 11px 48px 10px 18px !important;
    background: #f7a91f !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-sizing: border-box;
}

#infopopup .popup-title,
.item-option-popup-wrapper.ui-dialog .ui-dialog-title {
    display: block !important;
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    color: #1f2328 !important;
    font-size: 18px !important;
    line-height: 26px !important;
    font-weight: 800 !important;
    text-align: left !important;
    text-transform: uppercase;
}

#infopopup button.close,
#infopopup .close-model,
.item-option-popup-wrapper.ui-dialog .ui-dialog-titlebar-close {
    position: absolute !important;
    top: 7px !important;
    right: 8px !important;
    width: 34px !important;
    height: 34px !important;
    border: 0 !important;
    border-radius: 7px !important;
    background: #fff !important;
    color: #222 !important;
    opacity: 1 !important;
    box-shadow: 0 1px 5px rgba(0,0,0,.18) !important;
}

.item-option-popup-wrapper.ui-dialog .ui-dialog-titlebar-close span {
    background: transparent !important;
    border: 0 !important;
}

#infopopup .item-option-popup,
.item-option-popup-wrapper.ui-dialog .item-option-popup {
    width: 100% !important;
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(100vh - 112px);
    display: flex !important;
    flex-direction: column;
    padding: 12px 14px 0 !important;
    box-sizing: border-box;
    overflow: hidden !important;
}

.item-option-popup .popupscrollable {
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(100vh - 205px);
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0 0 14px !important;
    -webkit-overflow-scrolling: touch;
}

.item-option-popup .ets-extra-block,
.item-option-popup .t_box,
.item-option-popup .mfb-v242-block {
    float: none !important;
    width: auto !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    background: #fff !important;
    border: 1px solid #dedee4 !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    overflow: hidden;
}

.item-option-popup .opname,
.item-option-popup .op_title_click,
.item-option-popup .tbox_heading h2,
.item-option-popup .mfb-v242-heading {
    display: block !important;
    position: relative;
    min-height: 42px;
    margin: 0 !important;
    padding: 12px 14px 10px 36px !important;
    color: #151515 !important;
    background: #fff !important;
    border: 0 !important;
    border-bottom: 1px solid #ececf0 !important;
    font-size: 17px !important;
    line-height: 22px !important;
    font-weight: 800 !important;
    text-align: center !important;
    box-sizing: border-box;
}

.item-option-popup .opname:before,
.item-option-popup .op_title_click:before,
.item-option-popup .tbox_heading h2:before,
.item-option-popup .mfb-v242-heading:before {
    content: "";
    position: absolute;
    left: 14px;
    top: 20px;
    width: 16px;
    height: 4px;
    border-radius: 5px;
    background: #8bd900;
}

.item-option-popup .opname:after,
.item-option-popup .op_title_click:after,
.item-option-popup .tbox_heading h2:after,
.item-option-popup .mfb-v242-heading:after {
    content: "\25B2";
    position: absolute;
    right: 14px;
    top: 13px;
    color: #d71920;
    font-size: 13px;
    line-height: 18px;
}

.item-option-popup .mfb-v242-collapsed > .opname:after,
.item-option-popup .mfb-v242-collapsed > .op_title_click:after,
.item-option-popup .mfb-v242-collapsed > .tbox_heading h2:after,
.item-option-popup .mfb-v242-collapsed .mfb-v242-heading:after {
    content: "\25BC";
}

.item-option-popup .options-extra,
.item-option-popup .selectbox_list,
.item-option-popup .checkbox_list,
.item-option-popup .mfb-v242-panel {
    display: block !important;
    padding: 12px !important;
    background: #fff !important;
    border: 0 !important;
}

.item-option-popup select.mfb-v242-native-select {
    display: none !important;
}

.item-option-popup select[id="typeselect"],
.item-option-popup select[name^="topping["] {
    display: none !important;
}

.item-option-popup .tblRootCauseBody,
.item-option-popup .checkbox_list,
.item-option-popup .selectbox_list,
.item-option-popup .mfb-v242-choice-list {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    border-collapse: separate;
    box-sizing: border-box;
}

.item-option-popup .tblRootCauseBody tbody,
.item-option-popup .tblRootCauseBody tr {
    display: contents;
}

.item-option-popup .tblRootCauseBody td,
.item-option-popup .checkbox_list .checkbox,
.item-option-popup .selectbox_item,
.item-option-popup .mfb-v242-card {
    display: flex !important;
    align-items: center;
    flex-direction: row-reverse;
    min-height: 44px;
    margin: 0 !important;
    padding: 9px 12px !important;
    border: 1px solid #d9d9de !important;
    border-radius: 7px !important;
    background: #fff !important;
    color: #222 !important;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.item-option-popup .tblRootCauseBody td:hover,
.item-option-popup .checkbox_list .checkbox:hover,
.item-option-popup .selectbox_item:hover,
.item-option-popup .mfb-v242-card:hover {
    border-color: #e31d2b !important;
    box-shadow: 0 2px 8px rgba(227,29,43,.12);
}

.item-option-popup .tblRootCauseBody td input,
.item-option-popup .checkbox_list .checkbox input,
.item-option-popup .selectbox_item input[type="radio"],
.item-option-popup .mfb-v242-card input {
    display: inline-block !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 0 0 10px !important;
    flex: 0 0 auto;
}

.item-option-popup .tblRootCauseBody td label,
.item-option-popup .checkbox_list .checkbox label,
.item-option-popup .selectbox_item label,
.item-option-popup .mfb-v242-label {
    display: flex !important;
    align-items: center;
    width: auto;
    flex: 1 1 auto;
    margin: 0 !important;
    padding: 0 !important;
    color: #222 !important;
    background: transparent !important;
    border: 0 !important;
    font-size: 14px !important;
    line-height: 18px !important;
    font-weight: 700 !important;
    cursor: pointer;
    pointer-events: none;
}

.item-option-popup .mfb-v242-selected,
.item-option-popup .selectbox_item > input:checked + label {
    border-color: #e31d2b !important;
    background: #fff5f6 !important;
    box-shadow: 0 0 0 2px rgba(227,29,43,.08);
}

.item-option-popup .red,
.item-option-popup #price-main {
    margin-left: auto;
    color: #d71920 !important;
    font-weight: 800 !important;
    white-space: nowrap;
}

.item-option-popup .selectbox_action {
    margin-left: auto;
    display: none;
    align-items: center;
    gap: 7px;
}

.item-option-popup .selectbox_item > input:checked + label + .selectbox_action {
    display: flex !important;
}

.item-option-popup .selectbox_action .no_btn {
    width: 24px !important;
    height: 24px !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #e31d2b !important;
    color: #fff !important;
    font-weight: 800 !important;
    line-height: 24px !important;
}

.item-option-popup .mfb-v242-footer {
    flex: 0 0 auto;
    position: relative !important;
    z-index: 40;
    display: grid !important;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    margin: 0 -14px !important;
    padding: 14px 18px !important;
    background: linear-gradient(180deg, #252525 0%, #070707 100%) !important;
    border-top: 1px solid rgba(255,255,255,.08) !important;
    box-shadow: 0 -8px 24px rgba(0,0,0,.18);
    box-sizing: border-box;
}

.item-option-popup .mfb-v242-footer .mfb-v242-back,
.item-option-popup .mfb-v242-footer .btn_back {
    grid-column: 1;
    justify-self: start;
    min-width: 118px;
    min-height: 46px;
    padding: 0 18px !important;
    border: 1px solid rgba(255,255,255,.45) !important;
    border-radius: 7px !important;
    background: transparent !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    line-height: 44px !important;
    text-align: center;
    text-transform: uppercase;
    cursor: pointer;
    box-sizing: border-box;
}

.item-option-popup .mfb-v242-footer .mfb-v242-total {
    grid-column: 2;
    justify-self: center;
    color: #fff !important;
    font-size: 22px !important;
    line-height: 28px !important;
    font-weight: 900 !important;
    text-align: center;
    white-space: nowrap;
}

.item-option-popup .mfb-v242-footer .cart,
.item-option-popup .mfb-v242-footer .mfb-v242-action {
    grid-column: 3;
    justify-self: end;
}

.item-option-popup .mfb-v242-footer .cart a.button,
.item-option-popup .mfb-v242-footer .btn_next,
.item-option-popup .mfb-v242-footer .module_submit,
.item-option-popup .mfb-v242-footer .mfb-v242-action {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    min-height: 48px;
    padding: 0 20px !important;
    border: 0 !important;
    border-radius: 7px !important;
    background: #d71920 !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 48px !important;
    text-align: center;
    text-transform: uppercase;
    box-shadow: none !important;
    box-sizing: border-box;
}

.item-option-popup .mfb-v242-footer .cart a.button .sizeprice,
.item-option-popup .mfb-v242-footer .cart a.button .basket,
.item-option-popup .mfb-v242-footer .cart a.button .show-carttext,
.item-option-popup .mfb-v242-footer .cart a.button .hide-carttext {
    display: none !important;
}

.item-option-popup .mfb-v242-footer .mfb-v242-action-text {
    display: inline !important;
}

@media only screen and (max-width: 767px) {
    #infopopup .modal-dialog,
    .item-option-popup-wrapper.ui-dialog {
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    #infopopup .item-option-popup,
    .item-option-popup-wrapper.ui-dialog .item-option-popup {
        max-height: calc(100vh - 48px);
        padding: 10px 10px 0 !important;
    }

    .item-option-popup .popupscrollable {
        max-height: calc(100vh - 126px);
    }

    .item-option-popup .tblRootCauseBody,
    .item-option-popup .checkbox_list,
    .item-option-popup .selectbox_list,
    .item-option-popup .mfb-v242-choice-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .item-option-popup .mfb-v242-footer {
        grid-template-columns: 1fr auto 1fr;
        min-height: 66px;
        margin: 0 -10px !important;
        padding: 10px !important;
        gap: 8px;
    }

    .item-option-popup .mfb-v242-footer .mfb-v242-back,
    .item-option-popup .mfb-v242-footer .btn_back {
        min-width: 88px;
        min-height: 42px;
        padding: 0 10px !important;
        font-size: 13px !important;
        line-height: 40px !important;
    }

    .item-option-popup .mfb-v242-footer .mfb-v242-total {
        font-size: 18px !important;
        line-height: 24px !important;
    }

    .item-option-popup .mfb-v242-footer .cart a.button,
    .item-option-popup .mfb-v242-footer .btn_next,
    .item-option-popup .mfb-v242-footer .module_submit,
    .item-option-popup .mfb-v242-footer .mfb-v242-action {
        min-width: 108px;
        min-height: 42px;
        padding: 0 12px !important;
        font-size: 13px !important;
        line-height: 42px !important;
    }
}

/* Final overrides: old theme rules use ID selectors, so keep these last and specific. */
#infopopup .modal-content,
.item-option-popup-wrapper.ui-dialog,
.item-option-popup-wrapper.ui-dialog #item-option-popup-inner {
    overflow: hidden !important;
}

@media only screen and (min-width: 768px) {
    .item-option-popup-wrapper.ui-dialog {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
        width: min(620px, calc(100vw - 42px)) !important;
        max-width: 620px !important;
        max-height: 82vh !important;
    }

    .item-option-popup-wrapper.ui-dialog #item-option-popup-inner {
        max-height: 82vh !important;
    }

    .item-option-popup-wrapper.ui-dialog .item-option-popup {
        max-height: calc(82vh - 48px) !important;
    }

    .item-option-popup-wrapper.ui-dialog .item-option-popup .popupscrollable {
        max-height: calc(82vh - 138px) !important;
    }
}

#infopopup .item-option-popup,
.item-option-popup-wrapper.ui-dialog .item-option-popup {
    display: flex !important;
    flex-direction: column !important;
    max-height: calc(100vh - 112px) !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
}

#infopopup .item-option-popup .popupscrollable,
.item-option-popup-wrapper.ui-dialog .item-option-popup .popupscrollable {
    display: block !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: calc(100vh - 205px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 14px !important;
}

#infopopup .item-option-popup #buttonrow,
#infopopup .item-option-popup .control_btns,
#infopopup .item-option-popup .mfb-v242-footer,
.item-option-popup-wrapper.ui-dialog .item-option-popup #buttonrow,
.item-option-popup-wrapper.ui-dialog .item-option-popup .control_btns,
.item-option-popup-wrapper.ui-dialog .item-option-popup .mfb-v242-footer {
    flex: 0 0 auto !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 40 !important;
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    align-items: center !important;
    gap: 12px !important;
    width: auto !important;
    min-height: 72px !important;
    max-width: none !important;
    margin: 0 -14px !important;
    padding: 14px 18px !important;
    background: linear-gradient(180deg, #252525 0%, #070707 100%) !important;
    border: 0 !important;
    border-top: 1px solid rgba(255,255,255,.08) !important;
    box-shadow: 0 -8px 24px rgba(0,0,0,.18) !important;
    box-sizing: border-box !important;
}

#infopopup .item-option-popup #buttonrow .cart,
.item-option-popup-wrapper.ui-dialog .item-option-popup #buttonrow .cart {
    grid-column: 3 !important;
    justify-self: end !important;
    float: none !important;
    margin: 0 !important;
}

#infopopup .item-option-popup .mfb-v242-total,
.item-option-popup-wrapper.ui-dialog .item-option-popup .mfb-v242-total {
    grid-column: 2 !important;
    justify-self: center !important;
    display: block !important;
    color: #fff !important;
    font-size: 22px !important;
    line-height: 28px !important;
    font-weight: 900 !important;
    text-align: center !important;
    white-space: nowrap !important;
}

#infopopup .item-option-popup #buttonrow .cart a.button,
.item-option-popup-wrapper.ui-dialog .item-option-popup #buttonrow .cart a.button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 150px !important;
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 20px !important;
    border: 0 !important;
    border-radius: 7px !important;
    background: #d71920 !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 48px !important;
    text-align: center !important;
    text-transform: uppercase !important;
}

#infopopup .item-option-popup #buttonrow .cart a.button .sizeprice,
#infopopup .item-option-popup #buttonrow .cart a.button .basket,
.item-option-popup-wrapper.ui-dialog .item-option-popup #buttonrow .cart a.button .sizeprice,
.item-option-popup-wrapper.ui-dialog .item-option-popup #buttonrow .cart a.button .basket {
    display: none !important;
}

@media only screen and (max-width: 767px) {
    #infopopup .item-option-popup .popupscrollable,
    .item-option-popup-wrapper.ui-dialog .item-option-popup .popupscrollable {
        max-height: calc(100vh - 126px) !important;
    }

    #infopopup .item-option-popup #buttonrow,
    #infopopup .item-option-popup .control_btns,
    #infopopup .item-option-popup .mfb-v242-footer,
    .item-option-popup-wrapper.ui-dialog .item-option-popup #buttonrow,
    .item-option-popup-wrapper.ui-dialog .item-option-popup .control_btns,
    .item-option-popup-wrapper.ui-dialog .item-option-popup .mfb-v242-footer {
        min-height: 66px !important;
        margin: 0 -10px !important;
        padding: 10px !important;
        gap: 8px !important;
    }

    #infopopup .item-option-popup #buttonrow .cart a.button,
    .item-option-popup-wrapper.ui-dialog .item-option-popup #buttonrow .cart a.button {
        min-width: 108px !important;
        height: 42px !important;
        min-height: 42px !important;
        padding: 0 12px !important;
        font-size: 13px !important;
        line-height: 42px !important;
    }
}
