/* ---------- Typography helpers (Customer_* text styles) ---------- */
.t-minor { font-size: var(--fs-minor); font-weight: 500; }
.t-sub { font-size: var(--fs-sub); font-weight: 400; line-height: 1.35; }
.t-sub-sb { font-size: var(--fs-sub); font-weight: 600; }
.t-body { font-size: var(--fs-body); font-weight: 400; line-height: 1.45; }
.t-body-md { font-size: var(--fs-body); font-weight: 500; }
.t-body-sb { font-size: var(--fs-body); font-weight: 600; letter-spacing: .28px; }
.t-major { font-size: var(--fs-major); font-weight: 600; }
.t-major-b { font-size: var(--fs-major); font-weight: 700; }
.t-title { font-size: var(--fs-title); font-weight: 700; }
.t-h2 { font-size: var(--fs-h2); font-weight: 700; line-height: 1.2; }
.muted { color: var(--text-muted); }
.action-text { color: var(--text-action); }
.center { text-align: center; }

/* ---------- Layout helpers ---------- */
.pad { padding-inline: var(--gutter); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.section { margin-top: 32px; }
.hscroll {
  display: flex; gap: 16px; overflow-x: auto; padding-inline: var(--gutter);
  scroll-snap-type: x mandatory; scrollbar-width: none; scroll-padding-inline: var(--gutter);
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: none; }
.divider { height: 1px; background: var(--line-2); border: 0; margin: 0; }
.spacer { flex: 1; }

/* ---------- App bar ---------- */
.appbar {
  position: sticky; top: calc(var(--status-h) * -1); z-index: 20;
  margin-top: calc(var(--status-h) * -1); padding-top: var(--status-h);
  background: var(--surface); border-bottom: 1px solid var(--line-2);
}
.appbar__row { height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 8px; }
.appbar__title { font-size: var(--fs-major); font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar--clear { background: transparent; border-bottom: 0; position: absolute; left: 0; right: 0; margin-top: 0; top: 0; }
.appbar--clear .icon-btn { background: rgba(255,255,255,.92); box-shadow: var(--shadow-1); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  transition: background var(--dur-1);
}
.icon-btn:active { background: var(--primary-100); }
.icon-btn svg { width: 24px; height: 24px; }

/* ---------- Buttons ---------- */
.btn {
  min-height: 48px; padding: 0 20px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: var(--fs-body); font-weight: 600; letter-spacing: .28px;
  transition: transform var(--dur-1) var(--ease-out), background var(--dur-1), opacity var(--dur-1);
  user-select: none;
}
.btn:active { transform: scale(.98); }
.btn--block { width: 100%; }
.btn--dark { background: var(--surface-dark); color: #fff; }
.btn--dark:hover { background: #2c2c33; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: #6a56dc; }
.btn--outline { border: 1px solid var(--line-2); background: var(--white); color: var(--ink); }
.btn--outline-primary { border: 1px solid var(--primary); color: var(--primary); background: var(--white); }
.btn--ghost { color: var(--primary); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.btn svg { width: 20px; height: 20px; }

/* Small dark pill (ADOPT ANIMAL, VIEW MAP, KNOW MORE …) */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  background: var(--surface-dark); color: #fff; border-radius: 50px;
  height: 24px; padding: 0 8px; font-size: 10px; font-weight: 600; white-space: nowrap;
  position: relative;
}
.pill::before { content: ""; position: absolute; inset: -10px -4px; } /* 44px touch area */
.pill--md { height: 32px; padding: 0 12px; font-size: 12px; }
.pill--sm-text { font-size: 12px; }
.text-link {
  display: inline-flex; align-items: center; gap: 8px; color: var(--primary);
  font-size: var(--fs-body); font-weight: 600; letter-spacing: .28px; min-height: 32px;
}

/* ---------- Chips / tabs ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-inline: var(--gutter); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 36px; padding: 0 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: var(--white);
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: #3c3c42; transition: all var(--dur-1);
}
.chip.is-on, .chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip--primary.is-on { background: var(--primary); border-color: var(--primary); }
.tabs { display: flex; border-bottom: 1px solid var(--line-2); padding-inline: var(--gutter); gap: 20px; }
.tab { height: 44px; font-size: 14px; font-weight: 600; color: var(--muted); position: relative; }
.tab.is-on { color: var(--ink); }
.tab.is-on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); border-radius: 2px; }
.seg { display: flex; background: #f2f1f7; border-radius: 10px; padding: 4px; }
.seg button { flex: 1; height: 36px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.is-on { background: var(--white); color: var(--ink); box-shadow: var(--shadow-1); }

/* ---------- Cards ---------- */
.card { background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-md); }
.card--pad { padding: 16px; }
.card--soft { background: var(--surface-alt); border-color: transparent; }
.card--press { transition: transform var(--dur-1) var(--ease-out); }
.card--press:active { transform: scale(.985); }
.img-cover { width: 100%; height: 100%; object-fit: cover; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700; background: var(--primary-100); color: var(--primary);
}
.badge--green { background: var(--success-bg); color: var(--success); }
.badge--coral { background: var(--tertiary-200); color: #b5402b; }
.badge--sun { background: var(--sun-300); color: #7a5a00; }
.badge--dark { background: rgba(24,24,28,.72); color: #fff; }

/* List rows */
.list-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 56px; }
.list-row + .list-row { border-top: 1px solid var(--line-2); }
.list-row__ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-100); flex: none; }
.list-row__ico svg { width: 20px; height: 20px; }
.chev { width: 20px; height: 20px; flex: none; color: var(--muted); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; font-weight: 600; }
.field__label .req { color: var(--tertiary); }
.input {
  height: 48px; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 0 14px;
  background: var(--white); font-size: 15px; width: 100%; transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(119,100,228,.15); }
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: none; }
.field__help { font-size: 12px; color: var(--muted); }
.field__err { font-size: 12px; color: var(--danger); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); margin: 0; flex: none; }
.radio-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line-2);
  border-radius: var(--r-md); background: var(--white); cursor: pointer; transition: border-color var(--dur-1), background var(--dur-1);
}
.radio-card.is-on { border-color: var(--primary); background: #f8f7fe; }
.radio-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--neutral-300); flex: none; display: grid; place-items: center; }
.radio-card.is-on .radio-dot { border-color: var(--primary); }
.radio-card.is-on .radio-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }

