/* =========================================================
   ENGINEERING FAQ AI - FIXED & MERGED
========================================================= */

.faq-ai {
    --faq-ink: #172026;
    --faq-paper: #ffffff;
    --faq-soft: #f4f6f5;
    --faq-line: #e1e6e7;
    --faq-muted: #69757a;
    --faq-accent: #c6a15b;
    --faq-shadow: 0 24px 70px rgba(17, 24, 28, .22);
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 100000;
    font-family: Roboto Slab, Arial, sans-serif;
}

.faq-ai-launcher {
    position: relative;
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 50%;
    background: var(--faq-ink);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 14px 35px rgba(23, 32, 38, .28);
    display: grid;
    place-items: center;
    transition: transform .25s ease, box-shadow .25s ease;
}

.faq-ai-launcher:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 42px rgba(23, 32, 38, .34);
}

.faq-ai-launcher-icon {
    font-size: 21px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.faq-ai-launcher-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 50%;
}

.faq-ai-launcher-label {
    position: absolute;
    right: -2px;
    bottom: -1px;
    min-width: 25px;
    height: 25px;
    padding: 0 6px;
    border-radius: 20px;
    background: var(--faq-accent);
    color: var(--faq-ink);
    display: grid;
    place-items: center;
    font: 800 9px/1 Oswald, sans-serif;
    letter-spacing: .08em;
}

.faq-ai-launcher-pulse {
    position: absolute;
    inset: -5px;
    border: 1px solid rgba(198, 161, 91, .55);
    border-radius: 50%;
    animation: faqPulse 2.6s ease-out infinite;
    pointer-events: none;
}

@keyframes faqPulse {
    0% { transform: scale(.94); opacity: .8; }
    70%, 100% { transform: scale(1.16); opacity: 0; }
}

.faq-ai-panel {
    position: absolute;
    right: 0;
    bottom: 82px;
    top: auto;
    width: min(380px, calc(100vw - 30px));
    height: 580px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--faq-paper);
    border: 1px solid rgba(23, 32, 38, .1);
    border-radius: 18px;
    box-shadow: var(--faq-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(.98);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}

.faq-ai.is-open .faq-ai-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.faq-ai-header {
    min-height: 68px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--faq-ink);
    color: #fff;
    overflow: hidden;
}

.faq-ai-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .1);
    color: var(--faq-accent);
    font-size: 16px;
    overflow: hidden;
}

.faq-ai-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.faq-ai-heading {
    min-width: 0;
    flex: 1;
}

.faq-ai-heading strong {
    display: block;
    font: 800 13px/1.2 Oswald, sans-serif;
    letter-spacing: .01em;
    margin: 0;
}

.faq-ai-heading span {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    color: #bdc6c9;
    font-size: 10px;
}

.faq-ai-heading span i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #75b78c;
}

.faq-ai-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #dce1e2;
    cursor: pointer;
    font-size: 16px;
}

.faq-ai-close:hover {
    background: rgba(255, 255, 255, .08);
}

.faq-ai-messages {
    flex: 1;
    padding: 18px 15px 10px;
    overflow-y: auto;
    background:
        radial-gradient(circle at top right, rgba(198, 161, 91, .08), transparent 30%),
        #fbfcfc;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.faq-ai-message {
    display: flex;
    margin: 0 0 13px;
}

.faq-ai-message.is-user {
    justify-content: flex-end;
}

.faq-ai-bubble {
    max-width: 86%;
    padding: 11px 13px;
    border-radius: 14px 14px 14px 4px;
    background: #fff;
    border: 1px solid var(--faq-line);
    color: #354148;
    font-size: 13px;
    line-height: 1.6;
    box-shadow: 0 4px 15px rgba(17, 24, 28, .04);
}

.is-user .faq-ai-bubble {
    border-radius: 14px 14px 4px 14px;
    background: var(--faq-ink);
    border-color: var(--faq-ink);
    color: #fff;
}

.faq-ai-bubble p {
    margin: 0;
}

.faq-ai-bubble a {
    display: inline-flex;
    margin-top: 9px;
    color: #9b7b3e;
    font-weight: 800;
    text-decoration: none;
}

.faq-ai-bubble a:hover {
    text-decoration: underline;
}

.faq-ai-typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.faq-ai-typing i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #9ba5a8;
    animation: faqTyping 1s infinite ease-in-out;
}

