@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800;900&family=IBM+Plex+Mono:wght@500&display=swap');

.avazto-widget {
  --bg: #fbf6ee; --bg-soft: #f5ead9; --panel: rgba(255,255,255,0.72); --panel-strong: rgba(255,255,255,0.92);
  --border-c: rgba(80,55,20,0.12); --border-c2: rgba(80,55,20,0.20);
  --amber: #c9832a; --amber-soft: rgba(201,131,42,0.15); --amber-text: #9c5f14;
  --blue: #3b6fd1; --blue-soft: rgba(59,111,209,0.13);
  --green: #3f9d63; --green-soft: rgba(63,157,99,0.14);
  --text-1: #2b2118; --text-2: #6b5c4c; --text-3: #a08d78; --danger: #d24b4b;
  font-family: 'Vazirmatn', sans-serif; background: var(--bg); border-radius: 20px;
  border: 1px solid var(--border-c); overflow: hidden; color: var(--text-1);
  max-width: 740px; margin: 0 auto; box-shadow: 0 20px 50px rgba(80,55,20,0.14);
  direction: rtl; box-sizing: border-box; position: relative;
  display: flex; flex-direction: column;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
.avazto-widget *, .avazto-widget *::before, .avazto-widget *::after { box-sizing: border-box; }
.avazto-widget button { touch-action: manipulation; }

/* حالت تمام‌صفحه */
.avazto-widget.avz-fullscreen {
  position: fixed; inset: 0; z-index: 2147483000; max-width: 100%; width: 100%;
  height: 100vh; height: 100dvh; /* 100vh فال‌بک برای مرورگرهای قدیمی‌تر که dvh رو نمی‌شناسن */
  border-radius: 0; margin: 0; box-shadow: none;
}
.avazto-widget.avz-fullscreen .avz-chatwrap { height: auto; flex: 1; min-height: 0; }

.avz-topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border-c); background: linear-gradient(180deg, rgba(255,255,255,0.55), transparent); }
.avz-brand { display: flex; align-items: center; gap: 10px; }
.avz-logo { width: 38px; height: 38px; border-radius: 11px; background: var(--amber-soft); display: flex; align-items: center; justify-content: center; color: var(--amber); flex-shrink: 0; font-size: 18px; overflow: hidden; }
.avz-logo img { width: 100%; height: 100%; object-fit: cover; }
.avz-brand-name { font-weight: 800; font-size: 15px; letter-spacing: -0.2px; }
.avz-brand-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.avz-fsbtn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border-c2); background: var(--panel); color: var(--text-2); font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.avz-fsbtn:hover { color: var(--amber-text); border-color: var(--amber); }

/* ================= لانچر شناور (حباب چت گوشه‌ی سایت) ================= */
.avz-launcher-bubble {
  position: fixed; z-index: 2147483000;
  width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #e8a33d, #c9832a);
  display: flex; align-items: center; justify-content: center; padding: 0; color: #fff;
  box-shadow: 0 10px 26px rgba(180,120,30,0.38), 0 2px 8px rgba(0,0,0,0.14);
  transition: transform .16s ease;
}
.avz-launcher-bubble:hover { transform: scale(1.06); }
.avz-launcher-bubble:active { transform: scale(0.95); }
.avz-launcher-bubble svg { width: 27px; height: 27px; }
.avz-launcher-ring {
  position: fixed; z-index: 2147482999; width: 60px; height: 60px; border-radius: 50%;
  border: 2px solid rgba(201,131,42,0.55); pointer-events: none;
  animation: avz-launcher-pulse 2.4s ease-out infinite;
}
@keyframes avz-launcher-pulse {
  0% { transform: scale(1); opacity: .6; }
  100% { transform: scale(1.9); opacity: 0; }
}
.avz-launcher-badge {
  position: fixed; z-index: 2147483001; width: 19px; height: 19px; border-radius: 50%;
  background: #d24b4b; color: #fff; font-size: 10.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-family: 'Vazirmatn', sans-serif;
  box-shadow: 0 0 0 2px #fff;
}
.avz-launcher-panel {
  position: fixed; z-index: 2147483000;
  width: 400px; max-width: calc(100vw - 32px);
  height: 640px; max-height: calc(100vh - 120px);
  opacity: 0; transform: translateY(16px) scale(0.96); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  border-radius: 20px; overflow: hidden; box-shadow: 0 24px 60px rgba(60,40,10,0.28);
}
.avz-launcher-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.avz-launcher-panel .avazto-widget { max-width: 100%; width: 100%; height: 100%; margin: 0; box-shadow: none; border-radius: 20px; }
.avz-launcher-panel .avz-chatwrap { height: auto; flex: 1; min-height: 0; }

