/* Bachehaye Shargh site-wide add-to-cart popup */
.added_to_cart.wc-forward, .woocommerce a.added_to_cart{ display: none !important; }

#custom-thank-you-overlay{
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(16, 43, 79, .42);
  opacity: 0;
  backdrop-filter: blur(5px) saturate(125%);
  -webkit-backdrop-filter: blur(5px) saturate(125%);
  transition: opacity .24s ease;
}
#custom-thank-you-overlay.is-visible{ opacity: 1; }

#custom-thank-you-popup{
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 99999;
  width: min(92vw, 570px);
  max-height: min(90vh, 760px);
  overflow: auto;
  padding: 22px 22px 18px;
  direction: rtl;
  color: var(--zg-dark-700);
  background: #fff;
  border: 1px solid rgba(16, 43, 79, .08);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(16, 43, 79, .24);
  opacity: 0;
  transform: translate(-50%, -46%) scale(.96);
  transition: transform .24s ease, opacity .24s ease;
}
#custom-thank-you-popup.is-visible{ opacity: 1; transform: translate(-50%, -50%) scale(1); }
#ctp-close{ position: absolute; top: 12px; left: 14px; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: #f3f4f6; color: var(--zg-gray-100); font-size: 25px; line-height: 1; }
#ctp-close:hover{ color: var(--zg-primary); background: rgba(226, 21, 20, .08); }
#ctp-header{ display: flex; align-items: center; gap: 12px; padding-left: 35px; margin-bottom: 14px; }
#ctp-icon{ display: inline-grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 13px; background: rgba(226, 21, 20, .09); color: var(--zg-primary); }
#ctp-title{ color: var(--zg-navy); font-size: 18px; font-weight: 700; }
#ctp-sub{ margin-top: 1px; color: var(--zg-gray-100); font-size: 13px; }
#ctp-mini{ overflow: hidden; margin-bottom: 14px; background: #fff; border: 1px solid #eceef1; border-radius: 14px; }
#ctp-mini .mini-head{ padding: 10px 12px; color: var(--zg-gray-100); background: #fcfcfc; border-bottom: 1px solid #f0f1f3; font-size: 12px; }
#ctp-mini .mini-wrap{ max-height: 250px; overflow: auto; }
.ctp-list{ list-style: none; margin: 0; padding: 0; }
.ctp-item{ display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; min-height: 92px; padding: 10px 12px; border-bottom: 1px solid #f0f1f3; }
.ctp-item:last-child{ border-bottom: 0; }
.ctp-thumb{ width: 76px; height: 76px; overflow: hidden; border: 1px solid #f0f1f3; border-radius: 10px; background: #fff; }
.ctp-thumb img{ display: block; width: 100%; height: 100%; object-fit: contain; }
.ctp-body{ display: flex; min-width: 0; flex-direction: column; justify-content: space-between; }
.ctp-name{ overflow: hidden; color: var(--zg-dark-700); font-size: 13px; font-weight: 600; line-height: 1.65; }
.ctp-unit{ margin-top: 3px; color: var(--zg-gray-100); font-size: 12px; }
.ctp-meta{ display: flex; gap: 12px; margin-top: 7px; color: var(--zg-gray-100); font-size: 12px; }
.ctp-qty{ display: inline-flex; align-items: center; gap: 4px; direction: rtl; }
.ctp-qty b{ font-weight: 500; }
.ctp-qty span{ direction: ltr; unicode-bidi: isolate; font-weight: 700; }
.ctp-remove{ align-self: flex-start; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--zg-primary); font-size: 11px; }
.ctp-remove:hover{ text-decoration: underline; }
.ctp-total{ display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; color: var(--zg-navy); background: #fcfcfc; border-top: 1px solid #f0f1f3; font-size: 13px; font-weight: 700; }
#ctp-actions{ display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ctp-btn{ display: inline-flex; align-items: center; justify-content: center; min-height: 43px; padding: 9px 14px; border: 1px solid transparent; border-radius: 11px; text-decoration: none; font-size: 12px; font-weight: 600; }
.ctp-btn--ghost{ color: var(--zg-dark-600); background: #f5f6f7; border-color: #e7e9ec; }
.ctp-btn--primary{ color: #fff; background: var(--zg-navy); }
.ctp-btn--accent{ color: #fff; background: var(--zg-primary-light); box-shadow: var(--zg-red-shadow); }
.ctp-btn:hover{ transform: translateY(-1px); }
body.zg-cart-popup-open{ overflow: hidden; }

@media (max-width: 560px) {
  #custom-thank-you-popup{ width: calc(100vw - 20px); max-height: calc(100vh - 24px); padding: 18px 14px 14px; border-radius: 18px; }
  #ctp-header{ padding-left: 30px; }
  #ctp-title{ font-size: 16px; }
  .ctp-item{ grid-template-columns: 68px minmax(0, 1fr); padding-inline: 9px; }
  .ctp-thumb{ width: 68px; height: 68px; }
  #ctp-actions{ display: grid; grid-template-columns: 1fr 1fr; }
  #ctp-continue{ grid-column: 1 / -1; }
}
