/* style.css */
:root {
    --chat-bg-color: #ffffff;
    --chat-body-bg: #f8f9fa;
    --chat-bot-bubble-bg: #f1f3f4;
    --chat-user-bubble-bg: var(--chat-primary-color, #0f52ba);
    --chat-text-light: #ffffff;
    --chat-text-dark: #202124;
    --chat-border-color: #dadce0;
    --chat-header-height: 75px;
    --chat-footer-height: 80px;
}

/* کنترل اسکرول صفحه اصلی */
@media (max-width: 768px) {
    body.goocha-chat-open {
        overflow: hidden !important;
    }
}

body.goocha-chat-open #goocha-chat-bubble {
    animation: none !important;
}

#goocha-chat-container *,
#goocha-chat-container *::before,
#goocha-chat-container *::after {
    box-sizing: border-box;
    margin: 0;
}
#goocha-chat-container {
    content-visibility: visible !important;
}

#goocha-chat-bubble, 
#goocha-chat-window, 
#goocha-quick-contact-btn,
#goocha-quick-contact-overlay {
    z-index: 999999 !important;
}
/* استایل‌های دکمه شناور */
#goocha-chat-bubble {
    position: fixed !important;
    bottom: var(--bubble-bottom-desktop, 20px) !important;
    width: 60px !important;
    height: 60px !important;
    background-color: var(--chat-send-btn-color, var(--chat-primary-color));
    background-image: linear-gradient(-125deg, var(--chat-primary-color) 0%, color-mix(in srgb, var(--chat-primary-color), white 30%) 100%);
    border-radius: 50%;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 99980 !important;
    transition: transform 0.4s cubic-bezier(0.2, 0, 0.2, 1), opacity 0.4s ease, visibility 0.4s ease, box-shadow 0.2s ease !important;
    animation-name: var(--chat-entrance-animation-name, fade-in-up), var(--chat-bubble-animation-name, pulse);
    animation-duration: 0.5s, 14s;
    animation-timing-function: ease-out, ease-in-out;
    animation-delay: 0.5s, 2s;
    animation-iteration-count: 1, infinite;
    animation-fill-mode: both, none;
}
#goocha-chat-bubble.goocha-no-entrance-anim {
    animation-name: var(--chat-bubble-animation-name, pulse) !important;
    animation-duration: 14s !important;
    animation-delay: 2s !important;
    animation-iteration-count: infinite !important;
    animation-fill-mode: none !important;
}

/* کلاس برای مخفی شدن نرم دکمه و تیزر در انتهای سایت */
#goocha-chat-bubble.goocha-hidden-at-bottom,
#goocha-chat-teaser.goocha-hidden-at-bottom,
#goocha-quick-contact-btn.goocha-hidden-at-bottom {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(100px) !important;
    animation: none !important;
    pointer-events: none !important;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0s 0.4s !important;
}

#goocha-chat-bubble:not(.goocha-left) { right: var(--bubble-side-desktop, 20px); left: auto;}
#goocha-chat-bubble.goocha-left { right: auto; left: var(--bubble-side-desktop, 20px); }
#goocha-chat-bubble:hover { transform: scale(1.1); animation-play-state: paused; }
#goocha-chat-bubble[style*="--chat-bubble-animation-name:none"] { animation: none !important; }

/* استایل و انیمیشن سوئیچ شدن آیکون‌ها */
#goocha-chat-bubble .goocha-bubble-icon-main,
#goocha-chat-bubble .goocha-bubble-icon-close {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#goocha-chat-bubble .goocha-bubble-icon-main {
    transform: rotate(0deg) scale(1);
    opacity: 1;
}

#goocha-chat-bubble .goocha-bubble-icon-close {
    transform: rotate(-90deg) scale(0);
    opacity: 0;
    color: #ffffff;
}

body.goocha-chat-open #goocha-chat-bubble .goocha-bubble-icon-main {
    transform: rotate(90deg) scale(0);
    opacity: 0;
}

body.goocha-chat-open #goocha-chat-bubble .goocha-bubble-icon-close {
    transform: rotate(0deg) scale(1);
    opacity: 1;
}

#goocha-chat-bubble .goocha-bubble-icon-main img { 
    width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; 
}
#goocha-chat-bubble .goocha-bubble-icon-main svg.goocha-chat-icon-svg { 
    width: 30px; height: 30px; fill: white; display: block; border-radius: 50%; 
}
#goocha-chat-bubble .goocha-bubble-icon-main span.goocha-chat-icon-fallback { 
    color: white; font-size: 28px; line-height: 0; 
}

/* منوی راه‌های ارتباطی سریع */
#goocha-quick-contact-btn {
    position: fixed !important;
    bottom: calc(var(--bubble-bottom-desktop, 20px) + 7.5px) !important;
    width: 45px !important;
    height: 45px !important;
    background-color: #ffffff;
    border: 1px solid var(--chat-border-color);
    outline: none !important;
    border-radius: 50%;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    color: var(--chat-primary-color);
    z-index: 99979 !important;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.5);
    transition: all 0.4s cubic-bezier(0.2, 0, 0.2, 1);
}
body.goocha-chat-open #goocha-quick-contact-btn {
    opacity: 1; visibility: visible; transform: scale(1);
}
#goocha-quick-contact-btn:not(.goocha-left) {
    right: calc(var(--bubble-side-desktop, 20px) + 75px); left: auto; padding: 10px;
}
#goocha-quick-contact-btn.goocha-left {
    left: calc(var(--bubble-side-desktop, 20px) + 75px); right: auto;
}
#goocha-quick-contact-btn:hover {
    transform: scale(1.1) !important;
}
@media (max-width: 768px) {
    #goocha-quick-contact-btn { bottom: calc(var(--bubble-bottom-mobile, 15px) + 7.5px) !important; }
    #goocha-quick-contact-btn:not(.goocha-left) { right: calc(var(--bubble-side-mobile, 15px) + 75px); }
    #goocha-quick-contact-btn.goocha-left { left: calc(var(--bubble-side-mobile, 15px) + 75px); }
}

/* لایه Overlay منوی ارتباطات روی چت */
#goocha-quick-contact-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
    direction: rtl;
}
#goocha-quick-contact-overlay.is-open {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.goocha-qcm-header {
    background: linear-gradient(-120deg, var(--chat-primary-color), color-mix(in srgb, var(--chat-primary-color), white 20%));
    color: #fff;
    padding: 15px;
    text-align: start;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.goocha-qcm-header strong { display: block; font-weight: bold; }

.goocha-qcm-list {
    list-style: none !important; margin: 0 !important; padding: 15px !important;
    overflow-y: auto; flex: 1;
}
.goocha-qcm-list li { 
    position: relative;
    margin: 0 0 16px 0 !important;
    padding: 0 !important;
}

.goocha-qcm-list li:not(:last-child)::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 5%;
    right: 5%;
    border-bottom: 1px dashed #cbd5e1;
    height: 0;
    pointer-events: none;
}

.goocha-qcm-list li:last-child {
    margin-bottom: 0 !important;
}
.goocha-qcm-list a {
    display: flex; align-items: center; padding: 5px 10px;
    text-decoration: none !important;
    background: #fff;
    border-radius: 12px;
}
.goocha-qcm-list a:hover {
    background: #f5f5f5;
    transform: none;
}

.goocha-qcm-icon {
    width: 44px; height: 44px; border-radius: 12px; display: flex;
    align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}

.goocha-qcm-text { display: flex; flex-direction: column; flex: 1; text-align: start; padding-inline-start: 15px; }
.goocha-qcm-label { font-size: 14px; font-weight: bold;}
.goocha-qcm-desc { font-size: 11px; color: #888; }
.goocha-qcm-arrow { display: flex; align-items: center; padding-left: 5px; }

#goocha-qcm-close-fab {
    background: #ffffff33;
    color: #fff;
    border: none;
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.2s;
    padding: 6px;
}
#goocha-qcm-close-fab:hover { transform: scale(1.1); }

/*  استایل پنجره چت */
#goocha-chat-window {
    position: fixed !important;
    bottom: var(--window-bottom-desktop, 90px) !important;
    width: 390px !important;
    max-width: calc(100% - 40px) !important;
    height: 75vh !important;
    max-height: 650px !important;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,.15);
    z-index: 999990 !important;
    display: flex !important;
    flex-direction: column !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease, width 0.3s ease, height 0.3s ease, max-height 0.3s ease, border-radius 0.3s ease;
    overflow: hidden !important;
}

#goocha-chat-window:not(.goocha-left) { right: var(--window-side-desktop, 20px); left: auto; }
#goocha-chat-window.goocha-left { right: auto; left: var(--window-side-desktop, 20px); }

#goocha-chat-window.is-open {
    opacity: 1;
    visibility: visible;
    animation: fade-in-up 0.3s ease forwards;
}

#goocha-chat-window.is-closing {
    animation: fade-out-down 0.3s ease forwards;
    pointer-events: none;
}

#goocha-chat-window input,
#goocha-chat-window button,
#goocha-chat-window a,
#goocha-chat-window textarea {
    box-sizing: border-box;
}

/* هدر چت */
#goocha-chat-window .goocha-chat-header { 
    background: var(--chat-header-bg, var(--chat-primary-color));
    color: var(--chat-header-text-color, var(--chat-text-light)); 
    padding: 15px; 
    height: var(--chat-header-height);
    border-top-left-radius: 16px; 
    border-top-right-radius: 16px; 
    flex-shrink: 0; 
    display: flex; 
    align-items: center; 
    justify-content: flex-end; 
    direction: rtl; 
    position: relative; 
}
#goocha-chat-window .goocha-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

#goocha-chat-window .goocha-header-actions button:not(.goocha-menu-item) {
    background: #ffffff17  !important;
    border: none !important;
    color: var(--chat-header-text-color, #ffffff) !important;
    cursor: pointer !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    margin: 0 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0.8;
    transition: all 0.2s ease;
    padding: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
}

#goocha-chat-window #goocha-chat-expand {
    transform: rotate(90deg);
}

#goocha-chat-window .goocha-header-actions button:not(.goocha-menu-item):hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2) !important;
}
#goocha-chat-window .goocha-header-actions button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* منوی هدر */
.goocha-chat-menu-wrapper {
    position: relative;
    display: inline-block;
}
#goocha-chat-menu-btn {
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    color: var(--chat-header-text-color, #ffffff) !important;
    opacity: 0.8;
    transition: all 0.2s;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
#goocha-chat-menu-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2) !important;
}
.goocha-chat-menu-dropdown {
    position: absolute;
    top: 40px;
    left: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    min-width: 220px;
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    direction: rtl;
    border: 1px solid #eaeaea;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.goocha-chat-menu-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.goocha-menu-item {
    background: #ffffff !important;
    border: none !important;
    padding: 12px 15px !important;
    text-align: right!important;
    cursor: pointer;
    font-size: 13px !important;
    color: #333 !important;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
    width: 100%;
    font-family: inherit;
    border-bottom: 1px solid #f0f0f0 !important;
    box-shadow: none !important;
    outline: none;
}
.goocha-menu-item:last-child {
    border-bottom: none !important;
}
.goocha-menu-item:hover {
    background: #f0f2f5 !important;
}
.goocha-menu-toggle-item {
    justify-content: space-between;
    cursor: default;
}
.goocha-menu-toggle-item:hover {
    background: #ffffff !important;
}