.faq-ai-typing i:nth-child(2) { animation-delay: .14s; }
.faq-ai-typing i:nth-child(3) { animation-delay: .28s; }

@keyframes faqTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: .45; }
    30% { transform: translateY(-3px); opacity: 1; }
}

.faq-ai-quick {
    display: flex;
    gap: 6px;
    padding: 6px 12px 8px;
    overflow-x: auto;
    scrollbar-width: thin;
    background: #fbfcfc;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    -webkit-overflow-scrolling: touch;
}

.faq-ai-quick:empty {
    display: none;
}

.faq-ai-quick button {
    flex: 0 0 auto;
    border: 1px solid #d8dfe0;
    border-radius: 999px;
    background: #fff;
    color: #4d595e;
    padding: 7px 10px;
    font: 600 11px/1.2 Roboto Slab, sans-serif;
    cursor: pointer;
    white-space: nowrap;
}

.faq-ai-quick button:hover {
    border-color: var(--faq-accent);
    color: var(--faq-ink);
}

.faq-ai-form {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--faq-line);
    background: #fff;
}

.faq-ai-form input {
    min-width: 0;
    flex: 1;
    height: 43px;
    border: 1px solid #d9dfe0;
    border-radius: 10px;
    outline: 0;
    padding: 0 12px;
    color: var(--faq-ink);
    background: #fafbfb;
    font: 500 14px/1.2 Roboto Slab, sans-serif;
}

.faq-ai-form input:focus {
    border-color: var(--faq-accent);
    box-shadow: 0 0 0 3px rgba(198, 161, 91, .12);
}

.faq-ai-form button {
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    border: 0;
    border-radius: 10px;
    background: var(--faq-ink);
    color: #fff;
    cursor: pointer;
}

.faq-ai-form button:hover {
    background: #26343b;
}

.faq-ai-form button:disabled {
    opacity: .55;
    cursor: wait;
}

.faq-ai-footer {
    min-height: 35px;
    padding: 0 13px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #9aa3a6;
    font-size: 9px;
}

.faq-ai-footer a {
    color: #9b7b3e;
    font-weight: 800;
}

.faq-ai-footer i {
    margin-left: 3px;
    font-size: 8px;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* =========================================================
   RESPONSIVE & SMALL DEVICE ADAPTATIONS
========================================================= */

@media (max-width: 600px) {
    .faq-ai {
        right: 14px;
        bottom: 14px;
    }

    .faq-ai-launcher {
        width: 54px;
        height: 54px;
    }

    .faq-ai-panel {
        right: -2px;
        bottom: 68px;
        width: min(390px, calc(100vw - 24px));
        height: min(580px, calc(100vh - 95px));
        border-radius: 16px;
    }
}

/* Very Small Mobile Screens (Phones under 480px) */
@media (max-width: 480px) {
    .faq-ai {
        right: 10px;
        bottom: 10px;
    }

    .faq-ai-panel {
        position: fixed;
        right: 10px;
        left: 10px;
        bottom: 72px;
        width: auto;
        height: calc(100dvh - 90px);
        max-height: none;
        border-radius: 16px;
    }

    .faq-ai-header {
        min-height: 60px;
        padding: 10px 12px;
    }

    .faq-ai-avatar {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        font-size: 15px;
    }

    .faq-ai-messages {
        padding: 14px 10px 8px;
    }

    .faq-ai-bubble {
        max-width: 90%;
        padding: 10px 12px;
        font-size: 12px;
    }

    .faq-ai-form {
        padding: 8px 10px;
    }

    .faq-ai-form input {
        height: 40px;
        font-size: 16px; /* Prevents iOS auto-zoom on input focus */
    }

    .faq-ai-form button {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
    }
}

/*====================================
whatsapp green app
====================================*/

.whatsapp-float {
    position: fixed;
    right: 24px;
    bottom: 105px;
    width: 62px;
    height: 62px;
    z-index: 9998;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    text-decoration: none;

    filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.25));

    transition:
        transform 0.25s ease,
        filter 0.25s ease;
}

.whatsapp-float img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 50%;
}

.whatsapp-float:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 7px 16px rgba(0, 0, 0, 0.35));
}

@media (max-width: 768px) {
    .whatsapp-float {
        right: 16px;
        bottom: 95px;
        width: 56px;
        height: 56px;
    }
}