/* =========================================================
   Yooz — Loan contact modal (خرید امتیاز / مشاوره رایگان)
   روی متغیرهای طرح صفحه‌ی وام (loan-single.css) سوار است؛ مودال داخل
   article.yz-loan قرار دارد و همان پالت، فونت و شعاع‌ها را به ارث می‌برد.
   چیدمان کارت‌ها برای ۱ تا ۷ آیتم:
     ۱ آیتم    → یک کارت بزرگ
     ۲ آیتم    → دو ستون (دسکتاپ)
     تعداد فرد → آخرین کارت تمام‌عرض می‌شود (flex-wrap)
   متن کارت‌ها هرگز کوتاه (…) نمی‌شود: کارت‌ها کوچک‌تر از محتوای خود
   نمی‌شوند و اگر دو کارت در یک ردیف جا نشوند، به ردیف بعد می‌روند.
   ========================================================= */

.yz-contact {
  --yz-contact-whatsapp: #1fa855;
  --yz-contact-whatsapp-soft: #e7f8ee;
  --yz-contact-telegram: #1d8fcf;
  --yz-contact-telegram-soft: #e6f3fb;
  --yz-contact-instagram: #c72a86;
  --yz-contact-instagram-soft: #fbeaf4;
  --yz-contact-width: 640px;

  width: min(var(--yz-contact-width), calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--_r-2xl);
  background: var(--_bg);
  color: var(--_text);
  font-family: inherit;
  line-height: 1.7;
  overflow: hidden;
  box-shadow: 0 40px 80px -32px rgba(11, 61, 134, .5);
  opacity: 0;
  transform: translateY(18px) scale(.98);
  transition: opacity .25s var(--_ease), transform .4s var(--_ease);
}
.yz-contact.is-shown { opacity: 1; transform: none; }

.yz-contact::backdrop {
  background: rgba(16, 24, 40, .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .25s;
}
.yz-contact.is-shown::backdrop { opacity: 1; }

/* قفل اسکرول صفحه وقتی مودال باز است */
html.yz-contact-lock { overflow: hidden; }

.yz-contact__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: inherit;
}

/* ---------- Head (همان پنل آبی تیره‌ی «مبلغ وام») ---------- */
.yz-contact__head {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  flex-shrink: 0;
  padding: 30px 32px 26px;
  background: var(--yz-color-primary-deep);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.yz-contact__rings { position: absolute; z-index: -1; left: -150px; top: -210px; width: 420px; height: 420px; }
.yz-contact__rings circle { fill: none; stroke: #fff; stroke-width: 1.5; }

.yz-contact__title {
  margin: 0;
  padding-inline-end: 52px;
  font-size: clamp(16px, 2.2vw, 19px);
  font-weight: 800;
  line-height: 1.95;
  color: #fff;
}
.yz-contact__ref {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 5px 14px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .1);
  font-size: 13px;
  color: var(--yz-color-primary-on-deep);
}
.yz-contact__ref strong { color: #fff; font-weight: 800; }

.yz-contact__close {
  position: absolute;
  top: 18px;
  inset-inline-end: 18px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--_r-btn);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color .2s;
}
.yz-contact__close:hover { background: rgba(255, 255, 255, .2); }
.yz-contact__close svg { width: 18px; height: 18px; }
.yz-contact__close:focus-visible { outline-color: #fff; }

/* ---------- Body / list ---------- */
.yz-contact__body {
  overflow-y: auto;
  padding: 24px 24px 28px;
  overscroll-behavior: contain;
}
.yz-contact__list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.yz-contact__item {
  --_item: var(--_primary);
  --_item-soft: var(--yz-color-primary-soft);

  flex: 1 1 250px;
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--_border);
  border-radius: var(--_r-xl);
  background: var(--_bg);
  transition: border-color .2s, box-shadow .2s, transform .2s var(--_ease);
}
.yz-contact__item--whatsapp  { --_item: var(--yz-contact-whatsapp);  --_item-soft: var(--yz-contact-whatsapp-soft); }
.yz-contact__item--telegram  { --_item: var(--yz-contact-telegram);  --_item-soft: var(--yz-contact-telegram-soft); }
.yz-contact__item--instagram { --_item: var(--yz-contact-instagram); --_item-soft: var(--yz-contact-instagram-soft); }

.yz-contact__item:hover,
.yz-contact__item:has(:focus-visible) {
  border-color: var(--_item);
  box-shadow: 0 16px 32px -20px rgba(15, 79, 168, .35);
}

.yz-contact__link {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
  border-radius: inherit;
}
.yz-contact__link:hover { color: inherit; }

.yz-contact__icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--_item-soft);
  color: var(--_item);
  transition: background-color .2s, color .2s;
}
.yz-contact__icon svg { width: 22px; height: 22px; }
.yz-contact__item:hover .yz-contact__icon { background: var(--_item); color: #fff; }

.yz-contact__text { display: flex; flex-direction: column; }
.yz-contact__label { font-size: 12.5px; color: var(--_muted); line-height: 1.6; }
.yz-contact__value {
  font-size: 16px;
  font-weight: 800;
  color: var(--_heading);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: break-word;
}
/* شماره‌ها هیچ‌وقت دو خط نمی‌شوند؛ عرض کارت حداقل به اندازه‌ی شماره‌ی کامل است */
.yz-contact__value.is-number { white-space: nowrap; }

.yz-contact__go {
  margin-inline-start: auto;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--_gray-400);
  transition: color .2s, transform .2s var(--_ease);
}
.yz-contact__go svg { width: 18px; height: 18px; }
.yz-contact__item:hover .yz-contact__go { color: var(--_item); transform: translateX(-3px); }
/* شماره‌ها به‌جای فلش دکمه‌ی کپی دارند */
.yz-contact__item.has-copy .yz-contact__go { display: none; }

