﻿:root {
  --bg: #f3efea;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --line: #e4dcd2;
  --line-strong: #d3c7bb;
  --text: #2c2420;
  --muted: #a39a91;
  --accent: #94653d;
  --user: #181311;
  --user-text: #faf6f0;
  --success: #79cd97;
  --shadow: 0 18px 36px rgba(49, 34, 21, 0.08);
  --radius: 22px;
  --font-sans: 'Manrope', system-ui, sans-serif;
  --font-display: 'Cormorant Garamond', serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: linear-gradient(180deg, #f5f1ec 0%, #eee7de 100%);
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.chat-shell {
  width: min(640px, 100%);
}

.chat-panel {
  min-height: calc(100vh - 40px);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(14px);
}

.chat-header {
  padding: 18px 22px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
}

.chat-mark {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #15110f;
  color: #f7efe4;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
}

.chat-title {
  min-width: 0;
}

.chat-title h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.25rem);
  font-weight: 600;
  line-height: 0.95;
}

.status-pill {
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.messages {
  flex: 1;
  overflow: auto;
  padding: 18px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 88%;
}

.message-row.user {
  align-self: flex-end;
  align-items: flex-end;
}

.message-row.bot {
  align-self: flex-start;
}

.bubble {
  border-radius: var(--radius);
  padding: 15px 18px;
  line-height: 1.55;
  font-size: 0.98rem;
  white-space: pre-wrap;
}

.user-bubble {
  background: var(--user);
  color: var(--user-text);
  border-bottom-right-radius: 8px;
}

.bot-bubble {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-bottom-left-radius: 8px;
}

.message-time,
.message-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.message-meta {
  padding: 0 4px;
}

.advice-box {
  align-self: flex-start;
  max-width: 88%;
  padding: 13px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
  line-height: 1.55;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.product-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  min-height: 100%;
  color: inherit;
  text-decoration: none;
}

.product-image-wrap {
  aspect-ratio: 4 / 3;
  background: #f3ece4;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-image.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.product-body {
  padding: 14px;
}

.product-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.78rem;
  color: var(--accent);
}

.product-brand,
.product-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(148, 101, 61, 0.1);
}

.product-name {
  margin: 0 0 6px;
  font-size: 1rem;
  line-height: 1.3;
}

.product-category,
.product-stock {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.product-price {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--accent);
}

.sizes-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.size-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f6f0e8;
  font-size: 0.78rem;
}

.size-pill.muted {
  color: var(--muted);
}

.composer {
  border-top: 1px solid var(--line);
  padding: 18px 22px 22px;
  background: rgba(255, 255, 255, 0.42);
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.chip {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.74);
  color: #5d544d;
  border-radius: 999px;
  padding: 9px 16px;
  font: inherit;
  font-size: 0.94rem;
  cursor: pointer;
}

.chip:hover {
  background: #f6efe7;
}

.composer-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

#chat-input {
  flex: 1;
  min-height: 54px;
  max-height: 132px;
  resize: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 16px 20px;
  font: inherit;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

#chat-input:focus {
  outline: 2px solid rgba(148, 101, 61, 0.14);
  border-color: var(--accent);
}

.icon-btn {
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #171310;
  color: #fffaf4;
  cursor: pointer;
  flex: 0 0 54px;
}

.icon-btn svg {
  width: 22px;
  height: 22px;
}

.icon-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .page-shell {
    padding: 0;
  }

  .chat-shell {
    width: 100%;
  }

  .chat-panel {
    min-height: 100vh;
    border-radius: 0;
  }

  .chat-header,
  .messages,
  .composer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .message-row,
  .advice-box {
    max-width: 92%;
  }
}
