/* FAQ Чат Бот за Медиана — версия 1.4.0 */

#mediana-faq-widget,
#mediana-faq-widget * {
    box-sizing: border-box;
}

#mediana-faq-widget {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 2147483000;
    width: min(320px, calc(100vw - 24px));
    color: #1f2933;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.42;
    text-align: left;
}

#mediana-faq-widget [hidden] {
    display: none !important;
}

#mediana-faq-widget .mediana-faq-panel {
    width: 100%;
    margin: 0 0 7px;
    overflow: hidden;
    border: 1px solid #cfd8e3;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 12px 34px rgba(15, 35, 55, 0.24);
}

#mediana-faq-widget .mediana-faq-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    padding: 10px 12px 10px 15px;
    background: #1769aa;
    color: #ffffff;
}

#mediana-faq-widget .mediana-faq-header h2 {
    margin: 0;
    padding: 0;
    color: inherit;
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
}

#mediana-faq-widget .mediana-faq-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 30px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
    font: 400 28px/1 Arial, Helvetica, sans-serif;
    cursor: pointer;
}

#mediana-faq-widget .mediana-faq-close:hover,
#mediana-faq-widget .mediana-faq-close:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    outline: none;
}

#mediana-faq-widget .mediana-faq-warning {
    margin: 0;
    padding: 10px 12px;
    border-bottom: 1px solid #dbe3ec;
    background: #fff7dc;
    color: #4f4317;
    font-size: 12.5px;
    line-height: 1.38;
}

#mediana-faq-widget .mediana-faq-chatbox {
    display: flex;
    min-height: 150px;
    max-height: min(42vh, 330px);
    flex-direction: column;
    gap: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px;
    background: #f5f7fa;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

#mediana-faq-widget .mediana-faq-message {
    width: fit-content;
    max-width: 88%;
    margin: 0;
    padding: 8px 10px;
    overflow-wrap: anywhere;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    white-space: pre-line;
}

#mediana-faq-widget .mediana-faq-message-user {
    align-self: flex-end;
    border-bottom-right-radius: 3px;
    background: #1769aa;
    color: #ffffff;
}

#mediana-faq-widget .mediana-faq-message-bot {
    align-self: flex-start;
    border: 1px solid #d7e0e9;
    border-bottom-left-radius: 3px;
    background: #ffffff;
    color: #1f2933;
}

#mediana-faq-widget .mediana-faq-form {
    display: block;
    margin: 0;
    padding: 10px;
    border-top: 1px solid #dbe3ec;
    background: #ffffff;
}

#mediana-faq-widget .mediana-faq-input {
    display: block;
    width: 100%;
    height: 42px;
    min-height: 42px;
    margin: 0;
    padding: 9px 11px;
    border: 1px solid #aebdcb;
    border-radius: 8px;
    background: #ffffff;
    color: #17212b;
    font: 400 14px/1.3 Arial, Helvetica, sans-serif;
    box-shadow: none;
    outline: none;
}

#mediana-faq-widget .mediana-faq-input::placeholder {
    color: #44515e;
    opacity: 1;
}

#mediana-faq-widget .mediana-faq-input:focus {
    border-color: #1769aa;
    box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.15);
}

#mediana-faq-widget .mediana-faq-actions {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 3px;
}

#mediana-faq-widget .mediana-faq-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 9px 12px;
    border: 0;
    color: #ffffff;
    font: 700 14px/1.25 Arial, Helvetica, sans-serif;
    text-align: center;
    text-decoration: none;
    text-shadow: none;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.15s ease;
}

#mediana-faq-widget .mediana-faq-action svg {
    width: 19px;
    height: 19px;
    min-width: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#mediana-faq-widget .mediana-faq-action-chat {
    border-radius: 10px 10px 4px 4px;
    background: #1769aa;
}

#mediana-faq-widget .mediana-faq-action-viber {
    border-radius: 4px 4px 10px 10px;
    background: #665cac;
}

#mediana-faq-widget .mediana-faq-action:hover,
#mediana-faq-widget .mediana-faq-action:focus-visible {
    color: #ffffff;
    text-decoration: none;
    filter: brightness(0.92);
    outline: 3px solid rgba(23, 105, 170, 0.22);
    outline-offset: 2px;
}

#mediana-faq-widget .mediana-faq-action:active {
    transform: translateY(1px);
}

#mediana-faq-widget .mediana-faq-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    border: 0 !important;
    white-space: nowrap !important;
}

@media (min-width: 561px) {
    #mediana-faq-widget .mediana-faq-actions {
        width: 225px;
        margin-left: auto;
    }

    #mediana-faq-widget .mediana-faq-action {
        gap: 6px;
        min-height: 32px;
        padding: 5px 8px;
        font: 700 12.5px/1.2 Arial, Helvetica, sans-serif;
    }

    #mediana-faq-widget .mediana-faq-action svg {
        width: 15px;
        height: 15px;
        min-width: 15px;
    }
}

@media (max-width: 560px) {
    body #page.show-mobile-header ~ #mediana-faq-widget {
        display: none !important;
    }

    #mediana-faq-widget {
        right: 12px;
        bottom: 12px;
        width: min(340px, calc(100vw - 24px));
    }

    #mediana-faq-widget .mediana-faq-chatbox {
        max-height: min(40vh, 290px);
    }
}

@media (max-height: 600px) {
    #mediana-faq-widget .mediana-faq-warning {
        max-height: 76px;
        overflow-y: auto;
    }

    #mediana-faq-widget .mediana-faq-chatbox {
        min-height: 105px;
        max-height: 27vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    #mediana-faq-widget .mediana-faq-action {
        transition: none;
    }
}

/* v1.4 — бързи теми */
#mediana-faq-widget .mediana-faq-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 9px 10px;
    border-bottom: 1px solid #dbe3ec;
    background: #ffffff;
}

#mediana-faq-widget .mediana-faq-quick-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    margin: 0;
    padding: 5px 8px;
    border: 1px solid #b9cad9;
    border-radius: 999px;
    background: #f6f9fc;
    color: #174f7d;
    font: 600 11.5px/1.2 Arial, Helvetica, sans-serif;
    text-decoration: none;
    cursor: pointer;
}

#mediana-faq-widget .mediana-faq-quick-btn:hover,
#mediana-faq-widget .mediana-faq-quick-btn:focus-visible {
    border-color: #1769aa;
    background: #edf5fb;
    color: #174f7d;
    outline: none;
}

#mediana-faq-widget .mediana-faq-quick-link {
    background: #1769aa;
    border-color: #1769aa;
    color: #ffffff;
}

#mediana-faq-widget .mediana-faq-quick-link:hover,
#mediana-faq-widget .mediana-faq-quick-link:focus-visible {
    background: #125b94;
    color: #ffffff;
}
