/* Product card: Ask about + Chat on one row */

.shop-card-actions__row {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
  margin-top: 0.5rem;
  width: 100%;
}

.shop-card-actions__row .shop-enquire-btn,
.shop-card-actions__row .shop-service-btn,
.shop-card-actions__row .shop-chat-btn {
  flex: 1 1 0;
  width: auto !important;
  max-width: none;
  min-width: 0;
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
  white-space: nowrap;
  font-size: 0.72rem;
  padding: 0.45rem 0.4rem;
  box-sizing: border-box;
}

.shop-card-actions__row .shop-service-btn {
  border-radius: 999px;
}

.shop-chat-btn {
  position: relative;
  background: #fff;
  border: 1px solid #94a3b8;
  border-radius: 999px;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.shop-chat-btn:hover {
  background: #f8fafc;
  border-color: #64748b;
  color: #0f172a;
}

.shop-chat-btn__dot {
  display: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
  flex-shrink: 0;
}

.shop-chat-btn.is-online .shop-chat-btn__dot {
  display: inline-block;
}

body.seller-chat-open {
  overflow: hidden;
}

.seller-chat-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(15, 23, 42, 0.45);
}

.seller-chat-backdrop[hidden] {
  display: none !important;
}

.seller-chat-window {
  width: 100%;
  max-width: 420px;
  height: min(88dvh, 640px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

@media (min-width: 640px) {
  .seller-chat-backdrop {
    align-items: center;
    padding: 1rem;
  }
  .seller-chat-window {
    border-radius: 16px;
    height: min(80vh, 620px);
  }
}

.seller-chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.seller-chat__eyebrow {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.seller-chat__head h3 {
  margin: 0.1rem 0 0;
  font-size: 1rem;
  color: #0f172a;
}

.seller-chat__close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.seller-chat__product-wrap {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.seller-chat__product,
.enq-product-strip {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.seller-chat__thumb,
.enq-product-strip__thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: #f1f5f9;
  flex-shrink: 0;
}

.seller-chat__thumb--empty,
.enq-product-strip__thumb--empty {
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
}

.seller-chat__product-meta,
.enq-product-strip__meta {
  min-width: 0;
  font-size: 0.8125rem;
  line-height: 1.3;
}

.seller-chat__store,
.enq-product-strip__store {
  font-size: 0.7rem;
  font-weight: 700;
  color: #0f766e;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.seller-chat__price,
.enq-product-strip__price {
  font-weight: 700;
  color: #c2410c;
  margin-top: 0.1rem;
}

.seller-chat__spec,
.enq-product-strip__spec {
  color: #64748b;
  margin-top: 0.15rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.seller-chat__messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: #f8fafc;
  min-height: 0;
}

.seller-chat__empty {
  margin: auto;
  color: #94a3b8;
  font-size: 0.875rem;
  text-align: center;
}

.seller-chat__bubble {
  max-width: 85%;
  padding: 0.45rem 0.65rem;
  border-radius: 12px;
  font-size: 0.875rem;
}

.seller-chat__bubble--me {
  align-self: flex-end;
  background: #ccfbf1;
  border-bottom-right-radius: 4px;
}

.seller-chat__bubble--them {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}

.seller-chat__bubble--bot {
  background: #fff7ed;
  border-color: #fed7aa;
}

.seller-chat__who {
  font-size: 0.7rem;
  color: #64748b;
  margin-bottom: 2px;
}

.seller-chat__text {
  white-space: pre-wrap;
  color: #0f172a;
}

.seller-chat__intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.seller-chat__intro[hidden] {
  display: none !important;
}

.seller-chat__intro label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
}

.seller-chat__intro input,
.seller-chat__composer input {
  font-size: 16px; /* avoid iOS zoom */
  padding: 0.45rem 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
}

.seller-chat__composer {
  display: flex;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem 0.35rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.seller-chat__composer input {
  flex: 1 1 auto;
  min-width: 0;
}

.seller-chat__composer .btn {
  flex: 0 0 auto;
  padding: 0.5rem 0.85rem;
  font-size: 0.875rem;
}

.seller-chat__msg {
  min-height: 1.1em;
  margin: 0;
  padding: 0 0.75rem 0.55rem;
  font-size: 0.75rem;
  color: #64748b;
  background: #fff;
}

.seller-chat__msg--err {
  color: #b00020;
}

.seller-chat__msg--ok {
  color: #0e6b3a;
}

/* Shared strip in admin / seller enquiry cards */
.enq-product-strip {
  margin: 0.5rem 0;
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.enq-product-strip__thumb {
  width: 48px;
  height: 48px;
}

.enq-channel-chat {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #ccfbf1;
  color: #0f766e;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
