/* Voice Chatbot Widget */

#vcbot-root {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99998;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Toggle button */
#vcbot-toggle {
    width: 60px; height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(0,150,0,0.45);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}
#vcbot-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(0,150,0,0.55);
}
#vcbot-toggle-icon {
    display: flex; align-items: center; justify-content: center;
}
#vcbot-toggle-icon svg { display: block; }

/* Cart bubble */
#vcbot-cart-bubble {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 20px; height: 20px;
    background: #e53e3e; color: #fff;
    font-size: 11px; font-weight: 700;
    border-radius: 99px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 5px;
    border: 2px solid #fff;
}

/* Chat window */
#vcbot-window {
    width: 370px; height: 560px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #d4edda;
    display: flex; flex-direction: column;
    position: absolute; bottom: 72px; right: 0;
    box-shadow: 0 16px 48px rgba(0,0,0,0.15);
    overflow: hidden;
    animation: vcbot-slide-up 0.25s ease;
}
@keyframes vcbot-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.vcbot-hidden { display: none !important; }

/* Header */
#vcbot-header {
    background: linear-gradient(135deg, #00CC01, #006600);
    padding: 14px 16px;
    flex-shrink: 0;
}
#vcbot-header-inner {
    display: flex; align-items: center; gap: 10px;
}
#vcbot-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
#vcbot-avatar svg { display: block; }

/* Infinity logo animation — same keyframes as matrix plugin */
@keyframes vcbotInfRun { to { stroke-dashoffset: -502; } }
.vcbot-inf-stroke { animation: vcbotInfRun 1.6s linear infinite; }
#vcbot-header-text { flex: 1; }
#vcbot-name { font-size: 14px; font-weight: 700; color: #fff; }
#vcbot-status { font-size: 11px; color: rgba(255,255,255,0.8); margin-top: 1px; }
#vcbot-close {
    background: rgba(255,255,255,0.15);
    border: none; color: #fff; cursor: pointer;
    width: 28px; height: 28px; border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; transition: background 0.15s;
}
#vcbot-close:hover { background: rgba(255,255,255,0.3); }

/* Messages */
#vcbot-messages {
    flex: 1; overflow-y: auto;
    padding: 14px 12px 8px;
    display: flex; flex-direction: column; gap: 8px;
    background: #f0fff0;
}
#vcbot-messages::-webkit-scrollbar { width: 3px; }
#vcbot-messages::-webkit-scrollbar-thumb { background: #b2dfb2; border-radius: 3px; }

.vcbot-msg {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13.5px; line-height: 1.5;
    word-break: break-word;
    animation: vcbot-pop 0.2s ease;
}
@keyframes vcbot-pop {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}
.vcbot-bot {
    background: #fff; color: #1a1a1a;
    align-self: flex-start;
    border-radius: 4px 14px 14px 14px;
    border: 1px solid #d4edda;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.vcbot-user {
    background: linear-gradient(135deg, #00CC01, #008000);
    color: #fff;
    align-self: flex-end;
    border-radius: 14px 4px 14px 14px;
}

/* Typing indicator — spinning infinity logo */
.vcbot-typing {
    padding: 10px 14px !important;
    display: flex; align-items: center; justify-content: center;
    min-width: 70px;
}
.vcbot-typing-logo { display: flex; align-items: center; justify-content: center; }
.vcbot-typing-logo svg { display: block; }
.vcbot-typing span { display: none; }

/* Suggestions */
#vcbot-suggestions {
    padding: 4px 12px 8px;
    display: flex; flex-wrap: wrap; gap: 5px;
    background: #f0fff0;
}
.vcbot-suggestion {
    font-size: 12px; font-weight: 500;
    padding: 5px 12px; border-radius: 99px;
    border: 1px solid #b2dfb2;
    background: #fff; color: #007700;
    cursor: pointer; transition: all 0.15s;
    white-space: nowrap;
}
.vcbot-suggestion:hover {
    background: #00aa00; border-color: #00aa00;
    color: #fff;
}