.goocha-switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
}
.goocha-switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.goocha-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}
.goocha-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}
.goocha-switch input:checked + .goocha-slider {
  background-color: var(--chat-primary-color, #0f52ba);
}
.goocha-switch input:focus + .goocha-slider {
  box-shadow: 0 0 1px var(--chat-primary-color, #0f52ba);
}
.goocha-switch input:checked + .goocha-slider:before {
  transform: translateX(14px);
}
.goocha-slider.round {
  border-radius: 20px;
}
.goocha-slider.round:before {
  border-radius: 50%;
}

#goocha-chat-container.goocha-ltr .goocha-chat-menu-dropdown {
    left: auto;
    right: 0;
    direction: ltr;
    text-align: left;
}
#goocha-chat-container.goocha-ltr .goocha-menu-item {
    text-align: left;
}
#goocha-chat-container.goocha-ltr .goocha-switch input:checked + .goocha-slider:before {
    transform: translateX(14px);
}
#goocha-chat-window .goocha-header-actions button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* استایل حالت بزرگنمایی */
#goocha-chat-window.is-expanded {
    width: 600px !important;
    max-width: calc(100% - 40px) !important;
    height: 80vh !important;
    max-height: 800px !important;
    transition: width 0.3s ease, height 0.3s ease, max-height 0.3s ease, bottom 0.3s ease, right 0.3s ease, left 0.3s ease, border-radius 0.3s ease;
}

@media (max-width: 768px) {
    #goocha-chat-window.is-expanded {
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        border-radius: 0 !important;
        transform: translateY(0) !important;
    }
    #goocha-chat-window.is-expanded .goocha-chat-header {
        border-radius: 0 !important;
    }
    #goocha-chat-window.is-expanded .goocha-chat-input-container {
        border-radius: 0 !important;
        align-items: flex-start;
        padding-bottom: env(safe-area-inset-bottom, 12px) !important;
    }
}
#goocha-chat-window .header-avatar { position: relative; width: 50px; height: 50px; }
#goocha-chat-window .header-info { text-align: right; margin-right: 10px; margin-left: 25px; flex-grow: 1; }
#goocha-chat-window .header-info .title { font-weight: 600; font-size: 17px; color: var(--chat-header-text-color, #fff); margin: 0; }
#goocha-chat-window .header-info .subtitle { font-size: 13px; opacity: .85; }
#goocha-chat-window .header-avatar img { width: 48px; height: 48px; border-radius: 50%!important; background: #fff; padding: 4px; object-fit: cover; }
#goocha-chat-window .header-avatar .online-indicator { width: 12px; height: 12px; background-color: #2ed573; border-radius: 12px!important; border: 2px solid var(--chat-header-bg, var(--chat-primary-color)); position: absolute; top: 0px; left: 2px; animation: goocha-online-pulse 2s infinite;}
@keyframes goocha-online-pulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 213, 115, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(46, 213, 115, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 213, 115, 0); }
}

/* بدنه پیام‌ها */
#goocha-chat-window .goocha-chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg-color, #f8f9fa); 
    gap: 8px;
    transition: padding-bottom 0.25s ease;
}

/* حفظ ثابت پدینگ پایین پیام‌ها برای جلوگیری از پرش هنگام نمایش فرم ادامه گفتگو */
#goocha-chat-window:has(#goocha-action-buttons-wrapper:not(:empty)) .goocha-chat-messages {
    padding-bottom: 70px;
}
#goocha-chat-window .goocha-chat-messages::-webkit-scrollbar { width: 6px; }
#goocha-chat-window .goocha-chat-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
#goocha-chat-window .goocha-chat-messages::-webkit-scrollbar-track { background: transparent; }

/* استایل پیام‌ها */
#goocha-chat-window .goocha-message {
    display: flex;
    align-items: flex-end;
    animation: goocha-fade-in 0.4s ease;
    flex-direction: row-reverse;
}
#goocha-chat-window .goocha-message.incoming { justify-content: flex-start; flex-direction: row-reverse; }
#goocha-chat-window .goocha-message.outgoing { display: flex; flex-direction: row; }
#goocha-chat-window .goocha-message.goocha-message-outgoing { display: flex; flex-direction: row; }

#goocha-chat-window .goocha-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin: 0 8px 0 4px;
    flex-shrink: 0;
    align-self: flex-end; 
    margin-bottom: 5px;  
    margin-top: 0;
}
#goocha-chat-window .goocha-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%!important;
    border: solid 1px #dadce0;
    object-fit: cover;
    margin: 8px 0px 0px 0px;
}

#goocha-chat-window .goocha-bubble {
    max-width: 100%; 
    padding: 12px 16px;
    border-radius: 18px 18px 18px 5px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
    font-size: 15px;
    margin: 2px 0;
}
#goocha-chat-window .goocha-bubble-bot {
    background: var(--chat-bot-bubble-color, var(--chat-bot-bubble-bg));
    color: var(--chat-bot-text-color, var(--chat-text-dark));
    border-bottom-left-radius: 4px;
}
#goocha-chat-window .goocha-bubble-operator {
    background: var(--chat-op-bubble-color, var(--chat-bot-bubble-bg));
    color: var(--chat-op-text-color, var(--chat-text-dark));
    border-bottom-left-radius: 4px;
}
#goocha-chat-window .goocha-bubble-user {
    background: var(--chat-user-bubble-color, var(--chat-user-bubble-bg));
    color: var(--chat-user-text-color, var(--chat-text-light));
    border-bottom-right-radius: 5px!important;
    border-radius:18px;
}

#goocha-chat-window .goocha-bubble h1,
#goocha-chat-window .goocha-bubble h2,
#goocha-chat-window .goocha-bubble h3,
#goocha-chat-window .goocha-bubble h4,
#goocha-chat-window .goocha-bubble h5,
#goocha-chat-window .goocha-bubble h6 {
    margin-top: 10px;
    margin-bottom: 8px;
    font-weight: 600;
    line-height: 1.4;
    color: inherit;
    font-family: inherit !important;
}
#goocha-chat-window .goocha-bubble h1 { font-size: 1.3em; }
#goocha-chat-window .goocha-bubble h2 { font-size: 1.2em; }
#goocha-chat-window .goocha-bubble h3 { font-size: 1.1em; }
#goocha-chat-window .goocha-bubble h4 { font-size: 1.05em; }
#goocha-chat-window .goocha-bubble h5 { font-size: 1em; }
#goocha-chat-window .goocha-bubble h6 { font-size: 0.95em; }

/* پیام خوش‌آمدگویی */
#goocha-chat-window .goocha-welcome-message {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    flex-direction: row-reverse;
    animation: goocha-fade-in 0.4s ease;
    margin-bottom: 5px;
}
#goocha-chat-window .goocha-welcome-message .goocha-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin: 0 8px;
    flex-shrink: 0;
}
#goocha-chat-window .goocha-welcome-message .goocha-bubble {
    background: var(--chat-bot-bubble-bg);
    color: var(--chat-text-dark);
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px 18px 18px 5px;
    line-height: 1.6;
    word-wrap: break-word;
    font-size: 15px;
    margin: 2px 0;
}

/* پیام سیستم */
#goocha-chat-window .goocha-message.goocha-message-system { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    margin: 12px 0; 
    width: 100%;
    animation: goocha-fade-in 0.4s ease;
}

#goocha-chat-window .goocha-system-pill {
    display: inline-flex;
    align-items: center;
    background-color: #eaf5eb;
    color: #198754;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

#goocha-chat-window .goocha-system-pill img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* هماهنگی برای حالت چپ‌چین (انگلیسی) */
#goocha-chat-container.goocha-ltr .goocha-system-pill {
    padding: 4px 4px 4px 12px;
    direction: ltr;
}

/* لینک‌ها و تصاویر داخل حباب */
#goocha-chat-window .goocha-bubble a { 
    color: var(--chat-primary-color) !important; 
    text-decoration: none !important; 
    font-weight: 500;
    background: none !important;
    border: none !important;
}
#goocha-chat-window .goocha-bubble-user a { color: var(--chat-text-light) !important; text-decoration: underline !important; }
#goocha-chat-window .goocha-bubble img { max-width: 100%; cursor: pointer; }
#goocha-chat-window .goocha-bubble-container { display: flex; flex-direction: column; max-width: 75%; }

/* متادیتا و دکمه‌های بازخورد */
#goocha-chat-window .goocha-message-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px; 
    padding: 0 5px 2px 5px; 
    direction: ltr;
    opacity: 0.7;
    transition: opacity 0.2s;
    line-height: 1.2;
}
#goocha-chat-window .goocha-message[data-message-id="welcome"] .goocha-message-meta { display: none !important; }
#goocha-chat-window .goocha-bubble-container:hover .goocha-message-meta { opacity: 1; }
#goocha-chat-window .goocha-message-incoming .goocha-message-meta { justify-content: flex-start; }
#goocha-chat-window .goocha-message-outgoing .goocha-message-meta { justify-content: flex-end; }
#goocha-chat-window .goocha-meta-item.goocha-meta-time { font-size: 10px; color: #999; margin-right: 5px; }
#goocha-chat-window .goocha-meta-btn {
    background: none !important;
    border: none !important;
    padding: 2px !important;
    margin: 0 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    color: #888;
    transition: all 0.2s;
    opacity: 0;
    visibility: hidden;
}
#goocha-chat-window .goocha-bubble-container:hover .goocha-meta-btn { opacity: 1; visibility: visible; }
#goocha-chat-window .goocha-meta-btn:hover { color: var(--chat-primary-color); transform: scale(1.1); }
#goocha-chat-window .goocha-meta-btn svg { width: 14px; height: 14px; fill: currentColor; }
#goocha-chat-window .goocha-like-btn.selected { color: #2ed573 !important; }
#goocha-chat-window .goocha-dislike-btn.selected { color: #ff4757 !important; }
#goocha-chat-window .goocha-meta-btn:active { transform: scale(0.9); }
@media (min-width: 769px) {
    #goocha-chat-window .goocha-bubble-container:hover .goocha-message-meta .goocha-meta-btn { opacity: 0.5; visibility: visible; }
    #goocha-chat-window .goocha-bubble-container:hover .goocha-message-meta .goocha-meta-btn:hover { opacity: 1; }
}

/* سوالات متداول و دکمه‌های اکشن */
#goocha-chat-window .goocha-preset-questions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0px 0 20px 0; 
    padding: 0 5px;
    animation: goocha-fade-in 0.4s ease;
    justify-content: flex-end;
}
#goocha-chat-window .goocha-preset-btn {
    background: var(--chat-faq-btn-color, var(--chat-bg-color)) !important;
    border: 1px solid var(--chat-border-color) !important;
    border-radius: 20px !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    cursor: pointer !important;
    transition: all 0.2s;
    color: var(--chat-faq-btn-text-color, var(--chat-text-dark)) !important; 
    text-align: start !important;
    text-decoration: none !important;
    display: inline-block;
    line-height: 1.5 !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    flex-shrink: 0;
    width: auto;
    max-width: 100% !important;
    height: auto !important;
    box-shadow: none !important;
}
#goocha-chat-window .goocha-preset-btn:hover {
    background: var(--chat-bot-bubble-bg) !important;
    border-color: var(--chat-primary-color) !important;
    transform: translateY(-1px);
}

