/* ============ Nền tảng ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.icon { width: 20px; height: 20px; flex: none; stroke-width: 2; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

/* ============ Khung ứng dụng ============ */
.app {
  max-width: var(--app-max);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--c-surface);
  position: relative;
}
@media (min-width: 768px) {
  .app { box-shadow: 0 0 0 1px var(--c-line); }
}
.view {
  padding: 0 var(--gutter) var(--sp-6);
}
.view.has-bar {
  /* chừa chỗ cho thanh thao tác cố định + safe-area */
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px) + var(--sp-6));
}
.screen-enter { animation: screen-in var(--dur) var(--ease) both; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ============ Header thương hiệu ============ */
.brandbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3);
  padding: calc(var(--sp-3) + env(safe-area-inset-top, 0px)) var(--gutter) var(--sp-3);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--c-line);
}
/* Logo Pigeon: file gốc 1200×1200 có khoảng trắng + chữ katakana.
   Cắt bằng CSS vùng wordmark (x 97–1117, y 376–688) — không kéo giãn. */
.logo-pigeon {
  display: block;
  width: 118px;
  aspect-ratio: 1020 / 312;
  overflow: hidden;
  flex: none;
}
.logo-pigeon img {
  width: calc(100% * 1200 / 1020);
  max-width: none;
  margin-left: calc(-100% * 97 / 1020);
  margin-top: calc(-100% * 376 / 1020);
}
/* Logo Vietbaby: 640×483, cắt nhẹ viền trống (x 60–580, y 10–472). */
.logo-vietbaby {
  display: block;
  width: 64px;
  aspect-ratio: 520 / 462;
  overflow: hidden;
  flex: none;
}
.logo-vietbaby img {
  width: calc(100% * 640 / 520);
  max-width: none;
  margin-left: calc(-100% * 60 / 520);
  margin-top: calc(-100% * 10 / 520);
}
.brandbar .x {
  color: var(--c-text-3); font-size: var(--fs-sm);
}
@media (min-width: 768px) {
  .logo-pigeon { width: 140px; }
  .logo-vietbaby { width: 76px; }
}

/* ============ Thông tin sự kiện ============ */
.event-chip {
  display: flex; align-items: center; gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-brand-soft);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}
.event-chip .icon { color: var(--c-brand); width: 18px; height: 18px; }
.event-chip .dot { color: var(--c-text-3); }
.event-chip .name { flex-basis: 100%; font-weight: var(--fw-bold); font-size: var(--fs-md); }
.event-meta {
  display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
}
.event-meta span { display: inline-flex; align-items: center; gap: 6px; }
.event-meta .icon { color: var(--c-brand); width: 18px; height: 18px; }

/* ============ Tiêu đề ============ */
.page-head { margin: var(--sp-6) 0 var(--sp-5); }
.page-title { font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.page-sub { margin-top: var(--sp-1); color: var(--c-text-2); font-size: var(--fs-sm); }
.section-title {
  font-size: var(--fs-lg); font-weight: var(--fw-bold);
  margin: var(--sp-6) 0 var(--sp-3);
}

/* ============ Nút ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap);
  padding: 0 var(--sp-5);
  border: 0; border-radius: var(--r-md);
  font-weight: var(--fw-bold);
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease),
    opacity var(--dur-fast) var(--ease);
  user-select: none;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn-primary { background: var(--c-brand); color: var(--c-on-brand); }
.btn-primary:hover:not(:disabled) { background: var(--c-brand-hover); }
.btn-primary:active:not(:disabled) { background: var(--c-brand-press); }
.btn-primary:disabled, .btn-primary[aria-disabled="true"] {
  background: #e3b7bb; color: #fff; cursor: not-allowed;
}
.btn-block {
  width: 100%; min-height: var(--btn-h);
  font-size: var(--fs-lg); letter-spacing: 0.02em;
}
.btn-block { position: relative; }
.btn-block .trail { position: absolute; right: var(--sp-5); } /* chữ luôn ở giữa */
[tabindex="-1"]:focus { outline: none; }
.btn-soft {
  background: var(--c-brand-soft); color: var(--c-brand);
}
.btn-soft:hover { background: #fadde1; }
.btn-ghost {
  background: transparent; color: var(--c-text-2); min-height: var(--tap);
  padding: 0 var(--sp-3);
}
.btn-ghost:hover { color: var(--c-text); background: var(--c-surface-alt); }
.icon-btn {
  display: inline-grid; place-items: center;
  width: var(--tap); height: var(--tap);
  border: 0; border-radius: var(--r-md); background: transparent; color: var(--c-text);
}
.icon-btn:hover { background: var(--c-surface-alt); }

.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.45); border-top-color: #fff;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 1.6s; }
}

