/* ================================================================
   Creamia Lab — Embedded Chat Widget
   All sizes in fixed px, icons as base64 img for pixel-perfect render
   ================================================================ */

/* Reset any theme interference */
#clc-footer-col *,
.clc-panel *,
.clc-overlay {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

#clc-footer-col img,
.clc-panel img {
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
}

/* Cart badge */
.clc-desktop-cart,
.clc-mobile-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.clc-mobile-cart {
  padding: 6px;
}

.clc-cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #D4956A;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0 4px;
  z-index: 1;
  pointer-events: none;
}

/* Mobile cart badge - slightly different position due to padding */
.clc-mobile-cart .clc-cart-badge {
  top: 0;
  right: 0;
}

/* Payment method icons in footer */
.clc-payment-icons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.clc-pay-icon {
  height: 26px !important;
  width: auto !important;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 3px !important;
}

.clc-pay-icon:hover {
  opacity: 0.9;
}

@media (max-width: 767px) {
  .clc-payment-icons {
    justify-content: center;
    gap: 6px;
  }
  .clc-pay-icon {
    height: 20px !important;
  }
  /* Reduce footer gaps on mobile */
  .site-footer .footer-widgets {
    padding-top: 30px !important;
    padding-bottom: 0 !important;
  }
  .site-footer .footer-widgets .footer-widgets-area {
    margin-bottom: 10px !important;
    padding-bottom: 0 !important;
  }
  .site-footer .footer-widgets .widget {
    margin-bottom: 10px !important;
  }
  .site-footer .footer-main.site-info {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }
  .site-footer .footer-main .divider {
    margin: 0 !important;
  }
  .site-footer .footer-main .footer-items {
    padding: 8px 0 !important;
  }
  .site-footer .footer-main .footer-container {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
}

/* ── Footer Column ─────────────────────────────────────────── */
#clc-footer-col {
  padding-top: 0;
}

.clc-trigger {
  text-align: left;
  max-width: 420px;
}

.clc-trigger-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}

.clc-trigger-head svg,
.clc-trigger-head svg * {
  color: #D4956A;
  stroke: #D4956A;
  flex-shrink: 0;
}

.clc-trigger-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  padding: 0;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.clc-trigger-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin: 0 0 18px;
  padding: 0;
  line-height: 1.5;
}

/* Fake input — bigger, more chat-like */
.clc-trigger-box {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(212,149,106,0.28);
  border-radius: 18px;
  padding: 24px 16px 24px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 110px;
}

.clc-trigger-box:hover {
  border-color: #D4956A;
  background: rgba(212,149,106,0.06);
  box-shadow: 0 0 0 2px rgba(212,149,106,0.22), 0 8px 28px rgba(0,0,0,0.25);
}

.clc-trigger-box:focus-visible {
  outline: 2px solid rgba(212,149,106,0.5);
  outline-offset: 2px;
}

.clc-trigger-ph {
  font-size: 14px;
  color: rgba(255,255,255,0.3);
  user-select: none;
  line-height: 1.4;
  padding-top: 6px;
}

.clc-trigger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: clcHoverPulse 3s ease-in-out infinite;
}

@keyframes clcHoverPulse {
  0%, 100% { background: rgba(255,255,255,0.07); }
  50% { background: #D4956A; }
}

.clc-trigger-box:hover .clc-trigger-btn {
  background: #D4956A;
}

/* Quick pills */
.clc-trigger-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.clc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 100px;
  border: 1px solid rgba(212,149,106,0.45);
  background: rgba(212,149,106,0.08);
  color: #D4956A;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1;
}

.clc-pill svg,
.clc-pill svg * {
  color: #D4956A;
  stroke: #D4956A;
}

.clc-pill:hover {
  background: #D4956A;
  border-color: #D4956A;
  color: #fff;
  box-shadow: 0 4px 14px rgba(212,149,106,0.35);
  transform: translateY(-1px);
}

