/*
 * Nova Kit — Component styles
 * App bar, tab bar, cards, chips, buttons, rating, price, toast, bottom sheet, skeleton,
 * empty state. All colours come from tokens.css.
 */

/* ---- Buttons -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 48px; padding-inline: var(--space-5); border-radius: var(--radius-md);
  font-size: var(--fs-md); font-weight: var(--fw-semibold);
  background: var(--accent); color: var(--accent-contrast);
  transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast);
}
.btn:active { transform: scale(0.98); }
.btn--block { width: 100%; }
.btn--ghost { background: var(--accent-soft); color: var(--accent); }
.btn--outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn--sm { height: 38px; padding-inline: var(--space-4); font-size: var(--fs-sm); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.ico { flex: none; }

/* ---- App bar -------------------------------------------------------------------------- */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--space-2);
  height: var(--appbar-h); padding-inline: var(--space-2);
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.appbar__title {
  flex: 1; text-align: center; font-size: var(--fs-lg); font-weight: var(--fw-semibold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.appbar__actions { display: flex; align-items: center; gap: 2px; }

/* Generic page header (back + centred title/subtitle + optional action) */
.page-header { background: var(--bg); padding: 8px var(--space-4); position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--border); }
.page-header .header-top { display: flex; align-items: center; justify-content: space-between; height: 44px; }
.page-header .hbtn { background: none; border: none; color: var(--accent); padding: 8px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; cursor: pointer; min-width: 40px; }
.page-header .htitle { text-align: center; flex: 1; min-width: 0; }
.page-header .htitle h1 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.page-header .htitle span { font-size: var(--fs-sm); color: var(--text-muted); display: block; margin-top: 2px; }
@media (hover: hover) and (pointer: fine) { .page-header .hbtn:hover { background: var(--surface); } }

/* Brand header (Home) — left-aligned logo mark + name + greeting */
.appbar--brand { padding-inline: var(--space-4); }
.brand-mark { display: flex; align-items: center; gap: var(--space-3); flex: 1; min-width: 0; }
.brand-mark__logo {
  width: 40px; height: 40px; border-radius: var(--radius-md); flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: var(--accent-soft);
}
.brand-mark__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.brand-mark__name { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.brand-mark__sub { font-size: var(--fs-xs); color: var(--text-muted); }
.appbar__btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-md); color: var(--text);
}
.appbar__btn:active { background: var(--surface); }
.appbar__btn--placeholder { visibility: hidden; }
.appbar__badge {
  position: absolute; top: 4px; inset-inline-end: 4px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: var(--radius-pill); background: var(--danger);
  color: #fff; font-size: 10px; font-weight: var(--fw-bold);
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---- Tab bar -------------------------------------------------------------------------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 20; width: 100%; max-width: var(--app-max-width);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg); border-top: 1px solid var(--border);
}
.tabbar__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--text-muted); font-size: var(--fs-xs); font-weight: var(--fw-medium);
}
.tabbar__item.is-active { color: var(--accent); }
.tabbar__label { font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 1; }
.tabbar__icon { position: relative; }
.tabbar__badge {
  position: absolute; top: -4px; inset-inline-end: -8px; min-width: 15px; height: 15px;
  padding: 0 4px; border-radius: var(--radius-pill); background: var(--danger); color: #fff;
  font-size: 9px; font-weight: var(--fw-bold); display: inline-flex;
  align-items: center; justify-content: center;
}

/* ---- Section header ------------------------------------------------------------------- */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-5) var(--space-4) var(--space-3);
}
.section-head h2 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.section-head__link { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--accent); }

/* ---- Chips ---------------------------------------------------------------------------- */
.chip-row { display: flex; gap: var(--space-2); overflow-x: auto; padding: 0 var(--space-4) var(--space-2); scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: var(--space-2);
  height: 38px; padding-inline: var(--space-4); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-medium);
  border: 1px solid transparent; white-space: nowrap;
}
.chip.is-active { background: var(--accent); color: var(--accent-contrast); }