#goocha-action-buttons-wrapper {
    position: absolute;
    bottom: var(--chat-footer-height);
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    background-color: transparent !important;
    padding: 0 16px 18px;
    z-index: 20;
    transition: all 0.3s ease;
    pointer-events: none;
    display: flex;
    justify-content: center;
}
#goocha-action-buttons-wrapper:empty {
    display: none !important;
}
#goocha-action-buttons-wrapper.is-hidden-by-form {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(10px);
}
#goocha-action-buttons-wrapper.is-disabled {
    opacity: 0.45 !important;
    pointer-events: none !important;
}
#goocha-action-buttons-wrapper.is-disabled .goocha-action-buttons,
#goocha-action-buttons-wrapper.is-disabled .goocha-action-button {
    pointer-events: none !important;
    cursor: not-allowed !important;
}
#goocha-chat-window .goocha-action-buttons {
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    animation: goocha-fade-in 0.3s ease;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: stretch;
    pointer-events: auto;
}
#goocha-chat-window .goocha-action-button {
    background: var(--chat-action-btn-color, rgba(255, 255, 255, 0.88)) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid var(--chat-border-color) !important;
    border-radius: 20px !important;
    padding: 8px 12px !important;
    font-size: 12.5px !important;
    cursor: pointer !important;
    transition: all 0.2s;
    color: var(--chat-action-btn-text-color, var(--chat-text-dark)) !important; 
    text-align: center;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4 !important;
    flex: 1 1 0%;
    min-width: 0 !important;
    max-width: 100% !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    height: auto !important;
}
#goocha-chat-window .goocha-action-button:only-child {
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 150px !important;
    max-width: calc(100% - 16px) !important;
    padding: 8px 20px !important;
}

@media (max-width: 768px) {
    #goocha-action-buttons-wrapper {
        padding: 0 14px 14px;
    }
    #goocha-chat-window .goocha-action-button {
        font-size: 12px !important;
        padding: 8px 10px !important;
    }
    #goocha-chat-window .goocha-action-button:only-child {
        width: auto !important;
        min-width: 160px !important;
        max-width: 85% !important;
    }
}
#goocha-chat-window .goocha-action-button:hover {
    background: var(--chat-bot-bubble-bg) !important;
    border-color: var(--chat-primary-color) !important;
    transform: translateY(-1px);
}

/* چیپ‌های هوشمند */
.goocha-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 5px 0 10px 0!important;
    justify-content: flex-end;
    padding: 0 10px;
    opacity: 0;
    animation: goocha-fade-in 0.5s ease forwards;
    animation-delay: 0.3s;
}
/* اصلاح استایل چیپ‌های داخل حباب */
.goocha-bubble-container .goocha-chips-container {
    margin-top: 8px !important;
    justify-content: flex-end;
    padding: 0;
}
.goocha-chip-btn {
    background: #fff!important;
    border: 1px solid var(--chat-suggested-q-color, var(--chat-primary-color))!important;
    color: var(--chat-suggested-q-color, var(--chat-primary-color))!important;
    border-radius: 12px!important;
    padding: 6px 10px!important;
    font-size: 12px!important;
    cursor: pointer!important;
    transition: all 0.2s ease!important;
    box-shadow: 0 1px 2px rgba(0,0,0,.05)!important;
    margin: 0px;
    max-width: 100% !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.5 !important;
    height: auto !important;
    text-align: start !important;
}
.goocha-chip-btn:hover {
    background: var(--chat-suggested-q-color, var(--chat-primary-color)) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

/* تایپینگ ایندیکیتور */
#goocha-chat-window .goocha-typing-indicator { display: flex; align-items: center; padding: 5px 0; }
#goocha-chat-window .goocha-typing-indicator span {
    width: 8px; height: 8px; background-color: #9db2c2; border-radius: 50%;
    animation: typing-anim 1.2s infinite ease-in-out; margin: 0 2px;
}
#goocha-chat-window .goocha-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
#goocha-chat-window .goocha-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* کارت محصول و اسلایدر */
#goocha-chat-window .goocha-bubble.goocha-product-card-bubble {
    background: transparent; padding: 0; border: none; box-shadow: none; max-width: 100%; margin-top: 5px; width: 100%;
}

#goocha-chat-window .goocha-slider-container {
    width: 100%;
    margin-top: 8px;
}

#goocha-chat-window .goocha-product-slider {
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    padding: 4px 4px 10px 4px !important;
    direction: rtl !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
#goocha-chat-window .goocha-product-slider::-webkit-scrollbar {
    display: none;
}

/* مدیریت ردیف‌ها با Grid */
.style-1-container .goocha-product-slider { 
    grid-template-rows: 1fr; 
}
.style-2-container .goocha-product-slider { 
    grid-template-rows: auto auto; 
    grid-auto-columns: 88%;
}

#goocha-chat-window .goocha-product-card {
    background: #ffffff;
    border: 1px solid var(--chat-border-color, #eaeaea);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
    direction: rtl;
    text-align: right;
    position: relative;
    scroll-snap-align: center;
}

#goocha-chat-window .goocha-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    border-color: var(--chat-primary-color);
}

/* استایل 1: عمودی */
#goocha-chat-window .goocha-product-card.style-1 {
    display: flex; flex-direction: column; 
    width: 220px !important; min-width: 100% !important; max-width: 220px !important;
    height: 100%;
}
#goocha-chat-window .goocha-product-card.style-1 .goocha-product-image {
    width: 100%; height: auto; background: transparent; display: flex; align-items: center; justify-content: center; position: relative;
    overflow: visible; margin-bottom: 10px;
}
#goocha-chat-window .goocha-product-card.style-1 .goocha-product-image img {
    width: 100%; height: auto; max-height: 150px; object-fit: contain; border-bottom: 1px solid #eaeaea; border-radius: 12px 12px 0 0; display: block;
}

/* استایل 2: افقی */
#goocha-chat-window .goocha-product-card.style-2 {
    display: flex; 
    flex-direction: row; 
    width: 100% !important;
    max-width: 100% !important;
    height: auto; 
    align-items: stretch;
}
#goocha-chat-window .goocha-product-card.style-2 .goocha-product-image {
    width: 100px; flex-shrink: 0; background: #ffffff; border-left: 1px solid var(--chat-border-color, #eaeaea); 
    display: flex; align-items: center; justify-content: center; position: relative; padding: 6px; box-sizing: border-box;
}
#goocha-chat-window .goocha-product-card.style-2 .goocha-product-image {
    margin-bottom: 0;
}
#goocha-chat-window .goocha-product-card.style-2 .goocha-product-price-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    margin-top: auto;
}
#goocha-chat-window .goocha-product-card.style-2 .goocha-product-image img {
    width: 100%; height: auto; object-fit: contain; border-radius: 6px;
}

#goocha-chat-window .goocha-product-details {
    padding: 10px; display: flex; flex-direction: column; flex-grow: 1; justify-content: space-between; gap: 5px;
    min-width: 0;
}

#goocha-chat-window .goocha-product-title {
    font-size: 14px; font-weight: 500; color: #2d3436; margin: 0; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
#goocha-chat-window .goocha-product-card.style-2 .goocha-product-title { -webkit-line-clamp: 1; }

/* چیدمان قیمت و آیکون SVG */
#goocha-chat-window .goocha-product-price { 
    font-size: 14px; font-weight: 800; color: var(--chat-primary-color);
    display: flex; align-items: center; justify-content: flex-end; flex-direction: row; gap: 4px;
}
#goocha-chat-window .goocha-product-price.goocha-has-discount {
    flex-direction: column; align-items: flex-end; justify-content: flex-start; gap: 0;
}
#goocha-chat-window .goocha-product-price del,
#goocha-chat-window .goocha-old-price {
    color: #aab2bd !important; font-size: 11px !important; font-weight: 400 !important; text-decoration: none !important;
    display: flex; align-items: center; flex-direction: row; gap: 3px; margin-bottom: 2px;
}
#goocha-chat-window .goocha-old-price .goocha-price-amount {
    text-decoration: line-through !important;
}
#goocha-chat-window .goocha-discount-inline-badge {
    background-color: #e91140;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    border-radius: 5px;
    padding: 0 5px;
    height: 19px;
    margin-right: 2px;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
#goocha-chat-window .goocha-product-rating {
    position: absolute;
    bottom: -10px;
    right: 10px;
    background: #ffffff;
    border: 1px solid var(--chat-border-color, #eaeaea);
    border-radius: 12px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    box-shadow: 0 3px 6px rgba(0,0,0,0.08);
    z-index: 3;
}
#goocha-chat-window .goocha-product-card.style-2 .goocha-product-rating {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0;
    font-size: 12px;
}
#goocha-chat-window .goocha-product-price ins,
#goocha-chat-window .goocha-new-price {
    color: var(--chat-primary-color) !important; font-size: 15px !important; font-weight: 800 !important; text-decoration: none !important;
    display: flex; align-items: center; flex-direction: row; gap: 3px;
}
.goocha-toman-icon { color: #000; }

#goocha-chat-window .goocha-price-prefix {
    font-size: 10px;
    color: #888;
    margin-left: 4px;
    font-weight: normal;
}

#goocha-chat-window .goocha-star-icon {
    padding-bottom: 2px;
}

#goocha-chat-window .goocha-product-buttons { 
    display: flex; gap: 6px; margin-top: auto; width: 100%;
}
#goocha-chat-window .goocha-product-btn {
    flex: 1; text-align: center; border-radius: 8px !important; text-decoration: none !important;
    font-size: 11px !important; font-weight: 600; padding: 7px 4px !important;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s; white-space: nowrap; box-shadow: none !important;
}

#goocha-chat-window .goocha-product-btn.view { 
    background: #f0f2f5 !important; color: #555 !important; 
}
#goocha-chat-window .goocha-product-btn.view:hover { 
    background: #e4e6e9 !important; color: #333 !important; 
}
#goocha-chat-window .goocha-product-btn.add-to-cart { 
    background: var(--chat-primary-color) !important; color: #fff !important; 
}
#goocha-chat-window .goocha-product-btn.add-to-cart:hover { 
    opacity: 0.9; transform: translateY(-1px);
}

#goocha-chat-window .goocha-product-card.style-2 .goocha-product-price {
    margin-right: auto;
}

#goocha-chat-container.goocha-ltr .goocha-product-card.style-2 .goocha-product-price {
    margin-right: 0;
    margin-left: auto;
}

/* نقاط اسلایدر */
.goocha-slider-dots {
    display: flex; justify-content: center; gap: 6px; padding-top: 5px; margin-bottom: 5px;
}
.goocha-slider-dots .goocha-dot {
    width: 6px; height: 6px; border-radius: 50%; background: #d1d5db; cursor: pointer; transition: all 0.3s;
}
.goocha-slider-dots .goocha-dot.active {
    width: 15px; border-radius: 4px; background: var(--chat-primary-color);
}

#goocha-chat-container.goocha-ltr .goocha-product-card { direction: ltr; text-align: left; }
#goocha-chat-container.goocha-ltr .style-2 .goocha-product-image { border-left: none; border-right: 1px solid var(--chat-border-color, #eaeaea); }
#goocha-chat-container.goocha-ltr .goocha-product-card.style-2 .goocha-product-image img { border-radius: 6px; }
#goocha-chat-container.goocha-ltr .goocha-product-price { flex-direction: row; }

/* ورودی پیام و ابزارها */
#goocha-chat-window .goocha-chat-input-container {
    padding: 15px 12px;
    border-top: 1px solid var(--chat-border-color);
    background-color: var(--chat-input-bg-color, #ffffff) !important;
    flex-shrink: 0;
    min-height: var(--chat-footer-height);
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}
#goocha-chat-window .goocha-chat-input-container:has(.goocha-chat-copyright) {
    padding: 8px 12px 6px; 
}
#goocha-chat-window #goocha-chat-form { 
    display: flex; 
    align-items: center; 
    gap: 5px; 
    width: 100%; 
    background-color: rgba(0, 0, 0, 0.04); 
    border-radius: 30px; 
    padding: 6px;
    transition: all 0.3s ease;
}
#goocha-chat-window #goocha-chat-send {
    background-color: var(--chat-send-btn-color, var(--chat-primary-color)) !important; border: none !important; border-radius: 50% !important;
    width: 45px !important; height: 45px !important; cursor: pointer !important; display: flex !important;
    align-items: center; justify-content: center; flex-shrink: 0; transition: background-color .2s, transform 0.2s;
    padding: 0 !important; box-shadow: none !important; margin-left: 5px;
}
#goocha-chat-window #goocha-chat-send:hover { background-color: var(--chat-send-btn-color, var(--chat-primary-color)) !important;
    filter: brightness(1.2) !important; }