/* ============ Màn 1: QR ============ */
.qr-card {
  display: grid; justify-items: center; gap: var(--sp-4);
  padding: var(--sp-8) var(--sp-4) var(--sp-6);
  background: var(--c-surface-alt);
  border-radius: var(--r-xl);
  text-align: center;
}
.qr-phone {
  position: relative;
  width: 148px; height: 148px;
  display: grid; place-items: center;
  border-radius: var(--r-xl);
  background: #fff;
  box-shadow: var(--sh-card);
}
.qr-phone .icon { width: 96px; height: 96px; color: var(--c-brand); stroke-width: 1.6; }
.qr-phone::after { /* tia quét */
  content: ""; position: absolute; left: 22px; right: 22px; height: 2px;
  background: var(--c-brand); opacity: 0.55; border-radius: 2px;
  top: 26px;
  animation: scanline 2.4s ease-in-out infinite alternate;
}
@keyframes scanline { to { top: 120px; } }
@media (prefers-reduced-motion: reduce) { .qr-phone::after { animation: none; top: 74px; } }
.qr-label { font-weight: var(--fw-bold); letter-spacing: 0.06em; }
.qr-steps {
  display: grid; gap: var(--sp-2);
  margin: 0; padding: 0; list-style: none;
  font-size: var(--fs-sm); color: var(--c-text-2); text-align: left;
}
.qr-steps li { display: flex; gap: var(--sp-2); align-items: center; }
.qr-steps .icon { color: var(--c-brand); width: 18px; height: 18px; }
.note {
  margin-top: var(--sp-4);
  font-size: var(--fs-xs); color: var(--c-text-3);
}

/* ============ Form ============ */
.field { margin-bottom: var(--sp-5); }
.field label {
  display: block; margin-bottom: var(--sp-2);
  font-size: var(--fs-sm); font-weight: var(--fw-bold);
}
.field label .req { color: var(--c-brand); }
.input-wrap {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: var(--btn-h);
  padding: 0 var(--sp-4);
  border: 1.5px solid var(--c-line-strong);
  border-radius: var(--r-md);
  background: var(--c-surface);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.input-wrap .icon { color: var(--c-text-3); transition: color var(--dur-fast); }
.input-wrap input {
  flex: 1; min-width: 0; height: 48px;
  border: 0; outline: 0; background: transparent;
  font-size: 1rem; /* ≥16px để iOS không tự zoom */
}
.input-wrap input::placeholder { color: #9aabac; }
.input-wrap:focus-within {
  border-color: var(--c-text);
  box-shadow: 0 0 0 3px rgba(29, 111, 214, 0.25);
}
.input-wrap:focus-within .icon { color: var(--c-text); }
.field.is-valid .input-wrap { border-color: var(--c-success); }
.field.is-invalid .input-wrap { border-color: var(--c-error); background: var(--c-error-soft); }
.field.is-invalid .input-wrap .icon { color: var(--c-error); }
.field-error {
  display: flex; align-items: center; gap: 6px;
  margin-top: var(--sp-2);
  color: var(--c-error); font-size: var(--fs-sm); font-weight: var(--fw-medium);
  animation: screen-in var(--dur-fast) var(--ease) both;
}
.field-error .icon { width: 16px; height: 16px; }
.field-hint { margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--c-text-3); }

.info-note {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-brand-soft); border-radius: var(--r-md);
  font-size: var(--fs-sm); color: var(--c-text-2);
}
.info-note strong { color: var(--c-text); }
.info-note .icon { color: var(--c-brand); margin-top: 1px; }