@media (max-width: 640px) {
  .avz-launcher-panel {
    width: 100vw !important; max-width: 100vw; max-height: 100dvh;
    height: 100vh !important; height: 100dvh !important; /* 100vh فال‌بک برای مرورگرهای قدیمی */
    top: 0 !important; right: 0 !important; left: 0 !important; bottom: 0 !important;
    border-radius: 0; transform: translateY(0) scale(1);
    overscroll-behavior: none;
  }
  .avz-launcher-panel .avazto-widget { border-radius: 0; }
  .avz-launcher-bubble, .avz-launcher-ring, .avz-launcher-badge { bottom: 16px !important; }

  /* روی موبایل، اندازه‌ی فونت ورودی‌ها حتماً باید ۱۶ پیکسل یا بیشتر باشه، وگرنه
     سافاری آیفون هنگام فوکوس روی فیلد به‌طور خودکار زوم می‌کنه. */
  .avz-textinput { font-size: 16px; }

  /* دکمه‌های لمسی روی موبایل حداقل ۴۴×۴۴ پیکسل، طبق توصیه‌ی اپل/گوگل برای راحتی لمس */
  .avz-fsbtn { width: 44px; height: 44px; font-size: 17px; }
  .avz-lightbox-close { width: 44px; height: 44px; font-size: 19px; }

  .avazto-widget.avz-fullscreen,
  .avz-launcher-panel.open { overscroll-behavior: none; }
  .avazto-widget.avz-fullscreen .avz-topbar,
  .avz-launcher-panel.open .avz-topbar { padding-top: max(14px, env(safe-area-inset-top)); }
  .avazto-widget.avz-fullscreen .avz-inputrow,
  .avz-launcher-panel.open .avz-inputrow { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
}

.avz-subbar { display: flex; align-items: center; justify-content: space-between; padding: 9px 18px; border-bottom: 1px solid var(--border-c); background: var(--bg-soft); }
.avz-status { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); }
.avz-eq { display: flex; align-items: flex-end; gap: 3px; height: 13px; }
.avz-eq span { width: 3px; border-radius: 2px; background: var(--amber); animation: avz-eq-anim 0.9s ease-in-out infinite; opacity: 0.9; }
.avz-eq span:nth-child(1){height:40%;animation-delay:0s} .avz-eq span:nth-child(2){height:100%;animation-delay:0.15s}
.avz-eq span:nth-child(3){height:60%;animation-delay:0.3s} .avz-eq span:nth-child(4){height:85%;animation-delay:0.45s}
.avz-eq.idle span { animation-play-state: paused; height: 25% !important; opacity: 0.3; }
@keyframes avz-eq-anim { 0%,100%{transform:scaleY(0.4)} 50%{transform:scaleY(1)} }
.avz-contactbtn { display: flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border-c2); background: var(--panel); color: var(--text-2); font-size: 11.5px; cursor: pointer; font-family: inherit; }
.avz-contactbtn:hover { color: var(--amber-text); border-color: var(--amber); }

.avz-chatwrap { display: flex; flex-direction: column; height: 580px; flex-shrink: 0; }

