:root {
    --qa-dark-blue: #012087;
    --qa-blue: #265cff;
    --qa-text-primary: #101828;
    --qa-text-secondary: #475467;
    --qa-text-muted: #98a2b3;
    --qa-border: #e4e7ec;
    --qa-background-soft: #f7f8fa;
    --qa-background-blue: #f7f9ff;
    --qa-white: #fff;
}

#quesbox.qa-section {
    direction: rtl;
    width: 100%;
    margin: 28px 0;
    padding: 0;
    color: var(--qa-text-primary);
    background: transparent;
    border: 0;
    font-family: inherit;
}

#quesbox .qa-header,
#quesbox .qa-title-row,
#quesbox .qa-footer,
#quesbox .qa-answer-header {
    display: flex;
    align-items: center;
}

#quesbox .qa-header {
    justify-content: flex-start;
    gap: 20px;
    margin: 0 0 16px;
}

#quesbox .qa-title-row { gap: 10px; }

#quesbox .qa-title {
    margin: 0;
    color: var(--qa-text-primary);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.6;
}

#quesbox .qa-count {
    padding: 5px 10px;
    color: #667085;
    background: #f2f4f7;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
}

#quesbox .qa-subtitle {
    margin: 4px 0 0;
    color: #667085;
    font-size: 13px;
    line-height: 1.8;
}

#quesbox .qa-new-question,
#quesbox .qa-footer-button {
    min-height: 44px;
    padding: 10px 18px;
    color: var(--qa-dark-blue);
    background: var(--qa-white);
    border: 1px solid var(--qa-dark-blue);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

#quesbox .qa-new-question:hover,
#quesbox .qa-footer-button:hover {
    color: var(--qa-white);
    background: var(--qa-dark-blue);
}

#quesbox .qa-new-question:focus-visible,
#quesbox .qa-footer-button:focus-visible,
#quesbox .qa-question:focus-visible {
    outline: 3px solid rgba(38, 92, 255, .25);
    outline-offset: 3px;
}

#quesbox .qa-list { display: block; }

#quesbox .qa-item {
    margin-bottom: 12px;
    overflow: hidden;
    background: var(--qa-white);
    border: 1px solid var(--qa-border);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
    transition: border-color .2s ease, background-color .2s ease;
}

#quesbox .qa-item:hover { border-color: #cdd5df; }
#quesbox .qa-item.active { border-color: #d7e1ff; }

#quesbox .qa-question-heading {
    margin: 0;
    padding: 0;
    font-size: inherit;
}

#quesbox .qa-question {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    margin: 0;
    padding: 15px 18px 13px;
    color: inherit;
    background: transparent;
    border: 0;
    text-align: right;
    cursor: default;
}

#quesbox .qa-question-content {
    display: block;
    width: min(100%, 900px);
}

#quesbox .qa-user {
    display: block;
    margin-bottom: 4px;
    color: var(--qa-text-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.6;
}

#quesbox .qa-question-title {
    display: block;
    color: var(--qa-text-primary);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.9;
}

#quesbox .qa-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    color: #667085;
    background: #f2f4f7;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    transition: color .2s ease, background-color .2s ease;
}

#quesbox .qa-item.active .qa-toggle {
    color: var(--qa-dark-blue);
    background: #eef3ff;
}

#quesbox .qa-answer { padding: 0 18px 15px; }
#quesbox .qa-answer[hidden] { display: none !important; }

#quesbox .qa-answer::before {
    display: block;
    height: 1px;
    margin-bottom: 12px;
    background: #eaecf0;
    content: "";
}

#quesbox .qa-answer-entry + .qa-answer-entry {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #eaecf0;
}

#quesbox .qa-answer-header {
    gap: 7px;
    margin-bottom: 6px;
    color: var(--qa-dark-blue);
    font-size: 13px;
    font-weight: 600;
}

#quesbox .qa-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--qa-white);
    background: var(--qa-dark-blue);
    border-radius: 6px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

#quesbox .qa-answer-text {
    width: 100%;
    max-width: none;
    color: var(--qa-text-secondary);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.85;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

#quesbox .qa-phone-link {
    display: inline-block;
    color: var(--qa-dark-blue);
    font-weight: 600;
    text-decoration: none;
    direction: ltr;
    unicode-bidi: isolate;
}

#quesbox .qa-phone-link:hover,
#quesbox .qa-phone-link:focus { text-decoration: underline; }

#quesbox .qa-awaiting-answer { color: #667085; }

#quesbox .qa-empty {
    padding: 24px;
    color: #667085;
    background: var(--qa-background-soft);
    border: 1px dashed var(--qa-border);
    border-radius: 14px;
    text-align: center;
}

#quesbox .qa-footer {
    display: block;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 24px;
    padding: 20px 22px;
    background: linear-gradient(135deg, #f7f9ff 0%, #f1f5ff 100%);
    border: 1px solid #e1e8ff;
    border-radius: 14px;
}