/* Variation picker */
.vcbot-variation-btn {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 13px; border-radius: 10px;
    border: 1px solid #b2dfb2;
    background: #fff; cursor: pointer; transition: all 0.15s;
    width: 100%; text-align: left;
    font-family: inherit;
}
.vcbot-variation-btn:hover {
    border-color: #00aa00;
    background: #f0fff0;
}
.vcbot-var-label { font-size: 13px; font-weight: 600; color: #1a1a1a; }
.vcbot-var-price { font-size: 13px; color: #007700; font-weight: 700; }
.vcbot-var-price del { color: #999; font-weight: 400; font-size: 12px; margin-right: 4px; }
.vcbot-sale-badge {
    font-size: 10px; font-weight: 700;
    background: #fee2e2; color: #dc2626;
    padding: 1px 5px; border-radius: 99px; margin-left: 4px;
}
#vcbot-suggestions:has(.vcbot-variation-btn) { flex-direction: column; }

/* Footer / input */
#vcbot-footer {
    padding: 10px 12px;
    border-top: 1px solid #d4edda;
    display: flex; gap: 7px; align-items: center;
    background: #fff; flex-shrink: 0;
}
#vcbot-input {
    flex: 1; border: 1px solid #b2dfb2;
    border-radius: 10px; padding: 9px 12px;
    font-size: 13.5px; outline: none;
    font-family: inherit; color: #1a1a1a;
    background: #f0fff0; transition: border-color 0.2s;
}
#vcbot-input:focus { border-color: #00aa00; background: #fff; }
#vcbot-input::placeholder { color: #88bb88; }
#vcbot-send {
    width: 38px; height: 38px; border: none; border-radius: 10px;
    background: linear-gradient(135deg, #00CC01, #008000);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: transform 0.15s;
    box-shadow: 0 2px 8px rgba(0,150,0,0.35);
}
#vcbot-send:hover { transform: scale(1.08); }

/* Cart popup overlay */
#vcbot-cart-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 9999999;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: vcbot-fade-in 0.2s ease;
}
@keyframes vcbot-fade-in { from { opacity: 0; } to { opacity: 1; } }

#vcbot-cart-popup-inner {
    background: #fff;
    border-radius: 20px;
    width: 100%; max-width: 400px;
    padding: 32px 28px 28px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: vcbot-popup-in 0.28s cubic-bezier(.22,1,.36,1);
    position: relative;
}
@keyframes vcbot-popup-in {
    from { opacity: 0; transform: scale(0.88) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

#vcbot-popup-close {
    position: absolute; top: 14px; right: 14px;
    background: #f0f0f0; border: none; cursor: pointer;
    width: 28px; height: 28px; border-radius: 7px;
    font-size: 14px; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
#vcbot-popup-close:hover { background: #e0e0e0; }

.vcbot-popup-icon { font-size: 48px; margin-bottom: 12px; }

#vcbot-cart-popup-inner h3 {
    font-size: 20px; font-weight: 700; color: #1a1a1a;
    margin: 0 0 8px;
}
.vcbot-popup-item {
    font-size: 14px; font-weight: 600; color: #333;
    margin: 0 0 4px;
}
.vcbot-popup-meta {
    font-size: 12px; color: #888;
    margin: 0 0 20px;
}

/* Progress bar */
#vcbot-checkout-bar {
    height: 4px; background: #e0f0e0;
    border-radius: 99px; overflow: hidden;
    margin-bottom: 20px;
}
#vcbot-checkout-progress {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #00CC01, #008000);
    border-radius: 99px;
}