/* ---- Category tiles ------------------------------------------------------------------- */
.cat-row { display: flex; gap: var(--space-3); overflow-x: auto; padding: 0 var(--space-4) var(--space-2); scrollbar-width: none; }
.cat-row::-webkit-scrollbar { display: none; }
.cat-tile {
  flex: none; width: 76px; display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
}
.cat-tile__icon {
  width: 64px; height: 64px; border-radius: var(--radius-lg); background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.cat-tile__name { font-size: var(--fs-xs); font-weight: var(--fw-medium); text-align: center; color: var(--text-muted); }

/* ---- Catalog toolbar ------------------------------------------------------------------ */
.catalog-toolbar { display: flex; align-items: center; justify-content: space-between; padding-block: var(--space-3); }

/* ---- Product card --------------------------------------------------------------------- */
.pcard-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3);
  padding: 0 var(--space-4);
}
.pcard {
  display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  transition: transform var(--dur-fast) var(--ease);
}
.pcard:active { transform: scale(0.98); }
.pcard__media { position: relative; aspect-ratio: 1; background: var(--surface); }
.pcard__media img { width: 100%; height: 100%; object-fit: cover; }
.pcard__badge {
  position: absolute; top: var(--space-2); inset-inline-start: var(--space-2);
  padding: 3px 8px; border-radius: var(--radius-pill); background: var(--accent);
  color: var(--accent-contrast); font-size: 10px; font-weight: var(--fw-bold);
}
.pcard__oos {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--overlay); color: #fff; font-size: var(--fs-sm); font-weight: var(--fw-semibold);
}
.pcard__wish {
  position: absolute; top: var(--space-2); inset-inline-end: var(--space-2);
  width: 32px; height: 32px; border-radius: var(--radius-pill);
  background: var(--bg); color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.pcard__wish.is-wished { color: var(--danger); }
.pcard__body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); }
.pcard__name {
  font-size: var(--fs-sm); font-weight: var(--fw-medium); line-height: var(--lh-tight);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---- Rating & price ------------------------------------------------------------------- */
.rating { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-xs); color: var(--text-muted); }
.star { color: var(--border); display: inline-flex; }
.star.is-on { color: var(--warning); }
.rating__value { margin-inline-start: 4px; font-weight: var(--fw-semibold); color: var(--text); }
.rating__count { color: var(--text-muted); }
.price { display: inline-flex; align-items: baseline; gap: var(--space-2); }
.price__now { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--text); }
.price__was { font-size: var(--fs-xs); color: var(--text-faint); text-decoration: line-through; }

/* ---- Hero banner ---------------------------------------------------------------------- */
.hero {
  margin: var(--space-4); padding: var(--space-5); border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--accent-contrast);
}
.hero h2 { font-size: var(--fs-2xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.hero p { margin-top: var(--space-2); opacity: 0.9; font-size: var(--fs-sm); }
.hero .btn { margin-top: var(--space-4); background: rgba(255,255,255,0.16); color: #fff; backdrop-filter: blur(4px); }

/* ---- Search field --------------------------------------------------------------------- */
.searchbar { padding: var(--space-3) var(--space-4); }
.searchbar__field {
  display: flex; align-items: center; gap: var(--space-2);
  height: 46px; padding-inline: var(--space-3); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text-muted);
}
.searchbar__field input { flex: 1; border: none; background: none; outline: none; color: var(--text); }

/* ---- Toast ---------------------------------------------------------------------------- */
.toast-host {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--space-4)); transform: translateX(-50%);
  z-index: 60; display: flex; flex-direction: column; gap: var(--space-2); width: max-content; max-width: 90vw;
}
.toast {
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  background: var(--text); color: var(--bg); font-size: var(--fs-sm); font-weight: var(--fw-medium);
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px); transition: all var(--dur-med) var(--ease);
}
.toast.is-in { opacity: 1; transform: translateY(0); }
.toast--success { background: var(--success); color: #fff; }
.toast--danger { background: var(--danger); color: #fff; }

/* ---- Bottom sheet --------------------------------------------------------------------- */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 50; background: var(--overlay);
  display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity var(--dur-med);
}
.sheet-overlay.is-in { opacity: 1; }
.sheet {
  width: 100%; max-width: var(--app-max-width); background: var(--bg);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: var(--space-3) var(--space-4) var(--space-6);
  transform: translateY(100%); transition: transform var(--dur-med) var(--ease); max-height: 86dvh; overflow-y: auto;
}
.sheet-overlay.is-in .sheet { transform: translateY(0); }
.sheet__grabber { width: 40px; height: 4px; border-radius: var(--radius-pill); background: var(--border); margin: 0 auto var(--space-3); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.sheet__head h3 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.sheet__close { color: var(--text-muted); }

/* ---- Skeleton & empty state ----------------------------------------------------------- */
.skeleton { background: linear-gradient(90deg, var(--surface), var(--card-alt), var(--surface)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius-md); }
@keyframes sk { to { background-position: -200% 0; } }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); padding: var(--space-8) var(--space-5); color: var(--text-muted); }
.empty-state__emoji { font-size: 44px; }
.empty-state h3 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); color: var(--text); }

