/* Gali — Galip Nakliyat sohbet asistanı. Tüm sınıflar "gali-" ile başlar, sayfa stillerinden etkilenmez. */
#gali-root, #gali-root * { box-sizing: border-box; font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; letter-spacing: normal; text-transform: none; }
:where(#gali-root) :where(*) { margin: 0; padding: 0; } /* özgüllüğü sıfır: aşağıdaki sınıflar ezebilsin */
#gali-root { --g-red: #D50000; --g-red-dark: #B00000; --g-text: #1F2328; --g-muted: #667085; --g-border: #E4E7EC; --g-bg: #F6F7F9; --g-green: #12B76A; --g-orange: #F79009; line-height: 1.5; color: var(--g-text); font-size: 15px; }
#gali-root button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
#gali-root a { color: var(--g-red); }

/* ---------- Açma butonu */
.gali-launcher { position: fixed; left: 24px; bottom: 24px; z-index: 9990; width: 64px; height: 64px; border-radius: 50% !important; background: var(--g-red) !important; color: #fff !important; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(213,0,0,.38); border: 3px solid #fff !important; transition: transform .2s; }
.gali-launcher:hover { transform: scale(1.07); }
.gali-launcher svg { width: 30px; height: 30px; fill: currentColor; }
.gali-launcher .gali-dot { position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--g-green); border: 2px solid #fff; }
.gali-launcher.gali-hidden { transform: scale(0); pointer-events: none; }

/* ---------- Açılış balonu */
.gali-teaser { position: fixed; left: 100px; bottom: 34px; z-index: 9990; background: #fff; color: var(--g-text); border-radius: 14px 14px 14px 4px; padding: 12px 36px 12px 16px; box-shadow: 0 10px 30px rgba(16,24,40,.18); font-weight: 600; font-size: 14.5px; max-width: 270px; cursor: pointer; animation: galiPop .35s ease; }
.gali-teaser-close { position: absolute; top: 6px; right: 8px; width: 22px; height: 22px; border-radius: 50%; color: var(--g-muted) !important; font-size: 16px !important; line-height: 1; }
.gali-teaser-close:hover { background: var(--g-bg) !important; }
@keyframes galiPop { from { opacity: 0; transform: translateY(10px) scale(.95); } to { opacity: 1; transform: none; } }

/* ---------- Pencere */
.gali-panel { position: fixed; left: 24px; bottom: 24px; z-index: 10000; width: 390px; height: min(640px, calc(100vh - 48px)); background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(16,24,40,.28); display: flex; flex-direction: column; overflow: hidden; transform-origin: bottom left; animation: galiOpen .25s ease; }
.gali-panel[hidden] { display: none; }
@keyframes galiOpen { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

.gali-head { background: linear-gradient(135deg, #D50000, #A30000); color: #fff; padding: 14px 14px 14px 16px; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.gali-avatar { width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--g-red); display: grid; place-items: center; font-weight: 800; font-size: 19px; flex-shrink: 0; position: relative; }
.gali-avatar svg { width: 24px; height: 24px; fill: var(--g-red); }
.gali-head-text { flex: 1; min-width: 0; }
.gali-head-name { font-weight: 700; font-size: 16px; }
.gali-head-status { font-size: 12.5px; opacity: .92; display: flex; align-items: center; gap: 6px; }
.gali-head-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #6CE9A6; }
.gali-head-status.off::before { background: #FEC84B; }
.gali-head-btn { width: 34px; height: 34px; border-radius: 50%; color: #fff !important; font-size: 18px !important; display: grid; place-items: center; opacity: .9; }
.gali-head-btn:hover { background: rgba(255,255,255,.18) !important; opacity: 1; }

.gali-body { flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: var(--g-bg); display: flex; flex-direction: column; gap: 10px; }
.gali-msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; word-wrap: break-word; overflow-wrap: anywhere; animation: galiMsg .2s ease; }
.gali-msg.bot { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.gali-msg.user { align-self: flex-end; background: var(--g-red); color: #fff; border-bottom-right-radius: 4px; }
.gali-msg.user a { color: #fff; }
.gali-msg b { font-weight: 700; }
.gali-msg.error { background: #FEF3F2; color: #B42318; }
@keyframes galiMsg { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.gali-typing { align-self: flex-start; background: #fff; border-radius: 16px; border-bottom-left-radius: 4px; padding: 13px 16px; display: flex; gap: 4px; }
.gali-typing span { width: 7px; height: 7px; border-radius: 50%; background: #98A2B3; animation: galiBlink 1.2s infinite; }
.gali-typing span:nth-child(2) { animation-delay: .2s; }
.gali-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes galiBlink { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---------- Seçenek butonları */
.gali-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 0 4px; }
.gali-chips.scroll { max-height: 172px; overflow-y: auto; padding-right: 2px; }
.gali-chip { background: #fff !important; border: 1.5px solid #F3B4B4 !important; color: var(--g-red-dark) !important; border-radius: 999px !important; padding: 7px 13px !important; font-size: 13.5px !important; font-weight: 600; line-height: 1.3; text-align: left; transition: background .15s, border-color .15s; }
.gali-chip:hover, .gali-chip:focus-visible { background: #FFF1F1 !important; border-color: var(--g-red) !important; outline: none; }
.gali-chip.primary { background: var(--g-red) !important; color: #fff !important; border-color: var(--g-red) !important; }
.gali-chip.primary:hover { background: var(--g-red-dark) !important; }
.gali-chip.back { border-color: var(--g-border) !important; color: var(--g-muted) !important; }
.gali-filter { width: 100%; border: 1px solid var(--g-border); border-radius: 10px; padding: 8px 12px; font-size: 14px; margin-bottom: 6px; outline: none; background: #fff; color: var(--g-text); }
.gali-filter:focus { border-color: var(--g-red); }

/* ---------- Kartlar */
.gali-card { align-self: stretch; background: #fff; border-radius: 14px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(16,24,40,.06); border: 1px solid var(--g-border); font-size: 14px; }
.gali-card h4 { font-size: 13px; color: var(--g-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.gali-price { font-size: 24px; font-weight: 800; color: var(--g-red); line-height: 1.2; }
.gali-card .gali-note { color: var(--g-muted); font-size: 12.5px; margin-top: 8px; }
.gali-card details { margin-top: 8px; }
.gali-card summary { cursor: pointer; color: var(--g-red); font-weight: 600; font-size: 13px; }
.gali-card table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12.5px; }
.gali-card td { padding: 3px 0; border-bottom: 1px dashed var(--g-border); }
.gali-card td:last-child { text-align: right; white-space: nowrap; color: var(--g-muted); }
.gali-summary-row { display: flex; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--g-border); }
.gali-summary-row:last-child { border-bottom: 0; }
.gali-summary-row span:first-child { width: 22px; flex-shrink: 0; }
.gali-success { text-align: center; }
.gali-success .big { font-size: 34px; }

/* ---------- Yazma alanı */
.gali-foot { border-top: 1px solid var(--g-border); background: #fff; padding: 10px 12px 8px; flex-shrink: 0; position: relative; }
.gali-input-row { display: flex; gap: 8px; align-items: center; }
.gali-input { flex: 1; min-width: 0; border: 1.5px solid var(--g-border); border-radius: 12px; padding: 11px 14px; font-size: 15px; outline: none; color: var(--g-text); background: #fff; }
.gali-input:focus { border-color: var(--g-red); }
.gali-send { width: 44px; height: 44px; border-radius: 12px !important; background: var(--g-red) !important; color: #fff !important; display: grid; place-items: center; flex-shrink: 0; transition: background .15s; }
.gali-send:hover { background: var(--g-red-dark) !important; }
.gali-send[disabled] { background: #D0D5DD !important; cursor: not-allowed; }
.gali-send svg { width: 20px; height: 20px; fill: currentColor; }
.gali-hint { font-size: 11.5px; color: var(--g-muted); text-align: center; margin-top: 6px; }
.gali-hint a { color: var(--g-muted); }
.gali-suggest { position: absolute; left: 12px; right: 68px; bottom: 100%; background: #fff; border: 1px solid var(--g-border); border-radius: 12px; box-shadow: 0 -8px 24px rgba(16,24,40,.12); max-height: 220px; overflow-y: auto; }
.gali-suggest button { display: block; width: 100%; text-align: left; padding: 9px 14px; font-size: 14px; border-bottom: 1px solid var(--g-bg) !important; }
.gali-suggest button:hover, .gali-suggest button.active { background: #FFF1F1 !important; }
.gali-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* Altta sabit çubuk olan sayfalarda (eşya listesi) buton yukarı alınır */
body.gali-raise .gali-launcher { bottom: 96px; }
body.gali-raise .gali-teaser { bottom: 106px; }

/* ---------- Mobil: tam ekran */
@media (max-width: 560px) {
    .gali-launcher { left: 16px; bottom: 16px; width: 56px; height: 56px; }
    .gali-launcher svg { width: 26px; height: 26px; }
    .gali-teaser { left: 82px; bottom: 22px; max-width: calc(100vw - 170px); font-size: 13.5px; }
    .gali-panel { left: 0; right: 0; bottom: 0; top: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; }
    .gali-msg { font-size: 15px; }
    .gali-input { font-size: 16px; } /* iOS yakınlaştırmasın */
}
@media (prefers-reduced-motion: reduce) {
    #gali-root * { animation: none !important; transition: none !important; }
}