.clc-pill:hover svg,
.clc-pill:hover svg * {
  color: #fff;
  stroke: #fff;
}

.clc-pill span {
  display: inline;
}

/* ── Overlay ───────────────────────────────────────────────── */
.clc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.clc-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ── Chat Panel ────────────────────────────────────────────── */
.clc-panel {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 400px;
  max-width: 100vw;
  height: 100dvh;
  max-height: 620px;
  background: #18181B;
  border-left: 1px solid rgba(255,255,255,0.06);
  border-top-left-radius: 18px;
  display: flex;
  flex-direction: column;
  z-index: 99999;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.25s ease;
  box-shadow: -6px 0 36px rgba(0,0,0,0.35);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.clc-panel.is-open {
  transform: translateX(0);
  opacity: 1;
}

/* Panel Header */
.clc-ph {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.clc-ph-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #f0f0f0;
}

.clc-ph-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  transition: background 0.2s ease;
  padding: 0;
}

.clc-ph-close:hover {
  background: rgba(255,255,255,0.1);
}

/* Panel Body (messages) */
.clc-pb {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.clc-pb::-webkit-scrollbar { width: 4px; }
.clc-pb::-webkit-scrollbar-track { background: transparent; }
.clc-pb::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

/* Messages */
.clc-msg {
  display: flex;
  margin-bottom: 3px;
  animation: clcIn 0.2s ease;
}

.clc-msg--chain { margin-top: -2px; }
.clc-msg--user  { justify-content: flex-end; }
.clc-msg--agent { justify-content: flex-start; }
.clc-msg--system { justify-content: center; }

@keyframes clcIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.clc-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}

.clc-msg--user .clc-bubble {
  background: #D4956A;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.clc-msg--agent .clc-bubble {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.82);
  border-bottom-left-radius: 4px;
}

.clc-msg--system .clc-bubble {
  background: none;
  color: rgba(255,255,255,0.3);
  font-size: 12px;
  font-style: italic;
}

.clc-bubble a {
  color: #8BB4E8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Typing */
.clc-pt {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 20px 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
}

.clc-dot {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  animation: clcPulse 1.2s infinite;
}

.clc-dot:nth-child(2) { animation-delay: 0.15s; }
.clc-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes clcPulse {
  0%, 60%, 100% { opacity: 0.2; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1.1); }
}

.clc-pt-text {
  margin-left: 3px;
}

/* Panel Quick Actions */
.clc-pq {
  display: flex;
  gap: 6px;
  padding: 0 18px 10px;
  flex-wrap: wrap;
}

/* Panel Footer (input area) */
.clc-pf {
  padding: 0 14px 14px;
  flex-shrink: 0;
}

.clc-pi {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 10px 10px 10px 18px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.clc-pi:focus-within {
  border-color: rgba(255,255,255,0.14);
  box-shadow: 0 0 0 1px rgba(212,149,106,0.06);
}

.clc-pi textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  resize: none;
  color: rgba(255,255,255,0.88);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  padding: 4px 0;
  min-height: 42px;
  max-height: 140px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.clc-pi textarea::placeholder {
  color: rgba(255,255,255,0.28);
}

.clc-pi textarea::-webkit-scrollbar { width: 3px; }
.clc-pi textarea::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

/* Send button */
.clc-ps {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  max-width: 34px;
  max-height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.07);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
  margin-bottom: 2px;
}

.clc-ps.has-content {
  background: #fff;
}

.clc-ps.has-content:hover {
  background: #e8e8e8;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 767px) {
  .clc-panel {
    width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    border-left: none;
  }

  .clc-trigger {
    max-width: 100%;
  }

  .clc-trigger-pills {
    gap: 6px;
  }

  .clc-pill {
    height: 30px;
    font-size: 11px;
    padding: 0 11px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .clc-panel {
    width: 380px;
  }
}
