/* ============================================================
   Design Tokens — Stone & Slate Premium Palette
   ============================================================ */
:root {
  --bg:          #fafaf9;           /* stone-50 */
  --surface:     #ffffff;
  --surface-sub: rgba(255, 255, 255, 0.4); /* bg-white/40 */
  --border:      rgba(15, 23, 42, 0.08);   /* border-stone-200 */
  --ink:         #0f172a;           /* slate-900 */
  --muted:       #64748b;           /* slate-500 */
  --accent:      #3080ff;           /* reference blue-500 */
  --accent-hover: #1d6df1;          /* darker blue for hover */
  --accent-dark:  #1d4ed8;          /* even darker for deep hover */
  --accent-soft: rgba(48, 128, 255, 0.1);
  --error:       #e70044;           /* reference rose-600 */
  --success:     #22c55e;           /* Green-500 */
  --font:        'DM Sans', system-ui, sans-serif;
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;
  --transition:  200ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow-sm:   0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:   0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --bg:          #0a0a0b;
  --surface:     rgba(255, 255, 255, 0.03);
  --surface-sub: rgba(255, 255, 255, 0.02);
  --border:      rgba(255, 255, 255, 0.05);
  --ink:         #f1f5f9;
  --muted:       #94a3b8;
  --accent:      #3080ff;
  --accent-soft: rgba(48, 128, 255, 0.15);
}

/* ============================================================
   Base & Layout
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--ink);
  background: #f8fafc; /* light slate background for outer area */
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

/* Hide number arrows */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}

/* Ambient Orb */
.ambient-orb {
  position: fixed;
  top: -100px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.05) 0%, rgba(37, 99, 235, 0) 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
[data-theme="dark"] .ambient-orb {
  background: radial-gradient(circle, rgba(96, 165, 250, 0.08) 0%, rgba(96, 165, 250, 0) 70%);
}

button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; transition: var(--transition); }
a { text-decoration: none; color: inherit; transition: var(--transition); }

.chat-app {
  display: flex;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
  box-shadow: 0 0 100px rgba(0,0,0,0.05);
}

/* Sidebar (Left) */
.chat-sidebar {
  width: 288px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface-sub);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.sidebar-name { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.sidebar-tag { font-size: 9px; font-weight: 600; letter-spacing: 0.12em; color: var(--muted); margin-top: 2px; text-transform: uppercase; }

.sidebar-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.2em; color: var(--muted);
  padding: 16px 20px 8px;
}

.sidebar-actions { 
  padding: 0 12px; 
  flex: 1; 
  overflow-y: auto; 
  padding-bottom: 20px; /* Space before nav */
}

.action-btn {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-md);
  color: var(--ink); font-size: 14px; font-weight: 500;
  margin-bottom: 2px;
  transition: all var(--transition);
  cursor: pointer;
}
.action-btn:hover { 
  background: rgba(15, 23, 42, 0.05); 
}
[data-theme="dark"] .action-btn:hover { background: rgba(255, 255, 255, 0.08); }

.action-btn::after {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: auto;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--transition);
}
.action-btn:hover::after { 
  opacity: 0.8; 
  transform: translateX(0); 
}

.action-btn--active { background: rgba(15, 23, 42, 0.06); }
[data-theme="dark"] .action-btn--active { background: rgba(255, 255, 255, 0.08); }