.yz-contact__copy {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  margin-inline-end: 10px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--_gray-400);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.yz-contact__copy:hover { background: var(--_bg-soft); color: var(--_item); }
.yz-contact__copy svg { width: 18px; height: 18px; }
.yz-contact__copy.is-done { color: var(--_success); }

/* ---------- فقط یک راه ارتباطی: کارت بزرگ‌تر و برجسته‌تر ---------- */
.yz-contact__item:only-child { border-color: var(--_item); }
.yz-contact__item:only-child .yz-contact__link { gap: 18px; padding: 22px 22px; }
.yz-contact__item:only-child .yz-contact__icon { width: 60px; height: 60px; border-radius: 18px; background: var(--_item); color: #fff; }
.yz-contact__item:only-child .yz-contact__icon svg { width: 28px; height: 28px; }
.yz-contact__item:only-child .yz-contact__label { font-size: 13.5px; }
.yz-contact__item:only-child .yz-contact__value { font-size: clamp(19px, 3vw, 24px); font-weight: 900; }
.yz-contact__item:only-child .yz-contact__go { width: 40px; height: 40px; border-radius: 50%; background: var(--_item-soft); color: var(--_item); }
.yz-contact__item:only-child .yz-contact__copy { width: 44px; height: 44px; margin-inline-end: 14px; background: var(--_bg-soft); }

/* ---------- Toast داخل مودال (توست صفحه زیر لایه‌ی مودال می‌ماند) ---------- */
.yz-contact__toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 12px);
  padding: 8px 16px;
  border-radius: 9999px;
  background: var(--_gray-800);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .25s var(--_ease);
}
.yz-contact__toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mobile: bottom sheet ---------- */
@media (max-width: 640px) {
  .yz-contact {
    width: 100%;
    max-height: calc(100dvh - 24px);
    margin: auto 0 0;
    border-radius: var(--_r-2xl) var(--_r-2xl) 0 0;
    transform: translateY(100%);
    transition: opacity .2s, transform .4s var(--_ease);
  }
  .yz-contact.is-shown { transform: none; }
  .yz-contact__head { padding: 26px 20px 22px; }
  .yz-contact__close { top: 14px; inset-inline-end: 14px; }
  .yz-contact__body { padding: 18px 16px calc(22px + env(safe-area-inset-bottom, 0px)); }
  .yz-contact__item { flex-basis: 100%; }
  .yz-contact__item:only-child .yz-contact__link { padding: 18px; gap: 14px; }
  .yz-contact__item:only-child .yz-contact__icon { width: 52px; height: 52px; border-radius: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .yz-contact, .yz-contact::backdrop { transition: none !important; }
}
