<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>spacescience.ir | دامنه برای فروش</title>
  <meta name="description" content="دامنه spacescience.ir برای فروش است.">
  <meta property="og:title" content="spacescience.ir | دامنه برای فروش">
  <meta property="og:description" content="دامنه spacescience.ir برای فروش است.">
  <meta name="robots" content="index,follow">
  <link rel="icon" href="/favicon.svg" type="image/svg+xml">
  <style>
    @font-face {
      font-family: "Vazirmatn";
      src: url("/fonts/vazirmatn-regular.woff2") format("woff2");
      font-weight: 400;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: "Vazirmatn";
      src: url("/fonts/vazirmatn-bold.woff2") format("woff2");
      font-weight: 700;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: "Vazirmatn";
      src: url("/fonts/vazirmatn-extrabold.woff2") format("woff2");
      font-weight: 800;
      font-style: normal;
      font-display: swap;
    }

    :root {
      --paper: #eef3ef;
      --paper-deep: #e2ebe4;
      --ink: #14241c;
      --muted: #5d7267;
      --forest: #0f3b2c;
      --forest-soft: #1a5a42;
      --leaf: #1f8f5f;
      --line: rgba(20, 36, 28, .12);
      --card: #f7faf8;
      --ok: #1f8f5f;
      --bale: #2ecc71;
      --whatsapp: #25d366;
      --telegram: #2aabee;
      --sms: #5d7267;
      --phone: #2a7ab8;
      --shadow: 0 18px 50px rgba(15, 40, 28, .14);
    }

    * { box-sizing: border-box; }
    html { height: 100%; }
    body {
      margin: 0;
      min-height: 100%;
      min-height: 100dvh;
      font-family: "Vazirmatn", "Tahoma", "Segoe UI", sans-serif;
      color: var(--ink);
      background:
        linear-gradient(165deg, #f7faf8 0%, var(--paper) 48%, var(--paper-deep) 100%);
      display: flex;
      align-items: safe center;
      justify-content: safe center;
      padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    }

    .wrap { width: min(700px, 100%); text-align: center; }
    .card {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 18px;
      padding: clamp(1.35rem, 4vw, 2rem);
      box-shadow: var(--shadow);
    }

    .badge {
      display: inline-flex;
      align-items: center;
      gap: .4rem;
      border: 1px solid rgba(31, 143, 95, .28);
      padding: .38rem .9rem;
      border-radius: 999px;
      color: var(--leaf);
      font-size: .8rem;
      font-weight: 700;
      margin-bottom: 1rem;
      background: rgba(31, 143, 95, .08);
    }
    .badge::before {
      content: "";
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--leaf);
    }
    .badge.sold { color: #b42318; border-color: rgba(180, 35, 24, .25); background: rgba(180, 35, 24, .06); }
    .badge.sold::before { background: #b42318; }

    h1 {
      margin: 0 0 .45rem;
      font-size: clamp(2rem, 6.5vw, 3.1rem);
      line-height: 1.08;
      font-weight: 800;
      direction: ltr;
      letter-spacing: -.03em;
      word-break: break-all;
      color: var(--forest);
    }
    .persian {
      color: var(--muted);
      font-size: 1.05rem;
      margin-bottom: 1.15rem;
      line-height: 1.55;
    }

    .price-block { margin: .35rem 0 1.25rem; }
    .price-label {
      display: block;
      font-size: .8rem;
      font-weight: 700;
      color: var(--forest-soft);
      margin-bottom: .45rem;
    }
    .price {
      display: inline-block;
      margin: 0;
      padding: .85rem 1.5rem;
      border-radius: 6px;
      background: var(--leaf);
      color: #fff;
      font-size: clamp(1.05rem, 3.2vw, 1.22rem);
      font-weight: 800;
      line-height: 1.45;
      box-shadow: 0 10px 28px rgba(31, 143, 95, .28);
    }
    .price.unpriced {
      background: #6b7f74;
      box-shadow: none;
    }

    .notice {
      margin: 0 0 1.15rem;
      padding: .9rem 1rem;
      border: 1px solid rgba(15, 59, 44, .14);
      background: rgba(15, 59, 44, .04);
      color: #345044;
      border-radius: 8px;
      font-size: .92rem;
      line-height: 1.7;
      text-align: right;
    }

    .desc {
      color: var(--muted);
      font-size: .98rem;
      line-height: 1.8;
      margin: 0 auto 1rem;
      max-width: 36rem;
      text-align: right;
    }

    .chips {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: .4rem;
      margin: 0 0 1rem;
    }
    .chip {
      font-size: .74rem;
      padding: .28rem .7rem;
      border-radius: 999px;
      border: 1px solid var(--line);
      color: var(--muted);
      background: rgba(15, 59, 44, .04);
    }

    .details {
      margin: 0 0 1.15rem;
      text-align: right;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: rgba(15, 59, 44, .03);
      overflow: hidden;
    }
    .details-heading {
      margin: 0;
      padding: .8rem 1rem;
      font-size: .9rem;
      font-weight: 700;
      color: var(--forest);
    }
    .details-body {
      padding: 1.05rem 1rem .95rem;
      color: var(--muted);
      font-size: .9rem;
      line-height: 1.8;
      border-top: 1px solid var(--line);
    }

    .buy-section {
      margin-top: 1.1rem;
      padding-top: 1.1rem;
      border-top: 1px solid var(--line);
    }
    .buy-heading {
      margin: 0 0 .25rem;
      font-size: 1.08rem;
      font-weight: 800;
      color: var(--forest);
    }
    .buy-sub {
      margin: 0 0 .85rem;
      color: var(--muted);
      font-size: .86rem;
      line-height: 1.5;
    }

    .sale-channels {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: .75rem .5rem;
    }
    .sale-ch {
      appearance: none;
      -webkit-appearance: none;
      border: 0;
      background: transparent;
      color: inherit;
      font: inherit;
      cursor: pointer;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
      text-align: center;
      padding: .55rem .35rem;
      border-radius: 10px;
      transition: background .15s ease, transform .12s ease;
      flex: 0 1 7.8rem;
      width: 7.8rem;
    }
    .sale-ch:hover { background: rgba(15, 59, 44, .06); }
    .sale-ch:active { transform: scale(.98); }
    .sale-ch-icon {
      width: 3.1rem;
      height: 3.1rem;
      margin: 0 auto .55rem;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      background: #fff;
      border: 1px solid var(--line);
      box-shadow: 0 6px 16px rgba(15, 40, 28, .08);
    }
    .sale-ch-icon svg { width: 1.35rem; height: 1.35rem; fill: currentColor; }
    .sale-ch[data-channel="telegram"] .sale-ch-icon { color: var(--telegram); }
    .sale-ch[data-channel="sms"] .sale-ch-icon { color: var(--sms); }
    .sale-ch[data-channel="phone"] .sale-ch-icon { color: var(--phone); }
    .sale-ch[data-channel="bale"] .sale-ch-icon { color: var(--bale); }
    .sale-ch[data-channel="whatsapp"] .sale-ch-icon { color: var(--whatsapp); }
    .sale-ch-text strong {
      display: block;
      font-size: .95rem;
      font-weight: 800;
      margin-bottom: .2rem;
      color: var(--ink);
    }
    .sale-ch-text span {
      display: block;
      font-size: .78rem;
      line-height: 1.45;
      color: var(--muted);
    }

    .meta {
      margin-top: 1rem;
      color: var(--muted);
      font-size: .86rem;
      line-height: 1.6;
    }

    .trust {
      list-style: none;
      margin: 1.15rem 0 0;
      padding: 0;
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: .45rem .7rem;
      font-size: .8rem;
      color: var(--muted);
    }
    .trust li {
      display: inline-flex;
      align-items: center;
      gap: .3rem;
    }
    .trust li::before {
      content: "✓";
      color: var(--leaf);
      font-weight: 800;
      font-size: .75rem;
    }

        .modal {
          position: fixed;
          inset: 0;
          z-index: 1000;
          display: flex;
          align-items: flex-end;
          justify-content: center;
          padding: 1rem;
          opacity: 0;
          visibility: hidden;
          transition: opacity .2s ease, visibility .2s ease;
        }
        .modal:not(.is-open) { pointer-events: none; }
        .modal.is-open { opacity: 1; visibility: visible; }
        @media (min-width: 480px) { .modal { align-items: center; } }
        .modal-backdrop {
          position: absolute;
          inset: 0;
          background: rgba(0,0,0,.68);
          backdrop-filter: blur(4px);
          -webkit-backdrop-filter: blur(4px);
        }
        .modal-panel {
          position: relative;
          width: min(440px, 100%);
          background: #102820;
          border: 1px solid var(--line);
          border-radius: 20px 20px 16px 16px;
          padding: 1.35rem 1.25rem 1.15rem;
          box-shadow: var(--shadow);
          transform: translateY(1rem);
          transition: transform .22s ease;
        }
        .modal-panel.disclaimer {
          border-top: 3px solid #f0b429;
          padding-top: 1.15rem;
        }
        @media (min-width: 480px) { .modal-panel { border-radius: 20px; } }
        .modal.is-open .modal-panel { transform: translateY(0); }
        .modal-eyebrow {
          margin: 0 0 .85rem;
          font-size: .78rem;
          font-weight: 700;
          letter-spacing: .04em;
          color: #f0b429;
          text-align: center;
        }
        .modal-body {
          margin: 0 0 1.15rem;
          color: var(--muted);
          font-size: .95rem;
          line-height: 1.7;
          text-align: center;
        }
        .modal-short {
          margin: 0 0 .55rem;
          color: var(--ink);
          font-size: 1rem;
          font-weight: 600;
          line-height: 1.65;
        }
        .modal-short-en {
          margin: 0;
          direction: ltr;
          text-align: center;
          font-size: .88rem;
          line-height: 1.55;
          color: #8fa899;
        }
        .modal-actions-stacked {
          display: flex;
          flex-direction: column;
          gap: .55rem;
        }
        .modal-actions-stacked .btn-modal.confirm {
          min-height: auto;
          padding: .85rem .9rem;
          font-size: .92rem;
          font-weight: 700;
          box-shadow: 0 8px 24px rgba(62,207,130,.22);
          display: flex;
          flex-direction: column;
          align-items: center;
          gap: .35rem;
          line-height: 1.35;
        }
        .confirm-channel {
          display: inline-flex;
          align-items: center;
          gap: .4rem;
          font-size: .82rem;
          font-weight: 600;
          opacity: .92;
        }
        .confirm-channel svg {
          width: 1rem;
          height: 1rem;
          fill: currentColor;
          flex-shrink: 0;
        }
        .confirm-intent {
          display: block;
          font-size: 1rem;
          font-weight: 800;
        }
        .modal-actions-stacked .btn-modal.cancel {
          min-height: 42px;
          font-size: .88rem;
          font-weight: 500;
          border-color: transparent;
          color: #7a9084;
        }
        .modal-actions-row {
          display: grid;
          grid-template-columns: 1fr 1fr;
          gap: .55rem;
        }
        .btn-modal {
          appearance: none;
          border: 1px solid var(--line);
          border-radius: 12px;
          padding: .8rem .75rem;
          font: inherit;
          font-size: .9rem;
          font-weight: 600;
          cursor: pointer;
          touch-action: manipulation;
          min-height: 48px;
        }
        .btn-modal.cancel { background: transparent; color: var(--muted); }
        .btn-modal.confirm {
          background: linear-gradient(135deg, #3ecf82, #2da866);
          border-color: transparent;
          color: #042a14;
        }
        .fallback-number {
          display: block;
          margin: .65rem 0;
          font-size: clamp(1.55rem, 7vw, 2rem);
          font-weight: 800;
          letter-spacing: .04em;
          direction: ltr;
          color: var(--ink);
          text-align: center;
        }
        .fallback-hint {
          font-size: .82rem;
          color: var(--muted);
          line-height: 1.65;
          text-align: center;
          margin: 0 0 .65rem;
        }
        .fallback-message {
          display: block;
          width: 100%;
          margin: 0 0 .75rem;
          padding: .75rem .85rem;
          border-radius: 12px;
          border: 1px solid var(--line);
          background: rgba(0,0,0,.22);
          color: var(--ink);
          font: inherit;
          font-size: .82rem;
          line-height: 1.7;
          text-align: right;
          resize: none;
          min-height: 5.5rem;
        }
        .fallback-message[hidden] { display: none !important; }
        .btn-modal.secondary[hidden],
        .btn-modal.cancel[hidden] { display: none !important; }
        .modal-actions-row:has(.btn-modal[hidden]) {
          grid-template-columns: 1fr;
        }
        .btn-modal.secondary {
          background: rgba(255,255,255,.05);
          color: var(--ink);
        }
        .btn-modal.primary-action {
          background: linear-gradient(135deg, rgba(110,196,255,.25), rgba(110,196,255,.08));
          border-color: rgba(110,196,255,.35);
          color: var(--ink);
        }
        .copy-toast {
          text-align: center;
          font-size: .78rem;
          color: var(--ok);
          min-height: 1.1rem;
          margin-bottom: .35rem;
        }

    .modal-backdrop {
      background: rgba(15, 40, 28, .42);
    }
    .modal-panel {
      background: #f7faf8;
      color: var(--ink);
      border: 1px solid var(--line);
      border-radius: 18px;
      box-shadow: 0 22px 60px rgba(15, 40, 28, .22);
    }
    .modal-eyebrow {
      display: inline-block;
      color: var(--forest-soft);
      background: rgba(31, 143, 95, .08);
      border: 1px solid rgba(31, 143, 95, .22);
      border-radius: 999px;
      padding: .35rem .85rem;
      margin: 0 auto .95rem;
    }
    .modal-panel.disclaimer {
      border-top: 3px solid var(--leaf);
      text-align: center;
    }
    .modal-title {
      margin: 0 0 1rem;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: .45rem;
      font-size: 1.05rem;
      font-weight: 800;
      color: var(--forest);
      text-align: center;
    }
    .modal-title svg {
      width: 1.15rem;
      height: 1.15rem;
      fill: currentColor;
      color: var(--leaf);
      flex-shrink: 0;
    }
    .modal-body { color: var(--muted); }
    .modal-short { color: var(--ink); }
    .modal-short-en { color: var(--muted); }
    .fallback-hint { color: var(--forest-soft); font-weight: 600; }
    .fallback-number { color: var(--forest); }
    .fallback-message {
      background: #fff;
      border: 1px solid var(--line);
      color: var(--ink);
      border-radius: 10px;
    }
    .fallback-message[hidden] { display: none !important; }
    .btn-modal {
      border-radius: 10px;
      border-color: var(--line);
    }
    .btn-modal.confirm {
      background: var(--leaf);
      border-color: transparent;
      color: #fff;
      box-shadow: 0 10px 28px rgba(31, 143, 95, .28);
    }
    .modal-actions-stacked .btn-modal.confirm {
      box-shadow: 0 10px 28px rgba(31, 143, 95, .28);
    }
    .btn-modal.cancel {
      background: #fff;
      color: var(--forest);
      border: 1px solid var(--line);
    }
    .modal-actions-stacked .btn-modal.cancel {
      color: var(--muted);
      background: transparent;
      border-color: transparent;
    }
    .btn-modal.secondary {
      background: #fff;
      color: var(--forest);
      border: 1px solid var(--line);
    }
    .btn-modal.primary-action {
      background: var(--leaf);
      border-color: transparent;
      color: #fff !important;
      box-shadow: 0 8px 22px rgba(31, 143, 95, .24);
    }
    .copy-toast { color: var(--leaf); }
    .confirm-channel { color: rgba(255,255,255,.92); }
    .confirm-intent { color: #fff; }

    @media (max-width: 639px) {
      body {
        align-items: flex-start;
        padding: max(.55rem, env(safe-area-inset-top, 0px)) .7rem max(.9rem, env(safe-area-inset-bottom, 0px));
      }
      .card {
        border-radius: 14px;
        padding: 1.05rem .95rem 1.15rem;
      }
      h1 { font-size: clamp(1.75rem, 8vw, 2.2rem); }
      .sale-channels {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: .55rem;
      }
      .sale-ch {
        width: auto;
        flex: none;
        border: 1px solid var(--line);
        background: rgba(255,255,255,.65);
        padding: .7rem .5rem;
      }
      .sale-ch[data-channel="telegram"] { grid-column: 1 / -1; }
      .sale-ch-icon {
        width: 2.6rem;
        height: 2.6rem;
        margin-bottom: .4rem;
      }
    }
  </style>
</head>
<body>
  <main class="wrap">
    <div class="card">
      <div class="badge">برای فروش</div>
      <h1>spacescience.ir</h1>
      

      <div class="price-block">
        <span class="price-label">قیمت مصوب</span>
          <div class="price">36 میلیون تومان</div>
      </div>

      <p class="notice">این دامنه برای فروش است. وب‌سایت قبلی بسته شده و فعالیتی ندارد — فقط برای خرید دامنه پیام بدهید.</p>

      



      <section class="buy-section" aria-label="تماس برای خرید">
        <h2 class="buy-heading">خرید این دامنه</h2>
        <p class="buy-sub">یکی از راه‌های زیر را انتخاب کنید</p>
        <div class="sale-channels" id="contact-actions">
          <button type="button" class="sale-ch" data-channel="telegram" data-label="تلگرام">
            <span class="sale-ch-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4.64 6.8c-.15 1.58-.8 5.42-1.13 7.19-.14.75-.42 1-.68 1.03-.58.05-1.02-.38-1.58-.75-.88-.58-1.38-.94-2.23-1.5-.99-.65-.35-1.01.22-1.59.15-.15 2.71-2.48 2.76-2.69a.2.2 0 0 0-.05-.18c-.06-.05-.14-.03-.21-.02-.09.02-1.49.95-4.22 2.79-.4.27-.76.41-1.08.4-.36-.01-1.04-.2-1.55-.37-.63-.2-1.12-.31-1.08-.66.02-.18.27-.36.74-.55 2.92-1.27 4.86-2.11 5.83-2.51 2.78-1.16 3.35-1.36 3.73-1.36.08 0 .27.02.39.12.1.08.13.19.14.27-.01.06.01.24 0 .38z"/></svg></span>
            <span class="sale-ch-text"><strong>تلگرام</strong><span>ارسال پیام در تلگرام (بهترین)</span></span>
          </button>
          <button type="button" class="sale-ch" data-channel="sms" data-label="پیامک">
            <span class="sale-ch-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17L4 17.17V4h16v12z"/></svg></span>
            <span class="sale-ch-text"><strong>پیامک</strong><span>پیامک (سریع‌ترین)</span></span>
          </button>
          <button type="button" class="sale-ch" data-channel="phone" data-label="تماس">
            <span class="sale-ch-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M6.6 10.8c1.5 2.9 3.7 5.1 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.5.6.6 0 1 .4 1 1V21c0 .6-.4 1-1 1C10.3 22 2 13.7 2 3c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.2.2 2.4.6 3.5.1.3 0 .7-.2 1L6.6 10.8z"/></svg></span>
            <span class="sale-ch-text"><strong>تماس</strong><span>صحبت تلفنی</span></span>
          </button>
          <button type="button" class="sale-ch" data-channel="bale" data-label="بله">
            <span class="sale-ch-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.15 2 11.2c0 2.9 1.46 5.5 3.74 7.2L5 22l3.6-1.8c1.05.29 2.16.45 3.4.45 5.52 0 10-4.15 10-9.2S17.52 2 12 2z"/></svg></span>
            <span class="sale-ch-text"><strong>بله</strong><span>ارسال پیام در بله</span></span>
          </button>
          <button type="button" class="sale-ch" data-channel="whatsapp" data-label="واتساپ">
            <span class="sale-ch-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347z"/><path d="M12 0C5.373 0 0 5.373 0 12c0 2.625.846 5.059 2.284 7.034L.789 23.492a.75.75 0 0 0 .957.957l4.458-1.495A11.95 11.95 0 0 0 12 24c6.627 0 12-5.373 12-12S18.627 0 12 0zm0 21.75a9.714 9.714 0 0 1-4.96-1.356l-.355-.21-3.14 1.054 1.054-3.14-.231-.366A9.714 9.714 0 0 1 2.25 12C2.25 6.615 6.615 2.25 12 2.25S21.75 6.615 21.75 12 17.385 21.75 12 21.75z"/></svg></span>
            <span class="sale-ch-text"><strong>واتساپ</strong><span>پیام در واتساپ</span></span>
          </button>
        </div>
        <div class="meta" id="cta-text">برای خرید دامنه پیام بدهید</div>
      </section>
      <ul class="trust" aria-label="مزایا">
        <li>انتقال رسمی nic.ir</li>
        <li>پاسخ سریع</li>
        <li>قیمت شفاف</li>
      </ul>
    </div>
  </main>

    <div class="modal" id="disclaimer-modal" aria-hidden="true">
      <div class="modal-backdrop" data-dismiss="modal"></div>
      <div class="modal-panel disclaimer" role="dialog" aria-modal="true" aria-labelledby="modal-short">
        <p class="modal-eyebrow">Domain for sale · دامنه برای فروش</p>
        <div class="modal-body">
          <p class="modal-short" id="modal-short">وب‌سایت فعالیتی ندارد، برای خدمات قبلی سایت پیام ندهید.</p>
          <p class="modal-short-en">This website has no activity. Do not message about previous site services.</p>
        </div>
        <div class="modal-actions-stacked">
          <button type="button" class="btn-modal confirm" id="modal-confirm">
            <span class="confirm-channel" id="confirm-channel-line">
              <span id="confirm-icon" aria-hidden="true"></span>
              <span id="confirm-channel-text">ارسال پیام در تلگرام</span>
            </span>
            <span class="confirm-intent" id="confirm-intent">می‌خواهم دامنه را بخرم</span>
          </button>
          <button type="button" class="btn-modal cancel" data-dismiss="modal">انصراف - دامنه نمی خواهم</button>
        </div>
      </div>
    </div>
  
    <div class="modal" id="channel-fallback-modal" aria-hidden="true">
      <div class="modal-backdrop" data-dismiss="fallback"></div>
      <div class="modal-panel" role="dialog" aria-modal="true" aria-labelledby="fallback-title">
        <h2 class="modal-title" id="fallback-title">
          <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/></svg>
          <span id="fallback-title-text">راهنمای ارتباط</span>
        </h2>
        <div class="modal-body">
          <p class="fallback-hint" id="fallback-hint"></p>
          <span class="fallback-number" id="fallback-number" hidden></span>
          <textarea class="fallback-message" id="fallback-message" readonly hidden rows="4"></textarea>
          <p class="copy-toast" id="copy-toast" aria-live="polite"></p>
        </div>
        <div class="modal-actions-row">
          <button type="button" class="btn-modal cancel" data-dismiss="fallback">بستن</button>
          <button type="button" class="btn-modal secondary" id="fallback-copy">کپی متن</button>
        </div>
        <div class="modal-actions-stacked" style="margin-top:.55rem">
          <button type="button" class="btn-modal primary-action" id="fallback-retry">تلاش مجدد</button>
        </div>
      </div>
    </div>
    <script>
      (function(){
        function b64ToUtf8(b64){
          var bin = atob(b64);
          if (typeof TextDecoder !== 'undefined') {
            var bytes = new Uint8Array(bin.length);
            for (var i = 0; i < bin.length; i++) bytes[i] = bin.charCodeAt(i);
            return new TextDecoder('utf-8').decode(bytes);
          }
          return decodeURIComponent(Array.prototype.map.call(bin, function(c){
            return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
          }).join(''));
        }
  
        var cfg;
        try {
          cfg = JSON.parse(b64ToUtf8("eyJwaG9uZUUxNjQiOiI5ODkxMjIzNjc4NjAiLCJwaG9uZURpc3BsYXkiOiIwOTEyLTIzNjc4NjAiLCJiYWxlVXJsIjoiaHR0cHM6Ly9ibGUuaXIvZW1yYTIyOCIsIndoYXRzYXBwRTE2NCI6Ijk4OTEyMjM2Nzg2MCIsInRlbGVncmFtIjoiOTg5MTIyMzY3ODYwIiwiZG9tYWluIjoic3BhY2VzY2llbmNlLmlyIiwicHJpY2VUZXh0IjoiMzYg2YXbjNmE24zZiNmGINiq2YjZhdin2YYifQ=="));
        } catch (e) {
          return;
        }
  
        var pendingChannel = null;
        var fallbackRetryUrl = '';
        var fallbackMessageText = '';
        var modal = document.getElementById('disclaimer-modal');
        var fallbackModal = document.getElementById('channel-fallback-modal');
        var confirmBtn = document.getElementById('modal-confirm');
        var confirmIcon = document.getElementById('confirm-icon');
        var confirmChannelText = document.getElementById('confirm-channel-text');
        var confirmIntent = document.getElementById('confirm-intent');
        var fallbackTitle = document.getElementById('fallback-title-text');
        var fallbackHint = document.getElementById('fallback-hint');
        var fallbackNumber = document.getElementById('fallback-number');
        var fallbackMessage = document.getElementById('fallback-message');
        var fallbackCopyBtn = document.getElementById('fallback-copy');
        var fallbackRetryBtn = document.getElementById('fallback-retry');
        var copyToast = document.getElementById('copy-toast');
  
        var channelActionText = {
          telegram: 'ارسال پیام در تلگرام',
          bale: 'ارسال پیام در بله',
          sms: 'ارسال پیامک',
          phone: 'صحبت تلفنی',
          whatsapp: 'ارسال پیام در واتساپ'
        };
  
        var channelIcons = {
          telegram: '<svg viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4.64 6.8c-.15 1.58-.8 5.42-1.13 7.19-.14.75-.42 1-.68 1.03-.58.05-1.02-.38-1.58-.75-.88-.58-1.38-.94-2.23-1.5-.99-.65-.35-1.01.22-1.59.15-.15 2.71-2.48 2.76-2.69a.2.2 0 0 0-.05-.18c-.06-.05-.14-.03-.21-.02-.09.02-1.49.95-4.22 2.79-.4.27-.76.41-1.08.4-.36-.01-1.04-.2-1.55-.37-.63-.2-1.12-.31-1.08-.66.02-.18.27-.36.74-.55 2.92-1.27 4.86-2.11 5.83-2.51 2.78-1.16 3.35-1.36 3.73-1.36.08 0 .27.02.39.12.1.08.13.19.14.27-.01.06.01.24 0 .38z"/></svg>',
          bale: '<svg viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.15 2 11.2c0 2.9 1.46 5.5 3.74 7.2L5 22l3.6-1.8c1.05.29 2.16.45 3.4.45 5.52 0 10-4.15 10-9.2S17.52 2 12 2z"/></svg>',
          sms: '<svg viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17L4 17.17V4h16v12z"/></svg>',
          phone: '<svg viewBox="0 0 24 24"><path d="M6.6 10.8c1.5 2.9 3.7 5.1 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.5.6.6 0 1 .4 1 1V21c0 .6-.4 1-1 1C10.3 22 2 13.7 2 3c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.2.2 2.4.6 3.5.1.3 0 .7-.2 1L6.6 10.8z"/></svg>',
          whatsapp: '<svg viewBox="0 0 24 24"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347z"/><path d="M12 0C5.373 0 0 5.373 0 12c0 2.625.846 5.059 2.284 7.034L.789 23.492a.75.75 0 0 0 .957.957l4.458-1.495A11.95 11.95 0 0 0 12 24c6.627 0 12-5.373 12-12S18.627 0 12 0zm0 21.75a9.714 9.714 0 0 1-4.96-1.356l-.355-.21-3.14 1.054 1.054-3.14-.231-.366A9.714 9.714 0 0 1 2.25 12C2.25 6.615 6.615 2.25 12 2.25S21.75 6.615 21.75 12 17.385 21.75 12 21.75z"/></svg>'
        };
  
        function smsHref(number, message){
          var ua = navigator.userAgent.toLowerCase();
          var ios = ua.indexOf('iphone') > -1 || ua.indexOf('ipad') > -1;
          var sep = ios ? '&' : '?';
          return 'sms:+' + number + sep + 'body=' + encodeURIComponent(message);
        }
  
        function buyMessage(){
          var price = cfg.priceText ? (' با قیمت مصوب ' + cfg.priceText) : '';
          return 'سلام، دامنه سایت اینترنتی ' + cfg.domain + ' را' + price + ' خریدارم. فرآیند انتقال دامنه را (می‌دانم/توضیح دهید)';
        }
  
        function telUrl(){
          return 'tel:+' + cfg.phoneE164;
        }
  
        function channelUrl(channel){
          var msg = buyMessage();
          if (channel === 'bale') return cfg.baleUrl;
          if (channel === 'sms') return smsHref(cfg.phoneE164, msg);
          if (channel === 'phone') return telUrl();
          if (channel === 'whatsapp') return 'https://wa.me/' + cfg.whatsappE164 + '?text=' + encodeURIComponent(msg);
          if (channel === 'telegram') return 'https://t.me/+' + cfg.telegram + '?text=' + encodeURIComponent(msg);
          return '#';
        }
  
        function copyText(text){
          return new Promise(function(resolve){
            function legacyCopy(){
              try {
                var ta = document.createElement('textarea');
                ta.value = text;
                ta.setAttribute('readonly', '');
                ta.style.position = 'fixed';
                ta.style.opacity = '0';
                document.body.appendChild(ta);
                ta.select();
                var ok = document.execCommand('copy');
                document.body.removeChild(ta);
                resolve(!!ok);
              } catch (e) {
                resolve(false);
              }
            }
            if (navigator.clipboard && window.isSecureContext) {
              navigator.clipboard.writeText(text).then(function(){ resolve(true); }).catch(legacyCopy);
            } else {
              legacyCopy();
            }
          });
        }
  
        function trackClick(channel){
          try {
            navigator.sendBeacon('/api/public/contact-click', new Blob([JSON.stringify({
              domain: cfg.domain,
              channel: channel
            })], { type: 'application/json' }));
          } catch (e) {}
        }
  
        function showFallback(channel, msg){
          fallbackRetryUrl = channelUrl(channel);
          fallbackMessageText = msg || '';
  
          if (fallbackTitle) {
            if (channel === 'phone') fallbackTitle.textContent = 'تماس تلفنی';
            else if (channel === 'sms') fallbackTitle.textContent = 'ارسال پیامک';
            else if (channel === 'bale') fallbackTitle.textContent = 'ارسال پیام در بله';
            else if (channel === 'telegram') fallbackTitle.textContent = 'ارسال پیام در تلگرام';
            else fallbackTitle.textContent = 'راهنمای ارتباط';
          }
  
          if (fallbackHint) {
            if (channel === 'phone') {
              fallbackHint.textContent = 'اگر تماس خودکار برقرار نشد، این شماره را بگیرید:';
            } else if (channel === 'sms') {
              fallbackHint.textContent = 'اگر پیامک در این دستگاه باز نشد، شماره را بگیرید و متن زیر را ارسال کنید:';
            } else if (channel === 'bale') {
              fallbackHint.textContent = 'اگر بله باز نشد، متن زیر را کپی کرده و در بله ارسال کنید:';
            } else if (channel === 'telegram') {
              fallbackHint.textContent = 'اگر تلگرام باز نشد، متن زیر را کپی کرده و ارسال کنید:';
            } else {
              fallbackHint.textContent = 'متن پیام آماده خرید:';
            }
          }
  
          if (fallbackNumber) {
            if (channel === 'phone' || channel === 'sms') {
              fallbackNumber.hidden = false;
              fallbackNumber.textContent = cfg.phoneDisplay || '';
            } else {
              fallbackNumber.hidden = true;
            }
          }
  
          if (fallbackMessage) {
            if (channel === 'phone') {
              fallbackMessage.hidden = true;
            } else {
              fallbackMessage.hidden = false;
              fallbackMessage.value = msg || '';
            }
          }
  
          if (fallbackCopyBtn) fallbackCopyBtn.hidden = channel === 'phone';
          if (copyToast) copyToast.textContent = '';
          if (fallbackRetryBtn) {
            if (channel === 'phone') fallbackRetryBtn.textContent = 'تماس مجدد';
            else if (channel === 'sms') fallbackRetryBtn.textContent = 'تلاش مجدد پیامک';
            else if (channel === 'bale') fallbackRetryBtn.textContent = 'باز کردن بله';
            else if (channel === 'telegram') fallbackRetryBtn.textContent = 'باز کردن تلگرام';
            else fallbackRetryBtn.textContent = 'تلاش مجدد';
          }
  
          if (fallbackModal) {
            fallbackModal.classList.add('is-open');
            fallbackModal.setAttribute('aria-hidden', 'false');
          }
        }
  
        function hideFallback(){
          if (fallbackModal) {
            fallbackModal.classList.remove('is-open');
            fallbackModal.setAttribute('aria-hidden', 'true');
          }
        }
  
        function maybeShowFallback(channel, msg){
          setTimeout(function(){
            if (document.visibilityState === 'visible') showFallback(channel, msg);
          }, 900);
        }
  
        function openChannel(channel){
          var msg = buyMessage();
          var url = channelUrl(channel);
          trackClick(channel);
  
          if (channel === 'phone') {
            window.location.href = url;
            maybeShowFallback('phone', msg);
            return;
          }
  
          if (channel === 'bale' || channel === 'telegram') {
            copyText(msg).then(function(){
              window.location.href = url;
            });
            maybeShowFallback(channel, msg);
            return;
          }
  
          if (channel === 'sms') {
            window.location.href = url;
            maybeShowFallback('sms', msg);
            return;
          }
  
          window.location.href = url;
        }
  
        function showModal(channel, label){
          pendingChannel = channel;
          if (confirmChannelText) {
            confirmChannelText.textContent = channelActionText[channel] || ('ارتباط از طریق ' + label);
          }
          if (confirmIcon) {
            confirmIcon.innerHTML = channelIcons[channel] || '';
          }
          if (confirmIntent) {
            confirmIntent.textContent = 'می‌خواهم دامنه ' + (cfg.domain || '') + ' را بخرم';
          }
          if (modal) {
            modal.classList.add('is-open');
            modal.setAttribute('aria-hidden', 'false');
          }
          if (confirmBtn) confirmBtn.focus();
        }
  
        function hideModal(){
          pendingChannel = null;
          if (modal) {
            modal.classList.remove('is-open');
            modal.setAttribute('aria-hidden', 'true');
          }
        }
  
        function bindChannelButtons(root){
          if (!root) return;
          var buttons = root.querySelectorAll('[data-channel]');
          for (var i = 0; i < buttons.length; i++) {
            (function(btn){
              btn.addEventListener('click', function(ev){
                ev.preventDefault();
                var ch = btn.getAttribute('data-channel');
                var label = btn.getAttribute('data-label') || ch;
                if (ch) showModal(ch, label);
              });
            })(buttons[i]);
          }
        }
  
        if (confirmBtn) {
          confirmBtn.addEventListener('click', function(){
            var ch = pendingChannel;
            hideModal();
            if (ch) openChannel(ch);
          });
        }
  
        if (fallbackCopyBtn) {
          fallbackCopyBtn.addEventListener('click', function(){
            copyText(fallbackMessageText).then(function(ok){
              if (copyToast) copyToast.textContent = ok ? 'متن کپی شد' : 'کپی خودکار ممکن نشد — متن را دستی انتخاب کنید';
            });
          });
        }
  
        if (fallbackRetryBtn) {
          fallbackRetryBtn.addEventListener('click', function(){
            if (fallbackRetryUrl) window.location.href = fallbackRetryUrl;
          });
        }
  
        if (modal) {
          modal.addEventListener('click', function(ev){
            var t = ev.target;
            if (t && t.getAttribute && t.getAttribute('data-dismiss') === 'modal') hideModal();
          });
        }
  
        if (fallbackModal) {
          fallbackModal.addEventListener('click', function(ev){
            var t = ev.target;
            if (t && t.getAttribute && t.getAttribute('data-dismiss') === 'fallback') hideFallback();
          });
        }
  
        document.addEventListener('keydown', function(ev){
          if (ev.key === 'Escape') {
            if (fallbackModal && fallbackModal.classList.contains('is-open')) hideFallback();
            else if (modal && modal.classList.contains('is-open')) hideModal();
          }
        });
  
        bindChannelButtons(document.getElementById('contact-actions'));
      })();
    </script>
</body>
</html>
