@import "fonts.css";

*, *::before, *::after {
    box-sizing: border-box;
}

#hosha-chat-trigger {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 9998;
    font-family: sans, sans-serif;
}

/* دکمه بازکننده */
#hosha-chat-open-btn {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14);
    color: #2A2A2A;
    border-radius: 50%;
    border: 1px solid #ddd;
    font-size: 28px;
    width: 58px;
    height: 58px;
    cursor: pointer;
}

/* جعبه چت */
#hosha-chat-box {
    background: #f7f8fc;
    position: fixed;
    right: 32px;
    bottom: 32px;
    width: 380px;
    height: 600px;
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.18);
    border-radius: 15px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 56px;
}

/* هدر چت */
.hosha-chat-header {
    padding: 15px 20px 15px 6px;
    background: #21256a;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    font-family: sans, sans-serif;
}

#hosha-chat-close-btn {
    background: none;
    color: #fff;
    border: none;
    font-size: 30px;
    cursor: pointer;
}

/* محتوای چت */
#hosha-chat-content {
    flex: 1;
    overflow-y: auto;
    background: transparent;
    font-size: 15px;
    font-family: sans, sans-serif;
    padding: 0 0 16px 0;
}

.hosha-chat-title {
    padding: 18px 18px 0 18px;
}

/* صفحه خوشامد */
.hosha-chat-welcome {
    margin-bottom: 16px;
    color: #21256a;
    font-family: sans, sans-serif;
    padding: 8px 18px 0 18px;
}

/* سرویس */
.hosha-service-btn {
    display: flex;
    background: #fff;
    cursor: pointer;
    min-height: 32px;
    padding: 14px 12px 14px 12px;
    direction: rtl;
    transition: background 0.13s;
    margin-bottom: 12px;
    width: 100%;
    border: 1px solid #f3f3f3;
    font-size: 16px;
    text-align: right;
    position: relative;
    font-family: sans, sans-serif;
}

.hosha-service-btn:hover {
    background: #f4f4f4;
}

/* لیست FAQ و دسته‌بندی/سرویس */
.faq-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.faq-list-item,
.service-list-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #f3f3f3;
    cursor: pointer;
    min-height: 32px;
    padding: 14px 12px 10px 12px;
    direction: rtl;
    transition: background 0.13s;
    position: relative;
}

.faq-list-item:hover,
.service-list-item:hover {
    background: #f4f4f4;
}

.faq-list-item .faq-arrow,
.service-list-item .faq-arrow {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    margin-left: 0;
    flex-shrink: 0;
    background: url('data:image/svg+xml;utf8,<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13 5l-5 5 5 5" stroke="%233d4977" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center center;
    transition: background 0.2s;
}

.faq-list-item:hover .faq-arrow,
.service-list-item:hover .faq-arrow {
    background: url('data:image/svg+xml;utf8,<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13 5l-5 5 5 5" stroke="%23207abc" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat center center;
}

.faq-item-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.faq-item-title {
    font-size: 16px;
    margin-bottom: 2px;
    color: #232a39;
}

.faq-item-desc {
    font-size: 13px;
    color: #989bad;
    margin-top: 2px;
    line-height: 1.5;
}


/* برای آیتم ها بدون توضیح */
.faq-list-item.no-desc .faq-item-title,
.service-list-item .faq-item-title {
    margin-bottom: 0 !important;
}

.faq-list-item.no-desc .faq-item-desc {
    display: none !important;
}

/* پاسخ پرسش */
.faq-answer {
    background: #f7f9fe;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    justify-content: flex-start;
}

.faq-answer-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2555a5;
    display: flex;
    align-items: center;
    padding: 20px 18px;
}

.faq-answer-body {
    color: #222;
    font-size: 1rem;
    padding: 5px 18px;
}

/* دکمه بازگشت پایین چت */
#hosha-chat-back-btn, .hosha-chat-back-btn {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    background: #21256a;
    color: #fff;
    border: none;
    padding: 13px 0 12px 0;
    font-size: 16px;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    z-index: 101;
    cursor: pointer;
    transition: background .21s;
    box-shadow: 0 -2px 11px rgba(33, 37, 106, .09);
    font-family: sans, sans-serif;
}

#hosha-chat-back-btn:hover, .hosha-chat-back-btn:hover {
    background: #3540a6;
}

@media (max-width: 480px) {
    html, body {
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden !important;
        /* بهتر است dir را هم رعایت کنی اگر سایت rtl است */
    }

    body.chat-open #wpadminbar {
        display: none !important;
    }

    #hosha-chat-box {
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
        right: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        top: 0 !important;
        height: 100% !important;
        max-height: 100% !important;
        padding: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: hidden !important;
    }


}

#hosha-chat-content .order-detail {
    font-family: 'sans', 'Tahoma', sans-serif;
    background: #f9fafb;
    padding: 12px;
    color: #293042;
    letter-spacing: 0.01em;
    line-height: 2.1;
    transition: box-shadow 0.2s;
}

#hosha-chat-content .order-number span {
    font-family: monospace;
    background: #f1f6fa;
    padding: 2px 9px;
    border-radius: 5px;
    font-size: 15px;
    margin-right: 4px;
}

#hosha-chat-content .order-info-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 8px;
}

#hosha-chat-content .order-info-row .label {
    width: 70px;
    font-weight: 500;
    color: #46596d;
    font-size: 15.3px;
    margin-left: 7px;
}

#hosha-chat-content .order-info-row .value {
    color: #223349;
    font-family: inherit;
}

#hosha-chat-content .order-status {
    display: inline-block;
    background: #e3f6ec;
    color: #079477;
    font-weight: bold;
    border-radius: 7px;
    padding: 3px 13px 2px 13px;
    font-size: 14.5px;
    margin-right: 2px;
    letter-spacing: 0.04em;
}

#hosha-chat-content .order-items-section {
    margin-top: 15px;
}

#hosha-chat-content .order-items {
    padding: 0;
    margin: 0 0 0 0;
    list-style-type: disc;
}

#hosha-chat-content .order-items li {
    list-style: inside;
    padding-right: 4px;
    color: #2a334a;
    margin-bottom: 4px;
    font-size: 15.1px;
    line-height: 2;
}

#hosha-chat-content .item-qty {
    color: #666b7a;
    font-size: 14px;
    margin-right: 3px;
}

@media (max-width: 600px) {
    #hosha-chat-content .order-detail {
        max-width: 99vw;
        padding: 8px;
        font-size: 14px;
        border-radius: 6px;
    }

    #hosha-chat-content .order-header, .order-title, .order-number span {
        font-size: 15px !important;
    }
}

#hosha-chat-content .order-info-row {
    display: flex;
    flex-direction: row; /* عادی - عنوان راست، محتوا چپ */
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 8px;
    direction: rtl; /* جهت نوشتار RTL بماند */
}

#hosha-chat-content .order-info-row .label {
    width: 90px;
    font-weight: 500;
    color: #46596d;
    font-size: 15px;
    margin-left: 12px;
    margin-right: 0;
    text-align: right; /* عنوان بچسبد به راست */
    white-space: nowrap;
}

#hosha-chat-content .order-info-row .value,
#hosha-chat-content .order-info-row .order-status {
    flex: 1;
    color: #223349;
    font-family: inherit;
    text-align: left; /* محتوای سفارش بچسبد به چپ */
    display: block;
}
