.app-shell {
  width: 100%;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  background: transparent;
}

.app-frame {
  position: relative;
  width: 100%;
  max-width: var(--app-max-width);
  min-height: 100dvh;
  background: linear-gradient(180deg, rgba(255, 247, 251, 0.92) 0%, #ffffff 100%);
  overflow-x: hidden;
  box-shadow: 0 0 0 1px rgba(145, 62, 120, 0.06);
}

.spa-view {
  display: none;
}

.spa-view.is-active {
  display: block;
}

.spa-view.is-animating {
  display: block;
}

.spa-view.is-exiting,
.spa-view.is-entering {
  will-change: transform, opacity, filter;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 251, 253, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-line);
}

.top-bar__inner {
  /* padding: calc(12px + var(--safe-top)) 16px 12px; */

  padding: var(--safe-top) 16px 0;
  min-height: calc(56px + var(--safe-top));

  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
}

.top-bar__left,
.top-bar__actions {
  display: flex;
  align-items: center;
}

.top-bar__left {
  min-width: 42px;
  justify-content: flex-start;
}

.top-bar__title {
  margin: 0;
  line-height: 1.2;
  text-align: center;
}

.top-bar__back-button,
.top-bar__icon-button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.top-bar__back-button svg,
.top-bar__icon-button svg {
  display: block;
  flex: 0 0 auto;
  flex-shrink: 0;
}

/* .top-bar__eyebrow {
  font-size: 12px;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
} */

.top-bar__title {
  margin: 0px 0 0;
  font-size: 18px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  padding: 0 12px;
}

.top-bar__title.is-animating {
  will-change: transform, opacity, filter;
}

@media (max-width: 370px) {
  .top-bar__title {

    font-size: 15px;

  }
}

.top-bar__actions {
  min-width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.top-bar__icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  /* background:
    radial-gradient(circle at 30% 20%, rgba(224, 75, 144, 0.16), transparent 42%),
    #ffffff; */
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* box-shadow: 0 10px 22px rgba(145, 62, 120, 0.1); */
  cursor: pointer;
  background-color: #fffbfd;
}

.top-bar__icon-button svg {
  width: 19px;
  height: 19px;
  min-width: 19px;
  min-height: 19px;
  flex: 0 0 19px;
  flex-shrink: 0;
  stroke-width: 2.2;
  overflow: visible;
}

.top-bar__icon-button.is-refreshing {
  opacity: 0.82;
  pointer-events: none;
}

.top-bar__icon-button.is-refreshing svg {
  animation: headerRefreshSpin 0.72s linear infinite;
}

@keyframes headerRefreshSpin {
  to {
    transform: rotate(360deg);
  }
}

.notification-badge {

  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 24px;
  height: 24px;
  padding: 0 4px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--color-danger);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  transform: translate(35%, -35%);
  box-shadow: 0 4px 10px rgba(197, 61, 53, 0.24);
}

.notification-badge[hidden] {
  display: none;
}

.notification-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 16px;
  width: min(360px, calc(100% - 32px));
  padding: 12px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-16);
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(43, 19, 36, 0.14);
  z-index: 40;
}

.notification-toast {
  position: fixed;
  top: calc(var(--safe-top) + 12px);
  left: 50%;
  width: min(360px, calc(100vw - 24px));
  padding: 14px 14px 12px;
  border: 1px solid rgba(145, 62, 120, 0.12);
  border-radius: var(--radius-16);
  background: rgba(255, 255, 255, 0.98);
  color: var(--color-text);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(43, 19, 36, 0.18);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
  z-index: 70;
}

.notification-toast[hidden] {
  display: none;
}

.notification-toast__icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #fdf1f8;
  color: #cf4a8c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(207, 74, 140, 0.12);
}

.notification-toast__icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.notification-toast__content {
  min-width: 0;
}

