:root {
  --bg: #fff8f3;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --brand: #ea580c;
  --brand-dark: #c2410c;
  --brand-soft: #ffedd5;
  --accent: #16a34a;
  --border: #f3e8e0;
  --shadow: 0 10px 30px rgba(234, 88, 12, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(255, 248, 243, 0.92);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
}

.logo-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), #fb923c);
  color: white;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
  font-weight: 600;
}

.nav-links a.active,
.nav-links a:hover {
  color: var(--brand-dark);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--brand);
  color: white;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-secondary {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.875rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 48px 0 24px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.05;
  margin: 0 0 16px;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.hero-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.hero-card img {
  border-radius: 18px;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.section {
  padding: 32px 0 48px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.75rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
}

.card-body {
  padding: 16px;
}

.card-body h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.card-body p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.price {
  font-weight: 800;
  color: var(--brand-dark);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 700;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.chip {
  border: 1px solid var(--border);
  background: white;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
}

.chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.cart-layout,
.checkout-layout,
.support-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  padding: 32px 0 48px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel h2,
.panel h3 {
  margin-top: 0;
}

.cart-item,
.order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item:last-child,
.order-item:last-child {
  border-bottom: none;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-controls button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  color: var(--muted);
}

.summary-row.total {
  color: var(--text);
  font-weight: 800;
  font-size: 1.1rem;
  margin-top: 12px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font: inherit;
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 0.92rem;
}

.alert-info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.alert-warn {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.alert-success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.login-page {
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.login-card {
  width: min(420px, 100%);
}

.chat-demo {
  display: grid;
  gap: 16px;
}

.chat-load-more {
  margin-bottom: 10px;
}

.chat-messages {
  min-height: 360px;
  max-height: 480px;
  overflow-y: auto;
  padding: 14px;
  background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-empty {
  color: var(--muted);
  margin: 0;
  text-align: center;
  padding: 24px 12px;
}

.chat-row {
  display: flex;
  width: 100%;
}

.chat-row.customer {
  justify-content: flex-end;
}

.chat-row.agent,
.chat-row.system {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: min(85%, 420px);
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.95rem;
  position: relative;
}

.chat-bubble.customer {
  background: var(--brand-soft);
  border-bottom-right-radius: 4px;
}

.chat-bubble.agent {
  background: white;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-bubble.system {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-bottom-left-radius: 4px;
}

.chat-meta {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.chat-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-reply-quote {
  border-left: 3px solid var(--brand);
  padding: 6px 8px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.chat-reply-label {
  display: block;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 2px;
}

.chat-reply-btn {
  margin-top: 8px;
  border: none;
  background: transparent;
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.chat-attachment-image-wrap {
  display: block;
  margin-top: 8px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
}

.chat-attachment-image {
  max-width: min(280px, 100%);
  border-radius: 10px;
  display: block;
}

#chat-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(15, 23, 42, 0.88);
  display: grid;
  place-items: center;
  padding: 24px;
}

#chat-image-lightbox[hidden] {
  display: none !important;
}

.chat-lightbox-inner {
  position: relative;
  max-width: min(920px, 96vw);
  max-height: 92vh;
}

.chat-lightbox-image {
  max-width: min(920px, 96vw);
  max-height: 92vh;
  border-radius: 12px;
  display: block;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.chat-lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: white;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.chat-attachment-fallback {
  display: inline-block;
  margin-top: 8px;
  color: var(--brand-dark);
  font-weight: 600;
  font-size: 0.88rem;
}

.chat-attachment-audio {
  width: min(260px, 100%);
  margin-top: 8px;
}

.chat-attachment-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--brand-dark);
  font-weight: 600;
}

.chat-reply-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-top: 10px;
  background: var(--brand-soft);
  border-radius: 10px;
  font-size: 0.88rem;
}

.chat-reply-bar em {
  flex: 1;
  font-style: normal;
  color: var(--text);
}

.chat-reply-cancel {
  border: none;
  background: white;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  cursor: pointer;
}

.cz-composer {
  margin-top: 10px;
  padding: 10px 12px 12px;
  background: var(--cz-input-bg, #ffffff);
  border: 1px solid var(--border);
  border-radius: 14px;
  --cz-teal: #128c7e;
  --cz-teal-dark: #075e54;
  --cz-input-bg: #ffffff;
  --cz-input-border: #e2e8f0;
  --cz-muted: #64748b;
  --cz-received: #f1f5f9;
}

.cz-composer.is-busy {
  opacity: 0.85;
}

.cz-composer.is-busy .cz-send-btn,
.cz-composer.is-busy .cz-icon-btn,
.cz-composer.is-busy .cz-composer-input {
  pointer-events: none;
}

.chat-demo > .chat-reply-bar {
  margin-top: 10px;
}

.cz-voice-banner-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cz-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.cz-composer-input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  max-height: 120px;
  resize: none;
  padding: 10px 12px;
  border-radius: 22px;
  border: 1px solid var(--cz-input-border);
  background: var(--cz-input-bg);
  font: inherit;
  line-height: 1.35;
}

.cz-composer-input:focus {
  outline: none;
  border-color: var(--cz-teal);
  box-shadow: 0 0 0 2px rgba(18, 140, 126, 0.12);
}

.cz-icon-btn,
.cz-send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--cz-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.cz-icon-btn:hover,
.cz-send-btn:hover {
  background: var(--cz-received);
}

.cz-icon-btn svg,
.cz-send-btn svg {
  width: 20px;
  height: 20px;
}

.cz-icon-btn.recording {
  color: #dc2626;
  background: #fee2e2;
  animation: pulse-rec 1s infinite;
}

.cz-send-btn {
  background: var(--cz-teal);
  color: #fff;
}

.cz-send-btn:hover {
  background: var(--cz-teal-dark);
  color: #fff;
}

.cz-attach-wrap {
  position: relative;
  flex-shrink: 0;
}

.cz-attach-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 20;
  width: 192px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.cz-attach-menu[hidden] {
  display: none !important;
}

.cz-attach-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
}

.cz-attach-menu button:hover {
  background: var(--cz-received);
}

.cz-menu-hint {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--cz-muted);
}

.cz-pending-attachment {
  margin-bottom: 8px;
}

.cz-pending-attachment[hidden] {
  display: none !important;
}

.cz-pending-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
}

.cz-pending-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.cz-pending-video {
  width: 80px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #000;
}

.cz-pending-file-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--cz-received);
  display: grid;
  place-items: center;
  color: var(--cz-muted);
}

.cz-pending-file-icon svg {
  width: 20px;
  height: 20px;
}

.cz-pending-copy {
  min-width: 0;
  flex: 1;
}

.cz-pending-copy strong {
  display: block;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cz-pending-copy span {
  display: block;
  font-size: 0.78rem;
  color: var(--cz-muted);
}

.cz-voice-banner {
  margin-bottom: 8px;
}

.cz-voice-banner[hidden] {
  display: none !important;
}

.cz-voice-banner-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.85rem;
}

.cz-voice-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #dc2626;
  animation: pulse-rec 1s infinite;
  flex-shrink: 0;
}

.cz-voice-time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 2.5rem;
}

.cz-voice-hint {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
}

.cz-voice-send {
  width: 32px;
  height: 32px;
}

.cz-voice-cancel {
  width: 32px;
  height: 32px;
}

.chat-attachment-video {
  width: min(280px, 100%);
  border-radius: 10px;
  margin-top: 8px;
  background: #000;
}

@keyframes pulse-rec {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
  font-weight: 600;
}

.tab.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  color: var(--muted);
  font-size: 0.92rem;
}

.integration-note {
  font-size: 0.85rem;
  color: var(--muted);
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
}

@media (max-width: 900px) {
  .hero,
  .cart-layout,
  .checkout-layout,
  .support-layout {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }
}