/* ============ Màn 3: Trang chính ============ */
.search {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-top: var(--sp-4);
  min-height: 48px; padding: 0 var(--sp-2) 0 var(--sp-4);
  background: var(--c-bg);
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.search:focus-within { border-color: var(--c-text); background: #fff; }
.search .icon { color: var(--c-text-3); }
.search input {
  flex: 1; min-width: 0; height: 46px; border: 0; outline: 0; background: transparent; font-size: 1rem;
}
.search input::-webkit-search-cancel-button { display: none; }
.hero-tip {
  display: flex; gap: var(--sp-3); align-items: center;
  margin-top: var(--sp-4); padding: var(--sp-4);
  background: var(--c-surface-alt); border-radius: var(--r-lg);
}
.hero-tip .icon { color: var(--c-brand); width: 32px; height: 32px; stroke-width: 1.6; }
.hero-tip b { display: block; font-size: var(--fs-md); }
.hero-tip span { font-size: var(--fs-sm); color: var(--c-text-2); }

.cat-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3);
}
@media (min-width: 600px) { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cat-card {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: 72px; padding: var(--sp-3);
  background: var(--c-surface);
  border: 1.5px solid var(--c-line); border-radius: var(--r-md);
  text-align: left; font-weight: var(--fw-semibold); font-size: var(--fs-sm); line-height: var(--lh-tight);
  transition: border-color var(--dur-fast), transform var(--dur-fast) var(--ease), background-color var(--dur-fast);
}
.cat-card:hover { border-color: var(--c-brand-line); background: var(--c-brand-softer); }
.cat-card:active { transform: scale(0.98); }
.cat-ico {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--c-brand-soft); color: var(--c-brand);
}
.cat-card small { display: block; margin-top: 2px; color: var(--c-text-3); font-weight: var(--fw-regular); font-size: var(--fs-xs); }

.customer-line {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  margin-top: var(--sp-5);
  font-size: var(--fs-sm); color: var(--c-text-2);
}
.customer-line span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.customer-line .icon { color: var(--c-text-3); width: 16px; height: 16px; }
.link-btn {
  border: 0; background: none; color: var(--c-brand); font-weight: var(--fw-semibold);
  min-height: var(--tap); padding: 0 var(--sp-2); font-size: var(--fs-sm);
}

/* ============ Màn 4: Danh mục ============ */
.cat-head { display: flex; align-items: center; gap: var(--sp-2); margin: var(--sp-4) 0 var(--sp-3) calc(-1 * var(--sp-2)); }
.cat-head h1 { font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.crumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  margin: 0; padding: var(--sp-2) var(--sp-3);
  list-style: none;
  background: var(--c-brand-soft); border-radius: var(--r-md);
  font-size: var(--fs-sm);
}
.crumbs li { display: inline-flex; align-items: center; gap: 4px; }
.crumbs .icon { width: 16px; height: 16px; color: var(--c-text-3); }
.crumbs a, .crumbs button {
  color: var(--c-text-2); text-decoration: none; border: 0; background: none; padding: 4px 2px; font-size: inherit;
}
.crumbs [aria-current] { color: var(--c-text); font-weight: var(--fw-semibold); }
.chips {
  display: flex; gap: var(--sp-2);
  margin: var(--sp-3) calc(-1 * var(--gutter)) 0; padding: 2px var(--gutter) var(--sp-1);
  overflow-x: auto; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 40px; padding: 0 var(--sp-4);
  border: 1.5px solid var(--c-line); border-radius: var(--r-pill);
  background: var(--c-surface); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--c-text-2);
  transition: all var(--dur-fast) var(--ease);
}
.chip[aria-pressed="true"] { background: var(--c-text); border-color: var(--c-text); color: #fff; }
.list-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin: var(--sp-4) 0 var(--sp-3);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
}
.list-meta span { color: var(--c-text-3); font-weight: var(--fw-regular); }

