/* ═══════════════════════════════════════════════
   Azamol Meatfest AI Asistan — Sohbet Widget Stilleri
   ═══════════════════════════════════════════════ */

/* Değişkenler PHP tarafından :root'a enjekte edilir (marka jetonları, var()+fallback) */

/* Ekran okuyucu-only yardımcı sınıf (MEAT FEST UYARLAMALARI §8 — erişilebilirlik) */
.mfa-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;
}

/* prefers-reduced-motion: reduce -> animasyonlar kapanır (MEAT FEST UYARLAMALARI §8) */
@media (prefers-reduced-motion: reduce) {
    #mfa-chat-container,
    #mfa-chat-container *,
    #mfa-chat-bubble,
    #mfa-chat-window,
    .mfa-message,
    #mfa-notify-bubble {
        animation: none !important;
        transition: none !important;
    }
}

/* ── Konteyner ── */
#mfa-chat-container {
    position: fixed !important;
    bottom: 24px !important;
    z-index: 999999 !important;
    /* MEAT FEST UYARLAMALARI §7: sabit bir yazı ailesi ZORLAMAZ — site genelinde
       yüklü olan Poppins/Playfair Display'i miras alır (Woodmart body font-family). */
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
    width: auto !important;
    height: auto !important;
}
#mfa-chat-container * {
    box-sizing: border-box !important;
}
#mfa-chat-container.mfa-right {
    right: 24px !important;
}
#mfa-chat-container.mfa-left {
    left: 24px !important;
}

/* ── Sohbet Balonu ── */
#mfa-chat-bubble {
    width: var(--mfa-bubble-size, 62px) !important;
    height: var(--mfa-bubble-size, 62px) !important;
    min-width: var(--mfa-bubble-size, 62px) !important;
    min-height: var(--mfa-bubble-size, 62px) !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    background: var(--mfa-bubble-color, #7a1f2b) !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 6px 20px rgba(122,31,43,0.4), 0 2px 6px rgba(0,0,0,0.15) !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s !important;
    position: relative !important;
    animation: mfaBounce 2.5s ease infinite;
    animation-delay: 3s;
}
#mfa-chat-bubble:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 8px 28px rgba(122,31,43,0.5) !important;
}
#mfa-chat-bubble.mfa-bubble-active {
    animation: none !important;
    transform: scale(1) !important;
}
.mfa-bubble-icon {
    width: 28px !important;
    height: 28px !important;
    color: #fff !important;
}

@keyframes mfaBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

/* ── Sohbet Penceresi ── */
#mfa-chat-window {
    position: absolute !important;
    bottom: calc(var(--mfa-bubble-size, 62px) + 16px) !important;
    width: var(--mfa-chat-width, 420px) !important;
    height: var(--mfa-chat-height, 600px) !important;
    /* 🔴 1.1.6: pencere ALTTAN konumlaniyor (`bottom: balon + 16px`) ve
       yuksekligi SABIT idi -- ekran kisaldikca ust kenari yukari tasiyordu.
       OLCULDU: 1280x610 viewport'ta ust kenar y=-90 -> pencere EKRAN DISI,
       kullanici balonu acik (X) goruyor ama pencereyi goremiyordu. Tarayici
       zoom'u da tetikler (%125-150 efektif yuksekligi 600-700px'e dusurur).
       `max-height` `height`i ezer; once vh (her tarayicida var), sonra dvh. */
    max-height: calc(100vh - 108px) !important;
    max-height: calc(100dvh - 108px) !important;
    background: var(--mfa-chat-bg, #faf6f1) !important;
    border-radius: var(--mfa-border-radius, 14px) !important;
    box-shadow: 0 24px 64px rgba(0,0,0,0.18), 0 8px 24px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06) !important;
    flex-direction: column !important;
    overflow: hidden !important;
    opacity: 0;
    transform: translateY(20px) scale(0.94);
    transition: opacity 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    z-index: 1000000 !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
}
.mfa-right #mfa-chat-window {
    right: 0 !important;
}
.mfa-left #mfa-chat-window {
    left: 0 !important;
}
#mfa-chat-window.mfa-window-open {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

