/* v0.3 — vendor socials on the shop page + chat. Uses each theme's tokens, so shop themes carry over. */

/* ---------- shop page: bio, socials, message button ---------- */
.v-bio { white-space: pre-line; font-size: 15px; }
.v-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; margin-top: 14px; }
.v-socials { gap: 10px; }
.v-socials a { width: 44px; height: 44px; border-radius: 14px; }
.v-socials a svg { width: 22px; height: 22px; }
.s-whatsapp { background: #25d366; }
.v-chat, .p-ask { display: inline-flex; align-items: center; gap: 8px; }
.v-chat svg, .p-ask svg { width: 20px; height: 20px; }
.p-ask { margin-top: 14px; }
.chat-fab {
  position: fixed; bottom: calc(18px + env(safe-area-inset-bottom)); right: 18px; z-index: 30;
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); color: var(--primary-ink); box-shadow: 0 10px 26px rgba(0, 0, 0, .25);
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.chat-fab:hover { transform: scale(1.08); }
.chat-fab svg { width: 28px; height: 28px; }
[dir="rtl"] .chat-fab { right: auto; left: 18px; }

/* ---------- dashboard: social link editor ---------- */
.social-edit { border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px 4px; margin: 0; display: grid; gap: 4px 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.social-edit legend { font-weight: 700; padding: 0 6px; }
.social-edit legend small { font-weight: 400; color: var(--muted); }
.soc-field label { display: flex; align-items: center; gap: 8px; }
.soc-ic { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: #fff; }
.soc-ic svg { width: 15px; height: 15px; }

/* ---------- notifications opt-in ---------- */
.notif-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 0 0 12px;
  border-radius: 16px; background: var(--surface); border: 1px dashed var(--primary);
}
.notif-card > svg { flex: none; width: 26px; height: 26px; color: var(--primary); }
.notif-card p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.notif-card > div { flex: 1; min-width: 0; }
.notif-card .btn { flex: none; }
.notif-ok { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.notif-ok svg { width: 18px; height: 18px; color: var(--primary); }

/* ---------- start-chat (login / sign-up) ---------- */
.chat-auth-head { text-align: center; }
.chat-auth-head .c-av { width: 74px; height: 74px; font-size: 30px; margin: 0 auto; }
.chat-auth-head .page-title { margin-top: 10px; }
.seg { display: flex; margin-bottom: 14px; }
.seg .chip { flex: 1; justify-content: center; }

/* ---------- inbox ---------- */
.chat-shell { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.chat-shell.embedded { grid-template-columns: 1fr; }
.chat-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.chat-list a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); min-height: 64px; transition: border-color .2s, transform .2s;
}
.chat-list a:hover { border-color: var(--primary); }
.chat-list a[aria-current="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; }
.c-av {
  flex: none; width: 46px; height: 46px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--primary); color: var(--primary-ink); font-family: var(--font-head); font-weight: 700; font-size: 20px;
}
.c-av img { width: 100%; height: 100%; object-fit: cover; }
.c-main { flex: 1; min-width: 0; display: grid; }
.c-main b, .c-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-main small { color: var(--muted); }
.c-meta { display: grid; justify-items: end; gap: 4px; font-size: 12px; color: var(--muted); }

.chat-thread {
  display: flex; flex-direction: column; min-height: 0; height: clamp(420px, calc(100vh - 260px), 760px);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow);
}
.chat-thread > .empty { margin: auto; }
.th-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.th-head .grow { flex: 1; min-width: 0; display: grid; }
.th-head .grow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-head small { color: var(--muted); font-size: 12px; }
.th-head .c-av { width: 40px; height: 40px; font-size: 17px; }
.th-head small a { color: inherit; }
.th-call { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); }
.th-call svg { width: 20px; height: 20px; }
.th-back { display: none; width: 40px; height: 40px; place-items: center; border-radius: 50%; color: inherit; }
[dir="rtl"] .th-back svg { transform: scaleX(-1); }
.th-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.th-day { text-align: center; margin: 8px 0; }
.th-day span { font-size: 12px; color: var(--muted); background: var(--surface); padding: 3px 10px; border-radius: 999px; }
.msg {
  max-width: min(78%, 480px); padding: 8px 12px 6px; border-radius: 18px; position: relative;
  background: var(--surface); border: 1px solid var(--border); align-self: flex-start; animation: rise .25s ease-out;
}
.msg.me { align-self: flex-end; background: var(--primary); color: var(--primary-ink); border-color: transparent; border-end-end-radius: 6px; }
.msg.them { border-end-start-radius: 6px; }
.msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg img { border-radius: 12px; max-height: 260px; margin-bottom: 4px; }
.msg time { display: block; text-align: end; font-size: 11px; opacity: .7; margin-top: 2px; }
.th-seen { align-self: flex-end; font-size: 11px; color: var(--muted); margin-top: -2px; }
.th-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: var(--surface); padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.th-compose textarea {
  flex: 1; min-width: 0; resize: none; max-height: 140px; min-height: 44px; padding: 10px 14px; line-height: 1.4;
  border-radius: 22px; border: 1px solid var(--border); background: var(--surface-2); outline: none;
}
.th-compose textarea:focus { border-color: var(--primary); }
.th-photo { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; cursor: pointer; color: var(--muted); }
.th-photo:hover { color: var(--primary); }
.th-send { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; flex: none; display: grid; place-items: center; }
.th-send svg { width: 20px; height: 20px; }

@media (max-width: 760px) {
  .chat-shell { grid-template-columns: 1fr; }
  .chat-shell.has-thread .chat-list { display: none; }
  .chat-shell:not(.has-thread):not(.embedded) .chat-thread { display: none; }
  body.chat-open .masthead, body.chat-open .catnav { display: none; }
  body.chat-open #app { padding-bottom: 8px; }
  .chat-thread { height: calc(100dvh - 64px); border-radius: 18px; }
  .th-back { display: grid; }
  .hide-xs { display: none; }
}
/* Telegram alerts card */
.tg-card > svg, .tg-ok > svg { color: #229ed9; }
.linkish { background: none; border: 0; padding: 0; color: var(--primary); text-decoration: underline; cursor: pointer; font-size: 13px; }
.dash-tg { margin: 0 0 14px; }
.dash-tg .notif-card { border-style: solid; border-color: #229ed9; background: color-mix(in srgb, #229ed9 8%, var(--surface)); }