/* Clear chat separator */
.action-btn[data-action-id="clear-chat"] {
  margin-top: 16px;
  position: relative;
}
.action-btn[data-action-id="clear-chat"]::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.action-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.action-icon.blue    { background: rgba(37, 99, 235, 0.1); color: #2563eb; }
.action-icon.amber   { background: rgba(217, 119, 6, 0.1); color: #d97706; }
.action-icon.violet  { background: rgba(124, 58, 237, 0.1); color: #7c3ae8; }
.action-icon.emerald { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.action-icon.cyan    { background: rgba(8, 145, 178, 0.1); color: #0891b2; }
.action-icon.rose    { background: rgba(225, 29, 72, 0.1); color: #e11d48; }

/* Main Area */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

/* Header */
.chat-header {
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-sub);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
  z-index: 10;
}

.header-left { display: flex; align-items: center; gap: 12px; }
.menu-btn { display: none; }
.back-btn {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.back-btn:hover { background: rgba(15, 23, 42, 0.05); color: var(--ink); }

.header-title-wrap { display: flex; flex-direction: column; line-height: 1.2; }
.header-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.header-status { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin-top: 2px; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  position: relative;
}
.status-dot::after {
  content: '';
  position: absolute; inset: 0;
  background: var(--accent);
  border-radius: 50%;
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
  opacity: 0.75;
}
@keyframes ping {
  75%, 100% { transform: scale(3); opacity: 0; }
}

.header-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  width: 36px; height: 36px; border: 1px solid var(--border);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

 .view-container {
   flex: 1;
   display: flex;
   flex-direction: column;
   min-height: 0;
 }

/* Views */
.view {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.view--active { display: flex; animation: fadeIn 0.3s ease; }

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

.view-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
.view-scroll::-webkit-scrollbar { width: 5px; }
.view-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* Home View */
.home-content { max-width: 720px; margin: 0 auto; width: 100%; }
.home-greeting { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.home-subtitle { font-size: 14px; color: var(--muted); margin-bottom: 32px; }

.home-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted);
  margin-bottom: 12px;
}

.threads-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px; margin-bottom: 32px;
}

.thread-card {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
}
.thread-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.thread-card-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.thread-card-info { flex: 1; min-width: 0; }
.thread-card-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.thread-card-preview { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-card-count { font-size: 10px; font-weight: 700; color: var(--muted); background: var(--bg); padding: 2px 6px; border-radius: 10px; }

.quick-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }

/* Messages View */
.messages-scroll { 
  display: flex; flex-direction: column; gap: 20px;
  max-width: 720px; margin: 0 auto; width: 100%;
}

.message { display: flex; gap: 12px; max-width: 100%; }
.message--user { align-self: flex-end; flex-direction: row-reverse; }
.message--bot { align-self: flex-start; }

.msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 4px;
}
.message--user .msg-avatar { background: var(--border); color: var(--muted); }

.message-content-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.msg-bubble {
  max-width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 15px;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
}
.message--bot .msg-bubble { background: var(--surface); border: 1px solid var(--border); }
.message--bot .msg-bubble:empty { display: none; }
.message--user .msg-bubble { background: var(--accent); color: white; border-top-right-radius: 4px; align-self: flex-end; }

/* Markdown content styling */
.message-content p { margin-bottom: 0.75rem; }
.message-content p:last-child { margin-bottom: 0; }
.message-content ul, .message-content ol { padding-left: 1.5rem; margin: 0.5rem 0; }
.message-content ul { list-style-type: disc; }
.message-content ol { list-style-type: decimal; }
.message-content li { margin-bottom: 0.4rem; line-height: 1.5; }
.message-content li:last-child { margin-bottom: 0; }
.message-content table {
  font-size: 13px;
  margin: 12px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border-collapse: collapse;
  width: 100%;
}
.message-content th {
  background: var(--border);
  font-weight: 600;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.message-content td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.message-content tr:last-child td { border-bottom: none; }

/* Internal Links inside messages */
.msg-bubble a, .quick-reply-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  cursor: pointer;
}
.quick-reply-link {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
  display: inline;
  vertical-align: baseline;
  text-align: left;
  line-height: inherit;
}
.quick-reply-link:hover, .msg-bubble a:hover {
  color: var(--accent-hover);
}

/* Typing dots */
.typing-dots { display: flex; gap: 4px; padding: 4px 0; }
.typing-dots span {
  width: 6px; height: 6px;
  background: var(--muted);
  border-radius: 50%;
  animation: bounce 1.2s ease infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

/* Input Area */
.input-area {
  padding: 16px 24px;
  background: transparent;
  flex-shrink: 0;
  z-index: 10;
}
.input-container { max-width: 720px; margin: 0 auto; width: 100%; }
.input-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 14px; border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: var(--transition);
}
.input-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.input-helper {
  font-size: 10px; color: var(--muted);
  display: flex; align-items: center; gap: 4px;
  margin-right: 8px;
}
.chat-input {
  flex: 1; border: none; background: none; outline: none;
  font-size: 15px; color: var(--ink); line-height: 1.5;
  padding: 4px 0; resize: none; max-height: 160px;
}
.chat-input::placeholder { color: var(--muted); }

.send-btn {
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px var(--accent-soft);
}
.send-btn:disabled { opacity: 0.3; cursor: not-allowed; box-shadow: none; }
.send-btn:hover:not(:disabled) { transform: translateY(-1px); background: #1d4ed8; }

.input-disclaimer {
  font-size: 11px; color: var(--muted); text-align: center; margin-top: 12px;
}

/* Bottom Nav (Moved to Sidebar) */
.bottom-nav {
  height: 72px;
  display: flex; align-items: center; justify-content: space-around;
  border-top: 1px solid var(--border);
  background: var(--surface-sub);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
  margin-top: auto; /* Pin to bottom of sidebar */
  width: 100%;
}
.bottom-nav-btn {
  flex: 1; height: 56px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); font-size: 11px; font-weight: 500;
  border-radius: var(--radius-md);
  margin: 0 4px;
  cursor: pointer;
}
.bottom-nav-btn:hover { color: var(--ink); }
.bottom-nav-btn--active { color: var(--accent); background: var(--accent-soft) !important; font-weight: 600; }
.bottom-nav-btn svg { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
.bottom-nav-btn--active svg { stroke-width: 2.5; }

.bottom-nav-btn .icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-badge {
  position: absolute; top: -6px; right: -8px;
  background: var(--accent); color: white;
  font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}

/* ============================================================
   Shared Components (Cards, etc)
   ============================================================ */
.product-card {
  display: flex; gap: 16px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); margin-top: 12px;
}
.product-card__img { width: 80px; height: 80px; object-fit: contain; border-radius: 8px; }
.product-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.product-card__title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.product-card__qty { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.product-card__desc { font-size: 12px; color: var(--muted); margin-bottom: 8px; line-clamp: 2; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.product-card__price { font-size: 15px; font-weight: 700; color: var(--accent); }

.product-card__actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}

.product-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: all var(--transition);
  white-space: nowrap;
  flex: 1;
  cursor: pointer;
}

.product-card__btn:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.product-card__btn--primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.product-card__btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: white;
}

.product-card__btn--ghost {
  background: white;
  border: none;
  color: var(--ink);
}

.product-card__btn--options {
  background: #f1f3f5;
  color: var(--ink);
  border-color: var(--border);
}

.product-card__btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg);
}

/* Order Card */
.order-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.order-card__section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.order-card__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #10b981; /* Greenish as in screenshot */
}
.order-card__value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.order-card__actions {
  margin-top: 8px;
}

