/* Giao diện Telegram Mini App — Tiệm Số Hùng Hiền Hòa (/tma/)
   Đồng bộ 100% bảng màu giấy kem / xanh tím / vàng từ /ui.css, tối ưu gọn dọc chuẩn App di động */

.tma-shell {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 12px 12px calc(84px + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 12px;
}

.tma-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid var(--hh-hair);
  background: var(--hh-card);
  box-shadow: var(--hh-shadow-sm);
}

.tma-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.tma-brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: none;
}

.tma-brand-text small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  opacity: 0.72;
}

.tma-brand-text b {
  display: block;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tma-user-pill {
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--yellow);
  font-size: 12px;
  font-weight: 700;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tma-banner {
  padding: 14px 16px;
  border-radius: 22px;
  background: var(--blue);
  color: var(--cream);
  display: grid;
  gap: 5px;
}

.tma-banner .eyebrow {
  margin-bottom: 2px;
  padding: 4px 10px;
  font-size: 10px;
}

.tma-banner h1 {
  font-size: 20px;
  line-height: 1.22;
}

.tma-banner p {
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.9;
}

#tma-search {
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 14px;
}

.tma-cats {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.tma-cats::-webkit-scrollbar {
  display: none;
}

.tma-cat-btn {
  flex: none;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1.5px solid var(--hh-hair);
  background: var(--hh-card);
  font-size: 12.5px;
  font-weight: 600;
}

.tma-cat-btn[aria-pressed="true"] {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--cream);
}

.tma-list {
  display: grid;
  gap: 10px;
}

.tma-card {
  padding: 13px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--hh-hair);
  background: var(--hh-card);
  box-shadow: var(--hh-shadow-sm);
  display: grid;
  gap: 8px;
}

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

.tma-tag {
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--yellow) 45%, var(--cream));
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.tma-summary {
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.86;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tma-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--hh-hair);
}

.tma-price {
  font-size: 17px;
  font-weight: 800;
}

.tma-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tma-actions .btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12.5px;
}

details.tma-drawer {
  border-top: 1px dashed var(--hh-hair);
  padding-top: 8px;
}

details.tma-drawer > summary {
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

details.tma-drawer > summary::-webkit-details-marker {
  display: none;
}

details.tma-drawer > summary::after {
  content: '+';
  font-weight: 800;
}

details.tma-drawer[open] > summary::after {
  content: '−';
}

.tma-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 6px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--cream) 94%, #fff);
  border-top: 1px solid var(--hh-hair);
  backdrop-filter: blur(12px);
}

.tma-nav-in {
  width: min(540px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.tma-nav-btn {
  min-height: 40px;
  padding: 5px 4px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.tma-nav-btn[aria-selected="true"] {
  background: var(--blue);
  color: var(--yellow);
}

.tma-status {
  padding: 8px 11px;
  border-radius: 12px;
  background: var(--hh-soft);
  font-size: 12.5px;
}

.tma-status:empty {
  display: none;
}

.tma-status.is-error {
  background: color-mix(in srgb, var(--coral) 20%, var(--cream));
  color: #9b2919;
}

.tma-status.is-ok {
  background: color-mix(in srgb, var(--mint) 30%, var(--cream));
  color: #135c3a;
}

.tma-qr-box {
  padding: 10px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--hh-hair);
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.tma-qr-box img {
  width: 164px;
  height: auto;
  border-radius: 8px;
}

.tma-kv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 11px;
  background: var(--cream);
  border: 1px solid var(--hh-hair);
  font-size: 12.5px;
}

dialog {
  width: 100%;
  max-width: min(540px, 100%);
  max-height: 88dvh;
  margin: auto auto 0;
  padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  border-radius: 24px 24px 0 0;
}
