/* askcart — storefront widget */

.askcart-root {
    --askcart-brand: #14243D;

    /* Light is the default; the dark block below only swaps these. */
    --ac-panel:   #ffffff;
    --ac-chat-bg: #F7F8FA;
    --ac-bubble:  #ffffff;
    --ac-border:  #E4E7EC;
    --ac-text:    #1a1a1a;
    --ac-muted:   #98A2B3;
    --ac-input:   #ffffff;

    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}
.askcart-bottom-right { right: 20px; bottom: 20px; }
.askcart-bottom-left  { left: 20px;  bottom: 20px; }

/* Launcher */
.askcart-launcher {
    width: 58px; height: 58px; border-radius: 50%;
    border: none; cursor: pointer;
    background: var(--askcart-brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 20px rgba(0,0,0,.22);
    transition: transform .15s ease;
}
.askcart-launcher:hover { transform: scale(1.06); }
.askcart-root.is-open .askcart-launcher { display: none; }

/* Panel */
.askcart-panel {
    width: 380px; max-width: calc(100vw - 32px);
    height: 560px; max-height: calc(100vh - 100px);
    background: var(--ac-panel); border-radius: 16px; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,.24);
}
.askcart-head {
    background: var(--askcart-brand); color: #fff;
    padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
.askcart-title { font-weight: 600; font-size: 15px; }
.askcart-close {
    background: none; border: none; color: #fff; cursor: pointer;
    font-size: 15px; line-height: 1; padding: 6px; border-radius: 6px;
}
.askcart-close:hover { background: rgba(255,255,255,.15); }

/* Messages */
.askcart-messages {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
    background: var(--ac-chat-bg);
}
.askcart-msg {
    max-width: 85%; padding: 10px 13px; border-radius: 14px;
    word-wrap: break-word;
}
.askcart-user {
    align-self: flex-end; background: var(--askcart-brand); color: #fff;
    border-bottom-right-radius: 4px;
}
.askcart-assistant {
    align-self: flex-start; background: var(--ac-bubble); color: var(--ac-text);
    border: 1px solid var(--ac-border); border-bottom-left-radius: 4px;
}
.askcart-msg a { color: inherit; text-decoration: underline; }
.askcart-user a { color: #fff; }

/* Typing */
.askcart-typing { display: flex; gap: 4px; padding: 13px; }
.askcart-typing span {
    width: 7px; height: 7px; border-radius: 50%; background: #98A2B3;
    animation: askcart-bounce 1.2s infinite;
}
.askcart-typing span:nth-child(2) { animation-delay: .15s; }
.askcart-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes askcart-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .5; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* Conversation starters */
.askcart-starters { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 92%; }
.askcart-starter {
    font: inherit; font-size: 13px; padding: 7px 12px;
    border: 1px solid var(--askcart-brand); border-radius: 999px;
    background: var(--ac-bubble); color: var(--askcart-brand); cursor: pointer; text-align: left;
}
.askcart-starter:hover { background: var(--askcart-brand); color: #fff; }

/* Product cards */
.askcart-products { align-self: flex-start; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.askcart-prod {
    display: flex; gap: 10px; padding: 9px;
    background: var(--ac-bubble); border: 1px solid var(--ac-border); border-radius: 10px;
}
.askcart-prod-img {
    width: 62px; height: 62px; flex-shrink: 0;
    object-fit: cover; border-radius: 8px; background: #F2F4F7;
}
.askcart-prod-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.askcart-prod-name {
    font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--ac-text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.askcart-prod-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.askcart-price { font-size: 14px; font-weight: 700; color: var(--ac-text); }
.askcart-was { font-size: 12px; color: #98A2B3; text-decoration: line-through; }
.askcart-badge { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 999px; }
.askcart-in  { background: #E9F9EF; color: #1A7F47; }
.askcart-out { background: #FDECEC; color: #B42318; }
.askcart-prod-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.askcart-btn {
    font: inherit; font-size: 11px; font-weight: 600;
    padding: 5px 10px; border-radius: 6px; cursor: pointer;
    border: 1px solid #D0D5DD; background: #fff; color: #344054;
    text-decoration: none; display: inline-block;
}
.askcart-btn:hover { background: #F8FAFC; }
.askcart-btn-primary { background: var(--askcart-brand); color: #fff; border-color: transparent; }

/* Composer */
.askcart-form {
    display: flex; gap: 8px; padding: 12px;
    border-top: 1px solid var(--ac-border); background: var(--ac-panel); flex-shrink: 0;
}
.askcart-input {
    flex: 1; padding: 10px 12px; font: inherit; font-size: 14px;
    border: 1px solid var(--ac-border); border-radius: 10px; outline: none;
    background: var(--ac-input); color: var(--ac-text);
}
.askcart-input:focus { border-color: var(--askcart-brand); }
.askcart-send {
    width: 44px; border: none; border-radius: 10px; cursor: pointer;
    background: var(--askcart-brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
}

@media (max-width: 480px) {
    .askcart-panel { width: calc(100vw - 24px); height: calc(100vh - 90px); }
}

/* Dark theme — only the surface colours change; the brand stays. */
.askcart-root[data-theme="dark"] {
    --ac-panel:   #1D2430;
    --ac-chat-bg: #161C26;
    --ac-bubble:  #252D3B;
    --ac-border:  #333D4E;
    --ac-text:    #E9EDF3;
    --ac-muted:   #8B96A8;
    --ac-input:   #252D3B;
}
.askcart-root[data-theme="dark"] .askcart-btn {
    background: #252D3B; border-color: #3A4658; color: #D6DDE7;
}
.askcart-root[data-theme="dark"] .askcart-btn:hover { background: #2E374A; }
.askcart-root[data-theme="dark"] .askcart-btn-primary {
    background: var(--askcart-brand); color: #fff; border-color: transparent;
}
.askcart-root[data-theme="dark"] .askcart-prod-img { background: #2B3442; }
.askcart-root[data-theme="dark"] .askcart-in  { background: #15311F; color: #6EE7A0; }
.askcart-root[data-theme="dark"] .askcart-out { background: #3A1A1A; color: #F79090; }
.askcart-root[data-theme="dark"] .askcart-was { color: var(--ac-muted); }

/* The assistant's face — it carries its own disc, so it fills the button */
.askcart-launcher { padding: 0; overflow: hidden; }
.askcart-launcher-face { width: 100%; height: 100%; display: block; color: var(--askcart-brand); }
.askcart-launcher-face svg { width: 100%; height: 100%; }
.askcart-head-face {
    width: 30px; height: 30px; flex-shrink: 0; color: #fff;
    margin-right: 10px; display: block; border-radius: 50%;
    background: rgba(255,255,255,.18);
}
.askcart-head-face svg { width: 100%; height: 100%; }
.askcart-head { display: flex; align-items: center; }
.askcart-title { flex: 1; }