#goocha-chat-window #goocha-chat-send:active { transform: scale(0.9); }
#goocha-chat-window #goocha-chat-send svg { width: 35px; height: 35px; fill: #fff; margin-right: 0px; }

#goocha-chat-window .goocha-input-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
    background-color: transparent;
    border-radius: 26px;
    flex-direction: row;
    transition: all 0.3s ease;
}

/* استایل درگ اند دراپ - ورود به کل صفحه مرورگر */
#goocha-chat-window .goocha-input-wrapper.goocha-global-drag {
    border: 2px dashed #999 !important;
}

/* استایل درگ اند دراپ - رفتن دقیقاً روی کادر */
#goocha-chat-window .goocha-input-wrapper.goocha-drag-over {
    background-color: rgba(15, 82, 186, 0.08) !important;
    border: 2px dashed var(--chat-primary-color) !important;
}

#goocha-chat-window #goocha-chat-input {
    flex-grow: 1; width: auto !important; height: 46px !important; background: transparent !important; border: none !important; 
    padding: 12px 10px 12px 10px !important; 
    outline: 0 !important; font-size: 15px !important; direction: rtl; 
    resize: none !important; margin: 0 !important; box-shadow: none !important;
    line-height: 22px !important; min-height: auto !important; color: #333 !important;
    order: 1; 
}

/* مدیریت ترتیب نمایش دکمه‌ها از راست به چپ */
#goocha-chat-window #goocha-record-btn { order: 2; margin: 0 !important; }
#goocha-chat-window #goocha-attach-btn { order: 3; margin: 0 0 0 8px !important; }
#goocha-chat-window .goocha-record-timer { order: 4; margin-right: 10px; color: #ff3b30; font-size: 14px; font-weight: 500; display: none; }

#goocha-chat-window #goocha-attach-btn, 
#goocha-chat-window #goocha-record-btn { 
    position: static !important;
    transform: none !important; background: transparent !important; color: #7B7B7B !important; 
    border: none !important; cursor: pointer !important; padding: 5px !important; opacity: 0.8; transition: all 0.2s; 
    display: flex; align-items: center; justify-content: center; box-shadow: none !important; width: auto !important; height: auto !important;
    flex-shrink: 0;
}
#goocha-chat-window #goocha-attach-btn:hover, 
#goocha-chat-window #goocha-record-btn:hover { opacity: 1; color: var(--chat-primary-color) !important; transform: scale(1.05) !important;}
#goocha-chat-window #goocha-attach-btn svg, 
#goocha-chat-window #goocha-record-btn svg { width: 22px; height: 22px; }
#goocha-chat-window #goocha-record-btn.is-recording { color: #ff3b30 !important; opacity: 1; animation: pulse 1.5s infinite; }
#goocha-chat-window #goocha-record-btn.is-recording svg { fill: currentColor; }

/* پخش کننده صوتی */
.goocha-audio-player {
    display: flex; align-items: center; gap: 8px; width: 240px; max-width: 100%;
    background: rgb(176 176 176 / 20%); padding: 5px; border-radius: 25px; direction: ltr;
}
#goocha-chat-window .goocha-play-pause-btn { 
    width: 32px !important; height: 32px !important; border-radius: 50% !important; border: none !important;
    cursor: pointer !important; flex-shrink: 0; background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333' width='18px' height='18px'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; box-shadow: 0 2px 5px rgba(0,0,0,0.1); transition: transform 0.1s;
}
#goocha-chat-window .goocha-message.incoming .goocha-play-pause-btn {
    background-color: var(--chat-primary-color) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff' width='18px' height='18px'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
    border: none !important;
}
#goocha-chat-window .goocha-message.incoming .goocha-play-pause-btn.playing {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff' width='18px' height='18px'%3E%3Cpath d='M6 19h4V5H6v14zm8-14v14h4V5h-4z'/%3E%3C/svg%3E");
}
#goocha-chat-window .goocha-message.outgoing .goocha-play-pause-btn {
    background-color: rgba(255, 255, 255, 0.25) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff' width='18px' height='18px'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
    border: none !important;
}
#goocha-chat-window .goocha-message.outgoing .goocha-play-pause-btn.playing {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff' width='18px' height='18px'%3E%3Cpath d='M6 19h4V5H6v14zm8-14v14h4V5h-4z'/%3E%3C/svg%3E");
}
.goocha-play-pause-btn.playing {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333' width='18px' height='18px'%3E%3Cpath d='M6 19h4V5H6v14zm8-14v14h4V5h-4z'/%3E%3C/svg%3E");
}
.goocha-audio-progress-container {
    flex-grow: 1; height: 6px; background-color: rgba(0, 0, 0, 0.1); border-radius: 3px;
    cursor: pointer; position: relative; overflow: hidden;
}
#goocha-chat-window .goocha-message.incoming .goocha-audio-progress-container { background-color: #c9d2db; }
.goocha-audio-progress-bar { height: 100%; width: 0%; background-color: #fff; border-radius: 3px; transition: width 0.1s linear; }
#goocha-chat-window .goocha-message.incoming .goocha-audio-progress-bar { background-color: var(--chat-primary-color); }
.goocha-audio-time { font-size: 11px; font-family: monospace; color: inherit; min-width: 35px; text-align: center; margin-left: 5px; }
#goocha-chat-window .goocha-message.incoming .goocha-audio-time { color: var(--chat-text-dark); }

/* فرم پیش از چت */
#goocha-chat-window .goocha-bubble.goocha-pre-chat-bubble {
    background: var(--chat-bg-color); color: var(--chat-text-dark); padding: 0; border-radius: 12px;
    border: 1px solid var(--chat-border-color); max-width: 100%; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
#goocha-chat-window .goocha-pre-chat-container { padding: 20px 18px 15px 18px; direction: rtl; text-align: right; }
#goocha-chat-window .goocha-pre-chat-title { font-size: 16px; font-weight: 600; color: var(--chat-text-dark); margin-bottom: 8px; text-align: center; }
#goocha-chat-window .goocha-pre-chat-subtitle { font-size: 14px; line-height: 1.6; margin-bottom: 15px!important; color: #3b3b3b; text-align: right!important; }
#goocha-chat-window .goocha-pre-chat-header { display: none; }
#goocha-chat-window .goocha-pre-chat-form-group { margin-bottom: 12px; }
#goocha-chat-window .goocha-pre-chat-form-group label { display: none; }
#goocha-chat-window .goocha-pre-chat-input-wrapper { position: relative; display: flex; align-items: center; }
#goocha-chat-window .goocha-form-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 14px;
    color: #64748b;
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    transition: color 0.2s ease;
}
#goocha-chat-window .goocha-pre-chat-input-wrapper.is-textarea-wrapper .goocha-form-icon {
    top: 15px;
    transform: none;
}
#goocha-chat-window .goocha-form-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}
#goocha-chat-window .goocha-pre-chat-input-wrapper:focus-within .goocha-form-icon {
    color: var(--chat-primary-color, #0f52ba);
}
#goocha-chat-window .goocha-pre-chat-form-group input[type="text"],
#goocha-chat-window .goocha-pre-chat-form-group input[type="email"],
#goocha-chat-window .goocha-pre-chat-form-group input[type="tel"],
#goocha-chat-window .goocha-pre-chat-form-group input[type="number"],
#goocha-chat-window .goocha-pre-chat-form-group textarea {
    width: 100% !important; padding: 12px 45px 12px 18px !important; border: 1px solid var(--chat-border-color) !important;
    border-radius: 10px !important; box-sizing: border-box; font-size: 14px !important;
    background-color: #f7f7f7 !important; direction: rtl; transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: none !important; line-height: 1.5 !important; height: auto !important; color: #333 !important;
}
#goocha-chat-window .goocha-pre-chat-form-group textarea { resize: vertical; min-height: 80px !important; }
#goocha-chat-window .goocha-pre-chat-form-group input::placeholder { color: #999; }
#goocha-chat-window .goocha-pre-chat-form-group input:focus,
#goocha-chat-window .goocha-pre-chat-form-group textarea:focus {
    border-color: var(--chat-primary-color) !important; background-color: #fff !important;
    box-shadow: 0 0 0 2px rgba(13, 130, 255, 0.2) !important; outline: none !important;
}
#goocha-chat-window .goocha-pre-chat-submit {
    background-color: var(--chat-primary-color) !important; color: #fff !important; border: none !important;
    padding: 12px 18px !important; border-radius: 10px !important; width: 100% !important; font-size: 15px !important;
    font-weight: 500 !important; cursor: pointer !important; transition: background-color 0.2s !important;
    display: flex !important; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; box-shadow: none !important;
}
#goocha-chat-window .goocha-pre-chat-submit:hover { opacity: 0.9; }
#goocha-chat-window .goocha-pre-chat-submit:disabled { background-color: #ccc !important; cursor: not-allowed; }
#goocha-chat-window .goocha-pre-chat-status { font-size: 13px; margin-top: 10px; text-align: center; font-weight: 500; padding: 5px; }
#goocha-chat-window .goocha-loader {
    width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
    border-radius: 50%; animation: goocha-spin 0.8s linear infinite;
}

/* فرم ارسال تاریخچه به ایمیل */
.goocha-export-container {
    background: var(--chat-bg-color); border: 1px solid var(--chat-border-color); border-radius: 12px;
    padding: 20px; margin-top: 10px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.goocha-export-container p { font-size: 14px; color: var(--chat-text-dark); margin-bottom: 15px; }
.goocha-export-container input[type="email"] {
    width: 100% !important; padding: 10px !important; border: 1px solid #ccc !important;
    border-radius: 8px !important; margin-bottom: 10px !important; background: #f9f9f9;
}
.goocha-export-container button#goocha-export-btn {
    width: 100%; background: var(--chat-primary-color) !important; color: #fff !important;
    border: none; padding: 10px; border-radius: 8px; cursor: pointer; font-weight: 500;
}
.goocha-export-container button#goocha-skip-export {
    background: transparent !important; color: #888 !important; margin-top: 10px; border: none; cursor: pointer; font-size: 12px;
}
.goocha-export-wrapper input:focus { border-color: var(--chat-primary-color) !important; outline: none; }
.goocha-export-wrapper button:hover { opacity: 0.9; }

/* مودال تایید */
#goocha-confirm-modal-overlay { 
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6); 
    display: none; align-items: center; justify-content: center; z-index: 999995 !important;
    opacity: 0; transition: opacity 0.3s ease; direction: rtl;
}
#goocha-confirm-modal { 
    background: #fff; padding: 25px 30px; border-radius: 12px; text-align: center; box-shadow: 0 5px 20px rgba(0,0,0,0.2); 
    transform: scale(0.9); opacity: 0; transition: transform 0.3s ease, opacity 0.3s ease; width: 90%; 
    max-width: 320px; visibility: hidden;
}
#goocha-confirm-modal p { margin: 0 0 20px 0; font-size: 16px; color: #333; line-height: 1.6; }
#goocha-confirm-modal .goocha-modal-buttons { display: flex; gap: 10px; }
#goocha-confirm-modal .goocha-modal-buttons button { 
    flex-grow: 1; border: none !important; padding: 12px !important; border-radius: 8px !important; 
    cursor: pointer !important; font-size: 15px !important; font-weight: 500 !important; 
    transition: all 0.2s; line-height: 1.5 !important; height: auto !important; box-shadow: none !important;
}
#goocha-confirm-modal #goocha-confirm-yes { background-color: var(--chat-primary-color) !important; color: #fff !important; }
#goocha-confirm-modal #goocha-confirm-yes:hover { background-color: #3E76C8!important; }
#goocha-confirm-modal #goocha-confirm-no { background-color: #f0f2f5 !important; color: #333 !important; }
#goocha-confirm-modal #goocha-confirm-no:hover { background-color: #e4e6e9 !important; }

