/* 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; }

/* Narrowing chips shown under a set of product cards */
.askcart-followup { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.askcart-chips { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 92%; }
.askcart-chip {
    font: inherit; font-size: 13px; padding: 6px 12px;
    border: 1px solid var(--ac-border); border-radius: 999px;
    background: var(--ac-bubble); color: var(--ac-text); cursor: pointer;
}
.askcart-chip:hover { border-color: var(--askcart-brand); color: var(--askcart-brand); }
/* "Show me more" is the action, not another filter, so it reads as one. */
.askcart-chip-more {
    border-color: var(--askcart-brand); color: var(--askcart-brand); font-weight: 600;
}
.askcart-chip-more:hover { background: var(--askcart-brand); color: #fff; }
.askcart-chip[disabled] { opacity: .45; cursor: default; }
/* The offer button earns a warmer colour than the filters beside it. */
.askcart-chip-offer {
    border-color: #B54708; color: #B54708; font-weight: 600;
    background: #FFFAEB;
}
.askcart-chip-offer:hover { background: #B54708; color: #fff; border-color: #B54708; }

/* 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;
}

/* The widget lands inside somebody else's theme, and a shop theme styles
   every button on the page — often with !important. Without this the send
   button takes the theme's colour and its icon disappears into it. Raised
   specificity plus the few properties worth forcing. */
.askcart-root .askcart-send,
.askcart-root .askcart-send:hover,
.askcart-root .askcart-send:focus {
    background: var(--askcart-brand) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: none !important;
    text-indent: 0 !important;
    font-size: 0;
    padding: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    line-height: 1 !important;
}
.askcart-root .askcart-send svg,
.askcart-root .askcart-close svg,
.askcart-root .askcart-reset svg,
.askcart-root .askcart-launcher svg {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 18px; height: 18px;
    stroke: currentColor !important;
    fill: none !important;
    max-width: none !important;
}
.askcart-root .askcart-launcher svg { width: 26px; height: 26px; }
.askcart-root .askcart-launcher-face svg,
.askcart-root .askcart-head-face svg {
    width: 100% !important; height: 100% !important;
    stroke: none !important;
}

@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,
.askcart-launcher-face img { width: 100%; height: 100%; display: block; }
/* An uploaded photo is rarely square. Cropping to fill beats letterboxing
   it inside the circle with bars down the sides. */
.askcart-face-img { object-fit: cover; border-radius: 50%; }
/* In the header the avatar sits on the brand colour, so it needs a light
   disc of its own — otherwise its brand-coloured circle disappears into
   the bar and only the white line-art is left floating. */
.askcart-head-face {
    width: 32px; height: 32px; flex-shrink: 0;
    color: var(--askcart-brand);
    margin-right: 10px; display: block; border-radius: 50%;
    background: #fff; padding: 2px; box-sizing: border-box;
}
.askcart-head-face svg,
.askcart-head-face img { width: 100%; height: 100%; display: block; }
/* A photo brings its own edges, so the white ring the SVG set needs
   would only shrink it. */
.askcart-head-face:has(img) { background: none; padding: 0; }
.askcart-head { display: flex; align-items: center; }
.askcart-title { flex: 1; }

/* Continue on WhatsApp, in the header */
.askcart-wa {
    background: #25D366; color: #fff; text-decoration: none;
    width: 30px; height: 30px; border-radius: 50%; margin-right: 6px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: transform .15s;
}
.askcart-wa:hover, .askcart-wa:focus-visible { transform: scale(1.08); color: #fff; }
.askcart-root .askcart-wa svg { display: block; }

/* Start-over button in the header */
.askcart-reset {
    background: none; border: none; color: #fff; cursor: pointer;
    padding: 6px; border-radius: 6px; margin-right: 2px;
    display: flex; align-items: center; opacity: .75;
}
.askcart-reset:hover { background: rgba(255,255,255,.15); opacity: 1; }

/* The offer reminder beside a product's price */
.askcart-price-note {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin: 8px 0 14px; font-size: 14px; line-height: 1.4;
    color: #B54708;
}
.askcart-price-note-tag {
    background: #B54708; color: #fff; border-radius: 4px;
    padding: 2px 8px; font-size: 12px; font-weight: 600;
    letter-spacing: .01em; white-space: nowrap;
}

/* The quiet proactive notice: a dot on the bubble, and the first words
   beside it. Nothing opens until the visitor asks it to. */
.askcart-teaser {
    position: absolute; bottom: 72px; display: flex; align-items: stretch;
    max-width: 272px; border-radius: 12px; overflow: hidden;
    background: var(--ac-panel); border: 1px solid var(--ac-border);
    box-shadow: 0 8px 26px rgba(0,0,0,.18);
    animation: askcartTeaserIn .22s ease-out;
}
.askcart-bottom-right .askcart-teaser { right: 0; }
.askcart-bottom-left  .askcart-teaser { left: 0; }
@keyframes askcartTeaserIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
.askcart-teaser-body {
    font: inherit; font-size: 14px; line-height: 1.45; text-align: left;
    padding: 11px 6px 11px 13px; border: none; background: none;
    color: var(--ac-text); cursor: pointer; flex: 1;
}
.askcart-teaser-body:hover { color: var(--askcart-brand); }
.askcart-teaser-close {
    font: inherit; font-size: 12px; line-height: 1; cursor: pointer;
    border: none; background: none; color: var(--ac-muted);
    padding: 0 11px 0 6px; flex-shrink: 0;
}
.askcart-teaser-close:hover { color: var(--ac-text); }

/* An unread dot, so the notice still reads as waiting once it is dismissed. */
.askcart-has-teaser .askcart-launcher::after {
    content: ""; position: absolute; top: 2px; right: 2px;
    width: 13px; height: 13px; border-radius: 50%;
    background: #E5484D; border: 2px solid var(--ac-panel);
}
.askcart-launcher { position: relative; }

@media (max-width: 480px) {
    .askcart-teaser { max-width: calc(100vw - 52px); }
}
