/* Mediana storefront dialogs. Scoped resets protect controls from theme CSS. */
.om-qcart,
.om-qpay,
.om-qcart-toast,
#omidH .omidH__cart {
  --om-qc-brand: #004851;
  --om-qc-hover: #003a42;
  --om-qc-gold: #817324;
  --om-qc-bg: #f3f7f7;
  --om-qc-border: #d5e2e3;
  --om-qc-text: #183238;
  --om-qc-muted: #50676c;
  --om-qc-ring: #bd9d35;
  direction: rtl;
  font-family: var(--site-font, "Farhang2FaNum", Tahoma, sans-serif) !important;
  box-sizing: border-box;
  color-scheme: light;
}
.om-qcart *, .om-qpay *, .om-qcart-toast * {
  box-sizing: border-box;
  font-family: inherit !important;
}
.om-qcart [hidden], .om-qpay [hidden],
.om-qcart[hidden], .om-qpay[hidden], .om-qcart-toast[hidden] {
  display: none !important;
}
.om-qcart :focus-visible, .om-qpay :focus-visible {
  outline: 3px solid var(--om-qc-ring) !important;
  outline-offset: 3px !important;
}
.om-qcart button::before, .om-qcart button::after,
.om-qpay button::before, .om-qpay button::after {
  content: none !important;
  display: none !important;
}

/* The existing site header keeps its native cart link, even when empty. */
#omidH .omidH__cart {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 44px;
  min-height: 44px;
  text-decoration: none !important;
}
#omidH .omidH__cart svg {
  display: block;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  pointer-events: none;
}
#omidH .omidH__cartCount {
  position: absolute;
  top: -4px;
  left: -4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--om-qc-gold);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
#omidH .omidH__cartCount[hidden] { display: none !important; }
#omidH .omidH__cart.is-notified { animation: om-qcart-pop .6s ease 2; }
@keyframes om-qcart-pop { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.1); } }