/* --- استایل دکمه چت جدید --- */
#goocha-chat-window .goocha-new-chat-container { text-align: center; padding: 15px; direction: rtl; }
#goocha-chat-window #goocha-start-new-chat {
    background: var(--chat-primary-color) !important; color: var(--chat-text-light) !important; border: none !important;
    border-radius: 20px !important; padding: 10px 20px !important; font-size: 14px !important; font-weight: 500 !important;
    cursor: pointer !important; transition: all 0.2s; box-shadow: none !important;
}
#goocha-chat-window #goocha-start-new-chat:hover { opacity: 0.9; }

#goocha-unread-badge {
    position: absolute; top: -5px; left: -5px; background-color: #ff3b30; color: white;
    border-radius: 50%; min-width: 20px; height: 20px; font-size: 11px; display: flex;
    align-items: center; justify-content: center; border: 2px solid white; z-index: 10000; font-weight: bold;
}

@media (max-width: 768px) {
    :root {
        --chat-footer-height: 70px;
    }
    #goocha-chat-window,
    #goocha-chat-window.goocha-left {
        bottom: calc(var(--bubble-bottom-mobile, 15px) + 75px) !important; 
        right: var(--bubble-side-mobile, 15px) !important; 
        left: var(--bubble-side-mobile, 15px) !important; 
        width: auto !important; 
        max-width: none !important;
        height: calc(100vh - var(--bubble-bottom-mobile, 15px) - 95px) !important;
        height: calc(100dvh - var(--bubble-bottom-mobile, 15px) - 95px) !important; 
        max-height: 650px !important; 
        border-radius: 16px !important; 
        transform: translateY(120%);
        padding: 0; 
        margin: 0; 
        box-shadow: 0 10px 40px rgba(0,0,0,0.15) !important; 
        transition: transform 0.4s cubic-bezier(0.2, 0, 0.2, 1), opacity 0.3s ease, visibility 0.3s ease, width 0.3s ease, height 0.3s ease, max-height 0.3s ease, border-radius 0.3s ease, bottom 0.3s ease, right 0.3s ease, left 0.3s ease !important; 
    }
    #goocha-chat-window.is-open { 
        transform: translateY(0) !important; 
        animation: none !important;
    }
    #goocha-chat-window.is-closing {
        transform: translateY(120%) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        animation: none !important;
    }
    #goocha-chat-bubble { bottom: var(--bubble-bottom-mobile, 15px) !important; }
    #goocha-chat-bubble:not(.goocha-left) { right: var(--bubble-side-mobile, 15px); left: auto; }
    #goocha-chat-bubble.goocha-left { right: auto; left: var(--bubble-side-mobile, 15px); }
    
    #goocha-chat-window .goocha-chat-header { border-radius: 16px 16px 0 0 !important; }
    #goocha-chat-window .goocha-chat-input-container { height: auto; min-height: 70px; padding: 12px 15px; border-radius: 0 0 16px 16px !important; }
    #goocha-chat-window .goocha-chat-input-container:has(.goocha-chat-copyright) { padding: 8px 15px 6px !important; }
    #goocha-chat-window #goocha-chat-input { padding: 10px 15px !important; height: 42px !important; line-height: 22px !important; font-size: 15px !important; }
    #goocha-chat-window #goocha-chat-send { width: 42px !important; height: 42px !important; }
    #goocha-chat-window #goocha-chat-send svg { width: 30px; height: 30px; }
    #goocha-chat-window .goocha-bubble { font-size: 15px; padding: 10px 14px; max-width: 100%; }
    #goocha-chat-window .goocha-action-button { min-width: 0 !important; }
    #goocha-chat-window .goocha-preset-questions { gap: 6px; }
    #goocha-chat-window .goocha-preset-btn { padding: 6px 12px !important; font-size: 12px !important; }
    #goocha-chat-window .goocha-message-meta .goocha-meta-btn { opacity: 0.5; visibility: visible; }
}

/* Keyframes (Animations) */
@keyframes typing-anim { 
    0%, 80%, 100% { transform: scale(0.5); opacity: 0.5; } 
    40% { transform: scale(1); opacity: 1; } 
}
@keyframes goocha-spin {
    to { transform: rotate(360deg); }
}
@keyframes goocha-fade-in { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}
@keyframes pulse {
    0% { transform: scale(1); }
    5% { transform: scale(1.1); }
    10% { transform: scale(1); }
    100% { transform: scale(1); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    1%, 3%, 5% { transform: translateX(-5px); }
    2%, 4%, 6% { transform: translateX(5px); }
    7% { transform: translateX(0); }
}
@keyframes tada {
    0%, 100% { transform: scale(1); }
    1%, 2% { transform: scale(0.9) rotate(-3deg); }
    3%, 5%, 7% { transform: scale(1.1) rotate(3deg); }
    4%, 6%, 8% { transform: scale(1.1) rotate(-3deg); }
    10% { transform: scale(1) rotate(0); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  2% { transform: rotate(-10deg); }
  4% { transform: rotate(10deg); }
  6% { transform: rotate(-10deg); }
  8% { transform: rotate(0); }
}
@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-out-down {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}
@keyframes slide-in-right {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slide-in-left {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes zoom-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes bounce-light {
  0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
  40% {transform: translateY(-10px);}
  60% {transform: translateY(-5px);}
}

/* کدهای قابلیت چپ چین */

/* تنظیم جهت اصلی کانتینر */
#goocha-chat-container.goocha-ltr #goocha-chat-window,
#goocha-chat-container.goocha-ltr #goocha-chat-teaser,
#goocha-chat-container.goocha-ltr #goocha-confirm-modal {
    direction: ltr !important;
    text-align: left !important;
}

/* هدر چت */
#goocha-chat-container.goocha-ltr .goocha-chat-header {
    direction: ltr !important;
    justify-content: flex-start !important;
}
#goocha-chat-container.goocha-ltr .header-info {
    text-align: left !important;
    margin-right: 0 !important;
    margin-left: 15px !important;
}
#goocha-chat-container.goocha-ltr .goocha-header-actions {
    left: auto !important;
    right: 12px !important;
}
#goocha-chat-container.goocha-ltr .header-avatar .online-indicator {
    left: auto !important;
    right: 2px !important;
}


/* پیام کاربر */
#goocha-chat-container.goocha-ltr .goocha-message.outgoing {
    flex-direction: row !important;
    justify-content: flex-start !important;
}

/* پیام ربات */
#goocha-chat-container.goocha-ltr .goocha-message.incoming {
    flex-direction: row-reverse !important;
    justify-content: flex-start !important;
}

/* پیام خوش‌آمدگویی */
#goocha-chat-container.goocha-ltr .goocha-welcome-message {
    flex-direction: row-reverse !important;
    justify-content: flex-start !important;
}

#goocha-chat-container.goocha-ltr .goocha-avatar {
    margin: 0 4px 0 8px !important;
}

/* تنظیم گوشه‌های حباب */
#goocha-chat-container.goocha-ltr .goocha-bubble-bot, 
#goocha-chat-container.goocha-ltr .goocha-bubble-operator {
    border-bottom-left-radius: 18px !important;
    border-bottom-right-radius: 4px !important;
}

/* حباب کاربرد */
#goocha-chat-container.goocha-ltr .goocha-bubble-user {
    border-bottom-right-radius: 18px !important;
    border-bottom-left-radius: 5px !important;
}

/* تنظیم تراز محتوای داخل پیام */
#goocha-chat-container.goocha-ltr .goocha-message.incoming .goocha-bubble-container,
#goocha-chat-container.goocha-ltr .goocha-welcome-message .goocha-bubble-container {
    align-items: flex-end !important;
}

/* کانتینر حباب کاربر -> تراز به چپ */
#goocha-chat-container.goocha-ltr .goocha-message.outgoing .goocha-bubble-container {
    align-items: flex-start !important;
}

/* تنظیم تراز متادیتا (ساعت و دکمه‌ها) */

/* ساعت پیام ربات -> سمت راست */
#goocha-chat-container.goocha-ltr .goocha-message.incoming .goocha-message-meta {
    justify-content: flex-end !important;
}

/* ساعت پیام کاربر -> سمت چپ */
#goocha-chat-container.goocha-ltr .goocha-message.outgoing .goocha-message-meta {
    justify-content: flex-start !important;
}
#goocha-chat-container.goocha-ltr .goocha-meta-item.goocha-meta-time {
    margin-right: 0 !important;
    margin-left: 5px !important;
}


/* ورودی پیام */
#goocha-chat-container.goocha-ltr .goocha-input-wrapper {
    flex-direction: row !important;
}
#goocha-chat-container.goocha-ltr #goocha-chat-input {
    direction: ltr !important;
    padding: 12px 10px 12px 15px !important;
}
#goocha-chat-container.goocha-ltr #goocha-chat-send {
    transform: scaleX(-1);
}

/* فرم پیش از چت */
#goocha-chat-container.goocha-ltr .goocha-pre-chat-container {
    direction: ltr !important;
    text-align: left !important;
}
#goocha-chat-container.goocha-ltr .goocha-pre-chat-subtitle {
    text-align: left !important;
}
#goocha-chat-container.goocha-ltr .goocha-form-icon {
    right: auto !important;
    left: 15px !important;
}
#goocha-chat-container.goocha-ltr .goocha-pre-chat-form-group input,
#goocha-chat-container.goocha-ltr .goocha-pre-chat-form-group textarea {
    padding: 12px 18px 12px 45px !important;
    direction: ltr !important;
}

/* پلیر صوتی */
#goocha-chat-container.goocha-ltr .goocha-audio-player {
    direction: ltr !important;
}

/* کارت محصول */
#goocha-chat-container.goocha-ltr .goocha-product-details {
    direction: ltr !important;
    text-align: left !important;
}
#goocha-chat-container.goocha-ltr .goocha-product-price {
    text-align: right !important;
}

/* تیزر */
#goocha-chat-container.goocha-ltr #goocha-chat-teaser {
    direction: ltr !important;
}
#goocha-chat-container.goocha-ltr #goocha-chat-teaser-close {
    right: auto !important;
    left: -10px !important;
}

#goocha-chat-container.goocha-ltr #goocha-quick-contact-overlay {
    direction: ltr !important;
}
#goocha-chat-container.goocha-ltr .goocha-qcm-arrow svg {
    transform: rotate(180deg);
}

.goocha-inline-mode {
    position: relative !important;
    width: 100% !important;
    height: 600px !important;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    z-index: 10;
}
.goocha-inline-mode #goocha-chat-window {
    position: relative !important;
    bottom: 0 !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-radius: 12px;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    animation: none !important;
}
.goocha-inline-mode #goocha-chat-expand {
    display: none !important;
}
/* استایل‌های حباب تیزر */
#goocha-chat-teaser {
    position: fixed;
    bottom: calc(var(--bubble-bottom-desktop) + 73px);
    z-index: 99980;
    background: #ffffff;
    color: #444;
    padding: 12px 15px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    max-width: 280px;
    font-size: 13px;
    line-height: 1.6;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s, visibility 0s 0.3s;
    direction: var(--chat-direction, rtl);
    cursor: pointer;
    overflow: visible !important;
}

#goocha-chat-teaser.goocha-left {
    left: var(--bubble-side-desktop);
}

#goocha-chat-teaser:not(.goocha-left) {
    right: var(--bubble-side-desktop);
}