/* ---- Cards & list rows ---------------------------------------------------------------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  margin: var(--space-3) var(--space-4); overflow: hidden;
}
.card--pad { padding: var(--space-4); }
/* Lists are separated cards with a gap (not a divided container). */
.list { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-3) var(--space-4); }
.list-row {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%; padding: var(--space-3) var(--space-4); text-align: start; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md);
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast) var(--ease);
}
.list-row:active { transform: scale(0.99); }
.list-row__icon {
  width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--accent-soft);
  color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none;
}
.list-row__text { flex: 1; min-width: 0; }
.list-row__title { font-size: var(--fs-md); font-weight: var(--fw-medium); }
.list-row__sub { font-size: var(--fs-sm); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row__meta { color: var(--text-faint); }

/* ---- Forms ---------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.field__label { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-muted); }
.input, .select, .textarea {
  width: 100%; height: 48px; padding-inline: var(--space-3); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
}
.textarea { height: auto; min-height: 96px; padding: var(--space-3); resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); outline: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-3); }

/* ---- Switch --------------------------------------------------------------------------- */
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch__track { position: absolute; inset: 0; border-radius: var(--radius-pill); background: var(--border); transition: background var(--dur-fast); }
.switch__track::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform var(--dur-fast) var(--ease); }
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
[dir="rtl"] .switch input:checked + .switch__track::after { transform: translateX(-18px); }

/* ---- Emoji picker (avatar / product image chooser) ------------------------------------ */
.emoji-picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-2); }
.emoji-picker button { aspect-ratio: 1; border-radius: var(--radius-md); background: var(--surface); font-size: 24px; display: flex; align-items: center; justify-content: center; border: 1px solid transparent; }
.emoji-picker button.on { border-color: var(--accent); background: var(--accent-soft); }
@media (hover: hover) and (pointer: fine) { .emoji-picker button:hover { border-color: var(--accent); } }

/* ---- Checkbox (custom) ---------------------------------------------------------------- */
.checkbox-container { display: flex; align-items: flex-start; gap: var(--space-3); cursor: pointer; }
.checkbox-container input { position: absolute; opacity: 0; }
.checkmark { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border); background: var(--card); flex: none; display: flex; align-items: center; justify-content: center; transition: all var(--dur-fast); }
.checkbox-container input:checked + .checkmark { background: var(--accent); border-color: var(--accent); }
.checkbox-container input:checked + .checkmark::after { content: '✓'; color: var(--accent-contrast); font-size: 14px; font-weight: 700; }
.checkbox-text { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.4; }

