.cb-root {
    --cb-radius: 22px;
    --cb-shadow: 0 18px 50px rgba(15, 15, 20, 0.22);
    font-family: Poppins, "Segoe UI", sans-serif;
    z-index: 10050;
}

.cb-root *,
.cb-root *::before,
.cb-root *::after {
    box-sizing: border-box;
}

.cb-launcher {
    position: fixed;
    left: 18px;
    bottom: 22px;
    z-index: 10051;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    cursor: pointer;
    padding: 8px 16px 8px 8px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color, #5c1b78) 0%, var(--primary-purple, #540d4e) 100%);
    box-shadow: 0 10px 28px color-mix(in srgb, var(--primary-color, #5c1b78) 45%, transparent);
    transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.2s ease;
}

.cb-launcher:hover,
.cb-launcher:focus {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px color-mix(in srgb, var(--primary-color, #5c1b78) 55%, transparent);
    outline: none;
}

.cb-launcher-pulse {
    position: absolute;
    left: 8px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--primary-color, #5c1b78) 35%, transparent);
    animation: cbPulse 2.2s ease-out infinite;
    pointer-events: none;
}

.cb-launcher-icon {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.16);
    font-size: 18px;
    flex-shrink: 0;
}

.cb-launcher-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    padding-right: 6px;
}

.cb-launcher-text strong {
    font-size: 13.5px;
    font-weight: 600;
}

.cb-launcher-text small {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    font-size: 11px;
    opacity: 0.9;
    font-weight: 400;
}

.cb-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8dff7a;
    box-shadow: 0 0 0 3px rgba(141, 255, 122, 0.22);
    display: inline-block;
}

.cb-root.cb-open .cb-launcher {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.86);
}