#quesbox .qa-footer-button {
    display: block;
    min-width: 112px;
    margin-top: 14px;
    color: var(--qa-white);
    background: var(--qa-dark-blue);
}

#quesbox .qa-footer-button:hover {
    background: #001968;
}

#quesbox .qa-footer-copy strong,
#quesbox .qa-footer-copy span { display: block; }

#quesbox .qa-footer-copy strong {
    margin-bottom: 4px;
    color: var(--qa-text-primary);
    font-size: 14px;
    line-height: 1.8;
}

#quesbox .qa-footer-copy span {
    color: #667085;
    font-size: 13px;
    line-height: 1.8;
}

/* Question form modal */
#question_modal { direction: rtl; }

#question_modal .modal-dialog {
    width: auto;
    max-width: 560px;
    margin: 40px auto;
}

#question_modal .modal-content {
    overflow: hidden;
    background: #fff;
    border: 0;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(16, 24, 40, .22);
}

#question_modal .modal-header {
    position: relative;
    min-height: 0;
    padding: 22px 24px 18px;
    color: #101828 !important;
    background: #fff !important;
    border: 0 !important;
    border-bottom: 1px solid #eaecf0 !important;
}

#question_modal .modal-header .close {
    position: absolute;
    top: 18px;
    left: 20px;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    color: #667085 !important;
    background: #f2f4f7;
    border: 0;
    border-radius: 50%;
    font-size: 24px;
    line-height: 34px;
    opacity: 1;
}

#question_modal .qa-modal-heading { padding-left: 46px; }

#question_modal .modal-title {
    margin: 0;
    color: #101828 !important;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.7;
}

#question_modal .qa-modal-product {
    margin: 4px 0 0;
    color: #667085;
    font-size: 13px;
    line-height: 1.8;
}

#question_modal .modal-body { padding: 24px; }
#question_modal .form-group { margin: 0 0 18px; }

#question_modal .control-label {
    display: block;
    margin: 0 0 7px;
    color: #344054;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.7;
}

#question_modal .form-control {
    width: 100%;
    height: 46px;
    padding: 10px 12px;
    color: #101828;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    box-shadow: none;
    font-size: 14px;
    line-height: 1.7;
    transition: border-color .2s ease, box-shadow .2s ease;
}

#question_modal textarea.form-control {
    min-height: 132px;
    resize: vertical;
}

#question_modal .form-control:focus {
    border-color: #265cff;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(38, 92, 255, .12);
}

#question_modal .qa-form-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 4px;
}

#question_modal #button-qa {
    min-width: 120px;
    min-height: 44px;
    padding: 10px 22px;
    color: #fff !important;
    background: #012087 !important;
    border: 1px solid #012087 !important;
    border-radius: 10px !important;
    font-size: 14px;
    font-weight: 600;
}

#question_modal .text-danger {
    margin-top: 6px;
    color: #d92d20;
    font-size: 12px;
}

#question_modal .qa-optional { color: #98a2b3; font-size: 12px; font-weight: 400; }
#question_modal .qa-field-help { display: block; margin-top: 6px; color: #667085; font-size: 12px; line-height: 1.7; }

/* Existing question modal */
#questionanswer {
    width: 100%;
    min-height: 50px;
    margin-right: 0;
    margin-left: 0;
    padding: 3px;
    background: #f8f8f8;
    border: 1px solid #ccc;
}

#questionanswer table { width: 100%; }
#questionanswer table tr td:first-child { width: 10%; }
#questionanswer table tr td:last-child { width: 90%; }
#tab-questionanswer .input-group { margin-bottom: 10px; }
#tab-questionanswer .modal-body form { padding: 16px; border: 1px solid var(--qa-border); }
.question-btn { justify-content: end; margin: 5px 15px !important; }
.question-note { margin: 10px 0 0; font-size: 14px; }
#question_modal label { color: #222; font-weight: 600; }
#question_modal .form-control { color: #222; }
.text-danger { color: #d92d20; }
.captcha label { display: none !important; }

@media (max-width: 768px) {
    #quesbox.qa-section { margin: 20px 0; }
    #quesbox .qa-header,
    #quesbox .qa-footer {
        align-items: stretch;
        flex-direction: column;
    }
    #quesbox .qa-footer-button { width: 100%; }
    #quesbox .qa-question { gap: 12px; padding: 14px; }
    #quesbox .qa-answer { padding: 0 14px 14px; }
    #quesbox .qa-question-title { font-size: 16px; }
    #quesbox .qa-answer-text { font-size: 15px; line-height: 1.9; }
    #question_modal .modal-dialog { margin: 12px; }
    #question_modal .modal-header { padding: 18px 18px 15px; }
    #question_modal .modal-body { padding: 18px; }
    #question_modal .qa-modal-heading { padding-left: 42px; }
    #question_modal .modal-title { font-size: 16px; }
    #question_modal #button-qa { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    #quesbox .qa-item,
    #quesbox .qa-toggle,
    #quesbox .qa-new-question,
    #quesbox .qa-footer-button { transition: none; }
}
