#smsp-modal, #smsp-modal * { box-sizing: border-box; }
.smsp-modal { position: fixed; inset: 0; z-index: 2147483000; display: none; font-family: inherit; direction: rtl; }
.smsp-modal.is-open { display: block; }
.smsp-modal-backdrop { position: absolute; inset: 0; background: rgba(10, 20, 38, .58); backdrop-filter: blur(3px); }
.smsp-modal-panel { position: absolute; top: 50%; left: 50%; width: min(620px, calc(100vw - 32px)); max-height: min(850px, calc(100vh - 32px)); overflow: auto; transform: translate(-50%, -50%) scale(.98); background: #fff; border-radius: 24px; box-shadow: 0 24px 80px rgba(0,0,0,.28); opacity: 0; transition: .2s ease; }
.smsp-modal.is-open .smsp-modal-panel { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.smsp-modal-handle { display: none; }
.smsp-modal-header { position: relative; display: flex; align-items: center; gap: 14px; padding: 24px 24px 18px; border-bottom: 1px solid #eef1f5; }
.smsp-modal-header h2 { margin: 0 0 4px; font-size: 20px; color: #14213d; }
.smsp-modal-header p { margin: 0; color: #697386; font-size: 13px; }
.smsp-success-mark { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 50%; background: #e8f8f2; color: #11a675; font-size: 24px; font-weight: 700; }
.smsp-close { position: absolute; left: 18px; top: 18px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f3f5f8; color: #263248; font-size: 25px; line-height: 1; cursor: pointer; }
.smsp-form { padding: 18px 24px 24px; }
.smsp-product-card { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 20px; border: 1px solid #e7ebf0; border-radius: 16px; background: #fbfcfe; }
.smsp-product-thumb { width: 54px; height: 54px; flex: 0 0 54px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: #eef3f8; color: #7b8798; }
.smsp-product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.smsp-product-placeholder { font-size: 24px; }
.smsp-product-card small { display: block; margin-bottom: 4px; color: #7a8493; font-size: 11px; }
.smsp-product-card strong { display: block; color: #19263b; font-size: 14px; }
.smsp-question-field { min-width: 0; margin: 0 0 22px; padding: 0; border: 0; }
.smsp-question-field legend { width: 100%; margin-bottom: 11px; color: #1b273b; font-size: 15px; font-weight: 700; }
.smsp-question-field legend i { margin-right: 4px; color: #e64b5d; font-style: normal; }
.smsp-choice-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.smsp-choice { position: relative; display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 14px; border: 1.5px solid #dce3eb; border-radius: 15px; background: #fff; cursor: pointer; transition: .16s ease; }
.smsp-choice:hover { border-color: #91aac4; background: #fbfdff; }
.smsp-choice input { position: absolute; opacity: 0; pointer-events: none; }
.smsp-choice:has(input:checked) { border-color: #225d91; background: #f3f8fc; box-shadow: 0 0 0 3px rgba(34,93,145,.08); }
.smsp-radio-ui { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; border: 2px solid #c9d2dc; border-radius: 50%; background: #fff; }
.smsp-choice input:checked + .smsp-radio-ui { border-color: #225d91; }
.smsp-radio-ui i { width: 12px; height: 12px; border-radius: 50%; background: #225d91; transform: scale(0); transition: .15s; }
.smsp-choice input:checked + .smsp-radio-ui i { transform: scale(1); }
.smsp-choice-text { min-width: 0; flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.smsp-choice-text b { color: #243247; font-size: 14px; }
.smsp-choice-text small { white-space: nowrap; color: #225d91; font-weight: 700; }
.smsp-choice-text small.is-free { color: #7a8493; font-weight: 500; }
.smsp-select-wrap select, .smsp-question-field > input { width: 100%; min-height: 50px; padding: 0 14px; border: 1.5px solid #dce3eb; border-radius: 13px; background: #fff; color: #233047; font-family: inherit; font-size: 14px; outline: 0; }
.smsp-select-wrap select:focus, .smsp-question-field > input:focus { border-color: #225d91; box-shadow: 0 0 0 3px rgba(34,93,145,.09); }
.smsp-field-error { display: none; margin-top: 7px; color: #d63c50; font-size: 12px; }
.smsp-question-field.is-invalid .smsp-field-error { display: block; }
.smsp-question-field.is-invalid .smsp-choice, .smsp-question-field.is-invalid select, .smsp-question-field.is-invalid > input { border-color: #e05a6b; }
.smsp-fee-preview { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; margin: 4px 0 14px; border-radius: 16px; background: #f0f6fb; color: #1d3d5c; }
.smsp-fee-preview span { display: block; font-size: 13px; font-weight: 700; }
.smsp-fee-preview small { display: block; margin-top: 3px; color: #728197; font-size: 11px; }
.smsp-fee-preview strong { white-space: nowrap; font-size: 16px; }
.smsp-global-error { display: none; padding: 11px 13px; margin-bottom: 12px; border: 1px solid #f1b4bd; border-radius: 12px; background: #fff2f4; color: #bd3045; font-size: 13px; }
.smsp-global-error.is-visible { display: block; }
.smsp-submit { width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 15px; background: #225d91; color: #fff; font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; transition: .18s; }
.smsp-submit:hover { background: #174d7b; }
.smsp-submit:disabled { cursor: wait; opacity: .75; }
.smsp-spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: smsp-spin .7s linear infinite; }
.smsp-modal.is-busy .smsp-spinner { display: block; }
.smsp-modal.is-busy .smsp-submit-arrow { display: none; }
@keyframes smsp-spin { to { transform: rotate(360deg); } }
.smsp-native-shipping-label { display: inline-block; line-height: 1.8; color: #243247; }
.smsp-checkout-summary { width: 100%; padding: 15px; border: 1px solid #dfe6ee; border-radius: 16px; background: #fbfcfe; color: #1f2c40; }
.smsp-checkout-summary-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid #e5eaf0; }
.smsp-checkout-summary-head strong, .smsp-checkout-summary-head small { display: block; }
.smsp-checkout-summary-head small { margin-top: 3px; color: #778396; font-size: 11px; }
.smsp-truck-icon { font-size: 24px; }
.smsp-checkout-item + .smsp-checkout-item { padding-top: 14px; margin-top: 14px; border-top: 1px dashed #d7dee8; }
.smsp-checkout-product-name { display: block; margin-bottom: 10px; }
.smsp-checkout-answer-grid { display: grid; gap: 8px; }
.smsp-checkout-answer, .smsp-checkout-fee { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.smsp-checkout-answer span, .smsp-checkout-fee span { color: #727f91; }
.smsp-checkout-fee { padding-top: 10px; margin-top: 10px; border-top: 1px solid #e6ebf1; }
.smsp-order-summary { margin: 18px 0; padding: 18px; border: 1px solid #e0e6ed; border-radius: 14px; background: #fff; direction: rtl; }
.smsp-order-summary h3 { margin-top: 0; }
.smsp-order-summary dl div, .smsp-order-summary p { display: flex; justify-content: space-between; gap: 12px; }
.smsp-order-summary dt { color: #687588; }
.smsp-order-summary dd { margin: 0; font-weight: 700; }
@media (max-width: 640px) {
  .smsp-modal-panel { top: auto; bottom: 0; left: 0; width: 100%; max-height: 92vh; transform: translateY(24px); border-radius: 24px 24px 0 0; }
  .smsp-modal.is-open .smsp-modal-panel { transform: translateY(0); }
  .smsp-modal-handle { display: block; width: 46px; height: 5px; margin: 9px auto 0; border-radius: 10px; background: #d7dde5; }
  .smsp-modal-header { padding: 16px 18px 14px; }
  .smsp-form { padding: 14px 18px 20px; }
  .smsp-close { top: 13px; left: 13px; }
  .smsp-success-mark { width: 36px; height: 36px; flex-basis: 36px; font-size: 20px; }
  .smsp-choice { min-height: 62px; }
  .smsp-choice-text { align-items: flex-start; flex-direction: column; gap: 3px; }
  .smsp-fee-preview { position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -6px 16px rgba(27,45,68,.05); }
}

.smsp-product-brand { display: inline-flex; margin-top: 6px; padding: 3px 8px; border-radius: 999px; background: #eef5fb; color: #28618e; font-size: 11px; font-weight: 600; }
.smsp-question-field[hidden] { display: none !important; }

/* Checkout compatibility: keep WooCommerce shipping controls in the DOM. */
.checkout-main-options--shipping.smsp-checkout-summary-ready .smsp-checkout-summary { margin-bottom: 10px; }
.checkout-main-options--shipping .woocommerce-shipping-methods.smsp-native-shipping-methods--single,
.checkout-main-options--shipping #shipping_method.smsp-native-shipping-methods--single {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Dynamic calculations and instant cart feedback (v3.0) */
.smsp-choice-text { align-items:flex-start; }
.smsp-choice-text small { max-width:58%; white-space:normal; text-align:left; line-height:1.7; font-size:11px; }
.smsp-calculation-summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 14px; margin:0 0 10px; border:1px solid #d8e7f2; border-radius:13px; background:#f7fbfe; }
.smsp-calculation-summary span { color:#708095; font-size:11px; }
.smsp-calculation-summary strong { color:#225d91; font-size:12px; text-align:left; }
.smsp-cart-toast { position:fixed; z-index:1000001; left:24px; bottom:24px; display:flex; align-items:center; gap:11px; min-width:290px; max-width:min(420px,calc(100vw - 32px)); padding:13px 15px; border:1px solid #bfe2ce; border-radius:15px; background:#f1fbf5; color:#174e31; box-shadow:0 16px 45px rgba(18,55,36,.18); opacity:0; visibility:hidden; transform:translateY(18px); transition:.22s ease; direction:rtl; }
.smsp-cart-toast.is-visible { opacity:1; visibility:visible; transform:translateY(0); }
.smsp-cart-toast > span { width:34px; height:34px; flex:0 0 34px; display:grid; place-items:center; border-radius:50%; background:#2b9a5e; color:#fff; font-size:20px; font-weight:800; }
.smsp-cart-toast b,.smsp-cart-toast small,.smsp-cart-toast a { display:block; }
.smsp-cart-toast small { margin-top:3px; color:#547363; font-size:11px; line-height:1.6; }
.smsp-cart-toast a { margin-top:5px; color:#176b3d; font-size:11px; font-weight:800; text-decoration:underline; text-underline-offset:3px; }
.smsp-cart-toast a[hidden] { display:none !important; }
.smsp-added { animation:smspAddedPulse .55s ease; }
@keyframes smspAddedPulse { 0%{transform:scale(1)} 45%{transform:scale(.97)} 100%{transform:scale(1)} }
@media(max-width:640px){.smsp-cart-toast{right:16px;left:16px;bottom:16px;min-width:0}.smsp-calculation-summary{align-items:flex-start;flex-direction:column}.smsp-calculation-summary strong{text-align:right}.smsp-choice-text small{max-width:100%;text-align:right}}


/* Always-visible live cart count fallback for custom iShop header markup. */
.smsp-live-cart-count {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    margin-inline-start: 6px;
    border-radius: 999px;
    background: #f04055;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
    box-sizing: border-box;
}