.cb-window {
    position: fixed;
    left: 18px;
    bottom: 22px;
    width: 380px;
    max-width: calc(100vw - 24px);
    height: 620px;
    max-height: calc(100vh - 36px);
    background: #f4f5f7;
    border-radius: var(--cb-radius);
    box-shadow: var(--cb-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(16px) scale(0.97);
    transform-origin: left bottom;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
    z-index: 10052;
}

.cb-root.cb-open .cb-window {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    z-index: 1000010;
}

.cb-header {
    background: linear-gradient(135deg, var(--primary-color, #5c1b78) 0%, var(--primary-purple, #540d4e) 100%);
    color: #fff;
    padding: 14px 14px 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}

.cb-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.cb-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.cb-header-copy {
    min-width: 0;
}

.cb-title {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cb-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.92;
    margin-top: 2px;
}

.cb-header-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.cb-icon-btn {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.cb-icon-btn:hover,
.cb-icon-btn:focus {
    background: rgba(255, 255, 255, 0.28);
    outline: none;
}

.cb-messages {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px 14px 10px;
    -webkit-overflow-scrolling: touch;
}

.cb-row {
    display: flex;
    margin-bottom: 10px;
}

.cb-row.cb-bot {
    justify-content: flex-start;
}

.cb-row.cb-user {
    justify-content: flex-end;
}

.cb-bubble {
    max-width: 86%;
    padding: 11px 13px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.45;
    animation: cbPop 0.28s ease;
}

.cb-bot .cb-bubble {
    background: #fff;
    color: #2b2b2b;
    border: 1px solid #ececec;
    border-bottom-left-radius: 6px;
}

.cb-user .cb-bubble {
    background: linear-gradient(135deg, var(--primary-color, #5c1b78) 0%, var(--primary-purple, #540d4e) 100%);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.cb-typing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
}

.cb-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b7b7b7;
    animation: cbDots 1.2s infinite ease-in-out;
}

.cb-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.cb-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

.cb-chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    margin: 2px 0 12px;
}

.cb-chips-stack {
    grid-template-columns: 1fr;
}

.cb-chip {
    border: 1.5px solid var(--primary-color, #5c1b78);
    background: #fff;
    color: var(--primary-color, #5c1b78);
    border-radius: 999px;
    padding: 8px 10px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    text-align: center;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
    font-family: inherit;
}

.cb-chip:hover,
.cb-chip:focus {
    background: var(--primary-color, #5c1b78);
    color: #fff;
    outline: none;
    transform: translateY(-1px);
}

.cb-chip:disabled {
    opacity: 0.55;
    cursor: default;
    transform: none;
}

.cb-chip.cb-chip-on,
.cb-chip.cb-chip-on:disabled {
    opacity: 1;
    background: var(--primary-color, #5c1b78);
    color: #fff;
}

.cb-chip,
.cb-launcher,
.cb-icon-btn,
.cb-send,
.cb-mini {
    -webkit-tap-highlight-color: transparent;
}

.cb-products {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin: 2px 0 10px;
}

.cb-product {
    display: flex;
    gap: 10px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 14px;
    padding: 8px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.cb-product:hover {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.cb-product img {
    width: 68px;
    height: 68px;
    object-fit: cover;
    border-radius: 10px;
    background: #f0f0f0;
    flex-shrink: 0;
}

.cb-product-body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cb-product-name {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cb-product-price {
    margin-top: 4px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--primary-color, #5c1b78);
}

.cb-product-price s {
    color: #999;
    font-weight: 500;
    font-size: 11.5px;
    margin-left: 6px;
}

.cb-product-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.cb-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.cb-mini-view {
    background: color-mix(in srgb, var(--primary-color, #5c1b78) 12%, #fff);
    color: var(--primary-color, #5c1b78);
}

.cb-mini-wa {
    background: #25d366;
    color: #fff;
}

.cb-mini-order {
    background: var(--primary-color, #5c1b78);
    color: #fff;
}

.cb-summary {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 14px;
    padding: 12px 14px;
    margin: 2px 0 10px;
    font-size: 13px;
    line-height: 1.45;
    color: #333;
}

.cb-summary div + div {
    margin-top: 4px;
}

.cb-summary span {
    color: #777;
}

.cb-more {
    display: block;
    text-align: center;
    margin: 0 0 10px;
    padding: 9px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1.5px dashed var(--primary-color, #5c1b78);
    color: var(--primary-color, #5c1b78);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}

.cb-composer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 12px;
    background: #fff;
    border-top: 1px solid #ececec;
    flex-shrink: 0;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.cb-composer input {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    height: 44px;
    border: 1.5px solid #e3e3e3;
    border-radius: 999px;
    padding: 0 16px;
    font-size: 16px;
    font-family: inherit;
    background: #fff;
    outline: none;
}

.cb-composer input:focus {
    border-color: var(--primary-color, #5c1b78);
}

.cb-send {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #5c1b78) 0%, var(--primary-purple, #540d4e) 100%);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.18s ease;
}

.cb-send:hover,
.cb-send:focus {
    transform: scale(1.05);
    outline: none;
}

.cb-empty {
    font-size: 13px;
    color: #666;
}

@keyframes cbPulse {
    0% { transform: scale(1); opacity: 0.65; }
    100% { transform: scale(1.55); opacity: 0; }
}

@keyframes cbDots {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-4px); opacity: 1; }
}

@keyframes cbPop {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 991px) {
    .cb-launcher {
        left: 12px;
        bottom: 78px;
        width: 56px;
        height: 56px;
        padding: 0;
        gap: 0;
        justify-content: center;
        border-radius: 50%;
    }

    .cb-launcher-icon,
    .cb-launcher-pulse {
        width: 44px;
        height: 44px;
    }

    .cb-launcher-pulse {
        left: 50%;
        top: 50%;
        margin-left: -22px;
        margin-top: -22px;
    }

    .cb-launcher-text {
        display: none;
    }

    .cb-window {
        left: 0;
        right: 0;
        bottom: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        transform-origin: center bottom;
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
    }

    .cb-header {
        padding-top: calc(14px + env(safe-area-inset-top, 0px));
    }

    .cb-composer {
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .cb-send:hover,
    .cb-send:focus {
        transform: none;
    }
}

@media (max-width: 420px) {
    .cb-chip {
        font-size: 12px;
        padding: 8px 8px;
    }
}

@media (min-width: 992px) {
    .cb-launcher {
        left: 20px;
        bottom: 24px;
        width: 70px;
        height: 48px;
        padding: 0;
        gap: 0;
        justify-content: center;
        border-radius: 999px;
        color: #fff;
    }

    .cb-launcher-text {
        display: none;
    }

    .cb-launcher-icon {
        width: auto;
        height: auto;
        background: transparent;
        color: #fff;
        font-size: 20px;
    }

    .cb-launcher-icon i {
        color: #fff;
    }

    .cb-launcher-pulse {
        left: 50%;
        top: 50%;
        width: 58px;
        height: 38px;
        margin-left: -29px;
        margin-top: -19px;
        border-radius: 999px;
    }
}

@media (max-width: 991px) {
    .mobile-bildirim-btn {
        left: auto;
        right: 20px;
        bottom: calc(20px + 40px + 12px);
    }

    .mobile-bildirim-panel,
    html.mobile-bildirim-init .mobile-bildirim-panel {
        right: 20px;
        bottom: calc(20px + 40px + 12px + 40px + 12px);
    }
}

@media (max-width: 767px) {
    .mobile-bildirim-btn {
        left: auto;
        right: 15px;
        bottom: calc(80px + 35px + 10px);
        width: 35px;
        height: 35px;
    }

    .mobile-bildirim-panel,
    html.mobile-bildirim-init .mobile-bildirim-panel {
        right: 15px;
        bottom: calc(80px + 35px + 10px + 35px + 10px);
    }
}

body.cb-noscroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
}
