/* ═══════════════════════════════════════════════════
   CheveChat Widget — Clean Minimal Design
   Inspired by luxury e-commerce chat aesthetic
   ═══════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
  --cc-bg:       #f0efed;
  --cc-white:    #ffffff;
  --cc-black:    #1a1a1a;
  --cc-sub:      #6b6b6b;
  --cc-border:   #e2e0dd;
  --cc-pill-bg:  #e8e6e3;
  --cc-shadow:   0 8px 40px rgba(0,0,0,.16), 0 2px 8px rgba(0,0,0,.08);
  --cc-r:        20px;
  --cc-font:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --cc-primary:  #1a1a1a;
  --cc-user-bg:  #e8e6e3;
}

/* ── Launcher ─────────────────────────────────────── */
#cc-launcher {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--cc-primary);
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 99999;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
  user-select: none;
  border: none;
}
#cc-launcher:hover { transform: scale(1.07); box-shadow: 0 6px 28px rgba(0,0,0,.32); }
#cc-launcher svg { width: 22px; height: 22px; fill: #fff; }

#cc-badge {
  position: absolute; top: -2px; right: -2px;
  background: #e53e3e; color: #fff;
  border-radius: 50%; width: 17px; height: 17px;
  font-size: 9px; font-weight: 700; font-family: var(--cc-font);
  display: none; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
#cc-badge.show { display: flex; }

/* ── Panel ────────────────────────────────────────── */
#cc-panel {
  position: fixed;
  bottom: 92px; right: 28px;
  width: 360px;
  background: var(--cc-bg);
  border-radius: var(--cc-r);
  box-shadow: var(--cc-shadow);
  display: flex; flex-direction: column;
  z-index: 99998;
  font-family: var(--cc-font);
  overflow: hidden;
  max-height: 600px;
  transform: translateY(14px) scale(.97);
  opacity: 0; pointer-events: none;
  transition: transform .28s cubic-bezier(.34,1.56,.64,1), opacity .22s;
}
#cc-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1; pointer-events: all;
}

@media (max-width: 440px) {
  #cc-panel {
    width: calc(100vw - 16px);
    right: 8px; bottom: 80px;
    max-height: calc(100dvh - 96px);
    border-radius: 18px;
  }
  #cc-launcher { bottom: 18px; right: 14px; }
}

/* ── Top bar ──────────────────────────────────────── */
#cc-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 14px 10px;
  flex-shrink: 0;
}

#cc-topbar-center { flex: 1; }

#cc-topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

#cc-back-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.07);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  flex-shrink: 0;
}
#cc-back-btn:hover { background: rgba(0,0,0,.12); }
#cc-back-btn svg { width: 18px; height: 18px; fill: var(--cc-black); }

.cc-top-pill {
  display: flex; align-items: center; gap: 5px;
  background: rgba(0,0,0,.07);
  border: none;
  border-radius: 20px;
  padding: 6px 12px;
  font-family: var(--cc-font);
  font-size: 12px;
  font-weight: 500;
  color: var(--cc-black);
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.cc-top-pill:hover { background: rgba(0,0,0,.12); }
.cc-top-pill svg { width: 14px; height: 14px; fill: var(--cc-black); }

#cc-close-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.07);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
#cc-close-btn:hover { background: rgba(0,0,0,.12); }
#cc-close-btn svg { width: 16px; height: 16px; fill: var(--cc-black); }

/* ── Home screen ─────────────────────────────────── */
#cc-home {
  display: flex;
  flex-direction: column;
  padding: 0 16px 16px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

#cc-home-brand {
  text-align: center;
  padding: 20px 0 28px;
}

#cc-logo-img {
  max-width: 160px;
  max-height: 64px;
  object-fit: contain;
  filter: brightness(0);  /* force black */
}

#cc-brand-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--cc-black);
  letter-spacing: .5px;
  text-transform: uppercase;
  line-height: 1.2;
}

/* ── Quick pill buttons ───────────────────────────── */
#cc-quick-pills {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.cc-pill-btn {
  background: rgba(0,0,0,.06);
  border: none;
  border-radius: 24px;
  padding: 12px 18px;
  font-family: var(--cc-font);
  font-size: 13.5px;
  font-weight: 400;
  color: var(--cc-black);
  cursor: pointer;
  text-align: left;
  transition: background .15s;
  width: fit-content;
  max-width: 100%;
}
.cc-pill-btn:hover { background: rgba(0,0,0,.11); }

/* ── Home input ──────────────────────────────────── */
#cc-home-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.65);
  border-radius: 28px;
  padding: 10px 10px 10px 18px;
  border: 1.5px solid transparent;
  transition: border-color .2s, background .2s;
  margin-top: auto;
}
#cc-home-input-wrap:focus-within {
  background: #fff;
  border-color: rgba(0,0,0,.15);
}
#cc-home-input {
  flex: 1;
  border: none; background: transparent;
  font-family: var(--cc-font);
  font-size: 14px;
  color: var(--cc-black);
  resize: none;
  outline: none;
  line-height: 1.4;
  max-height: 80px;
  overflow-y: auto;
}
#cc-home-input::placeholder { color: #999; }