/* Popup buttons */
.vcbot-popup-btns { display: flex; flex-direction: column; gap: 8px; }
.vcbot-popup-btns a {
    display: block; padding: 13px;
    border-radius: 11px; font-size: 14px; font-weight: 600;
    text-decoration: none; transition: all 0.15s;
}
.vcbot-btn-checkout {
    background: linear-gradient(135deg, #00CC01, #008000);
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(0,150,0,0.35);
}
.vcbot-btn-checkout:hover { box-shadow: 0 6px 20px rgba(0,150,0,0.5); }
.vcbot-btn-cart {
    background: #f0fff0; color: #007700 !important;
    border: 1px solid #b2dfb2;
}
.vcbot-btn-cart:hover { background: #e0ffe0; }
.vcbot-btn-continue {
    color: #888 !important; font-size: 13px !important;
    font-weight: 500 !important; padding: 6px !important;
}
.vcbot-btn-continue:hover { color: #007700 !important; }

/* Mobile */
@media (max-width: 480px) {
    #vcbot-root { bottom: 14px; right: 12px; }
    #vcbot-window { width: calc(100vw - 24px); height: 75vh; }
}

/* Multi-select variation rows */
.vcbot-variation-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    border-radius: 10px;
    border: 1.5px solid #b2dfb2;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    font-family: inherit;
}
.vcbot-variation-row:hover {
    border-color: #00aa00;
    background: #f0fff0;
}
.vcbot-variation-row.vcbot-row-selected {
    border-color: #00aa00;
    background: #e6ffe6;
}
.vcbot-variation-row input[type="checkbox"] {
    width: 17px; height: 17px;
    accent-color: #00aa00;
    flex-shrink: 0;
    cursor: pointer;
}
.vcbot-variation-row .vcbot-var-label {
    flex: 1;
    font-size: 13px; font-weight: 600; color: #1a1a1a;
}
.vcbot-variation-row .vcbot-var-price {
    font-size: 13px; color: #007700;
    display: flex; align-items: center; gap: 5px; flex-shrink: 0;
}
.vcbot-variation-row .vcbot-var-price del {
    color: #999; font-weight: 400; font-size: 12px;
}

/* Add to Cart button */
.vcbot-add-selected-btn {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #00CC01, #008000);
    color: #fff;
    font-size: 14px; font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    margin-top: 4px;
    box-shadow: 0 3px 10px rgba(0,150,0,0.35);
}
.vcbot-add-selected-btn:hover:not(:disabled) {
    box-shadow: 0 5px 16px rgba(0,150,0,0.5);
    transform: translateY(-1px);
}
.vcbot-add-selected-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#vcbot-suggestions:has(.vcbot-variation-row) {
    flex-direction: column;
    gap: 6px;
}

/* Contact card */
.vcbot-contact-card {
    background: #f0fff0;
    border: 1.5px solid #b2dfb2;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.vcbot-contact-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
}
.vcbot-contact-row {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #007700;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}
.vcbot-contact-row:hover { color: #005500; }
.vcbot-contact-btn {
    margin-top: 4px;
    background: linear-gradient(135deg, #00CC01, #008000);
    color: #fff !important;
    padding: 9px 14px;
    border-radius: 8px;
    font-weight: 600;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,150,0,0.3);
}
.vcbot-contact-btn:hover { box-shadow: 0 4px 14px rgba(0,150,0,0.45); }

/* Qualification page link button */
.vcbot-qual-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 99px;
    background: linear-gradient(135deg, #00CC01, #008000);
    color: #fff !important;
    text-decoration: none;
    border: none;
    box-shadow: 0 2px 8px rgba(0,150,0,0.35);
    transition: all 0.15s;
    white-space: nowrap;
}
.vcbot-qual-link:hover {
    box-shadow: 0 4px 14px rgba(0,150,0,0.5);
    transform: translateY(-1px);
    color: #fff !important;
}

/* vcbot-link inside bot messages */
.vcbot-bot .vcbot-link {
    color: #007700;
    font-weight: 600;
    text-decoration: underline;
}
.vcbot-bot ul {
    margin: 6px 0 6px 16px;
    padding: 0;
}
.vcbot-bot li {
    margin-bottom: 3px;
    font-size: 13px;
    line-height: 1.5;
}
