/**
 * Insta Smart - front-end widgets (feed, buttons, floating bubble, site assistant).
 * Fonts are local (Shabnam), no external requests.
 *
 * @package InstaSmart
 * @author  پاندا وردپرس <https://www.rtl-theme.com/author/jakojast/products/>
 */
@font-face { font-family: "InsmShabnam"; src: url("../../assets/fonts/Shabnam.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "InsmShabnam"; src: url("../../assets/fonts/Shabnam-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

.insm-feed { display: grid; grid-template-columns: repeat(var(--insm-cols, 3), minmax(0, 1fr)); gap: 6px; direction: rtl; }
.insm-feed__item { display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 10px; background: #eef2f4; }
.insm-feed__item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.insm-feed__item:hover img { transform: scale(1.05); }
.insm-feed__foot { text-align: center; margin: 10px 0 0; font-family: "InsmShabnam", Tahoma, sans-serif; }
@media (max-width: 600px) { .insm-feed { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.insm-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; background: #0b1220; color: #fff !important; text-decoration: none !important; font: 700 14px/1.6 "InsmShabnam", Tahoma, sans-serif; transition: transform .2s ease, box-shadow .2s ease; }
.insm-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(11, 18, 32, .25); }
.insm-btn--ghost { background: transparent; color: #0b1220 !important; box-shadow: inset 0 0 0 2px #0b1220; }

.insm-float { position: fixed; bottom: 22px; z-index: 99990; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; background: #0d9488; color: #fff !important; text-decoration: none !important; font: 700 14px/1.4 "InsmShabnam", Tahoma, sans-serif; box-shadow: 0 12px 30px rgba(13, 148, 136, .35); }
.insm-float--left { left: 22px; }
.insm-float--right { right: 22px; }
@media (max-width: 600px) { .insm-float span { display: none; } .insm-float { padding: 14px; } }

.insm-assistant { --insm-c: #0d9488; font-family: "InsmShabnam", Tahoma, sans-serif; direction: rtl; }
.insm-as-fab { position: fixed; bottom: 22px; z-index: 99991; width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--insm-c); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: 0 14px 34px rgba(0, 0, 0, .22); }
.insm-as-fab svg { width: 26px; height: 26px; }
.insm-as-left .insm-as-fab, .insm-as-left .insm-as-panel { left: 22px; }
.insm-as-right .insm-as-fab, .insm-as-right .insm-as-panel { right: 22px; }
.insm-as-panel { position: fixed; bottom: 92px; z-index: 99992; width: min(370px, calc(100vw - 32px)); height: min(540px, calc(100vh - 130px)); background: #fff; border-radius: 20px; box-shadow: 0 24px 60px rgba(11, 18, 32, .28); display: flex; flex-direction: column; overflow: hidden; }
.insm-as-panel[hidden] { display: none; }
.insm-as-head { background: var(--insm-c); color: #fff; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
.insm-as-head button { background: rgba(255, 255, 255, .18); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; }
.insm-as-body { flex: 1; overflow-y: auto; padding: 14px; background: #f6f8f9; display: flex; flex-direction: column; gap: 8px; }
.insm-as-msg { max-width: 85%; padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.9; white-space: pre-wrap; word-wrap: break-word; }
.insm-as-msg--bot { background: #fff; color: #0b1220; align-self: flex-start; border-start-start-radius: 4px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.insm-as-msg--me { background: var(--insm-c); color: #fff; align-self: flex-end; border-start-end-radius: 4px; }
.insm-as-links a { display: inline-block; margin: 4px 0 0 6px; font-size: 12px; color: var(--insm-c); }
.insm-as-typing { align-self: flex-start; color: #64748b; font-size: 12px; }
.insm-as-foot { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e7ecef; background: #fff; }
.insm-as-foot input { flex: 1; border: 1px solid #dbe2e6; border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 14px; outline: none; min-width: 0; }
.insm-as-foot input:focus { border-color: var(--insm-c); }
.insm-as-foot button { border: 0; background: var(--insm-c); color: #fff; border-radius: 12px; padding: 0 14px; font: inherit; font-weight: 700; cursor: pointer; }
.insm-as-dm { display: block; text-align: center; padding: 8px; font-size: 12px; color: #475569; text-decoration: none; background: #fff; }