/* بک‌گراند چت شبیه تلگرام: طرح‌های ریز و ملایم موسیقیایی روی زمینه‌ی روشن */
.avz-messages {
  flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px;
  background-color: var(--bg-soft);
  scroll-behavior: smooth; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxODAiIGhlaWdodD0iMTgwIiB2aWV3Qm94PSIwIDAgMTgwIDE4MCI+CjxnIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2M5ODMyYSIgc3Ryb2tlLXdpZHRoPSIxLjQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgb3BhY2l0eT0iMC4xMCI+CiAgPHBhdGggZD0iTTIwIDMwIHE2IC0xNCAxNCAtNiBxNCA0IDAgMTAgcS02IDggLTE0IDIgcS00IC00IDAgLTZ6Ii8+CiAgPHBhdGggZD0iTTM0IDI0IHYtMTYgbDEwIC0zIHYxNCIvPgogIDxwYXRoIGQ9Ik05NSAyMCBxMTAgOCAwIDE2IHEtMTAgOCAwIDE2IiAvPgogIDxwYXRoIGQ9Ik0xMTUgMTUgcTE0IDEyIDAgMjQgcS0xNCAxMiAwIDI0IiBvcGFjaXR5PSIwLjYiLz4KICA8Y2lyY2xlIGN4PSIxNTAiIGN5PSI0NSIgcj0iMi40Ii8+CiAgPGNpcmNsZSBjeD0iNjAiIGN5PSI3MCIgcj0iMiIvPgogIDxwYXRoIGQ9Ik0xNDAgOTAgcTYgLTE0IDE0IC02IHE0IDQgMCAxMCBxLTYgOCAtMTQgMiBxLTQgLTQgMCAtNnoiLz4KICA8cGF0aCBkPSJNMTU0IDg0IHYtMTYgbDEwIC0zIHYxNCIvPgogIDxwYXRoIGQ9Ik0yMCAxMjAgcTEwIDggMCAxNiBxLTEwIDggMCAxNiIvPgogIDxjaXJjbGUgY3g9IjkwIiBjeT0iMTQwIiByPSIyLjQiLz4KICA8cGF0aCBkPSJNMTEwIDE1MCBxNiAtMTQgMTQgLTYgcTQgNCAwIDEwIHEtNiA4IC0xNCAyIHEtNCAtNCAwIC02eiIvPgogIDxwYXRoIGQ9Ik0xMjQgMTQ0IHYtMTYgbDEwIC0zIHYxNCIvPgogIDxjaXJjbGUgY3g9IjM1IiBjeT0iMTYwIiByPSIyIi8+CjwvZz4KPC9zdmc+");
  background-repeat: repeat; background-size: 180px 180px;
}
.avz-messages::-webkit-scrollbar { width: 6px; }
.avz-messages::-webkit-scrollbar-thumb { background: var(--border-c2); border-radius: 4px; }
.avz-row { display: flex; width: 100%; gap: 8px; animation: avz-fade-in 0.25s ease; }
@keyframes avz-fade-in { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: translateY(0);} }
.avz-row.bot { justify-content: flex-start; }
.avz-row.user { justify-content: flex-end; }
.avz-avatar { width: 26px; height: 26px; border-radius: 8px; background: var(--amber-soft); color: var(--amber); display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; font-size: 13px; overflow: hidden; }
.avz-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avz-bubble { max-width: 76%; padding: 11px 15px; border-radius: 16px; font-size: 14px; line-height: 1.9; white-space: pre-wrap; word-break: break-word; }
.avz-bubble.bot { background: var(--panel-strong); border: 1px solid var(--border-c); border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(80,55,20,0.05); }
.avz-bubble.user { background: var(--blue-soft); border: 1px solid rgba(59,111,209,0.25); color: #1d3f8a; border-bottom-right-radius: 4px; }
.avz-bubble .avz-explain-title { font-weight: 700; color: var(--amber-text); margin-bottom: 3px; display: block; }
.avz-typing { display: flex; align-items: center; gap: 5px; padding: 13px 16px; background: var(--panel-strong); border: 1px solid var(--border-c); border-radius: 16px; border-bottom-left-radius: 4px; width: fit-content; }
.avz-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: avz-blink 1.1s infinite; display: inline-block; }
.avz-typing span:nth-child(2){animation-delay:0.15s} .avz-typing span:nth-child(3){animation-delay:0.3s}
@keyframes avz-blink { 0%,80%,100%{opacity:0.25;transform:translateY(0)} 40%{opacity:1;transform:translateY(-2px)} }

.avz-optwrap { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 94%; }
.avz-optgroup-label { font-size: 11px; color: var(--text-3); margin: 4px 2px 0; font-weight: 600; }
.avz-optgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 9px; }
.avz-optbtn { display: flex; align-items: center; gap: 10px; text-align: right; padding: 12px 13px; border-radius: 14px; border: 1px solid var(--border-c); background: var(--panel-strong); color: var(--text-1); cursor: pointer; font-family: inherit; font-size: 13px; transition: border-color 0.15s, background 0.15s, transform 0.1s; }
.avz-optbtn:hover { border-color: var(--amber); background: var(--amber-soft); transform: translateY(-1px); }
.avz-optbtn:disabled { opacity: 0.45; cursor: default; transform: none; }
.avz-optbtn .avz-opticon { width: 34px; height: 34px; border-radius: 10px; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; color: var(--amber); flex-shrink: 0; font-size: 16px; }
.avz-optbtn.unknown { border-style: dashed; color: var(--text-2); }
.avz-optbtn.unknown .avz-opticon { color: var(--text-2); }