/* ---- Segmented control ---------------------------------------------------------------- */
.segmented { display: flex; gap: 2px; padding: 3px; background: var(--surface); border-radius: var(--radius-md); }
.segmented button {
  flex: 1; height: 38px; border-radius: calc(var(--radius-md) - 3px); color: var(--text-muted);
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
}
.segmented button.is-active { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---- Pick list (radio rows) ----------------------------------------------------------- */
.pick { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer; }
.pick input { accent-color: var(--accent); width: 20px; height: 20px; flex: none; }
.pick__body { flex: 1; display: flex; flex-direction: column; gap: 2px; }

/* ---- Quantity stepper ----------------------------------------------------------------- */
.stepper { display: inline-flex; align-items: center; gap: var(--space-3); background: var(--surface); border-radius: var(--radius-pill); padding: var(--space-1); }
.stepper button { width: 30px; height: 30px; border-radius: 50%; background: var(--card); color: var(--text); display: flex; align-items: center; justify-content: center; }
.stepper__value { min-width: 20px; text-align: center; font-weight: var(--fw-semibold); }

/* ---- Order summary -------------------------------------------------------------------- */
.summary { padding: var(--space-4); }
.summary__row { display: flex; justify-content: space-between; padding: var(--space-2) 0; font-size: var(--fs-md); color: var(--text-muted); }
.summary__row span:last-child { color: var(--text); font-weight: var(--fw-medium); }
.summary__row--total { border-top: 1px dashed var(--border); margin-top: var(--space-2); padding-top: var(--space-3); font-size: var(--fs-lg); }
.summary__row--total span { color: var(--text) !important; font-weight: var(--fw-bold); }
.summary__row--discount span:last-child { color: var(--success); }

/* ---- Status badges -------------------------------------------------------------------- */
.status { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.status--pending   { background: rgba(245,158,11,0.15);  color: var(--warning); }
.status--paid      { background: var(--accent-soft);      color: var(--accent); }
.status--shipped   { background: rgba(46,144,250,0.15);  color: var(--info); }
.status--delivered { background: rgba(0,168,84,0.15);    color: var(--success); }
.status--cancelled { background: rgba(229,72,77,0.15);   color: var(--danger); }

/* ---- Timeline ------------------------------------------------------------------------- */
.timeline { padding: var(--space-4); }
.timeline__step { position: relative; display: flex; gap: var(--space-3); padding-bottom: var(--space-5); }
.timeline__step:last-child { padding-bottom: 0; }
.timeline__dot { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--accent); background: var(--card); flex: none; margin-top: 2px; z-index: 1; }
.timeline__step:not(:last-child)::before { content: ''; position: absolute; inset-inline-start: 6px; top: 16px; bottom: 0; width: 2px; background: var(--border); }
.timeline__step.is-done .timeline__dot { background: var(--accent); }

/* ---- Colored icon tints (richer, @wallet-style colour accents) ------------------------ */
.tint-green  { background: rgba(0, 230, 118, 0.15);  color: var(--success); }
.tint-blue   { background: rgba(100, 210, 255, 0.16); color: var(--info); }
.tint-orange { background: rgba(255, 159, 10, 0.16);  color: var(--warning); }
.tint-pink   { background: rgba(236, 72, 153, 0.16);  color: #EC4899; }
.tint-purple { background: rgba(168, 85, 247, 0.16);  color: #A855F7; }
.tint-red    { background: rgba(255, 69, 58, 0.16);   color: var(--danger); }
:root[data-theme="light"] .tint-green { color: #00A854; }

/* ================================================================================
 * Hover & interaction polish — only on devices with a real pointer (desktop preview),
 * so touch users never get "stuck" hover states. This is what makes the kit feel alive.
 * ================================================================================ */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: var(--shadow-md); }
  .btn--outline:hover, .btn--ghost:hover { filter: none; background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

  .appbar__btn:hover { background: var(--surface); color: var(--accent); }

  .tabbar__item:hover { color: var(--accent); }
  .tabbar__item:hover .tabbar__icon { transform: translateY(-1px); }
  .tabbar__icon { transition: transform var(--dur-fast) var(--ease); }

  .chip:hover { border-color: var(--accent); color: var(--accent); }
  .chip.is-active:hover { color: var(--accent-contrast); filter: brightness(1.05); }

  .list-row:hover { background: var(--accent-soft); }
  .list-row:hover .list-row__icon { transform: scale(1.06); }
  .list-row__icon { transition: transform var(--dur-fast) var(--ease); }

  .data-row:hover { background: var(--accent-soft); }
  .data-row:hover .data-row__avatar { transform: scale(1.05); }
  .drawer-item:hover { background: var(--accent-soft); color: var(--accent); }
  /* Consistent coloured hover for every card/list item across the store */
  .info-card:hover, .dl-item:hover, .ticket-item:hover, .integration-item:hover,
  .wallet-item:hover, .payment-method-card:hover, .address-card:hover, .cart-item:hover {
    border-color: var(--accent); background: var(--accent-soft);
  }
  .quick-action:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
  .kpi:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
  .faq__q:hover { color: var(--accent); }
  .section-head__link:hover { text-decoration: underline; }

  /* Cards lift on hover (like the original asset/category tiles) */
  .pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--accent); }
  .cat-tile:hover .cat-tile__icon { transform: translateY(-3px) scale(1.04); box-shadow: var(--shadow-sm); }
  .cat-tile__icon { transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast); }
  .coupon-card:hover { border-color: var(--accent); }
  .pcard__wish:hover { color: var(--danger); transform: scale(1.1); }

  /* Coloured hover for category rows — mirrors the original's green-tinted hover */
  .cat-hover:hover { background: var(--accent-soft) !important; border-color: var(--accent) !important; }
}

/* ---- Settings groups ------------------------------------------------------------------ */
.settings-group { margin-top: var(--space-4); }
.settings-group__label { padding: 0 var(--space-5) var(--space-1); font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-muted); }

/* ---- Chat thread (support tickets — customer + admin) --------------------------------- */
.thread { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); }
.bubble { max-width: 82%; padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); font-size: var(--fs-sm); line-height: 1.4; }
.bubble.them { align-self: flex-start; background: var(--card); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bubble.me { align-self: flex-end; background: var(--accent); color: var(--accent-contrast); border-bottom-right-radius: 4px; }
.bubble__time { display: block; font-size: 10px; opacity: 0.7; margin-top: 4px; }
.thread-compose { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: var(--app-max-width); display: flex; gap: var(--space-2); padding: var(--space-3) var(--space-4); padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--border); z-index: 15; }
.thread-compose input { flex: 1; }

/* ---- Sticky bottom bar (checkout/cart CTA) -------------------------------------------- */
.bottom-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 15; width: 100%; max-width: var(--app-max-width);
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--border);
}
.bottom-bar__total { display: flex; flex-direction: column; }
.bottom-bar__total small { color: var(--text-muted); font-size: var(--fs-xs); }
.bottom-bar__total strong { font-size: var(--fs-lg); }