/* Quantity stepper */
.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-2); border-radius: var(--r-sm); height: 36px; }
.stepper button { width: 36px; height: 36px; display: grid; place-items: center; font-size: 18px; font-weight: 600; color: var(--primary); }
.stepper button[disabled] { color: var(--neutral-300); }
.stepper output { min-width: 20px; text-align: center; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- Sticky footer CTA ---------- */
.cta-bar {
  position: sticky; bottom: 0; z-index: 15; margin-top: 24px;
  background: var(--white); border-top: 1px solid var(--line-2);
  padding: 12px 16px 28px; display: flex; gap: 12px; align-items: center;
}
.cta-bar__total { display: flex; flex-direction: column; }
.cta-bar__total b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cta-bar__total span { font-size: 12px; color: var(--muted); }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30; height: var(--nav-h);
  background: var(--white); border-radius: 0 0 24px 24px; box-shadow: 0 -4px 18px rgba(208,214,226,.55);
  display: flex; align-items: flex-start; justify-content: center; padding: 13px 12px 0;
}
.bn-item {
  width: 76px; min-height: 48px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: .24px; color: var(--muted);
}
.bn-ico { width: 24px; height: 24px; }
.bn-ico .stroke { fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.bn-ico .fill { display: none; fill: var(--primary); }
.bn-item.is-active { color: var(--primary); font-weight: 700; }
.bn-item.is-active .stroke { stroke: var(--primary); }
.bn-item[data-tab="home"].is-active .stroke { display: none; }
.bn-item[data-tab="home"].is-active .fill { display: block; }
.bn-scan { flex: 1; display: flex; justify-content: center; margin-top: -25px; }
.bn-scan__btn {
  width: 60px; height: 60px; border-radius: 50%; background: var(--primary); border: 4px solid #fff;
  display: grid; place-items: center; box-shadow: 0 6px 16px rgba(119,100,228,.35);
  transition: transform var(--dur-1) var(--ease-out);
}
.bn-scan__btn:active { transform: scale(.94); }

/* ---------- Bottom sheet ---------- */
.sheet-host { position: absolute; inset: 0; z-index: 80; }
.scrim { position: absolute; inset: 0; background: rgba(24,24,28,.5); opacity: 0; transition: opacity var(--dur-2); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88%; overflow-y: auto;
  background: var(--white); border-radius: 24px 24px 0 0; padding: 8px 16px 32px;
  transform: translateY(100%); transition: transform var(--dur-3) var(--ease-out); box-shadow: var(--shadow-sheet);
}
.sheet--tall { height: 88%; }
.sheet-host.is-open .scrim { opacity: 1; }
.sheet-host.is-open .sheet { transform: none; }
.sheet__grab { width: 40px; height: 4px; border-radius: 2px; background: #d9d9de; margin: 4px auto 12px; }
.sheet__title { font-size: 18px; font-weight: 700; }

/* ---------- Toast ---------- */
.toast-host {
  position: absolute; left: 16px; right: 16px; bottom: 110px; z-index: 90; display: flex; justify-content: center;
  opacity: 0; transform: translateY(12px); transition: all var(--dur-2) var(--ease-out); pointer-events: none;
}
.toast-host.is-on { opacity: 1; transform: none; }
.toast { background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-2); }
.toast.ok { background: var(--secondary-700); }

/* ---------- Misc ---------- */
.dots { display: flex; gap: 8px; justify-content: center; align-items: center; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: #c9c9cf; }
.dots i.on { width: 8px; height: 8px; background: var(--ink); }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.success-ring {
  width: 88px; height: 88px; border-radius: 50%; background: var(--success-bg); display: grid; place-items: center; margin: 0 auto;
  animation: pop .45s var(--ease-out) both;
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.skeleton { background: linear-gradient(90deg, #f0eff5 25%, #f8f7fc 50%, #f0eff5 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