/* ── Başlık ── */
#mfa-chat-header {
    background: var(--mfa-header-bg, #7a1f2b) !important;
    color: var(--mfa-header-text, #faf6f1) !important;
    padding: 16px 18px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    border-radius: var(--mfa-border-radius, 14px) var(--mfa-border-radius, 14px) 0 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: hidden !important;
}
#mfa-chat-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    pointer-events: none;
}
.mfa-header-info {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    position: relative;
}
.mfa-header-avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid rgba(255,255,255,0.4) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
}
.mfa-header-avatar-default {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,0.18) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
}
.mfa-header-avatar-default svg {
    width: 22px !important;
    height: 22px !important;
    color: rgba(255,255,255,0.9) !important;
    display: block !important;
}
.mfa-header-text {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
}
.mfa-header-name {
    font-weight: 700 !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    letter-spacing: -0.01em !important;
}
.mfa-header-status {
    font-size: 12px !important;
    opacity: 0.85 !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    margin: 0 !important;
}
.mfa-status-dot {
    width: 7px !important;
    height: 7px !important;
    border-radius: 50% !important;
    background: #4ADE80 !important;
    display: inline-block !important;
    box-shadow: 0 0 6px rgba(74,222,128,0.8) !important;
    animation: mfaPulse 2s infinite !important;
}
@keyframes mfaPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}
#mfa-chat-close {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    border: none !important;
    background: rgba(255,255,255,0.15) !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.2s, transform 0.2s;
    padding: 0 !important;
    margin: 0 !important;
    position: relative;
}
#mfa-chat-close:hover {
    background: rgba(255,255,255,0.28) !important;
    transform: rotate(90deg);
}
#mfa-chat-close svg {
    width: 18px !important;
    height: 18px !important;
    color: var(--mfa-header-text, #faf6f1) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ── Mesaj Alanı ── */
#mfa-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
    background: var(--mfa-chat-bg, #faf6f1);
}
#mfa-chat-messages::-webkit-scrollbar {
    width: 4px;
}
#mfa-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
#mfa-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}
#mfa-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.18);
}