#goocha-chat-teaser.is-visible {
    opacity: 1; visibility: visible; transform: translateY(0);
    transition: opacity 0.3s, transform 0.3s, visibility 0s 0s;
}

/* فلش زیر تیزر */
#goocha-chat-teaser::after {
    content: ''; position: absolute; bottom: -8px; width: 0; height: 0;
    border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 8px solid #ffffff;
}
#goocha-chat-teaser:not(.goocha-left)::after { right: 22px; }
#goocha-chat-teaser.goocha-left::after { left: 22px; right: auto; }

/* دکمه بستن تیزر */
#goocha-chat-teaser-close {
    all: unset !important;
    position: absolute !important;
    top: -12px !important;
    right: -12px !important;
    width: 24px !important;
    height: 24px !important;
    background: #ffffff !important;
    border-radius: 50% !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 9999 !important;
    color: #555 !important;
    transition: transform 0.2s ease, color 0.2s;}

#goocha-chat-teaser.goocha-left #goocha-chat-teaser-close {
    right: auto !important;
    left: -12px !important;
}

#goocha-chat-teaser-close:hover {
    transform: scale(1.1) !important;
    color: #dc3232 !important;
}

#goocha-chat-teaser-close svg {
    width: 10px !important;
    height: 10px !important;
    stroke: currentColor !important;
    pointer-events: none;
}

@media (max-width: 768px) {
    #goocha-chat-teaser { bottom: calc(var(--bubble-bottom-mobile) + 73px); max-width: calc(100% - (var(--bubble-side-mobile) * 2)); }
    #goocha-chat-teaser.goocha-left { left: var(--bubble-side-mobile); }
    #goocha-chat-teaser:not(.goocha-left) { right: var(--bubble-side-mobile); max-width: 275px; }
}
.goocha-file-attachment {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.05);
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none !important;
    color: inherit !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: background 0.2s;
    margin-top: 5px;
    direction: ltr;
}
.goocha-bubble-user .goocha-file-attachment {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff !important;
}
.goocha-file-attachment:hover { background: rgba(0, 0, 0, 0.1); }
.goocha-bubble-user .goocha-file-attachment:hover { background: rgba(255, 255, 255, 0.25); }
.goocha-file-name { font-weight: 600; font-size: 13px; direction: rtl; word-break: break-all; }
/* استایل قابلیت ریپلای */
.goocha-reply-action-btn {
    background: none !important; border: none !important; padding: 2px !important; margin: 0 !important; cursor: pointer !important;
    display: inline-flex !important; align-items: center; justify-content: center;
    color: #888 !important;
    transition: all 0.2s; opacity: 0.6; visibility: hidden;
}
.goocha-bubble-container:hover .goocha-reply-action-btn { opacity: 1; visibility: visible; }
.goocha-reply-action-btn:hover { color: var(--chat-primary-color, #0f52ba)!important; transform: scale(1.1); }
.goocha-reply-action-btn svg { width: 16px;  height: 16px;  fill: none; stroke: currentColor; }

/* استیال باکس ریپلای */
.goocha-reply-box {
    background: rgba(0, 0, 0, 0.05);
    border-right: 3px solid var(--chat-primary-color, #0f52ba);
    padding: 6px 10px;
    margin-bottom: 8px!important;
    border-radius: 4px;
    cursor: pointer;
    text-align: right;
    direction: rtl;
    transition: background 0.2s;
}
.goocha-reply-box:hover { background: rgba(0, 0, 0, 0.08); }
.goocha-bubble-user .goocha-reply-box {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
}
.goocha-bubble-user .goocha-reply-box:hover { background: rgba(255, 255, 255, 0.3); }
.goocha-reply-box strong { font-size: 11px; display: block; margin-bottom: 2px; color: inherit; opacity: 0.9; }
.goocha-reply-box p { font-size: 12px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: inherit; opacity: 0.8; }

/* ریپلای پری ویو */
.goocha-reply-preview-container {
    display: none; padding: 10px 15px 10px 35px; background: #f0f2f5; 
    border-top: 1px solid var(--chat-border-color, #eaeaea);
    border-right: 3px solid var(--chat-primary-color, #0f52ba);
    position: absolute; bottom: 100%; left: 0; right: 0; z-index: 99;
    text-align: right; direction: rtl;
}
.goocha-reply-preview-container strong { font-size: 12px; color: var(--chat-primary-color, #0f52ba); display: block; margin-bottom: 2px; }
.goocha-reply-preview-container p { margin: 0; font-size: 12px; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goocha-reply-cancel-btn {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    cursor: pointer; color: #888; font-size: 25px; line-height: 1;
}
.goocha-reply-cancel-btn:hover { color: #d63638; }

/* چپ‌چین کردن باکس ریپلای ارسال شده */
#goocha-chat-container.goocha-ltr .goocha-reply-box {
    direction: ltr !important;
    text-align: left !important;
    border-right: none !important;
    border-left: 3px solid var(--chat-primary-color, #0f52ba) !important;
}

/* چپ‌چین کردن بخش پیش‌نمایش ریپلای */
#goocha-chat-container.goocha-ltr .goocha-reply-preview-container {
    direction: ltr !important;
    text-align: left !important;
    border-right: none !important;
    border-left: 3px solid var(--chat-primary-color, #0f52ba) !important;
    padding: 10px 35px 10px 15px !important; 
}
#goocha-chat-container.goocha-ltr .goocha-reply-cancel-btn {
    left: auto !important;
    right: 15px !important;
}

/* ریپلای انیمیشن */
@keyframes goocha-reply-blink {
    0% { background-color: rgba(15, 82, 186, 0.3); }
    100% { background-color: transparent; }
}
.goocha-reply-target-blink {
    animation: goocha-reply-blink 1.5s ease-out;
}

/* استایل‌های بخش پیش‌نمایش فایل */
.goocha-file-preview-container {
    display: flex;
    align-items: center;
    background: #f0f2f5;
    border-radius: 12px 12px 0 0;
    padding: 8px 12px;
    margin: 0;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    gap: 10px;
    border: 1px solid var(--chat-border-color, #eaeaea);
    border-bottom: none;
    transition: all 0.3s ease;
    z-index: 99;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.02);
}
.goocha-file-preview-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    flex-shrink: 0;
}
.goocha-file-preview-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}
.goocha-file-preview-name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    direction: ltr;
    text-align: right;
}
.goocha-file-preview-size {
    font-size: 11px;
    color: #777;
    margin-top: 2px;
}
.goocha-file-preview-remove {
    cursor: pointer;
    background: none !important;
    border: none !important;
    color: #888!important;
    font-size: 24px;
    padding: 0 5px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    line-height: 1;
    box-shadow: none !important;
}
.goocha-file-preview-remove:hover {
    color: #d63638 !important;
}
/* اینپوت در زمان نمایش فایل */
.goocha-input-wrapper:has(+.goocha-file-preview-container),
.goocha-file-preview-container + .goocha-input-wrapper {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}
/* استایل آکاردئون سوالات متداول */
#goocha-chat-window .goocha-faq-accordion,
#goocha-live-preview-box .goocha-faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0 0 20px 0;
    padding: 0 5px;
    animation: goocha-fade-in 0.4s ease;
    width: 100%;
}

.goocha-accordion-item {
    background: var(--chat-faq-btn-color, var(--chat-bg-color));
    border: 1px solid var(--chat-border-color, #dadce0);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.goocha-accordion-item:hover,
.goocha-accordion-item.active {
    border-color: var(--chat-primary-color);
}

.goocha-accordion-header {
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--chat-faq-btn-text-color, var(--chat-text-dark));
    user-select: none;
    transition: background 0.3s;
}

.goocha-accordion-header:hover {
    background: rgba(0, 0, 0, 0.02);
}

.goocha-accordion-header .goocha-acc-icon {
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-right: 10px;
}

#goocha-chat-container.goocha-ltr .goocha-accordion-header .goocha-acc-icon {
    margin-right: 0;
    margin-left: 10px;
}

.goocha-accordion-item.active .goocha-acc-icon {
    transform: rotate(180deg);
}

.goocha-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #ffffff;
}

.goocha-accordion-content {
    padding: 0 12px 12px 12px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--chat-text-dark);
    border-top: 1px solid rgba(0,0,0,0.04);
    margin-top: 8px;
    padding-top: 12px;
}

/* برای هماهنگی پیش نمایش لایو در پنل تنظیمات */
#goocha-live-preview-box .goocha-accordion-item {
    background: var(--preview-faq-btn, #f8f9fa);
    border: 1px solid #dadce0;
}
#goocha-live-preview-box .goocha-accordion-header {
    color: var(--preview-faq-text, #202124);
}
#goocha-live-preview-box .goocha-accordion-item:hover,
#goocha-live-preview-box .goocha-accordion-item.active {
    border-color: var(--preview-primary, #0f52ba);
}

#goocha-chat-bubble {
    background-color: transparent !important;
    background-image: none !important;
}

.goocha-liquid-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--chat-send-btn-color, var(--chat-primary-color));
    box-shadow: inset 0 -4px 10px rgba(0,0,0,0.15), inset 0 4px 10px rgba(255,255,255,0.2);
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    transform: translateZ(0);
    z-index: 1;
}

.goocha-liquid-scene {
    position: absolute;
    top: -20%; left: -20%;
    width: 140%; height: 140%;
    -webkit-filter: blur(5px);
    filter: blur(5px);
}

.goocha-blob {
    position: absolute;
    background: rgba(255, 255, 255, 0.40);
    border-radius: 50%;
    will-change: transform;
}

.goocha-b1 {
    width: 30px; height: 30px;
    top: 5px; left: 5px;
    animation: goocha-blob-move1 4s infinite alternate ease-in-out;
}

.goocha-b2 {
    width: 25px; height: 20px;
    top: 40%; left: 40%;
    animation: goocha-blob-move2 6s infinite alternate ease-in-out;
}

.goocha-liquid-grain {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
    z-index: 2;
    mix-blend-mode: overlay;
    opacity: 0.35;
    border-radius: 50%;
    pointer-events: none;
}

#goocha-chat-bubble .goocha-bubble-icon-main,
#goocha-chat-bubble .goocha-bubble-icon-close {
    z-index: 3;
    filter: drop-shadow(0px 2px 3px rgba(0,0,0,0.3));
}

#goocha-unread-badge {
    z-index: 4;
}

body.goocha-chat-open .goocha-blob {
    animation-play-state: paused !important;
}

@keyframes goocha-blob-move1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(25px, 15px) scale(1.2); }
}

@keyframes goocha-blob-move2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(15px, -25px) scale(1.1); }
}