.products { display: grid; gap: var(--sp-3); }
@media (min-width: 600px) { .products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.product {
  position: relative;
  display: grid; grid-template-columns: 88px 1fr; gap: var(--sp-3);
  padding: var(--sp-2);
  padding-right: var(--sp-3);
  background: var(--c-surface);
  border: 1.5px solid var(--c-line); border-radius: var(--r-lg);
  transition: border-color var(--dur) var(--ease);
}
.product.in-cart { border-color: var(--c-brand-line); }
.p-img {
  width: 88px; height: 88px; border-radius: var(--r-md);
  display: grid; place-items: center; overflow: hidden;
}
.p-img svg { width: 64px; height: 64px; }
.tone-rose { background: #fdecee; }
.tone-sky { background: #e8f1fb; }
.tone-mint { background: #e3f4ec; }
.p-body { display: flex; flex-direction: column; min-width: 0; padding-top: 2px; }
.p-name { font-size: var(--fs-sm); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.p-variant { margin-top: 2px; font-size: var(--fs-xs); color: var(--c-text-3); }
.p-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-2); margin-top: auto; padding-top: var(--sp-2); }
.price { color: var(--c-brand); font-weight: var(--fw-bold); font-size: var(--fs-md); white-space: nowrap; }
.p-qty {
  display: inline-block; margin-top: 4px;
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--c-success);
}
.add-btn {
  position: relative;
  display: grid; place-items: center; flex: none;
  width: var(--tap); height: var(--tap);
  border: 0; border-radius: var(--r-md);
  background: var(--c-brand); color: #fff;
  transition: transform var(--dur-fast) var(--ease), background-color var(--dur-fast);
}
.add-btn:hover { background: var(--c-brand-hover); }
.add-btn:active { transform: scale(0.9); }
.add-btn.pop { animation: pop var(--dur-slow) var(--ease); }
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(0.84); }
  75% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.add-btn .icon { width: 22px; height: 22px; stroke-width: 2.5; }

.empty {
  display: grid; justify-items: center; gap: var(--sp-2);
  padding: var(--sp-8) var(--sp-4);
  text-align: center; color: var(--c-text-2);
}
.empty-ico {
  display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%;
  background: var(--c-surface-alt); color: var(--c-text-3); margin-bottom: var(--sp-2);
}
.empty-ico .icon { width: 32px; height: 32px; }
.empty b { color: var(--c-text); font-size: var(--fs-lg); }
.empty .btn { margin-top: var(--sp-3); }

/* ============ Thanh thao tác cố định ============ */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  max-width: var(--app-max); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--sp-3);
  padding: var(--sp-3) var(--gutter) calc(var(--sp-3) + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--c-line);
  box-shadow: var(--sh-bar);
}
.actionbar.single { grid-template-columns: 1fr; }
.actionbar .btn { min-height: var(--btn-h); }
.cart-btn { justify-content: flex-start; gap: var(--sp-2); padding: 0 var(--sp-3); }
.cart-btn .cart-ico { position: relative; display: inline-grid; margin-right: 10px; }
.badge {
  position: absolute; top: -8px; right: -10px;
  min-width: 20px; height: 20px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  background: var(--c-brand); color: #fff;
  font-size: 11px; font-weight: var(--fw-bold); line-height: 1;
  border: 2px solid #fff;
}
.badge[data-n="0"] { background: var(--c-text-3); }
.bump { animation: bump var(--dur-slow) var(--ease); }
@keyframes bump {
  0% { transform: scale(1); }
  45% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.order-btn { flex-direction: column; align-items: flex-start; gap: 0; padding: 0 var(--sp-4); position: relative; }
.order-btn .ob-row { display: flex; width: 100%; align-items: center; justify-content: space-between; }
.order-btn .ob-label { font-size: var(--fs-md); }
.order-btn .ob-total { font-size: var(--fs-xs); font-weight: var(--fw-semibold); opacity: 0.92; font-variant-numeric: tabular-nums; }
.order-btn.ready { align-items: stretch; justify-content: center; }

/* ============ Toast ============ */
.toast-region {
  position: fixed; left: 0; right: 0; z-index: 50;
  bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px) + var(--sp-3));
  display: grid; justify-items: center; pointer-events: none;
  padding: 0 var(--gutter);
}
.toast {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  max-width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-text); color: #fff; border-radius: var(--r-md);
  box-shadow: var(--sh-toast);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  animation: toast-in var(--dur) var(--ease) both;
}
.toast .icon { color: #7ee2b0; width: 18px; height: 18px; }
.toast.out { animation: toast-out var(--dur-fast) ease-in both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ============ Màn 5: Giỏ hàng ============ */
.who {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-bg); border-radius: var(--r-md);
}
.who dl { margin: 0; display: grid; gap: 2px; font-size: var(--fs-sm); }
.who dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.who dd { margin: 0; display: flex; align-items: center; gap: 6px; font-weight: var(--fw-semibold); }
.who .icon { width: 16px; height: 16px; color: var(--c-text-3); }

.cart-list { display: grid; gap: var(--sp-3); margin-top: var(--sp-4); }
.cart-item {
  display: grid; grid-template-columns: 76px 1fr; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-2);
  border: 1.5px solid var(--c-line); border-radius: var(--r-lg);
  animation: screen-in var(--dur) var(--ease) both;
}
.cart-item .p-img { width: 76px; height: 76px; }
.cart-item .p-img svg { width: 54px; height: 54px; }
.unit { font-size: var(--fs-xs); color: var(--c-text-2); margin-top: 4px; }
.ci-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-top: var(--sp-2); }
.stepper {
  display: inline-flex; align-items: center;
  border: 1.5px solid var(--c-line); border-radius: var(--r-md);
}
.stepper button {
  display: grid; place-items: center;
  width: 40px; height: 40px; border: 0; background: none; color: var(--c-text);
  border-radius: var(--r-md);
}
.stepper button:hover { background: var(--c-surface-alt); }
.stepper button:active { transform: scale(0.92); }
.stepper .rm { color: var(--c-error); }
.stepper output {
  min-width: 28px; text-align: center; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums;
}
.line-total { font-weight: var(--fw-bold); color: var(--c-brand); white-space: nowrap; }