/* Quick Replies */
.quick-reply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: var(--transition);
  gap: 10px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.quick-reply:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  background: var(--surface);
}
.quick-reply:active {
  transform: translateY(0);
}

/* Order Form Card */
.order-form-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
.order-form-card__title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text);
}
.order-form-card__subtitle {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 24px 0;
}
.order-form-card__field {
  margin-bottom: 20px;
}
.order-form-card__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.order-form-card__label .required {
  color: #ef4444;
}
.order-form-card__input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  transition: border-color 0.2s;
  background: #fff;
}
.order-form-card__input:focus {
  outline: none;
  border-color: var(--accent);
}
.order-form-card__input.error {
  border-color: #ef4444;
}
.order-form-card__btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}
.order-form-card__btn:hover {
  background: var(--accent-dark);
}
.order-form-card__btn:active {
  transform: scale(0.98);
}
.order-form-card__btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Tool/Loading */
.tool-indicator {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: var(--radius-full);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 11px; color: var(--muted); margin-bottom: 6px;
  margin-left: 0;
}
.tool-indicator.done {
  background: transparent;
  color: var(--success);
  border-color: #22c55e40;
}
.tool-indicator.done::before { content: "✓"; font-weight: 700; margin-right: 4px; }
.tool-indicator.done .spinner { display: none; }
.spinner {
  width: 12px; height: 12px; border: 2px solid var(--accent-soft);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner--white {
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .menu-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; }
  .menu-btn:hover { background: rgba(15, 23, 42, 0.05); }

  .chat-sidebar {
    position: fixed; left: -288px; top: 0; bottom: 0; transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .chat-sidebar--open { transform: translateX(288px); }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 9;
  }
  .sidebar-overlay--open { display: block; }
}