.notification-toast__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.notification-toast__type {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(207, 74, 140, 0.1);
  color: #a8366f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.notification-toast strong,
.notification-toast small {
  display: block;
}

.notification-toast strong {
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.notification-toast small {
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.notification-toast__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, #e04b90 0%, #c26a14 100%);
  transform-origin: left center;
  transform: scaleX(1);
}

.notification-toast--system .notification-toast__icon {
  background: #fdf1f8;
  color: #cf4a8c;
}

.notification-toast--system .notification-toast__type {
  background: rgba(207, 74, 140, 0.1);
  color: #a8366f;
}

.notification-toast--system .notification-toast__progress {
  background: linear-gradient(90deg, #e04b90 0%, #c26a14 100%);
}

.notification-toast--order .notification-toast__icon {
  background: #eef4ff;
  color: #2b67d8;
}

.notification-toast--order .notification-toast__type {
  background: rgba(43, 103, 216, 0.12);
  color: #2456b1;
}

.notification-toast--order .notification-toast__progress {
  background: linear-gradient(90deg, #2b67d8 0%, #67a4ff 100%);
}

.notification-toast--payment .notification-toast__icon,
.notification-toast--wallet .notification-toast__icon {
  background: #edf9f2;
  color: #1f8a55;
}

.notification-toast--payment .notification-toast__type,
.notification-toast--wallet .notification-toast__type {
  background: rgba(31, 138, 85, 0.12);
  color: #1f8a55;
}

.notification-toast--payment .notification-toast__progress,
.notification-toast--wallet .notification-toast__progress {
  background: linear-gradient(90deg, #1f8a55 0%, #61c88d 100%);
}

.notification-toast--voucher .notification-toast__icon {
  background: #fff4e8;
  color: #ca7a16;
}

.notification-toast--voucher .notification-toast__type {
  background: rgba(202, 122, 22, 0.12);
  color: #b56a12;
}

.notification-toast--voucher .notification-toast__progress {
  background: linear-gradient(90deg, #ca7a16 0%, #efb14d 100%);
}

.notification-toast--message .notification-toast__icon,
.notification-toast--account .notification-toast__icon {
  background: #f3efff;
  color: #6a4bcf;
}

.notification-toast--message .notification-toast__type,
.notification-toast--account .notification-toast__type {
  background: rgba(106, 75, 207, 0.12);
  color: #6241cb;
}

.notification-toast--message .notification-toast__progress,
.notification-toast--account .notification-toast__progress {
  background: linear-gradient(90deg, #6a4bcf 0%, #a084ff 100%);
}

.notification-toast.is-timing .notification-toast__progress {
  animation: notificationToastProgress 5s linear forwards;
}

@keyframes notificationToastProgress {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

.notification-popover[hidden] {
  display: none;
}

.notification-popover.is-open {
  display: block;
}

.notification-popover__head {
  padding: 2px 2px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-popover__head strong {
  font-size: 16px;
}

.notification-popover__head a {
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

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

.notification-item {
  position: relative;
  padding: 12px 42px 12px 12px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-12);
  background: #fcfbfd;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.notification-item.is-new {
  border-color: rgba(197, 61, 53, 0.22);
  background: #fffafa;
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(145, 62, 120, 0.08);
}

.notification-item.is-new::before {
  content: "";
  position: absolute;
  top: 14px;
  right: 44px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #e04b90;
  box-shadow: 0 0 0 4px rgba(224, 75, 144, 0.12);
}

.notification-item__icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notification-item__icon svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.notification-item--system .notification-item__icon {
  background: #fff7ed;
  color: #c26a14;
}

.notification-item--wallet .notification-item__icon {
  background: #f0fdf4;
  color: #178347;
}

.notification-item--account .notification-item__icon {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.notification-item--payment .notification-item__icon {
  background: #eef7ff;
  color: #1d6fb8;
}

.notification-item--order .notification-item__icon {
  background: #f0fdf4;
  color: #178347;
}

.notification-item--voucher .notification-item__icon {
  background: #fff7ed;
  color: #c26a14;
}

.notification-item--message .notification-item__icon {
  background: #f5f3ff;
  color: #6d4fd8;
}

.notification-item__content {
  min-width: 0;
}

.notification-item__content[data-notification-link] {
  cursor: pointer;
}

.notification-item__meta {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notification-item__type {
  padding: 3px 7px;
  border-radius: 999px;
  background: #f8f7fb;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 800;
}

.notification-item__meta time {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 600;
}

.notification-item strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
}

.notification-item p {
  margin: 4px 0 0;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.45;
}

.notification-item:not(.is-new) {
  background: #f5f7fb;
  border-color: rgba(135, 148, 168, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.notification-item:not(.is-new) .notification-item__icon {
  background: rgba(148, 163, 184, 0.14);
  color: #68768c;
}

.notification-item:not(.is-new) .notification-item__type,
.notification-item:not(.is-new) .notification-item__meta time {
  color: #6e7b90;
}

.notification-item:not(.is-new) strong {
  color: #1f2937;
  font-weight: 700;
}

.notification-item:not(.is-new) p {
  color: #5f6d83;
}

.notification-item__delete {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #f8f7fb;
  color: var(--color-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.notification-item__delete svg {
  width: 15px;
  height: 15px;
}

.notification-empty {
  margin-top: 2px;
  padding: 14px;
  border-radius: var(--radius-12);
  background: #f8f7fb;
  color: var(--color-muted);
}

.notification-empty p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.lang-switch {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
}

.lang-switch__button {
  min-width: 42px;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.lang-switch__button.active {
  background: linear-gradient(135deg, #e04b90 0%, #b83280 100%);
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(224, 75, 144, 0.18);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, var(--app-max-width));
  max-width: var(--app-max-width);
  z-index: 30;
  background: rgba(255, 251, 253, 0.96);
  border-top: 1px solid var(--color-line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -8px 24px rgba(145, 62, 120, 0.08);
}

.bottom-nav--with-plus {
  overflow: visible;
}

.bottom-nav__inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.bottom-nav__item {
  min-height: 64px;
  padding: 10px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
}

.bottom-nav__item.is-active {
  color: var(--color-primary);
  font-weight: 700;
  animation: bottomNavActivePulse 520ms cubic-bezier(0.22, 1.28, 0.32, 1);
}

.bottom-nav__icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav__icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.bottom-nav__item.is-active .bottom-nav__icon {
  animation: bottomNavIconSpring 520ms cubic-bezier(0.22, 1.3, 0.32, 1);
  transform-origin: center;
}

.bottom-nav__plus {
  position: absolute;
  left: 50%;
  top: 0;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #e04b90 0%, #c26a14 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 30px rgba(145, 62, 120, 0.24);
  cursor: pointer;
  z-index: 2;
  text-decoration: none !important;
}

.bottom-nav__plus span {
  display: block;
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
  transform: translateY(-1px);
  text-decoration: none !important;
}

[data-motion-layer] {
  --motion-delay: 0ms;
}

.motion-enter {
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.985);
  filter: blur(6px);
  animation: motionLayerIn 560ms cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
  animation-delay: var(--motion-delay);
  will-change: transform, opacity, filter;
}

@keyframes motionLayerIn {
  0% {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(0.985);
    filter: blur(6px);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

@keyframes bottomNavActivePulse {
  0% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-2px);
  }

  72% {
    transform: translateY(1px);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes bottomNavIconSpring {
  0% {
    transform: scale(0.92);
  }

  45% {
    transform: scale(1.14);
  }

  72% {
    transform: scale(0.98);
  }

  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spa-view.is-exiting,
  .spa-view.is-entering,
  .top-bar__title.is-animating,
  .motion-enter,
  .bottom-nav__item.is-active,
  .bottom-nav__item.is-active .bottom-nav__icon {
    animation: none !important;
    transition: none !important;
  }
}

/* Chặn overscroll ở vùng cuộn chính.
Không cho header nhận gesture kéo dọc. */

/* html,
body {
  overscroll-behavior-y: contain;
}

.app-frame {
  overscroll-behavior-y: contain;
}

.top-bar {
  touch-action: auto;
  overscroll-behavior-y: contain;
}

html.platform-android,
html.platform-android body,
html.platform-android .app-frame,
html.platform-android .top-bar {
  overscroll-behavior-y: auto;
} */