/* استایل‌های متن کپی‌رایت گوچا */
#goocha-chat-window .goocha-chat-copyright {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    text-align: center;
    font-size: 10px;
    color: #9aa0a6;
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    direction: rtl;
    font-weight: 400;
    user-select: none;
    line-height: 1.2;
}
#goocha-chat-window .goocha-chat-copyright a {
    color: var(--chat-primary-color) !important;
    text-decoration: none !important;
    font-weight: bold;
    font-size: inherit;
    transition: opacity 0.2s ease;
}
#goocha-chat-window .goocha-chat-copyright a:hover {
    opacity: 0.8;
}
/* استایل پیگیری سفارش */
#goocha-chat-window .goocha-bubble:has(.goocha-order-shortcode-wrap) {
    max-width: calc(100% - 5px) !important;
    width: 100%;
}
/* استایل پیگیری سفارش */
.goocha-orders-wrapper { border-radius: 12px; padding: 0; padding-bottom: 0; margin-top: 10px!important; width: 100%; }
.goocha-orders-header-title { font-weight: 800; font-size: 15px; color: #1f2937; margin-bottom: 2px!important; text-align: start; }
.goocha-orders-subtitle { font-size: 11px; color: #6b7280; margin-bottom: 10px!important; text-align: start; }
.goocha-order-card { 
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; margin-bottom: 5px!important; 
    overflow: hidden; transition: all 0.3s ease; 
}
.goocha-order-card:hover { border-color: var(--chat-primary-color, #0f52ba); }
.goocha-order-card.is-expanded { 
    border-color: var(--chat-primary-color, #0f52ba); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.08); 
}
/* هدر سفارش - پشتیبانی طبیعی از LTR و RTL */
.goocha-order-header { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 7px 10px; cursor: pointer; user-select: none; gap: 5px; 
    transition: background 0.2s ease;
}
.goocha-order-header:hover { background: #f9fafb; }
.goocha-order-header-info { flex: 1; text-align: start; }
.goocha-order-header-status { display: flex; flex-direction: column; align-items: flex-end; }
#goocha-chat-container.goocha-ltr .goocha-order-header-status { align-items: flex-start; }
.goocha-order-number { font-weight: 700; font-size: 12px; color: #111827; margin-bottom: 4px!important; }
.goocha-order-date { font-size: 11px; color: #6b7280; }
.goocha-order-status { 
    display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; 
    padding: 4px 8px; border-radius: 20px; margin-bottom: 5px!important; flex-direction: row; gap: 5px; 
}
.goocha-status-dot { width: 6px; height: 6px; border-radius: 50%; margin: 0; }
.status-blue { color: #2563eb; background: #eff6ff; } .status-blue .goocha-status-dot { background: #3b82f6; }
.status-green { color: #059669; background: #ecfdf5; } .status-green .goocha-status-dot { background: #10b981; }
.status-orange { color: #d97706; background: #fffbeb; } .status-orange .goocha-status-dot { background: #f59e0b; }
.status-red { color: #dc2626; background: #fef2f2; } .status-red .goocha-status-dot { background: #ef4444; }
.status-default { color: #4b5563; background: #f3f4f6; } .status-default .goocha-status-dot { background: #9ca3af; }
.goocha-order-price-summary { font-size: 12px; font-weight: 500; color: #0c0d0e; }
.goocha-order-bag-icon { background: #f3f4f6; color: #6b7280; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: transform 0.3s ease; flex-shrink: 0; }
.goocha-order-card.is-expanded .goocha-order-bag-icon { background: var(--chat-primary-color, #0f52ba); color: #fff; }
/* بخش آکاردئونی پیگیری سفارش */
.goocha-order-details { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.4s ease, opacity 0.4s ease; border-top: 1px solid transparent; background: #fafafa; }
.goocha-order-card.is-expanded .goocha-order-details { max-height: 1000px; opacity: 1; border-top-color: #f3f4f6; padding-bottom: 0; }
.goocha-order-meta-grid { display: flex; justify-content: space-between; border-bottom: 1px solid #e5e7eb; padding: 10px; }
.goocha-order-meta-item { display: flex; flex-direction: column; text-align: start; }
.goocha-order-meta-item:last-child { text-align: end; }
.goocha-order-meta-item span { font-size: 10px; color: #6b7280; margin-bottom: 4px; }
.goocha-order-meta-item strong { font-size: 11px; color: #1f2937; }
.goocha-order-products-title { font-size: 11px; font-weight: 700; color: #374151; padding: 15px 15px 5px 15px; text-align: start; }
.goocha-order-products-list { padding: 0 10px; }
/* محدودیت عنوان محصول و استایل‌ها */
.goocha-order-product-item { display: flex; align-items: center; justify-content: flex-start; padding: 8px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 5px!important; gap: 10px; }
.goocha-order-product-info { flex: 1; text-align: start; min-width: 0; }
.goocha-order-product-title { 
    font-size: 12px !important; font-weight: 600; color: var(--chat-primary-color, #0f52ba); margin-bottom: 4px; 
    display: block; text-decoration: none; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.goocha-order-product-title:hover { text-decoration: underline; }
.goocha-order-product-meta { font-size: 11px; color: #6b7280; }
.goocha-order-product-meta span { color: #4b5563; margin: 0 4px; }
.goocha-order-product-item img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: #f3f4f6; border: 1px solid #e5e7eb; flex-shrink: 0; }
.goocha-order-total-box { margin: 10px 10px 0!important; background: #eff6ff; border-radius: 8px; padding: 10px; display: flex; justify-content: space-between; align-items: center; }
.goocha-total-label { font-size: 13px; font-weight: 700; color: var(--chat-primary-color, #0f52ba); }
.goocha-total-value { font-size: 14px; font-weight: 800; color: var(--chat-primary-color, #0f52ba); }
/* دکمه‌های اکشن سفارش */
.goocha-order-actions { padding: 10px; display: flex; justify-content: center; }
#goocha-chat-container.goocha-ltr .goocha-order-actions { justify-content: flex-start; }
.goocha-all-orders-wrapper { display: flex; justify-content: center; margin-top: 10px!important; }
#goocha-chat-window .goocha-bubble a.goocha-view-order-btn,
#goocha-chat-window .goocha-bubble a.goocha-all-orders-btn {
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    text-align: center;
    background: #fff !important; 
    color: var(--chat-primary-color, #0f52ba) !important;
    border: 1px solid var(--chat-primary-color, #0f52ba) !important;
    padding: 6px 14px; 
    border-radius: 8px; 
    text-decoration: none !important; 
    font-size: 13px;
    font-weight: 600; 
    transition: all 0.2s ease;
    width: fit-content;
}

#goocha-chat-window .goocha-bubble a.goocha-view-order-btn:hover,
#goocha-chat-window .goocha-bubble a.goocha-all-orders-btn:hover { 
    background: var(--chat-primary-color, #0f52ba) !important; 
    color: #fff !important; 
    text-decoration: none !important;
}
/* استایل مدرن نوار ضبط صدا در فرانت‌اند */
#goocha-chat-window .goocha-modern-recording-bar {
    display: none;
    flex-grow: 1;
    align-items: center;
    justify-content: space-between;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 24px;
    padding: 6px 12px;
    height: 46px;
    gap: 8px;
    direction: rtl;
    animation: goocha-fade-in 0.2s ease;
}

#goocha-chat-window .goocha-rec-cancel-btn {
    background: #fee2e2 !important;
    border: none !important;
    color: #dc2626 !important;
    border-radius: 16px !important;
    padding: 4px 10px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    box-shadow: none !important;
}

#goocha-chat-window .goocha-rec-cancel-btn:hover {
    background: #fecaca !important;
    color: #b91c1c !important;
}

#goocha-chat-window .goocha-rec-status-center {
    display: flex;
    align-items: center;
    gap: 8px;
    direction: ltr;
}

#goocha-chat-window .goocha-record-timer {
    color: #dc2626;
    font-size: 13px;
    font-weight: 700;
    font-family: monospace;
    display: inline-block !important;
    margin: 0 !important;
}

#goocha-chat-window .goocha-voice-waves {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 16px;
}

#goocha-chat-window .goocha-voice-waves span {
    width: 3px;
    background: #ef4444;
    border-radius: 2px;
    animation: goocha-wave-anim 1s infinite ease-in-out;
}
#goocha-chat-window .goocha-voice-waves span:nth-child(1) { height: 6px; animation-delay: 0s; }
#goocha-chat-window .goocha-voice-waves span:nth-child(2) { height: 13px; animation-delay: 0.15s; }
#goocha-chat-window .goocha-voice-waves span:nth-child(3) { height: 16px; animation-delay: 0.3s; }
#goocha-chat-window .goocha-voice-waves span:nth-child(4) { height: 10px; animation-delay: 0.45s; }
#goocha-chat-window .goocha-voice-waves span:nth-child(5) { height: 7px; animation-delay: 0.6s; }

@keyframes goocha-wave-anim {
    0%, 100% { transform: scaleY(0.5); opacity: 0.6; }
    50% { transform: scaleY(1.2); opacity: 1; }
}

#goocha-chat-window .goocha-rec-hint {
    font-size: 11px;
    color: #991b1b;
    font-weight: 500;
    white-space: nowrap;
}

#goocha-chat-window #goocha-chat-send.goocha-rec-send-pulse {
    box-shadow: 0 0 0 4px rgba(15, 82, 186, 0.25) !important;
    animation: pulse 1.5s infinite;
}

.goocha-voice-trigger {
    touch-action: none;
    user-select: none;
}
/* نقطه قرمز چشمک زن */
.goocha-recording-dot {
    width: 10px;
    height: 10px;
    background-color: #ef4444;
    border-radius: 50%;
    position: relative;
    order: 2;
}
.goocha-recording-dot::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background-color: rgba(239, 68, 68, 0.3);
    border-radius: 50%;
    animation: goocha-record-pulse 1s infinite alternate;
}
@keyframes goocha-record-pulse {
    from { transform: scale(0.8); opacity: 0.8; }
    to { transform: scale(1.2); opacity: 1; }
}
/* تایمر داخل کپسول */
.goocha-recording-pill .goocha-record-timer {
    color: #ef4444;
    font-size: 14px;
    font-weight: 600;
    font-family: monospace;
    display: inline-block !important;
    margin: 0;
    order: 3;
}
#goocha-chat-window .goocha-system-pill.goocha-sys-warning {
    background-color: #fff8e5;
    color: #856404;
    border: 1px solid #ffe69c;
}

#goocha-chat-window .goocha-system-pill.goocha-sys-warning .goocha-warn-icon {
    margin-left: 5px;
    stroke: #856404;
}

#goocha-chat-container.goocha-ltr .goocha-system-pill.goocha-sys-warning .goocha-warn-icon {
    margin-left: 0;
    margin-right: 5px;
}
/* ==========================================================================
   استایل‌های منتقل شده از فایل PHP (بهینه‌سازی ساختار و حذف استایل‌های خطی)
   ========================================================================== */

#goocha-chat-container {
    font-family: var(--chat-font-family) !important;
}

#goocha-chat-container input,
#goocha-chat-container textarea,
#goocha-chat-container button,
#goocha-chat-container select {
    font-family: inherit !important;
}

.goocha-svg-defs,
#goocha-file-input {
    display: none;
}

#goocha-unread-badge {
    display: none;
}

#goocha-chat-bubble .goocha-bubble-icon-main svg.goocha-chat-icon-svg {
    width: 33px;
    height: auto;
    display: block;
    border-radius: 0 !important;
    fill: white;
}

.goocha-qcm-header-titles strong {
    font-size: 16px;
    display: block;
    font-weight: bold;
}

.goocha-qcm-header-titles span {
    font-size: 13px;
    opacity: 0.9;
}

.goocha-qcm-icon {
    background-color: var(--qcm-color, var(--chat-primary-color));
}

.goocha-qcm-label {
    color: var(--qcm-color, var(--chat-primary-color));
}

.goocha-sound-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

#goocha-chat-expand .goocha-icon-minimize {
    display: none;
}

#goocha-recording-ui {
    display: none;
    flex-grow: 1;
    align-items: center;
    justify-content: flex-end;
}

/* استایل دکمه شورت‌کد باز کردن چت در فرانت‌اند */
.goocha-open-chat-shortcode-btn {
    background-color: var(--chat-primary-color, #0f52ba);
    color: #ffffff !important;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: 500;
    display: inline-block;
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-size: 15px;
    border: none;
    cursor: pointer;
}

.goocha-open-chat-shortcode-btn:hover {
    color: #ffffff !important;
    opacity: 0.9;
    transform: translateY(-1px);
}

/* استایل‌های شورت‌کد نقشه در پنجره چت */
.goocha-map-error {
    padding: 10px;
    border: 1px dashed #dc2626;
    color: #dc2626;
    border-radius: 8px;
    font-size: 12px;
    text-align: center;
}

.goocha-map-wrapper {
    direction: ltr;
    margin: 15px 0;
    width: 100%;
    min-width: 225px;
}

.goocha-map-canvas {
    width: 100%;
    height: 200px;
    border-radius: 12px 12px 0 0;
    border: 1px solid #ddd;
    border-bottom: none;
    z-index: 1;
}

.goocha-map-actions {
    display: flex;
    justify-content: space-between;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 0 0 12px 12px;
    border: 1px solid #ddd;
    border-top: none;
    gap: 8px;
}

#goocha-chat-window .goocha-bubble a.goocha-map-action-btn,
.goocha-map-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px !important;
    background: #ffffff !important;
    border: 1px solid #ddd !important;
    border-radius: 12px;
    font-size: 12px;
    text-decoration: none !important;
    color: var(--chat-primary-color, #0f52ba) !important;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

#goocha-chat-window .goocha-bubble a.goocha-map-action-btn:hover,
.goocha-map-action-btn:hover {
    background: #f0f2f5 !important;
}
/* استایل پیام‌های وضعیت شورت‌کد پیگیری سفارش */
.goocha-order-notice {
    padding: 10px;
    border-radius: 8px;
    font-size: 12px;
    text-align: center;
    margin-top: 10px;
    direction: rtl;
}

.goocha-order-admin-preview {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px dashed #7dd3fc;
}

.goocha-order-auth-req {
    background: #fffbeb;
    color: #d97706;
}

.goocha-order-empty {
    background: #f3f4f6;
    color: #4b5563;
}

.goocha-order-not-found {
    background: #fef2f2;
    color: #dc2626;
}
/* ==========================================================================
   استایل کپسول تاریخ (به سبک تلگرام) و تیک وضعیت پیام در فرانت‌اند
   ========================================================================== */
#goocha-chat-window .goocha-date-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0 6px 0;
    width: 100%;
    pointer-events: none;
    user-select: none;
    animation: goocha-fade-in 0.3s ease;
}

#goocha-chat-window .goocha-date-divider span {
    background-color: rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 999px;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

#goocha-chat-window .goocha-msg-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 3px;
    color: #94a3b8;
    transition: color 0.25s ease, transform 0.2s ease;
}

#goocha-chat-window .goocha-msg-status.is-read {
    color: var(--chat-primary-color, #0f52ba);
}

#goocha-chat-container.goocha-ltr #goocha-chat-window .goocha-msg-status {
    margin-right: 0;
    margin-left: 3px;
}

/* ==========================================================================
   استایل باکس مدرن آپلود فایل در فرم‌ها (ریسپانسیو + Drag & Drop)
   ========================================================================== */
#goocha-chat-window .goocha-form-file-dropzone {
    border: 1.5px dashed #cbd5e1;
    background: #f8fafc;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}

#goocha-chat-window .goocha-form-file-dropzone:hover,
#goocha-chat-window .goocha-form-file-dropzone.is-dragover {
    border-color: var(--chat-primary-color, #0f52ba);
    background: rgba(15, 82, 186, 0.04);
}

#goocha-chat-window .goocha-form-file-dropzone.has-file {
    border-style: solid;
    border-color: #bbf7d0;
    background: #f0fdf4;
    cursor: default;
}

#goocha-chat-window .goocha-form-file-placeholder {
    display: flex;
    align-items: center;
    gap: 10px;
}

#goocha-chat-window .goocha-form-file-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #eff6ff;
    color: var(--chat-primary-color, #0f52ba);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

#goocha-chat-window .goocha-form-file-dropzone:hover .goocha-form-file-icon-box {
    transform: translateY(-1px);
}

#goocha-chat-window .goocha-form-file-texts {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
}

#goocha-chat-window .goocha-form-file-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

/* استایل ستاره قرمز برای فیلدهای اجباری فرم‌ها */
#goocha-chat-window .goocha-required-star {
    color: #dc2626 !important;
    font-weight: bold;
    margin-right: 2px;
    display: inline-block;
}

#goocha-chat-window .goocha-placeholder-label {
    position: absolute;
    right: 45px;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #999;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
    direction: rtl;
    transition: opacity 0.15s ease;
}

#goocha-chat-window .goocha-pre-chat-input-wrapper.is-textarea-wrapper .goocha-placeholder-label {
    top: 12px;
    transform: none;
}

#goocha-chat-window .goocha-pre-chat-input-wrapper.has-value .goocha-placeholder-label,
#goocha-chat-window .goocha-pre-chat-input-wrapper input:not(:placeholder-shown) + .goocha-placeholder-label,
#goocha-chat-window .goocha-pre-chat-input-wrapper textarea:not(:placeholder-shown) + .goocha-placeholder-label {
    opacity: 0;
    visibility: hidden;
}

#goocha-chat-container.goocha-ltr #goocha-chat-window .goocha-placeholder-label {
    right: 18px !important;
    left: 45px !important;
    text-align: left !important;
    direction: ltr !important;
}

#goocha-chat-window .goocha-form-file-hint {
    font-size: 10.5px;
    color: #64748b;
    margin-top: 2px;
}

#goocha-chat-window .goocha-form-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}
#goocha-chat-window .goocha-form-file-dropzone.has-file .goocha-form-file-placeholder {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #bbf7d0;
    cursor: pointer;
}
#goocha-chat-window .goocha-form-file-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    direction: ltr;
    background: rgba(255, 255, 255, 0.7);
    padding: 4px 6px;
    border-radius: 8px;
}

#goocha-chat-window .goocha-form-file-thumb {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #dcfce7;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

#goocha-chat-window .goocha-form-file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#goocha-chat-window .goocha-form-file-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    text-align: left;
}

