/* Shop assistant widget — cutpricebd.com
   Scoped under .as_ prefixes so it cannot touch the existing theme.
   Sizes are fixed up front (no layout shift) and the launcher sits above the
   WhatsApp float button, which is pinned at right:18px bottom:20px. */

/* This theme stacks as high as z-index 9999999 (.top_right_btn), and the mobile
   header sits at 99999 -- at 9999 the panel opened UNDERNEATH both and its close
   button could not be reached. */
.as_launch {
    position: fixed; right: 18px; bottom: 92px; z-index: 9999998;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px 10px 13px; border: 0; border-radius: 999px;
    background: #ed2470; color: #fff; cursor: pointer;
    font: 600 14px/1.1 inherit;
    box-shadow: 0 6px 18px rgba(237, 36, 112, .35);
    transition: transform .15s ease, box-shadow .15s ease;
}
.as_launch:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(237, 36, 112, .45); }
.as_launch:focus-visible { outline: 3px solid #111; outline-offset: 2px; }
.as_launch svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.as_launch.as_hidden { display: none; }

.as_panel {
    position: fixed; z-index: 10000000; right: 18px; bottom: 20px;
    width: 700px; max-width: calc(100vw - 36px); height: 540px; max-height: calc(100vh - 40px);
    background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
    display: none; flex-direction: column;
    font: 14px/1.5 inherit; color: #222;
}
.as_panel.as_open { display: flex; }

.as_head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 14px; background: #ed2470; color: #fff; flex: 0 0 auto;
}
.as_head_t { display: flex; flex-direction: column; min-width: 0; }
.as_h_title { font-size: 15px; font-weight: 700; }
.as_h_sub { font-size: 12px; opacity: .9; }
.as_x {
    border: 0; background: rgba(255, 255, 255, .18); color: #fff; cursor: pointer;
    width: 32px; height: 32px; border-radius: 8px; font-size: 22px; line-height: 1; flex: 0 0 auto;
}
.as_x:hover { background: rgba(255, 255, 255, .3); }

.as_body { display: flex; min-height: 0; flex: 1 1 auto; }

/* LEFT rail: the live product column asked for on desktop. */
.as_rail {
    flex: 0 0 272px; border-right: 1px solid #ececec; background: #fafafa;
    padding: 12px; overflow-y: auto; display: flex; flex-direction: column;
}
.as_rail_h { margin: 0 0 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #777; }
.as_rail_empty { margin: 0; font-size: 13px; color: #999; }
.as_rail_list { display: flex; flex-direction: column; gap: 8px; }

.as_chat { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.as_log { flex: 1 1 auto; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }

.as_msg { max-width: 86%; padding: 9px 12px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
.as_msg.as_bot { align-self: flex-start; background: #f1f1f4; border-bottom-left-radius: 4px; }
.as_msg.as_me  { align-self: flex-end; background: #ed2470; color: #fff; border-bottom-right-radius: 4px; }
.as_msg.as_wait { color: #888; font-style: italic; background: #f7f7f9; }

/* Product card: used in the rail on desktop and inline in the chat on mobile. */
.as_card {
    display: flex; gap: 10px; align-items: center; text-decoration: none; color: inherit;
    background: #fff; border: 1px solid #e8e8e8; border-radius: 12px; padding: 8px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.as_card:hover { border-color: #ed2470; box-shadow: 0 4px 14px rgba(0, 0, 0, .08); text-decoration: none; }
.as_card img { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: #f6f6f6; flex: 0 0 auto; }
.as_card_b { min-width: 0; flex: 1 1 auto; }
.as_card_n { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; margin-bottom: 3px;
             overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.as_card_p { font-size: 13px; font-weight: 700; color: #ed2470; }
.as_card_o { font-size: 12px; color: #999; text-decoration: line-through; margin-left: 5px; font-weight: 400; }
.as_tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; margin-left: 5px; vertical-align: 1px; }
.as_tag.as_off  { background: #ffe8f0; color: #c2185b; }
.as_tag.as_out  { background: #f2f2f2; color: #777; }
.as_tag.as_free { background: #e6f7ec; color: #1b7f43; }

/* Inline cards inside the conversation (mobile, and as an echo on desktop). */
.as_inline { display: none; flex-direction: column; gap: 8px; align-self: stretch; }
.as_inline .as_card { background: #fff; }

.as_quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; flex: 0 0 auto; }
.as_chip {
    border: 1px solid #e0e0e0; background: #fff; color: #333; cursor: pointer;
    border-radius: 999px; padding: 6px 12px; font: 500 12px/1 inherit;
}
.as_chip:hover { border-color: #ed2470; color: #ed2470; }

.as_form { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid #ececec; flex: 0 0 auto; }
.as_in {
    flex: 1 1 auto; min-width: 0; border: 1px solid #ddd; border-radius: 10px;
    padding: 10px 12px; font: 14px/1.2 inherit; color: #222; background: #fff;
}
.as_in:focus { outline: 0; border-color: #ed2470; box-shadow: 0 0 0 3px rgba(237, 36, 112, .12); }
.as_send {
    border: 0; border-radius: 10px; background: #ed2470; color: #fff; cursor: pointer;
    padding: 0 16px; font: 600 14px/1 inherit; flex: 0 0 auto;
}
.as_send[disabled] { opacity: .55; cursor: default; }

.as_wa {
    display: block; text-align: center; text-decoration: none;
    background: #25d366; color: #fff; font-weight: 700; padding: 11px 14px; flex: 0 0 auto;
}
.as_wa:hover { background: #1fb858; color: #fff; text-decoration: none; }

/* Phones: full screen, no rail, product cards inline in the conversation. */
@media (max-width: 760px) {
    .as_panel { right: 0; bottom: 0; left: 0; top: 0;
                width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
    .as_rail { display: none; }
    .as_inline { display: flex; }
    /* On a phone the theme lifts the WhatsApp button to bottom:76px over a 60px
       bottom nav, so it occupies 76-136px. Sit clear above it. */
    .as_launch { right: 14px; bottom: 146px; padding: 9px 14px 9px 11px; font-size: 13px; }
    .as_msg { max-width: 92%; }
}

/* The site is light-only; keep the panel readable if the OS forces dark. */
@media (prefers-color-scheme: dark) {
    .as_panel { color: #222; background: #fff; }
}