.summary {
  margin-top: var(--sp-5); padding-top: var(--sp-4);
  border-top: 2px solid var(--c-line);
  display: grid; gap: var(--sp-2);
}
.summary .row { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--fs-sm); color: var(--c-text-2); }
.summary .total { font-size: var(--fs-lg); color: var(--c-text); font-weight: var(--fw-bold); }
.summary .total b { color: var(--c-brand); font-size: var(--fs-xl); }
.form-error {
  display: flex; gap: var(--sp-2); align-items: center;
  margin-top: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  background: var(--c-error-soft); color: var(--c-error);
  border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: var(--fw-semibold);
}

/* ============ Màn 6: Thành công ============ */
.success { text-align: center; padding-top: var(--sp-6); }
.check {
  width: 88px; height: 88px; margin: 0 auto var(--sp-4);
  display: grid; place-items: center;
  background: var(--c-success-soft); border-radius: 50%;
  animation: check-pop var(--dur-slow) var(--ease) both;
}
.check svg { width: 44px; height: 44px; color: var(--c-success); }
.check path {
  stroke-dasharray: 30; stroke-dashoffset: 30;
  animation: draw var(--dur-slow) var(--ease) 120ms forwards;
}
@keyframes check-pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .check path { stroke-dashoffset: 0; animation: none; } }