#goocha-chat-window .goocha-form-file-name {
    font-size: 12px;
    font-weight: 600;
    color: #166534;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#goocha-chat-window .goocha-form-file-size {
    font-size: 10.5px;
    color: #15803d;
}

#goocha-chat-window .goocha-form-file-remove {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border: none !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 16px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 0 !important;
    flex-shrink: 0;
    box-shadow: none !important;
    transition: background 0.2s ease, transform 0.2s ease;
}

#goocha-chat-window .goocha-form-file-remove:hover {
    background: #fecaca !important;
    transform: scale(1.08);
}

@media (max-width: 480px) {
    #goocha-chat-window .goocha-form-file-dropzone {
        padding: 9px 10px;
    }
    #goocha-chat-window .goocha-form-file-title {
        font-size: 12px;
    }
}

/* ==========================================================================
   استایل‌های مکالمه درختی و مشاور هوشمند در فرانت‌اند (Guided Decision Tree)
   ========================================================================== */
#goocha-chat-window .goocha-tree-starters-wrap {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 4px 0 12px 0;
    padding: 0 5px;
    animation: goocha-fade-in 0.35s ease;
}

#goocha-chat-window .goocha-tree-starter-btn {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 14px !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 1.5px solid color-mix(in srgb, var(--chat-primary-color, #0f52ba) 35%, transparent) !important;
    border-radius: 14px !important;
    color: var(--chat-text-dark, #1e293b) !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05) !important;
    transition: all 0.22s cubic-bezier(0.2, 0, 0.2, 1);
    text-align: start !important;
}

#goocha-chat-window .goocha-tree-starter-btn:hover {
    border-color: var(--chat-primary-color, #0f52ba) !important;
    background: color-mix(in srgb, var(--chat-primary-color, #0f52ba) 6%, #ffffff) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(15, 23, 42, 0.08) !important;
}

#goocha-chat-window .goocha-tree-starter-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: color-mix(in srgb, var(--chat-primary-color, #0f52ba) 12%, #ffffff);
    color: var(--chat-primary-color, #0f52ba);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#goocha-chat-window .goocha-tree-starter-title {
    flex: 1;
    line-height: 1.4;
}

#goocha-chat-window .goocha-tree-starter-arrow {
    color: #94a3b8;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

#goocha-chat-window .goocha-tree-starter-btn:hover .goocha-tree-starter-arrow {
    color: var(--chat-primary-color, #0f52ba);
    transform: translateX(-3px);
}

#goocha-chat-container.goocha-ltr #goocha-chat-window .goocha-tree-starter-arrow {
    transform: rotate(180deg);
}

/* باکس گزینه‌های مرحله فعلی درخت */
#goocha-chat-window .goocha-tree-interactive-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0 12px 0;
    padding: 0 4px;
    animation: goocha-fade-in 0.3s ease;
}

#goocha-chat-window .goocha-tree-options-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#goocha-chat-window .goocha-tree-option-btn {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 14px !important;
    background: #ffffff !important;
    border: 1px solid var(--chat-border-color, #cbd5e1) !important;
    border-radius: 12px !important;
    color: var(--chat-text-dark, #1e293b) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    text-align: start !important;
    line-height: 1.5 !important;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}

#goocha-chat-window .goocha-tree-option-btn:hover {
    background: var(--chat-primary-color, #0f52ba) !important;
    border-color: var(--chat-primary-color, #0f52ba) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 82, 186, 0.18) !important;
}

#goocha-chat-window .goocha-tree-opt-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid var(--chat-primary-color, #0f52ba);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

#goocha-chat-window .goocha-tree-option-btn:hover .goocha-tree-opt-bullet {
    border-color: #ffffff;
    background: #ffffff;
}

#goocha-chat-window .goocha-tree-options-grid.is-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

#goocha-chat-window .goocha-tree-opt-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 2px;
}

#goocha-chat-window .goocha-tree-opt-text {
    flex: 1;
    font-weight: 600;
}

#goocha-chat-window .goocha-tree-opt-sub {
    font-size: 11px;
    color: #64748b;
    font-weight: 400;
    transition: color 0.2s ease;
}

#goocha-chat-window .goocha-tree-option-btn:hover .goocha-tree-opt-sub {
    color: rgba(255, 255, 255, 0.85);
}

/* استایل باکس کد تخفیف مکالمه درختی */
#goocha-chat-window .goocha-tree-coupon-box {
    margin-top: 10px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1.5px dashed #16a34a;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s ease;
}

#goocha-chat-window .goocha-tree-coupon-box:hover {
    transform: scale(1.02);
}

#goocha-chat-window .goocha-coupon-title {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #166534;
    margin-bottom: 6px;
}

#goocha-chat-window .goocha-coupon-code-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
}

#goocha-chat-window .goocha-coupon-code-pill code {
    font-size: 14px;
    font-weight: 800;
    color: #15803d;
    letter-spacing: 1px;
    background: transparent;
}

#goocha-chat-window .goocha-coupon-copy-hint {
    font-size: 10.5px;
    background: #16a34a;
    color: #ffffff;
    padding: 2px 7px;
    border-radius: 6px;
    font-weight: 600;
}

#goocha-chat-window .goocha-tree-interactive-box.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

#goocha-chat-window .goocha-tree-step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #64748b;
    padding: 0 4px 2px 4px;
}

#goocha-chat-window .goocha-tree-step-badge {
    background: color-mix(in srgb, var(--chat-primary-color, #0f52ba) 10%, #ffffff);
    color: var(--chat-primary-color, #0f52ba);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

#goocha-chat-window .goocha-tree-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

@media (max-width: 420px) {
    #goocha-chat-window .goocha-tree-options-grid.is-grid-2col {
        grid-template-columns: 1fr;
    }
}

#goocha-chat-window .goocha-tree-nav-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    background: rgba(15, 23, 42, 0.05) !important;
    border: none !important;
    border-radius: 16px !important;
    padding: 4px 10px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #64748b !important;
    cursor: pointer !important;
    transition: all 0.2s ease;
    box-shadow: none !important;
}

#goocha-chat-window .goocha-tree-nav-btn:hover {
    background: rgba(15, 23, 42, 0.1) !important;
    color: #0f172a !important;
}