.afs-wrap{
    direction: rtl;
    background: var(--afs-bg);
    border-radius: var(--afs-container-radius);
    padding: 32px;
    font-family: 'iransans';
    position: relative;
    overflow: hidden;
}

.afs-grid{
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 36px;
    align-items: center;
}

.afs-logo-col{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
}

.afs-logo-box{
    width: 240px;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.afs-logo-img{
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.afs-logo-placeholder{
    width: 180px;
    height: 180px;
    border: 8px solid var(--afs-primary);
    border-radius: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--afs-primary);
    font-weight: 700;
    font-size: 24px;
}

.afs-message-area{
    width: 100%;
    max-width: 480px;
}

.afs-message-bubble{
    position: relative;
    background: var(--afs-bubble-bg);
    color: var(--afs-answer-text);
    border-radius: var(--afs-bubble-radius);
    padding: 20px 22px;
    min-height: 90px;
    box-shadow: var(--afs-message-shadow);
}

.afs-message-bubble::before{
    content: "";
    position: absolute;
    right: 40px;
    top: -10px;
    width: 22px;
    height: 22px;
    background: var(--afs-bubble-bg);
    transform: rotate(45deg);
    border-radius: 4px;
}

.afs-message-content{
    line-height: 2;
    font-size: 16px;
    font-weight: var(--afs-answer-weight);
    word-break: break-word;
}

.afs-questions-list{
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.afs-question-btn{
    background: #A9604590;
    color: white;
    padding: 20px 24px;
    border-radius: var(--afs-button-radius);
    cursor: pointer;
    border: none;
    text-align: right;
    font-size: 14px;
    font-weight: 700;
    transition: .25s ease;
    font-family: 'iransans';
}

.afs-question-btn:hover{
    transform: translateY(-2px);
    background-color: #A96045;
    filter: brightness(1.02);
    color:white;
}

.afs-question-btn.is-active{
    background: #A96045;
    color:white;
}

.afs-empty{
    padding: 20px;
    background: #fff3f3;
    border: 1px solid #f0c9c9;
    border-radius: 12px;
}

.afs-letter{
    display: inline-block;
    opacity: 0;
    transform: translateY(14px);
    white-space: pre;
}

/* تبلت و لپ‌تاپ کوچک */
@media (max-width: 900px){
    .afs-grid{
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .afs-wrap{
        padding: 24px;
    }

    .afs-logo-box{
        width: 180px;
        height: 180px;
    }

    .afs-question-btn{
        font-size: 16px;
        padding: 16px 18px;
    }

    .afs-message-area{
        max-width: 100%;
    }
}

/* موبایل (عرض خیلی کم) */
@media (max-width: 600px){
    .afs-wrap{
        padding: 18px;
    }

    .afs-grid{
        gap: 18px;
    }

    .afs-logo-box{
        width: 150px;
        height: 150px;
    }

    .afs-logo-placeholder{
        width: 140px;
        height: 140px;
        font-size: 20px;
        border-width: 6px;
    }

    .afs-message-bubble{
        padding: 16px 14px;
        min-height: auto;
    }

    .afs-message-bubble::before{
        right: 24px;
        top: -8px;
        width: 18px;
        height: 18px;
    }

    .afs-message-content{
        font-size: 14px;
        line-height: 1.9;
    }

    .afs-questions-list{
        gap: 12px;
    }

    .afs-question-btn{
        font-size: 14px;
        padding: 14px 16px;
    }
}

/* خیلی موبایل کوچک (مثلاً 360px) – اختیاری */
@media (max-width: 400px){
    .afs-wrap{
        padding: 14px;
    }

    .afs-message-bubble{
        padding: 14px 12px;
    }

    .afs-question-btn{
        font-size: 13px;
        padding: 12px 14px;
    }
}


/* اصلاحات ریسپانسیو برای حل مشکل بیرون‌زدگی */
@media (max-width: 480px){
    .afs-wrap {
        padding: 16px;
        width: 100%;
        border-radius: 20px; /* کمتر کردن رادیوس برای گوشی‌های کوچک */
    }

    .afs-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .afs-logo-box, .afs-logo-placeholder {
        width: 120px !important;
        height: 120px !important;
        border-width: 4px !important;
    }

    .afs-message-area {
        width: 100%;
        max-width: 100%;
        overflow-wrap: break-word;
    }

    .afs-message-bubble {
        padding: 15px;
        width: 100%;
    }

    .afs-message-bubble::before {
        right: 20px;
    }

    .afs-question-btn {
        width: 100%; /* مطمئن شو دکمه‌ها تمام عرض هستند */
        font-size: 14px;
        padding: 14px 12px;
        text-align: center; /* برای موبایل بهتر است */
    }
}
@media (max-width: 480px) {
    .afs-wrap{
        padding: 16px 12px;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        border-radius: 20px;
    }

    .afs-grid{
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .afs-logo-box{
        width: 140px;
        height: 140px;
    }

    .afs-logo-placeholder{
        width: 130px;
        height: 130px;
        border-width: 6px;
        font-size: 18px;
    }

    .afs-message-area{
        width: 100%;
        max-width: 100%;
    }

    .afs-message-bubble{
        width: 100%;
        padding: 14px 12px;
        min-height: auto;
    }

    .afs-message-bubble::before{
        right: 20px;
        top: -8px;
        width: 18px;
        height: 18px;
    }

    .afs-message-content{
        font-size: 14px;
        line-height: 1.8;
    }

    .afs-questions-list{
        gap: 10px;
    }

    .afs-question-btn{
        width: 100%;
        font-size: 13px;
        padding: 12px 12px;
        line-height: 2rem;
        text-align: right;   /* توی موبایل بهتره */
        white-space: normal;  /* اجازه بده متن به خط بعد بره */
    }
}