/* ── Mesaj Balonları ── */
.mfa-message {
    display: flex;
    gap: 8px;
    max-width: 88%;
    animation: mfaMsgIn 0.25s ease;
}
@keyframes mfaMsgIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.mfa-message-visitor {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.mfa-message-ai,
.mfa-message-admin {
    align-self: flex-start;
}

/* Avatar */
.mfa-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}
.mfa-message-visitor .mfa-msg-avatar {
    background: var(--mfa-user-bubble, #7a1f2b);
    box-shadow: 0 2px 6px rgba(122,31,43,0.3);
}
.mfa-message-ai .mfa-msg-avatar,
.mfa-message-admin .mfa-msg-avatar {
    background: #EEF0F8;
}
.mfa-msg-avatar svg {
    width: 16px;
    height: 16px;
}
.mfa-message-visitor .mfa-msg-avatar svg {
    color: #fff;
}
.mfa-message-ai .mfa-msg-avatar svg,
.mfa-message-admin .mfa-msg-avatar svg {
    color: #6B7280;
}
.mfa-msg-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Balon */
.mfa-msg-bubble {
    padding: 11px 15px;
    border-radius: 18px;
    position: relative;
    word-break: break-word;
    line-height: 1.55;
}
.mfa-message-visitor .mfa-msg-bubble {
    background: var(--mfa-user-bubble, #7a1f2b);
    color: var(--mfa-user-text, #faf6f1);
    border-bottom-right-radius: 5px;
    box-shadow: 0 2px 10px rgba(122,31,43,0.25);
}
.mfa-message-ai .mfa-msg-bubble {
    background: var(--mfa-ai-bubble, #ffffff);
    color: var(--mfa-ai-text, #1b1512);
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.mfa-message-admin .mfa-msg-bubble {
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FDE68A;
    border-bottom-left-radius: 5px;
}
.mfa-msg-text {
    font-size: 14px;
    line-height: 1.55;
}
.mfa-msg-text a {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
}
.mfa-msg-time {
    font-size: 10px;
    opacity: 0.5;
    margin-top: 5px;
    text-align: right;
}
.mfa-admin-label {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #D97706;
    background: #FEF3C7;
    padding: 1px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ── Mesaj İçi Ekler: Ses ve Görsel (1.1.7 — MADDE 3) ──
   Balonun kendi genişliğine oturur, mobilde de taşmaz. Renk sabitleri
   UYDURULMADI -- mevcut --mfa-* jetonlarina uyulur (audio/img elementleri
   dogal renk kullanir, ek renk gerekmiyor). */
.mfa-msg-audio {
    display: block;
    width: 100%;
    max-width: 240px;
    min-width: 190px;
    height: 40px;
    border-radius: 20px;
    margin: 2px 0;
}
.mfa-msg-image {
    display: block;
    width: 100%;
    max-width: 220px;
    max-height: 220px;
    object-fit: cover;
    border-radius: 12px;
    margin: 2px 0;
}
/* Mobil tam ekran pencerede balon genişliği artar — ek de orantılı büyür */
@media (max-width: 520px) {
    .mfa-msg-audio {
        max-width: 280px;
    }
    .mfa-msg-image {
        max-width: 260px;
        max-height: 260px;
    }
}

/* Link Buton */
.mfa-msg-link-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 7px 18px;
    background: var(--mfa-bubble-color, #7a1f2b);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    letter-spacing: 0.01em;
}
.mfa-msg-link-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(122,31,43,0.3);
    opacity: 0.92;
}
.mfa-msg-secondary {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.09);
    font-size: 14px;
    opacity: 1;
    font-style: normal;
    font-weight: 500;
    line-height: 1.55;
    color: var(--mfa-ai-text, #1b1512);
}
.mfa-msg-secondary-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 7px 18px;
    background: var(--mfa-bubble-color, #7a1f2b);
    color: #fff !important;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    font-style: normal;
    text-decoration: none !important;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    letter-spacing: 0.01em;
}
.mfa-msg-secondary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(122,31,43,0.3);
    opacity: 0.92;
}

/* ── Ek Butonlar (1.2.0 — ek_butonlar: WhatsApp/telefon vb.) ──
   Renk/radius/font .mfa-msg-secondary-btn'den AYNEN miras alınır (yeni bir
   tasarım dili icat edilmedi); yalnız düzen (yan yana/alt alta sarma) ve
   dokunma hedefi (min 44px) için ek sınıflar. */
.mfa-msg-ek-butonlar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.mfa-msg-ek-buton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 0;
    min-height: 44px;
    box-sizing: border-box;
}
.mfa-ek-buton-ikon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.mfa-ek-buton-ikon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ── Yazıyor Göstergesi ── */
#mfa-typing-indicator {
    padding: 4px 16px 10px;
    flex-shrink: 0;
}
.mfa-typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--mfa-ai-bubble, #ffffff);
    color: var(--mfa-ai-text, #1b1512);
    padding: 9px 16px;
    border-radius: 18px;
    border-bottom-left-radius: 5px;
    font-size: 13px;
    animation: mfaMsgIn 0.25s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.mfa-typing-text {
    font-style: italic;
    opacity: 0.7;
    font-size: 13px;
}
.mfa-typing-dots {
    display: flex;
    gap: 4px;
}
.mfa-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mfa-bubble-color, #7a1f2b);
    opacity: 0.4;
    animation: mfaDotPulse 1.4s infinite;
}
.mfa-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}
.mfa-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes mfaDotPulse {
    0%, 60%, 100% { opacity: 0.3; transform: scale(1); }
    30% { opacity: 1; transform: scale(1.3); }
}

/* ── Giriş Alanı ── */
#mfa-chat-input-area {
    padding: 12px 14px !important;
    border-top: 1px solid rgba(0,0,0,0.07) !important;
    display: flex !important;
    align-items: flex-end !important;
    gap: 6px !important;
    background: var(--mfa-chat-bg, #faf6f1) !important;
    flex-shrink: 0 !important;
    min-height: 60px !important;
    box-sizing: border-box !important;
}
.mfa-input-wrapper {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
}
#mfa-message-input {
    width: 100%;
    border: 1.5px solid #E5E7EB;
    border-radius: 22px !important;
    padding: 9px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 130px !important;
    margin: 0 !important;
    line-height: 1.4;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #F9FAFB !important;
    box-sizing: border-box !important;
    overflow: hidden;
    color: #1F2937;
}
#mfa-message-input:focus {
    border-color: var(--mfa-bubble-color, #7a1f2b) !important;
    background: #fff !important;
    box-shadow: 0 0 0 3.5px rgba(122,31,43,0.1) !important;
}
#mfa-message-input::placeholder {
    color: #9CA3AF !important;
}