.receipt {
  margin-top: var(--sp-6); text-align: left;
  border: 1.5px solid var(--c-line); border-radius: var(--r-lg);
  overflow: hidden;
}
.receipt-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4);
}
.receipt-row + .receipt-row { border-top: 1px dashed var(--c-line-strong); }
.receipt-label {
  font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: 0.06em; color: var(--c-text-3); text-transform: uppercase;
}
.order-id {
  display: block; margin-top: 2px;
  font-size: 1.625rem; font-weight: var(--fw-bold); color: var(--c-brand);
  letter-spacing: 0.01em; font-variant-numeric: tabular-nums;
  user-select: all; white-space: nowrap;
}
.order-phone {
  display: block; margin-top: 2px;
  font-size: var(--fs-xl); font-weight: var(--fw-bold); letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums; user-select: all;
}
.receipt-row > div { min-width: 0; }
.id-row { flex-direction: column; align-items: flex-start; background: var(--c-brand-softer); }
.copy-btn {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: var(--tap); min-height: var(--tap); padding: 0 var(--sp-3);
  border: 1.5px solid var(--c-line); border-radius: var(--r-md);
  background: #fff; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--c-text-2);
  transition: all var(--dur-fast);
}
.copy-btn:hover { border-color: var(--c-text-3); color: var(--c-text); }
.copy-btn.done { border-color: var(--c-success); color: var(--c-success); }
.facts { margin: var(--sp-5) 0 0; display: grid; gap: var(--sp-2); text-align: left; }
.facts div { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-md); }
.facts dt { color: var(--c-text-2); }
.facts dd { margin: 0; font-weight: var(--fw-bold); text-align: right; }
.facts .money { color: var(--c-brand); }
.stack { display: grid; gap: var(--sp-3); margin-top: var(--sp-6); }

/* Chi tiết đơn */
.order-lines { margin: var(--sp-4) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--c-line); }
.order-lines li {
  display: grid; grid-template-columns: 1fr auto; gap: 2px var(--sp-3);
  padding: var(--sp-3) 0; border-bottom: 1px solid var(--c-line); font-size: var(--fs-sm);
}
.order-lines .ol-name { font-weight: var(--fw-semibold); }
.order-lines .ol-sub { color: var(--c-text-3); font-size: var(--fs-xs); }
.order-lines .ol-amt { font-weight: var(--fw-bold); text-align: right; grid-row: span 2; align-self: center; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--c-success-soft); color: var(--c-success);
  font-size: var(--fs-xs); font-weight: var(--fw-bold);
}
.status-pill .icon { width: 14px; height: 14px; }

/* Màn hình rất nhỏ (≤ 350px) */
@media (max-width: 350px) {
  :root { --gutter: 12px; }
  .logo-pigeon { width: 100px; }
  .logo-vietbaby { width: 54px; }
  .cat-grid { grid-template-columns: 1fr; }
  .product { grid-template-columns: 72px 1fr; }
  .p-img { width: 72px; height: 72px; }
  .order-id { font-size: 1.3rem; }
  .copy-btn span { display: none; }
  .copy-btn { padding: 0; }
  .actionbar { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--sp-2); }
}

/* Đồng ý xử lý dữ liệu cá nhân (bắt buộc, không tích sẵn) */
.field .consent-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; font-weight: 400; color: var(--color-text-2, #4a5b6a); cursor: pointer; margin: 0; }
.field .consent-check b { font-weight: 600; color: var(--color-text, #243545); }
.consent-check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--color-primary, #cf183c); }
.consent-check a { color: var(--color-primary, #cf183c); font-weight: 600; }
.field.consent.is-invalid .consent-check { color: var(--color-danger, #b42318); }
.price .was { font-size: 12px; font-weight: 400; color: var(--color-muted, #6b7a88); margin-left: 4px; }
.p-soldout { display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--color-danger, #b42318); }
.add-btn:disabled { opacity: .4; cursor: not-allowed; }