.om-qcart-toast {
  position: fixed !important;
  inset-inline-end: clamp(14px, 3vw, 28px) !important;
  bottom: max(20px, calc(env(safe-area-inset-bottom) + 14px)) !important;
  z-index: 999996 !important;
  width: max-content;
  max-width: min(410px, calc(100vw - 28px));
  padding: 12px 16px;
  border: 1px solid #bdd6d8;
  border-radius: 12px;
  background: #fff;
  color: var(--om-qc-brand);
  box-shadow: 0 12px 34px rgb(0 72 81 / 20%);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.om-qcart-toast.is-error { border-color: #efc3c3; background: #fff7f7; color: #922424; }

/* Fixed header/footer; only the cart's contents scroll. */
.om-qcart { position: fixed; inset: 0; z-index: 999993; display: block; }
.om-qcart-backdrop {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: rgb(4 28 32 / 58%) !important;
  backdrop-filter: blur(2px);
  cursor: pointer !important;
}
.om-qcart-card {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(450px, 100vw);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #fff;
  color: var(--om-qc-text);
  box-shadow: -22px 0 64px rgb(0 0 0 / 22%);
}
.om-qcart-card > header, .om-qpay-card > header {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--om-qc-border);
  background: #fff;
}
.om-qcart-card > header > div, .om-qpay-card > header > div { min-width: 0; }
.om-qcart-card header small, .om-qpay-card header small {
  display: block;
  margin-bottom: 3px;
  color: var(--om-qc-gold);
  font-size: 12px;
  font-weight: 700;
}
.om-qcart-card header h2, .om-qpay-card header h2 {
  margin: 0 !important;
  color: var(--om-qc-brand) !important;
  font-size: 19px !important;
  line-height: 1.6 !important;
}
.om-qcart-close {
  display: flex !important;
  position: static !important;
  flex: 0 0 44px !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--om-qc-border) !important;
  border-radius: 12px !important;
  background: #f3f7f7 !important;
  color: var(--om-qc-brand) !important;
  -webkit-text-fill-color: var(--om-qc-brand) !important;
  font-size: 26px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  text-indent: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  cursor: pointer !important;
}
.om-qcart-body, .om-qpay-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 18px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  scroll-padding-block: 14px;
}
.om-qcart-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #e8efef;
}
.om-qcart-thumb { width: 64px; height: 64px; overflow: hidden; border: 1px solid var(--om-qc-border); border-radius: 12px; background: var(--om-qc-bg); }
.om-qcart-thumb img { display: block; width: 100% !important; height: 100% !important; margin: 0 !important; object-fit: cover; }
.om-qcart-info { display: grid; gap: 6px; min-width: 0; }
.om-qcart-info a, .om-qcart-info strong { color: var(--om-qc-brand) !important; font-size: 14px; font-weight: 700; line-height: 1.7; text-decoration: none; overflow-wrap: anywhere; }
.om-qcart-info span { color: var(--om-qc-muted); font-size: 12px; line-height: 1.7; }
.om-qcart-remove {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #eed5d5 !important;
  border-radius: 12px !important;
  background: #fff7f7 !important;
  color: #922424 !important;
  -webkit-text-fill-color: #922424 !important;
  font-size: 24px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  opacity: 1 !important;
}
.om-qcart-card > footer, .om-qpay-footer {
  display: grid;
  flex: none;
  gap: 10px;
  padding: 14px 18px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--om-qc-border);
  background: #fff;
  box-shadow: 0 -6px 18px rgb(0 72 81 / 4%);
}
.om-qcart-total, .om-qpay-total { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 12px 14px; border-radius: 12px; background: var(--om-qc-bg); color: var(--om-qc-brand); font-size: 13px; }
.om-qcart-total strong, .om-qpay-total strong { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.om-qcart-actions, .om-qpay-secondary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.om-qcart-actions a, .om-qcart-actions button, .om-qpay-link {
  display: inline-flex !important;
  position: static !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 8px 6px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--om-qc-brand) !important;
  -webkit-text-fill-color: var(--om-qc-brand) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.6 !important;
  text-decoration: underline !important;
  text-underline-offset: 4px;
  text-indent: 0 !important;
  text-transform: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  cursor: pointer !important;
}
.om-qcart-actions button { color: #922424 !important; -webkit-text-fill-color: #922424 !important; }
.om-qcart-empty, .om-qcart-loading { display: flex; min-height: 180px; align-items: center; justify-content: center; flex-direction: column; gap: 10px; padding: 24px 12px; text-align: center; color: var(--om-qc-muted); font-size: 13px; }
.om-qcart-empty > span { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--om-qc-bg); color: var(--om-qc-brand); font-size: 28px; }
.om-qcart-empty strong { color: var(--om-qc-brand); font-size: 16px; }
.om-qcart-empty small { font-size: 13px; }
.om-qcart-item.is-incomplete { border-color: #ead6ab; }
.om-qcart-warn { display: block; padding: 6px 8px; border-inline-start: 3px solid var(--om-qc-gold); border-radius: 6px; background: #fff8e8; color: #72530b; font-size: 12px; font-style: normal; line-height: 1.8; }
.om-qcart-info .om-qcart-complete { font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }

/* Payment sheet uses the VISUAL viewport, including the software keyboard. */
.om-qpay {
  position: fixed;
  top: var(--om-vv-top, 0px);
  left: 0;
  right: 0;
  z-index: 999995;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: var(--om-vv-h, 100dvh);
  padding: 16px;
  background: rgb(4 28 32 / 68%);
  backdrop-filter: blur(3px);
  overscroll-behavior: contain;
}
.om-qpay-card {
  display: flex;
  flex-direction: column;
  width: min(500px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(var(--om-vv-h, 100dvh) - 32px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid #d5e2e3;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 80px rgb(0 0 0 / 34%);
  color: var(--om-qc-text);
}
.om-qpay-steps { display: grid; flex: none; grid-template-columns: 1fr 1fr; gap: 6px; margin: 12px 18px 0; padding: 5px; background: var(--om-qc-bg); border-radius: 12px; }
.om-qpay-steps span { padding: 8px; text-align: center; color: var(--om-qc-muted); font-size: 13px; font-weight: 600; border-radius: 8px; }
.om-qpay-steps span.is-active { background: #fff; color: var(--om-qc-brand); box-shadow: 0 2px 8px rgb(0 72 81 / 9%); }
.om-qpay-body > section { margin: 0; padding: 0; }
.om-qpay-body p { margin: 0 0 12px; color: var(--om-qc-muted); font-size: 14px; line-height: 1.9; }
.om-qpay-body bdi { display: inline-block; color: var(--om-qc-brand); font-weight: 700; }
.om-qpay-error { display: none; margin: 0 0 12px; padding: 12px; border: 1px solid #edcaca; border-radius: 10px; background: #fff2f2; color: #922424; font-size: 13px; line-height: 1.8; white-space: pre-line; }
.om-qpay-error.is-active { display: block; }
.om-qpay-status { margin: 0 0 10px; font-size: 13px; color: var(--om-qc-brand); line-height: 1.7; }
.om-qpay-status:empty { display: none; }
.om-qpay-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px 8px; color: var(--om-qc-brand); font-size: 13px; }
.om-qpay-loading i, .om-qcart-loading i { flex: none; width: 22px; height: 22px; border: 2px solid #bdd3d5; border-top-color: var(--om-qc-brand); border-radius: 50%; animation: om-qpay-spin .8s linear infinite; }
@keyframes om-qpay-spin { to { transform: rotate(360deg); } }
.om-qpay-code-label { display: block; margin-bottom: 8px; color: var(--om-qc-text); font-size: 13px; font-weight: 700; }
#omQPayCode {
  display: block !important;
  position: static !important;
  width: 100% !important;
  min-height: 54px !important;
  margin: 0 0 8px !important;
  padding: 10px 14px !important;
  border: 2px solid var(--om-qc-border) !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: #183238 !important;
  -webkit-text-fill-color: #183238 !important;
  caret-color: var(--om-qc-brand);
  font-size: 24px !important;
  font-weight: 700 !important;
  letter-spacing: 8px !important;
  text-align: center !important;
  direction: ltr !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}
#omQPayCode::placeholder { color: #63797d !important; -webkit-text-fill-color: #63797d !important; opacity: 1 !important; font-size: 15px !important; letter-spacing: 3px !important; }
#omQPayCode:focus { border-color: var(--om-qc-brand) !important; box-shadow: 0 0 0 3px rgb(0 72 81 / 10%) !important; }
#omQPayCode[aria-invalid="true"] { border-color: #b33c3c !important; }
#omQPayCodeHint { font-size: 12px; }
.om-qcart-pay, .om-qcart-retry, #omQPay .om-qcart-pay {
  display: flex !important;
  position: static !important;
  width: 100% !important;
  height: auto !important;
  min-height: 50px !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 12px 16px !important;
  border: 1px solid var(--om-qc-brand) !important;
  border-radius: 12px !important;
  background: var(--om-qc-brand) !important;
  background-image: none !important;
  box-shadow: none !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.6 !important;
  text-decoration: none !important;
  text-indent: 0 !important;
  text-shadow: none !important;
  text-transform: none !important;
  white-space: normal !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  filter: none !important;
  cursor: pointer !important;
}
.om-qcart-pay:hover, .om-qcart-retry:hover, #omQPay .om-qcart-pay:hover { background: var(--om-qc-hover) !important; }
.om-qcart button:disabled, #omQPay button:disabled { opacity: .6 !important; cursor: not-allowed !important; }
.om-qpay-footer > div { display: grid; gap: 6px; }
.om-qpay-total { margin-bottom: 14px; }
.om-qpay-gateways { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.om-qpay-gateways legend { margin-bottom: 10px; color: var(--om-qc-text); font-size: 13px; font-weight: 700; }
.om-qpay-gateway { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 64px; margin: 0; padding: 12px; border: 1px solid var(--om-qc-border); border-radius: 12px; cursor: pointer; background: #fff; }
.om-qpay-gateway.is-selected { border-color: var(--om-qc-brand); background: #f0f7f7; box-shadow: 0 0 0 1px var(--om-qc-brand); }
.om-qpay-gateway span { color: var(--om-qc-text); font-size: 14px; font-weight: 600; line-height: 1.8; overflow-wrap: anywhere; }
.om-qpay-gateway i { line-height: 0; }
.om-qpay-gateway img { max-width: 56px !important; max-height: 34px !important; object-fit: contain; }
.om-qpay-empty { padding: 14px; border: 1px solid #edcaca; border-radius: 12px; background: #fff7f7; color: #922424; font-size: 13px; line-height: 1.9; }
.om-qpay-terms { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 8px; padding: 10px 0; color: var(--om-qc-muted); font-size: 13px; line-height: 1.8; cursor: pointer; }
.om-qpay-terms a { color: var(--om-qc-brand) !important; text-decoration: underline !important; text-underline-offset: 3px; }

/* Use the browser's native, unmirrored check mark. No theme pseudo-tick. */
#omQPay input[type="checkbox"], #omQPay input[type="radio"] {
  appearance: auto !important;
  -webkit-appearance: auto !important;
  display: inline-block !important;
  position: static !important;
  flex: 0 0 20px !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  margin: 2px 0 0 !important;
  padding: 0 !important;
  border: revert !important;
  border-radius: revert !important;
  background: revert !important;
  box-shadow: none !important;
  accent-color: #004851;
  direction: ltr !important;
  writing-mode: horizontal-tb !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  clip: auto !important;
  clip-path: none !important;
  cursor: pointer !important;
}
#omQPay input[type="checkbox"]::before, #omQPay input[type="checkbox"]::after,
#omQPay input[type="radio"]::before, #omQPay input[type="radio"]::after,
#omQPay .om-qpay-terms::before, #omQPay .om-qpay-terms::after,
#omQPay .om-qpay-gateway::before, #omQPay .om-qpay-gateway::after {
  content: none !important;
  display: none !important;
  transform: none !important;
}
html.om-qcart-lock, html.om-qcart-lock body { overflow: hidden !important; }
.om-pcard__btn.is-loading { opacity: .65 !important; pointer-events: none !important; cursor: wait !important; }

@media (max-width: 640px) {
  #omidH .omidH__cart { display: inline-flex !important; flex: 0 0 44px !important; width: 44px !important; height: 44px !important; }
  .om-qcart-toast { inset-inline-end: 10px !important; max-width: calc(100vw - 20px); font-size: 12px; }
  .om-qcart-card { top: auto; bottom: 0; width: 100%; height: 88vh; height: 88dvh; border-radius: 20px 20px 0 0; }
  .om-qpay { align-items: flex-end; padding: 8px 8px 0; }
  .om-qpay-card { max-height: calc(var(--om-vv-h, 100dvh) - 8px); border-radius: 18px 18px 0 0; }
  .om-qcart-card > header, .om-qpay-card > header { padding: 12px 14px; }
  .om-qcart-card header h2, .om-qpay-card header h2 { font-size: 17px !important; }
  .om-qcart-body, .om-qpay-body { padding: 12px 14px; }
  .om-qpay-steps { margin-inline: 14px; }
  .om-qpay-footer, .om-qcart-card > footer { padding-inline: 14px; }
}
@media (max-height: 480px) {
  .om-qpay-card > header { padding-block: 6px; }
  .om-qpay-card header small, .om-qpay-steps { display: none; }
  .om-qpay-footer { padding-block: 8px; }
  .om-qpay-terms { padding-block: 2px; margin-bottom: 2px; }
  .om-qpay-secondary .om-qpay-link { min-height: 36px !important; padding-block: 4px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .om-qcart *, .om-qpay *, #omidH .omidH__cart { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .om-qpay-gateway.is-selected { outline: 2px solid Highlight; }
}

/* Hidden state MUST outrank the ID-scoped theme resets above. */
#omQCart[hidden], #omQPay[hidden], #omQCart [hidden], #omQPay [hidden] { display: none !important; }
#omQPay .om-qpay-terms > span::before, #omQPay .om-qpay-terms > span::after,
#omQPay .om-qpay-gateway > span::before, #omQPay .om-qpay-gateway > span::after { content: none !important; display: none !important; transform: none !important; }