#cc-home-send {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--cc-black);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s, transform .15s;
  flex-shrink: 0;
}
#cc-home-send:hover { opacity: .8; }
#cc-home-send svg { width: 16px; height: 16px; fill: #fff; transform: translateX(1px); }

/* ── Chat screen ─────────────────────────────────── */
#cc-chat {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  background: #fff;
}

/* Brand bar inside chat */
#cc-brand-bar {
  text-align: center;
  padding: 24px 20px 12px;
  border-bottom: 1px solid var(--cc-border);
  flex-shrink: 0;
}
#cc-brand-bar-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--cc-black);
  text-transform: uppercase;
  letter-spacing: .5px;
}
#cc-brand-bar-sub {
  font-size: 12px;
  color: var(--cc-sub);
  margin-top: 4px;
}

/* ── Messages ─────────────────────────────────────── */
#cc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
#cc-messages::-webkit-scrollbar { width: 4px; }
#cc-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,.1); border-radius: 4px; }

.cc-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.cc-msg.user {
  flex-direction: row-reverse;
}
.cc-msg.admin {
  flex-direction: row;
}

.cc-bubble {
  max-width: 75%;
  padding: 11px 15px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.cc-msg.user .cc-bubble {
  background: var(--cc-user-bg);
  color: var(--cc-black);
  border-bottom-right-radius: 5px;
}
.cc-msg.bot .cc-bubble {
  background: transparent;
  color: var(--cc-black);
  padding-left: 0;
  border-bottom-left-radius: 5px;
  font-size: 14.5px;
}
.cc-msg.admin .cc-bubble {
  background: #fef9e7;
  color: var(--cc-black);
  border: 1px solid #f5e07a;
  border-bottom-left-radius: 5px;
}

/* Bot avatar — minimal dot */
.cc-bot-av {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ccc;
  flex-shrink: 0;
  margin-bottom: 4px;
}

/* Typing */
.cc-typing-bubble {
  display: flex; gap: 4px;
  padding: 10px 14px;
  background: #f0f0f0;
  border-radius: 18px;
  width: fit-content;
}
.cc-typing-bubble span {
  width: 7px; height: 7px;
  background: #aaa; border-radius: 50%;
  animation: ccBounce 1.2s infinite;
}
.cc-typing-bubble span:nth-child(2) { animation-delay: .15s; }
.cc-typing-bubble span:nth-child(3) { animation-delay: .3s; }
@keyframes ccBounce {
  0%,60%,100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

/* ── Contact / action elements in chat ───────────── */
.cc-contact-btns {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.cc-contact-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px;
  border-radius: 24px;
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  font-family: var(--cc-font);
  transition: opacity .15s;
  cursor: pointer;
}
.cc-contact-btn:hover { opacity: .82; }
.cc-contact-btn svg { width: 15px; height: 15px; }
.cc-contact-btn.phone { background: var(--cc-black); color: #fff; }
.cc-contact-btn.phone svg { fill: #fff; }
.cc-contact-btn.whatsapp { background: #25d366; color: #fff; }
.cc-contact-btn.whatsapp svg { fill: #fff; }

.cc-checkout-btn, .cc-wholesale-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--cc-black); color: #fff;
  padding: 10px 18px; border-radius: 24px;
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  font-family: var(--cc-font);
  transition: opacity .15s;
  margin-top: 4px;
}
.cc-checkout-btn:hover, .cc-wholesale-link:hover { opacity: .82; color: #fff; }
.cc-wholesale-link svg { width: 14px; height: 14px; fill: #fff; }

/* Email collect form */
.cc-email-form {
  background: #fafafa;
  border: 1px solid var(--cc-border);
  border-radius: 16px;
  padding: 16px;
  margin-top: 4px;
}
.cc-email-form label {
  font-size: 12px;
  font-weight: 600;
  color: var(--cc-black);
  display: block;
  margin-bottom: 6px;
}
.cc-email-form label span { color: #e53e3e; }
.cc-email-input {
  width: 100%;
  border: 1.5px solid var(--cc-border);
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 13px;
  font-family: var(--cc-font);
  outline: none;
  box-sizing: border-box;
  transition: border-color .2s;
}
.cc-email-input:focus { border-color: var(--cc-black); }
.cc-email-submit {
  width: 100%;
  margin-top: 10px;
  background: var(--cc-black);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 11px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--cc-font);
  cursor: pointer;
  transition: opacity .15s;
}
.cc-email-submit:hover { opacity: .8; }

/* ── Chat footer ─────────────────────────────────── */
#cc-footer {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--cc-border);
  gap: 8px;
  flex-shrink: 0;
  background: #fff;
}
#cc-input {
  flex: 1;
  border: 1.5px solid var(--cc-border);
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: var(--cc-font);
  color: var(--cc-black);
  resize: none;
  outline: none;
  max-height: 80px;
  overflow-y: auto;
  transition: border-color .2s;
  line-height: 1.4;
}
#cc-input::placeholder { color: #aaa; }
#cc-input:focus { border-color: rgba(0,0,0,.3); }

#cc-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--cc-black);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s, transform .15s;
  flex-shrink: 0;
}
#cc-send:hover { opacity: .8; }
#cc-send svg { width: 16px; height: 16px; fill: #fff; transform: translateX(1px); }