/* Butonlar */
.mfa-input-btn {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    border: none !important;
    background: transparent;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #9CA3AF;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s, transform 0.15s;
    padding: 0 !important;
    margin: 0 !important;
}
.mfa-input-btn:hover {
    color: var(--mfa-bubble-color, #7a1f2b);
    background: #F3F4F6;
    transform: scale(1.08);
}
.mfa-input-btn svg {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
    position: static !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.mfa-send-btn {
    background: var(--mfa-bubble-color, #7a1f2b) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(122,31,43,0.3) !important;
}
.mfa-send-btn:hover {
    opacity: 0.9;
    color: #fff !important;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(122,31,43,0.4) !important;
}
.mfa-send-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
}
.mfa-recording {
    color: #EF4444 !important;
    background: rgba(239,68,68,0.08) !important;
    animation: mfaRecordPulse 1.5s infinite;
}
@keyframes mfaRecordPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { transform: scale(1.12); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ── Bildirim Balonu ── */
#mfa-notify-bubble {
    position: absolute;
    bottom: calc(var(--mfa-bubble-size, 62px) + 14px);
    right: 0;
    width: 290px;
    background: #fff;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.06);
    padding: 14px 36px 14px 14px;
    cursor: pointer;
    z-index: 999998;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: mfaNotifyIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.mfa-left #mfa-notify-bubble {
    right: auto;
    left: 0;
    border-radius: 18px 18px 18px 4px;
}
@keyframes mfaNotifyIn {
    from { opacity: 0; transform: translateY(16px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
#mfa-notify-bubble.mfa-notify-out {
    animation: mfaNotifyOut 0.35s ease forwards;
}
@keyframes mfaNotifyOut {
    to { opacity: 0; transform: translateY(10px) scale(0.94); }
}
.mfa-notify-avatar {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    background: var(--mfa-bubble-color, #7a1f2b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mfa-notify-avatar svg {
    width: 18px;
    height: 18px;
    color: #fff;
    stroke: #fff;
}
.mfa-notify-text {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: #1F2937;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-top: 6px;
}
.mfa-notify-close {
    /* 🔴 1.1.5: !important ZORUNLU -- tema kurali
       `:is(.btn,.button,button,[type="submit"],...)` position:relative +
       background yaziyor, ozgulluk esit ama tema CSS'i SONRA yukleniyor.
       Onsuz buton absolute'u kaybedip balonun SOL BASINA dusuyordu. */
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: #F3F4F6 !important;
    border-radius: 50% !important;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    padding: 0;
    line-height: 1;
    transition: background 0.15s;
}
.mfa-notify-close:hover {
    background: #E5E7EB;
    color: #374151;
}

/* ── Mobil Uyumluluk — aşağıdaki genişletilmiş blokta ele alındı ── */

/* ── Mesaj içi linkler (tıklanabilir ve görünür) ── */
.mfa-msg-text a,
.mfa-inline-link {
    color: var(--mfa-bubble-color, #7a1f2b) !important;
    text-decoration: underline !important;
    text-decoration-thickness: 1.5px !important;
    text-underline-offset: 2px !important;
    font-weight: 600 !important;
    word-break: break-all !important;
    transition: opacity 0.15s !important;
    cursor: pointer !important;
}
.mfa-msg-text a:hover,
.mfa-inline-link:hover {
    opacity: 0.72 !important;
    text-decoration-thickness: 2px !important;
}
.mfa-message-visitor .mfa-msg-text a,
.mfa-message-visitor .mfa-inline-link {
    color: rgba(255,255,255,0.95) !important;
    text-decoration-color: rgba(255,255,255,0.6) !important;
}

/* ── Sistem Mesajı ── */
.mfa-system-message {
    text-align: center;
    font-size: 12px;
    color: #9CA3AF;
    padding: 6px 12px;
    background: rgba(0,0,0,0.04);
    border-radius: 12px;
    margin: 4px auto;
    max-width: 85%;
    font-style: italic;
}

/* ── Genel Mesaj Alanı Geliştirmeleri ── */
#mfa-chat-header {
    flex-wrap: nowrap !important;
    overflow: visible !important;
}
.mfa-header-info {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
}
.mfa-header-name {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* ── Mobil: Header buton taşmaları önleme ── */
@media (max-width: 520px) {
    #mfa-chat-container {
        bottom: 14px;
    }
    #mfa-chat-container.mfa-right {
        right: 14px;
    }
    #mfa-chat-container.mfa-left {
        left: 14px;
    }
    #mfa-chat-window {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        max-height: 100dvh;
    }
    .mfa-header-avatar {
        width: 32px !important;
        height: 32px !important;
    }
    .mfa-header-avatar-default {
        width: 32px !important;
        height: 32px !important;
    }
    .mfa-header-name {
        font-size: 13px !important;
    }
}

/* ── Erişilebilirlik: dokunma hedefleri en az 44×44px (MEAT FEST UYARLAMALARI §8) ── */
#mfa-chat-close,
.mfa-input-btn {
    min-width: 44px !important;
    min-height: 44px !important;
}

/* ── Erişilebilirlik: klavye odağı görünür olsun ── */
#mfa-chat-bubble:focus-visible,
#mfa-chat-close:focus-visible,
.mfa-input-btn:focus-visible,
#mfa-message-input:focus-visible,
.mfa-msg-link-btn:focus-visible,
.mfa-msg-secondary-btn:focus-visible,
.mfa-msg-ek-buton:focus-visible {
    outline: 3px solid var(--mfa-accent-gold, #b8863f) !important;
    outline-offset: 2px !important;
}

/* ── Maliyet freni / sistem bildirimi giriş alanı kilitliyken ── */
#mfa-message-input:disabled,
.mfa-input-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* ── Rıza (Consent) Ekranı ── */
#mfa-chat-window.mfa-consent-active #mfa-chat-messages,
#mfa-chat-window.mfa-consent-active #mfa-typing-indicator,
#mfa-chat-window.mfa-consent-active #mfa-chat-input-area {
    display: none !important;
}
.mfa-consent-screen {
    display: none;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding: 22px 20px;
    overflow-y: auto;
    background: var(--mfa-chat-bg, #faf6f1);
    box-sizing: border-box;
}
.mfa-consent-screen p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--mfa-ai-text, #1b1512);
}
.mfa-consent-privacy a {
    color: var(--mfa-bubble-color, #7a1f2b);
    font-weight: 600;
    text-decoration: underline;
}
.mfa-consent-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}
.mfa-consent-btn {
    flex: 1;
    min-width: 44px;
    min-height: 44px;
    border-radius: 22px !important;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s, background 0.15s;
    box-sizing: border-box;
}
.mfa-consent-btn-primary {
    /* 🔴 1.1.5: tema butonlari #F3F3F3'e boyuyordu -> "Accept & continue"
       ile "No thanks" AYNI gri dikdortgen goruniyordu. */
    background: var(--mfa-bubble-color, #7a1f2b) !important;
    color: var(--mfa-header-text, #faf6f1) !important;
    border: none !important;
}
.mfa-consent-btn-primary:hover {
    transform: translateY(-1px);
    opacity: 0.92;
}
.mfa-consent-btn-secondary {
    background: transparent !important;
    color: var(--mfa-ai-text, #1b1512) !important;
    border: 1.5px solid var(--mfa-accent-gold, #b8863f) !important;
}
.mfa-consent-btn-secondary:hover {
    background: rgba(184,134,63,0.08);
}
.mfa-consent-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}
.mfa-consent-btn:focus-visible {
    outline: 3px solid var(--mfa-accent-gold, #b8863f) !important;
    outline-offset: 2px !important;
}
.mfa-consent-error {
    color: #B91C1C;
    font-size: 12.5px;
    margin: 0;
}
#mfa-consent-declined-screen a {
    color: var(--mfa-bubble-color, #7a1f2b);
    font-weight: 600;
}

/* ── PLAN-web-secenekli-siparis Faz 3: Ürün Seçim Widget'ı ── */
/* Rıza ekranıyla AYNI desen -- panel açıkken mesaj/yazıyor/giriş alanı
   gizlenir, panel kapanınca normal sohbete geri dönülür. */
#mfa-chat-window.mfa-urun-secici-active #mfa-chat-messages,
#mfa-chat-window.mfa-urun-secici-active #mfa-typing-indicator,
#mfa-chat-window.mfa-urun-secici-active #mfa-chat-input-area {
    display: none !important;
}
.mfa-urun-secici {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0; /* iç içe flex kutularda taşma olmadan kaydırma */
    background: var(--mfa-chat-bg, #faf6f1);
    box-sizing: border-box;
}
.mfa-urun-secici-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--mfa-line, #e7dcd0);
    flex-shrink: 0;
}
.mfa-urun-secici-baslik {
    font-weight: 700;
    font-size: 14.5px;
    color: var(--mfa-ai-text, #1b1512);
}
#mfa-urun-secici-body[hidden] {
    display: none;
}
#mfa-urun-secici-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 14px;
    box-sizing: border-box;
}
.mfa-urun-arama {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1.5px solid var(--mfa-line, #e7dcd0);
    border-radius: 20px;
    font-size: 13.5px;
    font-family: inherit;
    background: #fff;
    color: var(--mfa-ai-text, #1b1512);
}
.mfa-urun-arama:focus-visible {
    outline: 3px solid var(--mfa-accent-gold, #b8863f) !important;
    outline-offset: 2px !important;
    border-color: var(--mfa-bubble-color, #7a1f2b);
}
.mfa-urun-kategoriler {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}
/* Son Düzeltme-1 (A3): kategori düğmeleri liste kayarken ÜSTTE sabit kalır
   (Lamb -> Chicken -> Beef -> Doner geçişi için başa kaydırmak gerekmez). */
#mfa-urun-secici-body .mfa-urun-kategoriler {
    position: sticky;
    top: -12px;
    z-index: 2;
    margin: 10px -14px;
    padding: 8px 14px;
    background: var(--mfa-chat-bg, #faf6f1);
    border-bottom: 1px solid var(--mfa-line, #e7dcd0);
}
.mfa-sepet-kategoriler {
    margin: 12px 0 4px;
}
.mfa-sepet-kategoriler-etiket {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--mfa-ai-text, #1b1512);
    opacity: 0.8;
    margin-bottom: 6px;
}
.mfa-sepet-kategori-chipleri {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.mfa-kategori-chip {
    padding: 6px 12px;
    min-height: 32px;
    border-radius: 16px;
    border: 1.5px solid var(--mfa-line, #e7dcd0);
    background: #fff;
    color: var(--mfa-ai-text, #1b1512);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    box-sizing: border-box;
}
.mfa-kategori-chip[aria-pressed="true"] {
    background: var(--mfa-bubble-color, #7a1f2b);
    border-color: var(--mfa-bubble-color, #7a1f2b);
    color: var(--mfa-header-text, #faf6f1);
}
.mfa-kategori-chip:focus-visible {
    outline: 3px solid var(--mfa-accent-gold, #b8863f) !important;
    outline-offset: 2px !important;
}
.mfa-urun-durum-metni {
    font-size: 13px;
    color: var(--mfa-ai-text, #1b1512);
    opacity: 0.75;
    margin: 10px 0;
}
.mfa-urun-listesi,
.mfa-sepet-listesi {
    list-style: none;
    margin: 0;
    padding: 0;
}
.mfa-urun-satir {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid var(--mfa-line, #e7dcd0);
}
.mfa-urun-satir-ad {
    flex: 1 1 auto;
    min-width: 120px;
    font-size: 13.5px;
    color: var(--mfa-ai-text, #1b1512);
}
.mfa-urun-satir-birim {
    font-weight: 400;
    opacity: 0.7;
}
.mfa-urun-satir-asgari {
    display: block;
    font-size: 11.5px;
    opacity: 0.6;
}
.mfa-urun-miktar {
    width: 64px;
    box-sizing: border-box;
    padding: 7px 8px;
    border: 1.5px solid var(--mfa-line, #e7dcd0);
    border-radius: 10px;
    font-size: 13.5px;
    font-family: inherit;
}
/* 22.09.2026: `.mfa-urun-ekle-btn` ("Add" dugmesi) KALDIRILDI -- eski
   secim akisiyla birlikte olmustu (yerine satir ici artı/eksi geldi). */
.mfa-urun-miktar:focus-visible {
    outline: 3px solid var(--mfa-accent-gold, #b8863f) !important;
    outline-offset: 2px !important;
}
/* 🔴 22.09.2026 (Okan): sepet ARTIK listenin altında yer kapmaz. Eskiden
   `max-height: 40%` ile hep ekrandaydı ve "Your selection" başlığı + alanlar
   + gönder düğmesi dar pencerenin neredeyse tamamını kaplıyordu. Yeni hâli:
   panelin TAMAMINI kaplayan ikinci bir görünüm -- yalnız "Review" ile açılır,
   açıkken ürün listesi ve özet çubuğu JS tarafında `hidden` yapılır. */
.mfa-sepet {
    flex: 1;
    min-height: 0;
    border-top: 1px solid var(--mfa-line, #e7dcd0);
    padding: 12px 14px;
    box-sizing: border-box;
    overflow-y: auto;
}
.mfa-sepet[hidden] {
    display: none;
}
.mfa-sepet-baslik {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--mfa-ai-text, #1b1512);
    margin-bottom: 6px;
}
.mfa-sepet-satir {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    color: var(--mfa-ai-text, #1b1512);
}
.mfa-sepet-satir-ad {
    flex: 1 1 110px;
    min-width: 0;
}
/* Son Düzeltme-1 (A1): gözden geçirmede miktar düzeltilir. */
.mfa-sepet-satir {
    flex-wrap: wrap;
}
.mfa-sepet-satir .mfa-urun-miktar {
    display: block;
    width: 56px;
    padding: 5px 6px;
    font-size: 13px;
    text-align: center;
}
.mfa-sepet-cikar-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--mfa-line, #e7dcd0);
    background: #fff;
    color: var(--mfa-ai-text, #1b1512);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mfa-sepet-cikar-btn:focus-visible {
    outline: 3px solid var(--mfa-accent-gold, #b8863f) !important;
    outline-offset: 2px !important;
}
#mfa-sepet-gonder-btn {
    width: 100%;
    margin-top: 10px;
}


/* ─── Sepet alanları: işletme adı + not (22.09.2026, Okan) ───────────────
   Seçim yapıldıktan sonra doldurulan iki opsiyonel alan. Panel dar
   (widget) olduğu için alanlar tam genişlik ve alt alta; not alanı
   dikey büyümez (rows=2 + resize:vertical) ki gönder düğmesi ekrandan
   kaçmasın. Renkler mevcut sepet bloğunun değişkenlerinden türer. */
.mfa-sepet-alanlar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
}

.mfa-sepet-alan-etiket {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.75;
}

.mfa-sepet-alan-girdi {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    background: #fff;
    color: inherit;
}

.mfa-sepet-alan-girdi:focus {
    outline: 2px solid rgba(0, 0, 0, 0.35);
    outline-offset: 1px;
}

.mfa-sepet-alan-not {
    resize: vertical;
    min-height: 44px;
    max-height: 120px;
}


/* ─── Tek satır + artı/eksi adımlayıcı (22.09.2026, Okan) ───────────────
   Eski düzende ürün adı, boş miktar kutusu ve "Add" düğmesi alt alta
   sarıyordu; 106 ürünlük katalogda ekrana iki ürün sığıyordu. Satır artık
   SARMAZ (flex-wrap: nowrap) ve dikey dolgu küçüldü -- aynı yükseklikte
   üç kat fazla ürün görünür. Dokunma hedefleri 34px'te tutuldu. */
.mfa-urun-satir {
    flex-wrap: nowrap;
    gap: 6px;
    padding: 6px 0;
}

.mfa-urun-satir-ad {
    min-width: 0; /* uzun ürün adı adımlayıcıyı ekran dışına itmesin */
    font-size: 13px;
    line-height: 1.3;
}

.mfa-urun-satir-secili {
    background: rgba(184, 134, 63, 0.10);
    border-radius: 8px;
    padding-left: 6px;
    padding-right: 6px;
}

.mfa-urun-adimlayici {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.mfa-urun-adim-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--mfa-line, #e7dcd0);
    background: #fff;
    color: var(--mfa-ai-text, #1b1512);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.mfa-urun-adim-arti {
    background: var(--mfa-bubble-color, #7a1f2b);
    border-color: var(--mfa-bubble-color, #7a1f2b);
    color: #fff;
}

.mfa-urun-adim-btn[hidden] {
    display: none;
}

.mfa-urun-adim-btn:focus-visible {
    outline: 3px solid var(--mfa-accent-gold, #b8863f) !important;
    outline-offset: 2px !important;
}

/* Satırda miktar kutusu yalnız ÜRÜN SEÇİLİYKEN görünür -- seçilmemiş 100
   üründe 100 boş kutu göstermek listeyi okunmaz yapıyordu. */
.mfa-urun-satir .mfa-urun-miktar {
    width: 52px;
    padding: 5px 6px;
    font-size: 13px;
    text-align: center;
}

.mfa-urun-miktar[hidden] {
    display: none;
}

/* ─── Alt özet çubuğu (22.09.2026, Okan) ─────────────────────────────── */
.mfa-sepet-ozet {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid var(--mfa-line, #e7dcd0);
    background: #fff;
    box-sizing: border-box;
}

.mfa-sepet-ozet[hidden] {
    display: none;
}

.mfa-sepet-ozet-metni {
    font-size: 13px;
    font-weight: 600;
    color: var(--mfa-ai-text, #1b1512);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mfa-sepet-review-btn {
    flex: 0 0 auto;
    padding: 9px 16px;
    min-height: 38px;
    border-radius: 19px;
    border: none;
    background: var(--mfa-bubble-color, #7a1f2b);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.mfa-sepet-review-btn:disabled {
    background: var(--mfa-line, #e7dcd0);
    color: rgba(27, 21, 18, 0.55);
    cursor: default;
}

.mfa-sepet-geri-btn {
    border: none;
    background: none;
    padding: 0 0 8px 0;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    color: var(--mfa-bubble-color, #7a1f2b);
    cursor: pointer;
}

.mfa-sepet-review-btn:focus-visible,
.mfa-sepet-geri-btn:focus-visible {
    outline: 3px solid var(--mfa-accent-gold, #b8863f) !important;
    outline-offset: 2px !important;
}


/* ─── Sipariş ipucu şeridi (22.09.2026, Okan) ────────────────────────────
   Ziyaretçi ilk mesajını yazar yazmaz sohbet akışına düşer; mesaj balonu
   DEĞİLDİR (kimse söylememiştir), bu yüzden kenardan kenara ince bir şerit
   olarak ve altın vurgu rengiyle çizilir. */
.mfa-siparis-ipucu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0;
    padding: 10px 12px;
    border: 1px solid var(--mfa-accent-gold, #b8863f);
    border-radius: 12px;
    background: rgba(184, 134, 63, 0.10);
}

.mfa-siparis-ipucu-metin {
    flex: 1 1 140px;
    font-size: 12.5px;
    line-height: 1.35;
    color: var(--mfa-ai-text, #1b1512);
}

.mfa-siparis-ipucu-btn {
    flex: 0 0 auto;
    padding: 8px 14px;
    min-height: 36px;
    border-radius: 18px;
    border: none;
    background: var(--mfa-bubble-color, #7a1f2b);
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.mfa-siparis-ipucu-btn:focus-visible {
    outline: 3px solid var(--mfa-accent-gold, #b8863f) !important;
    outline-offset: 2px !important;
}

/* 🔴 23.09.2026 — işletme adı ZORUNLU (canlı ölçüm: 97 siparişin 70'i
   "Bilinmeyen" düştü). Etiketin altındaki gerekçe satırı + geçersiz alan
   vurgusu. Renkler marka jetonlarından gelir (hardcode yok). */
.mfa-sepet-alan-ipucu {
    margin: 2px 0 6px !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    opacity: 0.7 !important;
}

.mfa-sepet-alan-girdi[aria-invalid="true"] {
    border-color: var(--mfa-bubble-color, #7a1f2b) !important;
    box-shadow: 0 0 0 2px rgba(122, 31, 43, 0.15) !important;
}

/* Sağdan sola diller (ar): yalnız sohbet penceresine `dir="rtl"` konur
   (chat-widget.js uygulaArayuzDili), gerisi MİRASA bırakılır.
   🔴 23.09.2026 (Opus incelemesi Ö-4): burada ESKİDEN `flex-direction:
   row-reverse` + `text-align: right` kuralları vardı. İkisi de YANLIŞTI:
   `dir="rtl"` zaten `direction: rtl` demektir, flex satırı kendiliğinden
   sağdan sola dizilir; üstüne `row-reverse` koymak dizilimi TEKRAR LTR'ye
   çeviriyordu (çift çevirme). `text-align` de gereksiz -- RTL'de `start`
   zaten sağdır. Kurallar silindi; yeni bir RTL kuralı gerekirse mantıksal
   özellikler (`margin-inline-start`, `text-align: start`) kullanılmalı ve
   ARAPÇA BİR OTURUMLA ÖLÇÜLMEDEN "RTL destekleniyor" denmemeli. */