.avz-pkgimg-wrap { max-width: 76%; border-radius: 16px; overflow: hidden; border: 1px solid var(--border-c2); background: var(--bg-soft); }
.avz-pkgimg { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg-soft); cursor: zoom-in; transition: filter .15s ease; touch-action: manipulation; }
.avz-pkgimg:hover { filter: brightness(0.94); }

.avz-lightbox {
  position: fixed; inset: 0; z-index: 2147483647;
  background: rgba(20,14,4,0.86);
  display: flex; align-items: center; justify-content: center;
  padding: 28px; animation: avz-fade-in 0.15s ease;
  touch-action: manipulation;
}
.avz-lightbox img {
  max-width: min(92vw, 640px); max-height: 86vh; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45); object-fit: contain; cursor: zoom-out;
  touch-action: manipulation;
}
.avz-lightbox-close {
  position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.32); color: #fff;
  font-size: 17px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}
.avz-lightbox-close:hover { background: rgba(255,255,255,0.24); }

.avz-pkgcard { border: 1px solid var(--border-c2); border-radius: 16px; padding: 16px; background: var(--panel-strong); max-width: 92%; }
.avz-pkgcard-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.avz-pkgcard-title { font-weight: 800; font-size: 15px; color: var(--amber-text); }
.avz-pkgcard-price { font-size: 12.5px; font-weight: 700; color: var(--text-1); background: var(--bg-soft); display: inline-block; padding: 5px 11px; border-radius: 999px; }
.avz-pkgcard-specs { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.avz-pkgcard-specs li { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 7px; }
.avz-pkgcard-specs li:before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--amber); flex-shrink: 0; display: inline-block; }
.avz-pkgcard-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 12.5px; color: var(--amber-text); text-decoration: none; border: 1px solid var(--border-c2); padding: 7px 12px; border-radius: 10px; }
.avz-pkgcard-link:hover { border-color: var(--amber); }

.avz-choicebtns { display: flex; gap: 9px; }
.avz-choicebtn { display: flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border-c2); background: var(--panel-strong); color: var(--text-1); font-size: 13px; cursor: pointer; font-family: inherit; }
.avz-choicebtn.yes:hover { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.avz-choicebtn.no:hover { border-color: var(--danger); background: rgba(210,75,75,0.12); color: var(--danger); }
.avz-choicebtn:disabled { opacity: 0.45; cursor: default; }

.avz-contactcard { border: 1px solid var(--border-c2); border-radius: 16px; padding: 16px; background: var(--panel-strong); max-width: 92%; }
.avz-contactcard-title { font-weight: 800; font-size: 14.5px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.avz-contact-row { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--text-2); margin-bottom: 9px; line-height: 1.8; }
.avz-contact-note { font-size: 12px; color: var(--amber-text); background: var(--amber-soft); border-radius: 10px; padding: 9px 11px; margin-top: 10px; line-height: 1.9; }

.avz-inputrow { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border-c); background: var(--bg-soft); }
.avz-inputrow-fields { display: flex; gap: 8px; flex-wrap: wrap; }
.avz-textinput { flex: 1; min-width: 120px; background: var(--panel-strong); border: 1px solid var(--border-c); border-radius: 12px; padding: 10px 14px; color: var(--text-1); font-family: inherit; font-size: 13.5px; outline: none; }
.avz-textinput:focus { border-color: var(--amber); }
.avz-textinput.error { border-color: var(--danger); }
.avz-inputerr { font-size: 11.5px; color: var(--danger); }
.avz-sendbtn { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 12px; border: none; background: var(--amber); color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit; }
.avz-sendbtn:disabled { opacity: 0.45; cursor: not-allowed; }
.avz-restartbtn { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border-c2); background: var(--panel-strong); color: var(--text-2); font-size: 12.5px; font-family: inherit; cursor: pointer; }
.avz-inline-link { background: none; border: none; padding: 2px 0; color: var(--text-3); font-size: 11.5px; font-family: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.avz-inline-link:hover { color: var(--amber-text); }
.avz-restartbtn:hover { color: var(--text-1); border-color: var(--amber); }
.avz-loading { display: flex; align-items: center; justify-content: center; height: 580px; color: var(--text-3); font-size: 13px; background: var(--bg); }
