.online-chat-widget {
    position: relative;
}

.float-inquiry-cart {
    position: relative;
    display: flex;
    width: 86px;
    min-height: 92px;
    padding: 12px 10px 11px;
    border-radius: 18px 0 0 18px;
    background: linear-gradient(160deg, #ff4b32 0%, #d71920 72%);
    color: #fff !important;
    box-shadow: 0 12px 28px rgba(215, 25, 32, .24);
    text-decoration: none;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: box-shadow .18s ease, transform .18s ease, background .18s ease;
}

.float-inquiry-cart:hover {
    background: linear-gradient(160deg, #ff5f44 0%, #bf121a 72%);
    box-shadow: 0 14px 34px rgba(215, 25, 32, .34);
    transform: translateX(-2px);
    color: #fff !important;
}

.float-cart-icon {
    display: flex;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(215, 25, 32, .08);
}

.float-cart-icon img {
    display: block;
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.float-cart-text {
    font-weight: bold;
    font-size: 14px;
    line-height: 1.25;
    text-align: center;
}

.float-cart-count {
    position: absolute;
    top: 8px;
    left: 8px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #fff;
    color: #d71920;
    font-size: 12px;
    font-weight: bold;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .18);
    box-sizing: border-box;
}

.float-inquiry-cart.has-items .float-cart-count {
    background: #ffd026;
    color: #8d1118;
}

.float-inquiry-cart.has-items {
    animation: floatCartPulse 1.4s ease-in-out infinite;
}

@keyframes floatCartPulse {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-4px); }
}

.online-chat-panel {
    position: absolute;
    right: 64px;
    bottom: 0;
    display: none;
    width: 320px;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 42px rgba(0, 0, 0, .18);
    border: 1px solid rgba(0, 0, 0, .08);
}

.online-chat-widget.is-open .online-chat-panel {
    display: block;
}

.online-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 0 14px;
    background: linear-gradient(110deg, #000 0, var(--site-accent-color, #111111) 100%);
    color: #fff;
    font-size: 15px;
    font-weight: bold;
}

.online-chat-head button {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.online-chat-body {
    height: 260px;
    padding: 12px;
    overflow-y: auto;
    background: #f6f8fb;
    box-sizing: border-box;
}

.online-chat-msg {
    margin: 0 0 10px;
}

.online-chat-msg .bubble {
    display: inline-block;
    max-width: 82%;
    padding: 9px 11px;
    border-radius: 12px;
    background: #fff;
    color: #333;
    line-height: 1.55;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
    word-break: break-word;
}

.online-chat-msg.customer {
    text-align: right;
}

.online-chat-msg.customer .bubble {
    background: var(--site-accent-color, #111111);
    color: #fff;
}

.online-chat-msg.admin .bubble {
    background: #fff;
    border: 1px solid #e8e8e8;
    color: #333;
}

.online-chat-msg.system {
    text-align: center;
}

.online-chat-msg.system .bubble {
    background: #e9eef7;
    color: #5a6473;
}

.online-chat-msg .time {
    margin-top: 3px;
    color: #999;
    font-size: 12px;
}

.online-chat-form {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: #fff;
    border-top: 1px solid #edf0f5;
    box-sizing: border-box;
}

.online-chat-form textarea {
    flex: 1;
    min-height: 42px;
    max-height: 88px;
    padding: 8px 10px;
    border: 1px solid #d9dde5;
    border-radius: 8px;
    resize: vertical;
    box-sizing: border-box;
    line-height: 1.45;
}

.online-chat-form textarea:focus {
    border-color: var(--site-border-color, #111111);
    outline: none;
}

.online-chat-form button {
    min-width: 64px;
    border: 0;
    border-radius: 8px;
    background: var(--site-accent-color, #111111);
    color: #fff;
    cursor: pointer;
    font-weight: bold;
}

.online-chat-form button:disabled {
    background: #a6bfdc;
    cursor: not-allowed;
}

.online-chat-page .main_pd {
    box-sizing: border-box;
}

.online-chat-page-hint {
    margin: 0 0 16px;
    color: #666;
    line-height: 1.7;
}

.online-chat-page-widget {
    position: static;
    display: block;
}

.online-chat-page-widget[hidden] {
    display: none;
}

.online-chat-page-widget .online-chat-page-button {
    display: none;
}

.online-chat-page-widget .online-chat-panel {
    position: static;
    display: block;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
}

.online-chat-page-widget .online-chat-body {
    height: 460px;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 0;
    }

    .online-chat-page-widget {
        display: block;
    }

    .online-chat-page {
        margin-bottom: 0;
    }

    .online-chat-page .container,
    .online-chat-page .main_pd {
        width: 100%;
        box-sizing: border-box;
    }

    .online-chat-page-widget .online-chat-panel {
        position: static;
        width: 100%;
        max-height: none;
        border-radius: 14px;
        box-shadow: 0 10px 28px rgba(0, 0, 0, .12);
    }

    .online-chat-page-widget .online-chat-body {
        height: calc(100vh - 280px);
        min-height: 320px;
        max-height: none;
    }

    .online-chat-page-widget .online-chat-form {
        gap: 8px;
    }

    .online-chat-body {
        height: 42vh;
        max-height: 360px;
    }

    .online-chat-form {
        padding: 10px;
    }

    .online-chat-form textarea {
        min-height: 44px;
        font-size: 14px;
    }

    .online-chat-form button {
        min-width: 68px;
    }
}
