/* ---------- CSS variables for live colours ---------- */
:root {
    --woo-smartchat-icon-bg:   #2196F3;
    --woo-smartchat-header-bg: #2196F3;
}

/* Ensure padding doesn't cause horizontal overflow inside the widget */
#woo-smartchat-window,
#woo-smartchat-window * {
    box-sizing: border-box;
}

/* ---------- floating icon ---------- */
#woo-smartchat-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--woo-smartchat-icon-bg);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
}

.woo-sc-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #d63638;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    border: 2px solid #fff;
}

/* ---------- chat window ---------- */
#woo-smartchat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 360px;
    max-width: 90vw;
    height: 500px;
    max-height: 70vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, .2);
    display: flex;
    flex-direction: column;
    transform: scale(0);
    opacity: 0;
    transition: .2s;
    z-index: 9999;
}
#woo-smartchat-window.open {
    transform: scale(1);
    opacity: 1;
}

/* ---------- header ---------- */
#woo-smartchat-header {
    background: var(--woo-smartchat-header-bg);
    color: #fff;
    padding: 12px;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.woo-smartchat-title {
    min-width: 0;
    flex: 1;
}

.woo-smartchat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.woo-sc-header-action {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
}

.woo-sc-header-action:hover,
.woo-sc-header-action:focus-visible {
    background: rgba(255, 255, 255, .28);
    outline: none;
}

/* ---------- message area ---------- */
#woo-smartchat-body {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ---------- input ---------- */
#woo-smartchat-input {
    width: 100%;
    max-width: 100%;
    display: block;
    box-sizing: border-box;
    border: none;
    border-top: 1px solid #eee;
    padding: 12px;
    resize: none;
    overflow: auto;
}

/* ---------- modern bubbles ---------- */
.user-msg,
.bot-msg {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 18px;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
}

.bot-msg {
    align-self: flex-start;
    background: #f1f3f5;
    color: #212529;
    border-bottom-left-radius: 4px;
}

.user-msg {
    align-self: flex-end;
    background: #2196F3;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

/* ---------- tiny arrow tails ---------- */
.bot-msg::after,
.user-msg::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 0;
    height: 0;
    border-style: solid;
}

.bot-msg::after {
    left: -8px;
    border-width: 0 10px 10px 0;
    border-color: transparent #f1f3f5 transparent transparent;
}

.user-msg::after {
    right: -8px;
    border-width: 10px 0 0 10px;
    border-color: transparent transparent transparent #2196F3;
}

/* ---------- product card inside bubble ---------- */
.woo-smartchat-product-card {
    margin-top: 8px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    gap: 10px;
    align-items: center;
    background: #ffffff;
}

.woo-smartchat-product-card img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
}

.woo-smartchat-product-card strong {
    font-size: 15px;
}

.woo-smartchat-product-link a {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    color: var(--woo-smartchat-header-bg);
    text-decoration: none;
}
.woo-smartchat-product-link a:hover {
    text-decoration: underline;
}

.woo-smartchat-product-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.woo-smartchat-product-price {
    margin-top: 4px;
    color: #333;
}

.bot-msg.woo-sc-order-msg {
    max-width: 88%;
}

.woo-sc-order-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.woo-sc-order-items-title {
    display: block;
    margin-bottom: 2px;
}

.woo-sc-order-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px;
    border: 1px solid #dde2e6;
    border-radius: 8px;
    background: #ffffff;
}

.woo-sc-order-item-thumb {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    object-fit: cover;
    flex: 0 0 64px;
    background: #f8f9fa;
}

.woo-sc-order-item-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.woo-sc-order-item-name {
    line-height: 1.3;
}

.woo-sc-order-item-name a {
    color: var(--woo-smartchat-header-bg);
    text-decoration: none;
}

.woo-sc-order-item-name a:hover {
    text-decoration: underline;
}

.woo-sc-order-item-meta {
    color: #646970;
    font-size: 12px;
    font-weight: 600;
}


/* =====  NEW: quick-reply buttons  ===== */
#woo-sc-reply-wrap,
.woo-sc-reply-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: 12px 0;
    width: 100%;
    max-width: 100%;
}

#woo-sc-preset-button-wrap,
#woo-sc-custom-button-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 100%;
}

.woo-sc-reply-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 8px 16px;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    background: #f6f7f7;
    color: #2c3338;
    cursor: pointer;
    transition: all .15s ease-in-out;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.woo-sc-reply-btn:hover {
    background: #fff;
    border-color: #8c8f94;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.woo-sc-reply-btn:active {
    transform: translateY(1px);
}

.woo-smartchat-input-area {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #ddd;
}

#woo-smartchat-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.woo-sc-send-button {
    padding: 8px 16px;
    background: var(--woo-smartchat-header-bg, #2196F3);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.woo-sc-send-button:hover {
    opacity: 0.9;
}

.woo-sc-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.woo-sc-privacy-notice {
    align-self: stretch;
    max-width: 100%;
    margin: 0 0 8px;
    padding: 10px;
    border: 1px solid #c3dafe;
    border-radius: 6px;
    background: #eef5ff;
    color: #1f2937;
    font-size: 13px;
    line-height: 1.4;
}

.woo-sc-privacy-notice p {
    margin: 0 0 8px;
}

.woo-sc-privacy-notice a {
    color: var(--woo-smartchat-header-bg);
    text-decoration: underline;
}

.woo-sc-privacy-ack {
    padding: 6px 10px;
    border: 1px solid var(--woo-smartchat-header-bg);
    border-radius: 4px;
    background: var(--woo-smartchat-header-bg);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.2;
}

.woo-sc-privacy-ack:hover {
    opacity: 0.9;
}
