/* KORI Chat Widget - izole stiller, tema ile çakışmasın diye her şey prefix'li */

#kori-widget-root, #kori-widget-root * {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

#kori-widget-root {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 999999;
}

.kori-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6fa5, #ff9bc4);
    box-shadow: 0 4px 16px rgba(255, 111, 165, 0.4);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}
.kori-toggle-btn:hover { transform: scale(1.08); }
.kori-toggle-btn svg { width: 28px; height: 28px; fill: #fff; }

.kori-badge {
    position: absolute;
    top: -4px; right: -4px;
    background: #ff3b5c;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    padding: 2px 6px;
}

.kori-chat-window {
    position: absolute;
    bottom: 76px;
    left: 0;
    width: 360px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: 70vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.18);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: kori-fade-in 0.2s ease;
}
.kori-chat-window.kori-open { display: flex; }

@keyframes kori-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.kori-header {
    background: linear-gradient(135deg, #ff6fa5, #ff9bc4);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.kori-header-title { font-weight: 700; font-size: 15px; }
.kori-header-sub { font-size: 12px; opacity: 0.9; }
.kori-close-btn {
    background: none; border: none; color: #fff;
    font-size: 20px; cursor: pointer; line-height: 1;
    padding: 4px;
}

.kori-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #fbf7f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kori-msg {
    max-width: 85%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.kori-msg-bot {
    background: #fff;
    border: 1px solid #f0d9e2;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.kori-msg-user {
    background: #ff6fa5;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.kori-typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 10px 13px;
}
.kori-typing span {
    width: 6px; height: 6px; border-radius: 50%;
    background: #ffb0cb;
    animation: kori-bounce 1s infinite ease-in-out;
}
.kori-typing span:nth-child(2) { animation-delay: 0.15s; }
.kori-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes kori-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

.kori-product-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}
.kori-product-card {
    display: flex;
    gap: 10px;
    background: #fff;
    border: 1px solid #f0d9e2;
    border-radius: 12px;
    padding: 8px;
    text-decoration: none;
    color: inherit;
    align-self: flex-start;
    width: 100%;
    max-width: 100%;
    transition: box-shadow 0.15s ease;
}
.kori-product-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.1); }
.kori-product-card img {
    width: 56px; height: 56px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #f5f5f5;
}
.kori-product-info { flex: 1; min-width: 0; }
.kori-product-name {
    font-size: 12.5px; font-weight: 600; color: #222;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.kori-product-brand { font-size: 11px; color: #999; margin-top: 1px; }
.kori-product-price { font-size: 12.5px; font-weight: 700; color: #ff6fa5; margin-top: 3px; }
.kori-product-price .kori-old-price {
    text-decoration: line-through; color: #bbb; font-weight: 400; margin-right: 5px; font-size: 11px;
}
.kori-out-of-stock { font-size: 11px; color: #c0392b; margin-top: 2px; }

.kori-category-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.kori-chip {
    background: #fff;
    border: 1px solid #ff9bc4;
    color: #ff6fa5;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 20px;
    text-decoration: none;
}
.kori-chip:hover { background: #ff6fa5; color: #fff; }

.kori-input-area {
    display: flex;
    align-items: center;
    padding: 10px;
    border-top: 1px solid #f0e0e6;
    background: #fff;
    gap: 8px;
}
.kori-input-area input {
    flex: 1;
    border: 1px solid #e8dbe1;
    border-radius: 20px;
    padding: 10px 14px;
    font-size: 13.5px;
    outline: none;
}
.kori-input-area input:focus { border-color: #ff9bc4; }
.kori-send-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: none;
    background: #ff6fa5;
    color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.kori-send-btn:disabled { opacity: 0.5; cursor: default; }
.kori-send-btn svg { width: 16px; height: 16px; fill: #fff; }

@media (max-width: 480px) {
    .kori-chat-window { width: calc(100vw - 24px); left: -8px; height: 65vh; }
}
