/* Keep the table intact; move its summary outside the horizontal scroll area. */
body.single-product .card__scroll.mi-order-scroll {width:100%;max-width:100%;min-width:0;overflow-x:auto!important;box-sizing:border-box;-webkit-overflow-scrolling:touch}
body.single-product .mi-order-summary {width:100%;max-width:100%;box-sizing:border-box}
body.single-product table.card__table.medintense-table-polished .add_btn[style*="display: none"] {display:none!important}
@media (max-width:767px) {
  body.single-product .mi-order-summary .res_block {display:flex!important;width:100%!important;min-width:0!important;flex-wrap:wrap!important;justify-content:space-between!important;align-items:center;gap:10px!important;box-sizing:border-box;padding:16px 0}
  body.single-product .mi-order-summary .res_block .order_btn {flex:1 0 100%;max-width:100%;text-align:center;box-sizing:border-box;margin:0!important}
  .popup4.active {box-sizing:border-box!important;width:min(92vw,420px)!important;max-width:92vw!important;padding:40px 20px 28px!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important}
}
.popup4 {position:fixed!important}
.popup4 .medintense-success-close {display:block;position:absolute;z-index:10;top:8px;right:8px;width:44px;height:44px;border:0;border-radius:50%;background:#eef8ff;color:#203042;font-size:28px;line-height:1;cursor:pointer}
.popup4 .popup__wrap {padding-right:20px;box-sizing:border-box}

/* One close button and balanced success-message spacing on every screen. */
body .popup4 .close-popup4 {display:none!important}
body .popup4, body .popup4.active {box-sizing:border-box!important;width:min(420px,calc(100vw - 32px))!important;max-width:calc(100vw - 32px)!important;padding:58px 24px 32px!important;border-radius:20px!important}
body .popup4 .popup__wrap {width:100%!important;max-width:100%!important;margin:0!important;padding:0!important}
body .popup4 .popup__title {margin:0!important;padding:0!important;font-size:26px!important;line-height:1.3!important;text-align:center!important;font-weight:600!important;overflow-wrap:break-word}
body .popup4 .medintense-success-close {display:flex!important;align-items:center;justify-content:center;top:10px;right:10px;padding:0;font-size:28px;font-family:Arial,sans-serif}

.mi-quote-context {padding:12px 16px;margin:0 0 20px;background:#eef8ff;border-radius:12px;color:#203042;line-height:1.5;font-size:15px}
.mi-mail-preview {margin-top:20px;font-size:13px;text-align:left}
.mi-mail-preview pre {white-space:pre-wrap;overflow-wrap:anywhere;max-height:35vh;overflow:auto;font:13px/1.5 sans-serif}

/* A single native scroll area for long orders, including iOS before input focus. */
body .popup__bg3.active {position:fixed!important;inset:0!important;height:100vh!important;height:100dvh!important;box-sizing:border-box;overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch;overscroll-behavior-y:contain;touch-action:pan-y;padding:24px 12px calc(24px + env(safe-area-inset-bottom));}
body .popup__bg3.active .popup3.active {position:relative!important;top:auto!important;left:auto!important;bottom:auto!important;right:auto!important;transform:none!important;margin:0 auto!important;max-width:100%!important;max-height:none!important;height:auto!important;box-sizing:border-box;overflow:visible!important;}
body .popup__bg3.active .popup__wrap, body .popup__bg3.active .popup_column, body .popup__bg3.active .popup_column__row, body .popup__bg3.active .list-order, body .popup__bg3.active .order_products {max-height:none!important;height:auto!important;overflow:visible!important;touch-action:pan-y;}
@media (max-width:767px) {
  body .popup__bg3.active {padding-top:max(12px,env(safe-area-inset-top));}
  body .popup__bg3.active .popup3.active {width:100%!important;padding-top:54px!important;}
}

/* Stable row controls: no recessed text-field line or height jump. */
body.single-product .card__table .add_btn {box-sizing:border-box!important;height:44px!important;min-height:44px!important;align-items:center;justify-content:center;padding:0 18px!important;line-height:42px!important;vertical-align:middle;}
body.single-product .card__table .count_block {box-sizing:border-box!important;height:44px!important;min-height:44px!important;align-items:center;justify-content:center;gap:4px;white-space:nowrap;line-height:1;vertical-align:middle;}
body.single-product .card__table .count_block[style*="display: block"] {display:flex!important;}
body.single-product .card__table .count_block[style*="display: none"] {display:none!important;}
body.single-product .card__table .counter {box-sizing:border-box!important;width:44px!important;height:44px!important;margin:0!important;padding:0!important;border:1px solid #e3edf3!important;border-radius:6px!important;background:#f5f9fc!important;box-shadow:none!important;text-align:center!important;font:16px/42px Arial,sans-serif!important;color:#282d3c!important;-webkit-text-fill-color:#282d3c!important;opacity:1!important;cursor:default;}
body.single-product .card__table .btn_count {box-sizing:border-box!important;display:inline-flex!important;align-items:center;justify-content:center;width:36px!important;height:44px!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;cursor:pointer;}
body.single-product .card__table .btn_count i {display:none!important;}
body.single-product .card__table .btn_count::before {font:24px/1 Arial,sans-serif!important;color:#282d3c;}
body.single-product .card__table .down_count::before {content:"−";}
body.single-product .card__table .up_count::before {content:"+";}