@media (max-width: 600px) {
  .chat-header { padding: 0 16px; }
  .view-scroll { padding: 16px; }
  .input-area { padding: 12px 16px 16px; }
  .threads-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Configurable Options Picker (mc-options)
   ============================================================ */
.mc-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  animation: fadeIn 0.2s ease;
}

.mc-options__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mc-options__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mc-options__values {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mc-option-btn {
  font-size: 13px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.4;
}

.mc-option-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.mc-option-btn--selected {
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.mc-option-btn--oos {
  opacity: 0.3;
  cursor: not-allowed;
  text-decoration: line-through;
  background: var(--bg);
}

.mc-options__add {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

.mc-options__add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

.product-card {
  height: auto;
  transition: box-shadow 0.3s ease;
}
.product-card:has(.mc-options) {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-soft);
}

/* ============================================================
   Return Items Form Styles
   ============================================================ */
.return-items-card__customer {
  margin-bottom: 24px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--ink);
  line-height: 1.6;
}

.return-items-card__section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--ink);
}

.return-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.return-item-row {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.return-item-row:hover {
  border-color: var(--accent-soft);
}

.return-item-row__check {
  display: flex;
  align-items: flex-start;
  padding-top: 4px;
}

.return-item-row__check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.return-item-row__content {
  display: flex;
  gap: 12px;
  flex: 1;
  cursor: pointer;
}

.return-item-row__img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.return-item-row__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.return-item-row__name {
  font-size: 14px;
  font-weight: 600;
}

.return-item-row__sku {
  font-size: 12px;
  color: var(--muted);
}

.return-item-row__qty-control {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-label {
  font-size: 12px;
  color: var(--muted);
}

.qty-input {
  width: 60px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

.qty-input:focus {
  border-color: var(--accent);
}

.return-items-card__policy {
  padding: 12px 0;
}

.policy-checkbox-wrap {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  align-items: center;
}

.policy-link {
  color: var(--accent);
  text-decoration: underline;
}

/* Show more / pagination */
.extra-products {
  display: none;
}
.extra-products.visible {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
}

.show-more-btn {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  transition: all var(--transition);
  cursor: pointer;
}
.show-more-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  border-style: solid;
}

/* ============================================================
   Confirm Dialog Modal
   ============================================================ */
.confirm-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
  animation: confirm-fade-in 0.2s ease-out forwards;
}

.confirm-dialog-overlay.fade-out {
  animation: confirm-fade-out 0.2s ease-out forwards;
}

.confirm-dialog-box {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  width: 100%;
  max-width: 320px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: scale(0.95);
  opacity: 0;
}

.confirm-dialog-box.animate-scale-up {
  animation: confirm-scale-up 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.confirm-dialog-box.animate-scale-down {
  animation: confirm-scale-down 0.15s ease-in forwards;
}

.confirm-dialog-header {
  display: flex;
  align-items: center;
}

.confirm-dialog-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink, #1e293b);
}

.confirm-dialog-body {
  font-size: 14px;
  color: var(--muted, #64748b);
  line-height: 1.5;
}

.confirm-dialog-message {
  margin: 0;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.confirm-dialog-btn {
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition, 0.15s ease);
}

.confirm-dialog-btn.btn-cancel {
  background: var(--surface, #ffffff);
  border-color: var(--border, #e2e8f0);
  color: var(--muted, #64748b);
}

.confirm-dialog-btn.btn-cancel:hover {
  background: var(--bg, #f8fafc);
  color: var(--ink, #1e293b);
}

.confirm-dialog-btn.btn-confirm {
  background: var(--accent, #2563eb);
  color: #ffffff;
}

.confirm-dialog-btn.btn-confirm:hover {
  filter: brightness(0.95);
}

.confirm-dialog-btn.btn-confirm.btn-danger {
  background: var(--error, #ef4444);
}

@keyframes confirm-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes confirm-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes confirm-scale-up {
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes confirm-scale-down {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0.95);
    opacity: 0;
  }
}

/* ============================================================
   Comerix Flow Block Protocol Styles
   ============================================================ */
.comerix-block {
  margin-top: 12px;
  width: 100%;
}

.flow-form-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.flow-form-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px 0;
}

.flow-form-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 24px 0;
}

.flow-form-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.flow-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.flow-form-label .required {
  color: #ef4444;
}

.flow-form-input,
.flow-form-select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.flow-form-input:focus,
.flow-form-select:focus {
  outline: none;
  border-color: var(--accent);
}

.flow-form-input:disabled,
.flow-form-select:disabled {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
}

.flow-form-input::placeholder {
  color: var(--muted);
}

.flow-form-submit-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}

.flow-form-submit-btn:hover:not(:disabled) {
  background: var(--accent-dark);
}

.flow-form-submit-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.flow-form-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.flow-buttons-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.flow-action-btn {
  padding: 10px 18px;
  background: var(--surface, #ffffff);
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: var(--radius-full, 24px);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink, #1e293b);
  cursor: pointer;
  transition: all var(--transition, 0.2s ease);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
}

.flow-action-btn:hover:not(:disabled) {
  border-color: var(--accent, #2563eb);
  background: var(--accent-soft, #eff6ff);
  color: var(--accent, #2563eb);
  transform: translateY(-1px);
}

.flow-action-btn:active:not(:disabled) {
  transform: translateY(0);
}

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

.flow-html-block {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink, #1e293b);
}

/* New Comerix Flow Elements */
.flow-choice-prompt {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}

.flow-link-btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.2s;
}

.flow-link-btn:hover {
  opacity: 0.9;
}

.flow-image-block {
  margin-top: 8px;
}

.flow-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.flow-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 8px;
}

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

.flow-card-body {
  padding: 16px;
}

.flow-card-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: var(--ink);
}

.flow-card-text {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 16px 0;
  line-height: 1.4;
}

.flow-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flow-card-action-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
}

.flow-card-action-btn--link {
  background: var(--accent);
  color: white;
}

.flow-card-action-btn--callback {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}

.flow-card-action-btn--callback:hover {
  background: var(--border);
}

.flow-form-heading {
  font-size: 16px;
  font-weight: 700;
  margin: 12px 0 4px 0;
  color: var(--ink);
}

.flow-form-paragraph {
  font-size: 14px;
  color: var(--muted);
  margin: 4px 0 12px 0;
  line-height: 1.4;
}

.flow-form-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.flow-form-textarea {
  min-height: 80px;
  resize: vertical;
}

.flow-form-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.flow-form-radio-label,
.flow-form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.flow-form-radio-label input[type="radio"],
.flow-form-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.flow-form-rating {
  display: flex;
  gap: 8px;
  font-size: 24px;
  color: var(--muted);
}

.rating-slot {
  cursor: pointer;
  transition: transform 0.1s, color 0.1s;
}

.rating-slot:hover {
  transform: scale(1.15);
}

.rating-slot.active {
  color: #fbbf24; /* yellow star */
}

.flow-form-upload-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-form-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  transition: border-color 0.2s;
}

.flow-form-upload-btn:hover {
  border-color: var(--accent);
}

.flow-form-upload-btn input[type="file"] {
  display: none;
}

.flow-form-upload-progress {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  display: none;
}

.flow-form-upload-progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.1s ease-out;
}

.flow-form-uploaded-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flow-form-uploaded-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink);
}

.flow-form-uploaded-file-remove {
  background: transparent;
  border: none;
  color: var(--error);
  cursor: pointer;
  padding: 0 4px;
  font-size: 14px;
}

.signature-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.signature-canvas {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: crosshair;
}

.signature-actions {
  display: flex;
  justify-content: flex-end;
}

.signature-clear {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
}

.signature-clear:hover {
  color: var(--ink);
}

.flow-form-field-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 4px;
  display: none;
}

.flow-form-group.has-error .flow-form-input,
.flow-form-group.has-error .flow-form-select,
.flow-form-group.has-error .flow-form-textarea,
.flow-form-group.has-error .signature-canvas {
  border-color: var(--error);
}

.flow-form-group.has-error .flow-form-field-error {
  display: block;
}

