/* ====================================================
   SHILAM COUTURE — AI Shopping Assistant Widget
   ==================================================== */

/* ── Trigger Button ── */
.sc-chat-trigger {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 4200;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--brown-dark, #3E1F0E);
  border: 2px solid var(--gold, #C9A96E);
  color: var(--cream, #FAF6F0);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(62,31,14,0.38), 0 2px 8px rgba(62,31,14,0.2);
  outline: none;
  transition:
    transform   0.5s cubic-bezier(.34,1.56,.64,1),
    box-shadow  0.4s cubic-bezier(.32,.72,0,1);
}
.sc-chat-trigger:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 16px 44px rgba(62,31,14,0.42), 0 4px 14px rgba(62,31,14,0.25);
}

/* Pulse ring */
.sc-chat-trigger::before {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid rgba(201,169,110,0.55);
  animation: sc-trigger-pulse 2.4s cubic-bezier(.32,.72,0,1) infinite;
  pointer-events: none;
}
@keyframes sc-trigger-pulse {
  0%   { transform: scale(1);    opacity: 0.8; }
  70%  { transform: scale(1.32); opacity: 0;   }
  100% { transform: scale(1.32); opacity: 0;   }
}

/* Trigger icon swap */
.sc-chat-trigger .sc-icon-open  { display: block; }
.sc-chat-trigger .sc-icon-close { display: none; }
.sc-chat-trigger.active .sc-icon-open  { display: none; }
.sc-chat-trigger.active .sc-icon-close { display: block; }

/* ── Chat Panel ── */
.sc-chat-panel {
  position: fixed;
  bottom: 102px;
  right: 28px;
  width: 368px;
  max-height: 570px;
  z-index: 4190;
  border-radius: 22px;
  background: var(--cream, #FAF6F0);
  border: 1px solid rgba(201,169,110,0.28);
  box-shadow:
    0 24px 70px rgba(62,31,14,0.22),
    0 6px 22px rgba(62,31,14,0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* closed state */
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  pointer-events: none;
  transform-origin: bottom right;
  transition:
    opacity   0.42s cubic-bezier(.32,.72,0,1),
    transform 0.42s cubic-bezier(.32,.72,0,1);
}
.sc-chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ── Header ── */
.sc-chat-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  background: var(--brown-dark, #3E1F0E);
  flex-shrink: 0;
}
.sc-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold, #C9A96E), #a0793c);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.14);
}
.sc-chat-avatar svg {
  width: 20px;
  height: 20px;
  color: var(--brown-dark, #3E1F0E);
}
.sc-chat-head-info { flex: 1; min-width: 0; }
.sc-chat-head-name {
  display: block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  font-style: italic;
  color: var(--cream, #FAF6F0);
  letter-spacing: 0.02em;
}
.sc-chat-head-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.1rem;
  font-family: 'Jost', sans-serif;
  font-size: 0.68rem;
  color: rgba(250,246,240,0.6);
  letter-spacing: 0.05em;
}
.sc-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5bc47a;
  flex-shrink: 0;
  animation: sc-status-pulse 2s ease-in-out infinite;
}
@keyframes sc-status-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.28); }
}
.sc-chat-close {
  background: transparent;
  border: 0;
  color: rgba(250,246,240,0.55);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem;
  flex-shrink: 0;
  transition: color 0.3s cubic-bezier(.32,.72,0,1);
}
.sc-chat-close:hover { color: var(--cream, #FAF6F0); }

/* ── Messages Body ── */
.sc-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  scroll-behavior: smooth;
  background: #fdfaf5;
}
.sc-chat-body::-webkit-scrollbar { width: 3px; }
.sc-chat-body::-webkit-scrollbar-thumb {
  background: rgba(201,169,110,0.3);
  border-radius: 99px;
}

/* ── Message Bubbles ── */
.sc-msg {
  display: flex;
  flex-direction: column;
  max-width: 90%;
  animation: sc-msg-pop 0.42s cubic-bezier(.32,.72,0,1) both;
}
@keyframes sc-msg-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.sc-msg-bot  { align-self: flex-start; }
.sc-msg-user { align-self: flex-end; }

.sc-msg-bubble {
  padding: 0.7rem 0.95rem;
  font-family: 'Jost', sans-serif;
  font-size: 0.87rem;
  line-height: 1.65;
}
.sc-msg-bot .sc-msg-bubble {
  background: #fff;
  border: 1px solid rgba(201,169,110,0.2);
  color: var(--text-dark, #2C1810);
  border-radius: 4px 18px 18px 18px;
  box-shadow: 0 2px 8px rgba(62,31,14,0.06);
}
.sc-msg-user .sc-msg-bubble {
  background: var(--brown-dark, #3E1F0E);
  color: var(--cream, #FAF6F0);
  border-radius: 18px 18px 4px 18px;
}

/* ── Typing Indicator ── */
.sc-msg-typing .sc-msg-bubble {
  padding: 0.8rem 1rem;
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.sc-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(201,169,110,0.8);
  display: inline-block;
}
.sc-typing-dot:nth-child(1) { animation: sc-bounce 1.3s cubic-bezier(.32,.72,0,1) infinite 0s; }
.sc-typing-dot:nth-child(2) { animation: sc-bounce 1.3s cubic-bezier(.32,.72,0,1) infinite 0.18s; }
.sc-typing-dot:nth-child(3) { animation: sc-bounce 1.3s cubic-bezier(.32,.72,0,1) infinite 0.36s; }
@keyframes sc-bounce {
  0%, 60%, 100% { transform: translateY(0);    opacity: 0.5; }
  30%            { transform: translateY(-7px); opacity: 1; }
}

/* ── Product Grid in Chat ── */
.sc-product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.6rem;
  width: 100%;
}
.sc-product-grid.sc-single {
  grid-template-columns: 1fr;
}
.sc-p-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(201,169,110,0.2);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(.32,.72,0,1), box-shadow 0.4s cubic-bezier(.32,.72,0,1);
}
.sc-p-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(62,31,14,0.14);
}
.sc-p-card-img {
  width: 100%;
  height: 108px;
  object-fit: cover;
  transition: transform 0.65s cubic-bezier(.32,.72,0,1) !important;
  display: block;
}
.sc-single .sc-p-card-img { height: 160px; }
.sc-p-card:hover .sc-p-card-img { transform: scale(1.07) !important; }
.sc-p-card-info {
  padding: 0.48rem 0.62rem 0.62rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.sc-p-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #2C1810;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sc-p-price {
  font-family: 'Jost', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brown-warm, #8B4513);
}
.sc-p-view {
  display: block;
  text-align: center;
  padding: 0.28rem 0.4rem;
  background: var(--brown-dark, #3E1F0E);
  color: var(--cream, #FAF6F0);
  font-family: 'Jost', sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 5px;
  margin-top: auto;
  transition: background 0.3s cubic-bezier(.32,.72,0,1);
  text-decoration: none;
}
.sc-p-view:hover { background: var(--brown-warm, #8B4513); }
.sc-see-all {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.55rem;
  font-family: 'Jost', sans-serif;
  font-size: 0.75rem;
  color: var(--brown-warm, #8B4513);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.3s cubic-bezier(.32,.72,0,1);
}
.sc-see-all:hover { color: var(--gold, #C9A96E); }

/* ── Quick Replies ── */
.sc-quick-wrap {
  padding: 0.55rem 0.9rem 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  border-top: 1px solid rgba(201,169,110,0.14);
  flex-shrink: 0;
  background: rgba(250,246,240,0.65);
  min-height: 0;
  transition: opacity 0.3s cubic-bezier(.32,.72,0,1);
}
.sc-quick-wrap:empty { padding: 0; border-top: 0; }
.sc-q-btn {
  border: 1px solid rgba(201,169,110,0.52);
  background: transparent;
  color: var(--brown-dark, #3E1F0E);
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition:
    background   0.35s cubic-bezier(.32,.72,0,1),
    color        0.35s cubic-bezier(.32,.72,0,1),
    transform    0.35s cubic-bezier(.34,1.56,.64,1),
    border-color 0.35s cubic-bezier(.32,.72,0,1);
}
.sc-q-btn:hover {
  background: var(--brown-dark, #3E1F0E);
  color: var(--cream, #FAF6F0);
  transform: translateY(-2px) scale(1.04);
  border-color: var(--brown-dark, #3E1F0E);
}

/* ── Input Area ── */
.sc-chat-foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border-top: 1px solid rgba(201,169,110,0.18);
  background: #fff;
  flex-shrink: 0;
}
.sc-chat-input {
  flex: 1;
  border: 1px solid rgba(62,31,14,0.18);
  border-radius: 999px;
  padding: 0.58rem 1rem;
  font-family: 'Jost', sans-serif;
  font-size: 0.84rem;
  background: var(--cream, #FAF6F0);
  color: var(--text-dark, #2C1810);
  outline: none;
  transition:
    border-color 0.35s cubic-bezier(.32,.72,0,1),
    box-shadow   0.35s cubic-bezier(.32,.72,0,1);
}
.sc-chat-input:focus {
  border-color: rgba(139,69,19,0.52);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.16);
}
.sc-chat-input::placeholder { color: rgba(90,62,48,0.42); }
.sc-chat-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brown-dark, #3E1F0E);
  border: 0;
  color: var(--cream, #FAF6F0);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    transform     0.4s cubic-bezier(.34,1.56,.64,1),
    background    0.3s cubic-bezier(.32,.72,0,1);
}
.sc-chat-send:hover {
  transform: scale(1.14);
  background: var(--brown-warm, #8B4513);
}
.sc-chat-send svg { width: 15px; height: 15px; }

/* ── Mobile Responsive ── */
@media (max-width: 480px) {
  .sc-chat-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 82dvh;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
    transform-origin: bottom center;
  }
  .sc-chat-trigger {
    bottom: 20px;
    right: 20px;
  }
}
