:root {
  --navy-900: #1A2C4D;
  --navy-800: #263A61;
  --navy-700: #3A537D;
  --cyan-500: #23ABDB;
  --cyan-600: #1C8FB8;
  --cyan-100: #E5F7FC;
  --paper: #F6F9FC;
  --white: #FFFFFF;
  --ink: #1D2939;
  --ink-soft: #5B6B85;
  --border: #DEE6EF;
  --success: #1FA97C;
  --success-bg: #E7F7F1;
  --danger: #E0503C;
  --danger-bg: #FCEAE7;
  --warning: #C98A1E;
  --warning-bg: #FBF0DD;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(26, 44, 77, .06);
  --shadow-md: 0 10px 30px rgba(26, 44, 77, .12);
  --shadow-lg: 0 20px 50px rgba(26, 44, 77, .16);
  --shadow-glow: 0 0 0 1px rgba(35, 171, 219, .16), 0 8px 24px rgba(35, 171, 219, .22);
  --gold: #E3A518;
  --gold-bg: #FCF3DD;
  --rose: #E0507E;
  --rose-bg: #FCE9EF;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: .15s;
  --dur-med: .22s;
  --dur-slow: .4s;
  --font-display: 'Space Grotesk', Inter, sans-serif;
  --font-body: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

button:not(:disabled) {
  transition: transform var(--dur-fast) var(--ease-spring);
}

button:not(:disabled):active {
  transform: scale(.96);
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
}

input,
select,
textarea {
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--navy-900);
  margin: 0;
}

p {
  margin: 0;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.mono {
  font-family: var(--font-mono);
}

:focus-visible {
  outline: 2px solid var(--cyan-500);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== Motion primitives ===== */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(.85);
  }

  70% {
    transform: scale(1.03);
  }

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

@keyframes pulseFade {

  0%,
  100% {
    opacity: .35;
  }

  50% {
    opacity: 1;
  }
}

@keyframes ringPulse {
  0% {
    transform: scale(.7);
    opacity: .55;
  }

  100% {
    transform: scale(1.7);
    opacity: 0;
  }
}

@keyframes heartBeat {
  0% {
    transform: scale(1);
  }

  30% {
    transform: scale(1.35);
  }

  55% {
    transform: scale(.92);
  }

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

@keyframes badgeBump {
  0% {
    transform: scale(1);
  }

  35% {
    transform: scale(1.4);
  }

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

@keyframes shimmer {
  0% {
    background-position: -300px 0;
  }

  100% {
    background-position: 300px 0;
  }
}

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

@keyframes dashTravel {
  to {
    stroke-dashoffset: -24;
  }
}

.stagger-in>* {
  animation: fadeSlideUp .2s var(--ease-out) both;
}

.stagger-in>*:nth-child(1) {
  animation-delay: 0s;
}

.stagger-in>*:nth-child(2) {
  animation-delay: .012s;
}

.stagger-in>*:nth-child(3) {
  animation-delay: .024s;
}

.stagger-in>*:nth-child(4) {
  animation-delay: .036s;
}

.stagger-in>*:nth-child(5) {
  animation-delay: .048s;
}

.stagger-in>*:nth-child(6) {
  animation-delay: .06s;
}

.stagger-in>*:nth-child(7) {
  animation-delay: .072s;
}

.stagger-in>*:nth-child(8) {
  animation-delay: .084s;
}

.stagger-in>*:nth-child(n+9) {
  animation-delay: .096s;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: #E7ECF3;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent);
  background-size: 300px 100%;
  animation: shimmer 1.3s infinite;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 16px) scale(.94);
  background: var(--navy-900);
  color: #fff;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-spring), transform var(--dur-med) var(--ease-spring);
  z-index: 999;
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow var(--dur-med) var(--ease-out);
}

.header.scrolled {
  box-shadow: 0 4px 20px rgba(26, 44, 77, .08);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 76px;
}

.logo-mark {
  height: 44px;
  width: 44px;
  object-fit: contain;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease-spring);
}

.logo-mark:hover {
  transform: rotate(-4deg) scale(1.05);
}

.search-bar {
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 6px 0 18px;
  height: 46px;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.search-bar:focus-within {
  border-color: var(--cyan-500);
  box-shadow: 0 0 0 4px var(--cyan-100);
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  height: 100%;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.search-bar input::placeholder {
  color: var(--ink-soft);
}

.search-bar input::-webkit-search-decoration,
.search-bar input::-webkit-search-cancel-button,
.search-bar input::-webkit-search-results-button,
.search-bar input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-bar button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.search-bar button:hover {
  background: var(--cyan-100);
  color: var(--cyan-600);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-800);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.icon-btn:hover {
  background: var(--cyan-100);
}

.icon-btn svg {
  transition: transform var(--dur-fast) var(--ease-spring);
}

.icon-btn:hover svg {
  transform: scale(1.1);
}

.icon-btn.is-active {
  color: var(--rose);
}

.badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--cyan-500);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-family: var(--font-mono);
}

.badge.bump {
  animation: badgeBump .4s var(--ease-spring);
}

.badge.rose {
  background: var(--rose);
}

.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  color: var(--navy-800);
}

.header.mobile-open .hamburger {
  background: var(--cyan-100);
}

.main-nav-wrap {
  border-top: 1px solid var(--border);
  background: var(--paper);
}

.main-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.main-nav-link {
  flex-shrink: 0;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  position: relative;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out);
}

.main-nav-link:hover {
  color: var(--navy-800);
}

.main-nav-link.active {
  color: var(--cyan-600);
}

.main-nav-link.active::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--cyan-500);
  animation: fadeSlideUp var(--dur-med) var(--ease-out);
}


.account-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-dropdown {
  position: relative;
}

.notif-dropdown {
  position: relative;
}

.notif-panel {
  width: 320px;
  max-height: 420px;
  overflow-y: auto;
  padding: 0;
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--navy-900);
}

.notif-head button {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--cyan-600);
  text-decoration: underline;
}

.notif-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background var(--dur-fast);
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background: var(--paper);
}

.notif-item.unread {
  background: var(--cyan-100);
  border-left-color: var(--cyan-500);
}

.notif-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-900);
}

.notif-msg {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.notif-time {
  font-size: 10.5px;
  color: var(--ink-soft);
  opacity: .8;
}

.notif-empty {
  padding: 34px 14px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
}

.notif-hint {
  padding: 10px 14px;
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 12px;
  line-height: 1.45;
  border-bottom: 1px solid var(--border);
}

.chat-dropdown {
  position: relative;
}

.chat-unread-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--rose);
  border: 2px solid #fff;
}

.chat-panel {
  width: 346px;
  padding: 0;
  overflow: hidden;
}

.chat-panel-head {
  background: var(--navy-900);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.chat-panel-head button {
  color: #fff;
  opacity: .8;
  font-size: 16px;
  transition: opacity var(--dur-fast);
}

.chat-panel-head button:hover {
  opacity: 1;
}

.chat-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-tab {
  flex: 1;
  padding: 11px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  position: relative;
  transition: color var(--dur-fast);
}

.chat-tab:hover {
  color: var(--navy-800);
}

.chat-tab.active {
  color: var(--cyan-600);
}

.chat-tab.active::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--cyan-500);
}

.chat-tab-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rose);
  margin-left: 5px;
  vertical-align: middle;
}

.chat-tab-panel {
  display: flex;
  flex-direction: column;
  height: 380px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--paper);
}

.chat-bubble {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-bubble.mine {
  align-self: flex-end;
  background: var(--cyan-500);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble.theirs {
  align-self: flex-start;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-bubble .chat-time {
  display: block;
  font-size: 9.5px;
  opacity: .7;
  margin-top: 3px;
}

.chat-empty {
  margin: auto;
  text-align: center;
  color: var(--ink-soft);
  font-size: 12.5px;
  padding: 20px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: #fff;
}

.chat-input-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 16px;
}

.chat-input-row button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cyan-500);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--dur-fast);
}

.chat-input-row button:hover {
  background: var(--cyan-600);
}

.chat-thread-mini-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--navy-900);
  flex-shrink: 0;
  background: #fff;
}

.chat-back-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  color: var(--navy-800);
  flex-shrink: 0;
  font-size: 14px;
  transition: background var(--dur-fast);
}

.chat-back-btn:hover {
  background: var(--cyan-100);
}

.friends-list-scroll {
  flex: 1;
  overflow-y: auto;
}

.friends-add-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.friends-add-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 13px;
}

.friends-add-row button {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--cyan-500);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: background var(--dur-fast);
  flex-shrink: 0;
}

.friends-add-row button:hover {
  background: var(--cyan-600);
}

.friend-section-label {
  padding: 10px 14px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

.friend-request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px;
}

.frq-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-request-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.friend-request-actions button {
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.btn-accept {
  background: var(--success-bg);
  color: var(--success);
}

.btn-accept:hover {
  background: #D3F0E4;
}

.btn-decline {
  background: var(--danger-bg);
  color: var(--danger);
}

.btn-decline:hover {
  background: #F9DAD4;
}

.friend-pending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.friend-pending-item button {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: underline;
  flex-shrink: 0;
}

.chat-admin-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
  height: 560px;
}

.chat-conv-list-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  height: 100%;
  overflow-y: auto;
  padding: 14px;
}

.chat-conv-list-wrap h3 {
  font-size: 14px;
  margin-bottom: 10px;
}

.chat-conv-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--dur-fast);
  margin-bottom: 4px;
}

.chat-conv-item:hover {
  background: var(--paper);
}

.chat-conv-item.active {
  background: var(--cyan-100);
}

.cc-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.cc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-900);
}

.chat-conv-item.unread .cc-name {
  font-weight: 800;
}

.cc-last {
  font-size: 12px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rose);
  flex-shrink: 0;
  margin-top: 4px;
}

.chat-admin-thread-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-admin-thread {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-admin-thread .chat-messages {
  flex: 1;
}

.msg-row {
  display: flex;
  flex-direction: column;
  max-width: 78%;
}

.msg-row.mine {
  align-self: flex-end;
  align-items: flex-end;
}

.msg-row.theirs {
  align-self: flex-start;
  align-items: flex-start;
}

.msg-row .chat-bubble {
  cursor: pointer;
  max-width: 100%;
}

.chat-bubble.recalled {
  font-style: italic;
  opacity: .65;
}

.msg-reply-quote {
  display: block;
  font-size: 10.5px;
  opacity: .85;
  border-left: 2px solid currentColor;
  padding-left: 6px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-actions {
  display: none;
  gap: 10px;
  padding: 3px 4px 0;
}

.msg-actions.open {
  display: flex;
}

.msg-action-link {
  font-size: 10.5px;
  color: var(--ink-soft);
  font-weight: 600;
}

.msg-action-link:hover {
  color: var(--cyan-600);
  text-decoration: underline;
}

.chat-input-wrap {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.reply-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  background: var(--cyan-100);
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--navy-800);
}

.reply-preview-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.reply-preview button {
  font-size: 14px;
  color: var(--ink-soft);
  flex-shrink: 0;
  line-height: 1;
}

.reply-preview button:hover {
  color: var(--danger);
}

.emoji-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 17px;
  transition: background var(--dur-fast);
}

.emoji-toggle-btn:hover {
  background: var(--paper);
}

.emoji-grid {
  display: none;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  max-height: 112px;
  overflow-y: auto;
  background: #fff;
}

.emoji-grid.open {
  display: grid;
}

.emoji-btn {
  font-size: 17px;
  padding: 4px 0;
  border-radius: 6px;
  transition: background var(--dur-fast);
  text-align: center;
}

.emoji-btn:hover {
  background: var(--paper);
}

.account-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--border);
}

.account-btn:hover {
  border-color: var(--cyan-500);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--navy-800);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
  flex-shrink: 0;
}

.account-name {
  font-size: 14px;
  font-weight: 600;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 190px;
  padding: 6px;
  display: none;
  flex-direction: column;
  z-index: 50;
}

.dropdown-panel.open {
  display: flex;
}

.dropdown-panel button {
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.dropdown-panel button:hover {
  background: var(--cyan-100);
  color: var(--cyan-600);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  transition: background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-spring), border-color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}

.btn-primary {
  background: var(--cyan-500);
  color: #fff;
}

.btn-primary:hover {
  background: var(--cyan-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--navy-800);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--navy-800);
  background: var(--paper);
}

.btn-lg {
  padding: 15px 30px;
  font-size: 15.5px;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 12.5px;
}

.btn-block {
  width: 100%;
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: .85;
  animation: spin .6s linear infinite;
  vertical-align: -2px;
}

button.is-loading {
  cursor: wait;
  opacity: .85;
}

.icon-action .btn-spinner,
.icon-btn .btn-spinner {
  width: 13px;
  height: 13px;
  border-width: 2px;
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.hero {
  position: relative;
  background: linear-gradient(160deg, var(--navy-900), var(--navy-800));
  overflow: hidden;
  padding: 76px 0 60px;
}

.hero-circuit {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-circuit .circuit-line {
  stroke-dasharray: 10 6;
  animation: dashTravel 1.8s linear infinite;
}

.hero-circuit .circuit-node {
  animation: pulseFade 2.6s ease-in-out infinite;
  transform-origin: center;
}

.hero-circuit .circuit-node:nth-of-type(2n) {
  animation-delay: .5s;
}

.hero-circuit .circuit-node:nth-of-type(3n) {
  animation-delay: 1s;
}

.hero-inner {
  position: relative;
  max-width: 640px;
}

.eyebrow {
  font-family: var(--font-mono);
  color: var(--cyan-500);
  font-size: 13px;
  letter-spacing: .14em;
  margin-bottom: 14px;
  animation: fadeSlideUp var(--dur-slow) var(--ease-out) both;
}

.hero h1 {
  color: #fff;
  font-size: clamp(28px, 4.4vw, 46px);
  line-height: 1.15;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -.01em;
  animation: fadeSlideUp var(--dur-slow) var(--ease-out) both .08s;
}

.hero-sub {
  color: #C5D2E5;
  font-size: 16.5px;
  line-height: 1.6;
  margin-bottom: 30px;
  max-width: 520px;
  animation: fadeSlideUp var(--dur-slow) var(--ease-out) both .16s;
}

.hero-inner .btn {
  animation: fadeSlideUp var(--dur-slow) var(--ease-out) both .24s;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 44px 0 20px;
}

.section-head h2 {
  font-size: 22px;
  font-weight: 700;
}

.view.container {
  padding-top: 32px;
  padding-bottom: 64px;
  min-height: 50vh;
}

.view {
  animation: fadeIn .35s var(--ease-out);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.narrow {
  max-width: 640px;
}

.checkout-width {
  max-width: 960px;
}

.filter-bar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.filter-chip {
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--paper);
  color: var(--ink-soft);
  border: 1px solid var(--border);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--cyan-500);
  color: var(--navy-800);
}

.filter-chip.active {
  background: var(--navy-800);
  color: #fff;
  border-color: var(--navy-800);
}

.filter-aux {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 2px;
  border-top: 1px dashed var(--border);
  margin-top: 2px;
  padding-top: 14px;
}

.filter-price {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-price input {
  width: 100px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.filter-price span {
  color: var(--ink-soft);
  font-size: 13px;
}

.filter-sort {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  color: var(--navy-800);
  margin-left: auto;
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-800);
  cursor: pointer;
}

.filter-clear {
  font-size: 12.5px;
  color: var(--cyan-600);
  font-weight: 600;
  text-decoration: underline;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding-bottom: 8px;
}

.product-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--dur-med) var(--ease-out), border-color var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
  position: relative;
  animation: fadeSlideUp var(--dur-med) var(--ease-out) both;
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--cyan-500);
  transform: translateY(-4px);
}

.product-card::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan-500);
  opacity: 0;
  transition: opacity var(--dur-fast);
  box-shadow: 0 0 0 3px rgba(35, 171, 219, .25);
}

.product-card:hover::after {
  opacity: 1;
}

.product-media {
  position: relative;
  aspect-ratio: 1/1;
  background: linear-gradient(135deg, var(--cyan-100), #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.product-emoji {
  font-size: 56px;
  transition: transform var(--dur-med) var(--ease-out);
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.product-card:hover .product-img {
  transform: scale(1.07);
}

.product-card:hover .product-emoji {
  transform: scale(1.1) rotate(-3deg);
}

.cat-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(26, 44, 77, .82);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.wishlist-heart {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
  z-index: 2;
  transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-spring);
}

.wishlist-heart:hover {
  transform: scale(1.1);
  color: var(--rose);
}

.wishlist-heart.active {
  color: var(--rose);
}

.wishlist-heart.active svg {
  fill: var(--rose);
}

.wishlist-heart.pop svg {
  animation: heartBeat .5s var(--ease-spring);
}

.product-body {
  padding: 14px 16px 16px;
}

.product-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
  transition: color var(--dur-fast);
}

.product-name:hover {
  color: var(--cyan-600);
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
  min-height: 16px;
}

.rating-stars {
  display: inline-flex;
  gap: 1px;
  color: var(--gold);
  flex-shrink: 0;
}

.rating-stars svg {
  width: 13px;
  height: 13px;
}

.rating-count {
  font-size: 11.5px;
  color: var(--ink-soft);
}

.rating-row.lg .rating-stars svg {
  width: 19px;
  height: 19px;
}

.rating-row.lg {
  gap: 8px;
  margin-bottom: 14px;
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  margin-bottom: 10px;
}

.stock-badge .node {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
}

.stock-badge.in {
  color: var(--success);
}

.stock-badge.low {
  color: var(--warning);
}

.stock-badge.low .node {
  background: var(--warning);
}

.stock-badge.out {
  color: var(--ink-soft);
}

.stock-badge.out .node {
  background: #B7C0CE;
}

.product-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--navy-900);
}

.product-actions {
  display: flex;
  gap: 8px;
}

.product-actions .btn-add,
.product-actions .btn-buy-now {
  flex: 1;
  text-align: center;
  padding: 9px 10px;
}

.btn-add {
  background: var(--navy-800);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-spring);
}

.btn-add:hover {
  background: var(--cyan-600);
}

.btn-add:disabled {
  background: #CBD4E1;
  cursor: not-allowed;
}

.btn-add.added {
  background: var(--success);
}

.btn-buy-now {
  background: var(--cyan-500);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  transition: background var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast) var(--ease-spring);
}

.btn-buy-now:hover {
  background: var(--cyan-600);
  box-shadow: var(--shadow-glow);
}

.btn-buy-now:disabled {
  background: #CBD4E1;
  cursor: not-allowed;
  box-shadow: none;
}

.empty-msg {
  color: var(--ink-soft);
  padding: 40px 0;
  text-align: center;
  grid-column: 1/-1;
  animation: fadeSlideUp var(--dur-med) var(--ease-out);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 50, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  backdrop-filter: blur(2px);
  animation: fadeSlideUp var(--dur-fast) var(--ease-out);
}

.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: popIn var(--dur-med) var(--ease-spring);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-spring);
}

.modal-close:hover {
  background: var(--cyan-100);
  transform: rotate(90deg);
}

.modal-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.modal-media {
  position: relative;
  background: linear-gradient(135deg, var(--cyan-100), #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 90px;
  min-height: 280px;
  overflow: hidden;
}

.modal-media-wrap {
  position: relative;
}

.media-carousel {
  touch-action: pan-y;
}

.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform .38s var(--ease-out);
  cursor: grab;
}

.carousel-track:active {
  cursor: grabbing;
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.carousel-slide img,
.carousel-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: var(--navy-800);
  box-shadow: var(--shadow-sm);
  z-index: 3;
  transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-spring);
  line-height: 1;
}

.carousel-arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.1);
}

.carousel-arrow.prev {
  left: 12px;
}

.carousel-arrow.next {
  right: 12px;
}

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 3;
}

.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .65);
  cursor: pointer;
  transition: width var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}

.carousel-dot.active {
  background: #fff;
  width: 20px;
}

.media-count-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(26, 44, 77, .75);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
}

.modal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-info {
  padding: 28px 30px;
}

.modal-info h2 {
  font-size: 22px;
  margin: 10px 0 10px;
}

.modal-desc {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 14px 0 18px;
}

.modal-price {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: 20px;
}

.modal-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 26px 0 0;
  padding: 0 30px;
}

.modal-tab-btn {
  padding: 12px 4px;
  margin-right: 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--dur-fast);
}

.modal-tab-btn.active {
  color: var(--navy-900);
  border-color: var(--cyan-500);
}

.modal-tab-panel {
  padding: 20px 30px 28px;
}

.review-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 18px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.review-summary .avg-num {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  color: var(--navy-900);
  line-height: 1;
}

.review-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.review-item:last-child {
  border-bottom: none;
}

.review-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.review-author {
  font-weight: 600;
  font-size: 13.5px;
}

.review-date {
  font-size: 12px;
  color: var(--ink-soft);
}

.review-comment {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.star-input {
  display: inline-flex;
  gap: 4px;
}

.star-input button {
  color: #D8DFE9;
  transition: color var(--dur-fast), transform var(--dur-fast) var(--ease-spring);
}

.star-input button svg {
  width: 26px;
  height: 26px;
}

.star-input button.on {
  color: var(--gold);
}

.star-input button:hover {
  transform: scale(1.15);
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-actions .btn {
  flex: 1;
}

.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 600;
}

.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.qty-control button {
  width: 34px;
  height: 34px;
  font-size: 17px;
  color: var(--navy-800);
}

.qty-control button:hover {
  background: var(--cyan-100);
}

.qty-control input {
  width: 44px;
  text-align: center;
  border: none;
  -moz-appearance: textfield;
}

.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.cart-row {
  display: grid;
  grid-template-columns: 64px 1fr auto auto 32px;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  position: relative;
  animation: fadeSlideUp var(--dur-med) var(--ease-out) both;
  transition: box-shadow var(--dur-fast);
}

.cart-row:hover {
  box-shadow: var(--shadow-sm);
}

.cart-row-media {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--cyan-100), #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.cart-row-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-row-name {
  font-weight: 600;
  font-size: 14.5px;
  margin-bottom: 4px;
}

.cart-row-price {
  color: var(--ink-soft);
  font-size: 13px;
}

.cart-row-subtotal {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--navy-900);
  min-width: 96px;
  text-align: right;
  transition: color var(--dur-fast);
}

.cart-row-remove {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--ink-soft);
  font-size: 14px;
  transition: background var(--dur-fast), color var(--dur-fast);
}

.cart-row-remove:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.cart-summary {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  max-width: 360px;
  margin-left: auto;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  margin-bottom: 16px;
}

.cart-total-row strong {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--navy-900);
}

.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  animation: fadeSlideUp var(--dur-med) var(--ease-out);
}

.voucher-box {
  margin-bottom: 18px;
}

.voucher-row {
  display: flex;
  gap: 8px;
}

.voucher-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 14px;
  font-size: 16px;
  text-transform: uppercase;
}

.voucher-row input::placeholder {
  text-transform: none;
}

.voucher-row .btn {
  flex-shrink: 0;
  padding: 11px 18px;
}

.voucher-save-link {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cyan-600);
  text-decoration: underline;
}

.saved-voucher-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.saved-voucher-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--cyan-100);
  border: 1px dashed var(--cyan-500);
  border-radius: 10px;
  padding: 8px 8px 8px 12px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-spring);
}

.saved-voucher-chip:hover {
  background: #D7F0F9;
  transform: translateY(-1px);
}

.saved-voucher-chip .sv-code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--navy-900);
}

.saved-voucher-chip .sv-off {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--cyan-600);
}

.saved-voucher-chip .sv-remove {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 10px;
  transition: background var(--dur-fast), color var(--dur-fast);
}

.saved-voucher-chip .sv-remove:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.voucher-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--success-bg);
  color: var(--success);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 600;
  animation: popIn var(--dur-med) var(--ease-spring);
}

.voucher-applied button {
  color: var(--success);
  text-decoration: underline;
  font-weight: 600;
  font-size: 12.5px;
}

.voucher-hint {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 6px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  padding: 5px 0;
  color: var(--ink-soft);
}

.summary-line.discount {
  color: var(--success);
}

.buynow-note {
  background: var(--cyan-100);
  color: var(--cyan-600);
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 10px;
  margin-bottom: 14px;
}

.buynow-note a {
  text-decoration: underline;
  cursor: pointer;
}

.bank-info-box {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: -6px 0 20px;
  animation: fadeSlideUp var(--dur-med) var(--ease-out);
}

.bank-info-title {
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 10px;
}

.bank-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
}

.bank-info-row:last-of-type {
  border-bottom: none;
}

.bank-info-row strong {
  font-family: var(--font-mono);
  color: var(--navy-900);
}

.order-bank-reminder {
  background: var(--warning-bg);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 12.5px;
}

.order-bank-reminder p {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--warning);
}

.order-bank-reminder .bank-info-row {
  border-bottom: 1px dashed rgba(0, 0, 0, .08);
}

.bank-reminder-body {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.bank-qr-img {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  border: 1px solid rgba(0, 0, 0, .08);
}

.bank-reminder-details {
  flex: 1;
  min-width: 0;
}

.order-bank-reminder p.qr-hint {
  margin: 8px 0 0;
  font-weight: 600;
  color: var(--ink-soft);
}

.order-review-reminder {
  background: #EDEFF3;
  color: var(--ink-soft);
  border-radius: 10px;
  padding: 11px 14px;
  margin: 12px 0;
  font-size: 12.5px;
  font-weight: 600;
}

.order-cancelled-banner {
  background: #F1E4E4;
  color: #8a4a4a;
  border-radius: 10px;
  padding: 11px 14px;
  margin: 12px 0;
  font-size: 12.5px;
  font-weight: 600;
}

.order-delivery-confirm {
  background: var(--cyan-100);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.order-delivery-confirm p {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cyan-600);
}

.order-cancel-btn {
  margin-top: 12px;
  width: 100%;
}

.form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.form-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: 16px;
  min-width: 0;
}

.form-card input[type=text],
.form-card input[type=email],
.form-card input[type=password],
.form-card input[type=tel],
.form-card input[type=number],
.form-card textarea,
.form-card select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-weight: 400;
  color: var(--ink);
  background: #fff;
  width: 100%;
  min-width: 0;
}

.form-card input:focus,
.form-card textarea:focus,
.form-card select:focus {
  border-color: var(--cyan-500);
  outline: none;
}

.form-card select:disabled {
  background: var(--paper);
  color: var(--ink-soft);
  cursor: not-allowed;
}

.combo {
  position: relative;
}

.form-card .combo-input:disabled {
  background: var(--paper);
  color: var(--ink-soft);
  cursor: not-allowed;
}

.combo-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}

.combo-panel.open {
  display: block;
}

.combo-option {
  padding: 10px 14px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.combo-option:hover {
  background: var(--cyan-100);
  color: var(--cyan-600);
}

.combo-empty {
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.form-card input[type=number] {
  -moz-appearance: textfield;
}

.form-card input[type=number]::-webkit-outer-spin-button,
.form-card input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pw-field {
  position: relative;
}

.pw-field input {
  padding-right: 42px !important;
}

.pw-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 8px;
  margin: 0;
  cursor: pointer;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  line-height: 0;
}

.pw-toggle:hover {
  color: var(--navy-800);
  background: var(--paper);
}

.pw-toggle svg {
  width: 18px;
  height: 18px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.checkbox-row,
.radio-row {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  font-weight: 500 !important;
}

.payment-choice {
  border: none;
  padding: 0;
  margin: 0 0 20px;
}

.payment-choice legend {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: 10px;
  padding: 0;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.auth-box {
  max-width: 420px;
  margin: 0 auto;
}

.auth-box h2 {
  margin-bottom: 22px;
  text-align: center;
}

.auth-switch {
  text-align: center;
  font-size: 14px;
  margin-top: 16px;
  color: var(--ink-soft);
}

.auth-switch a {
  color: var(--cyan-600);
  font-weight: 600;
}

.demo-hint {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  line-height: 1.6;
}

.btn-google {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-google:hover {
  border-color: var(--navy-700);
  background: var(--paper);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--ink-soft);
  font-size: 12.5px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  align-items: start;
}

.checkout-side h3 {
  font-size: 15px;
  margin-bottom: 14px;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.checkout-total {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
  padding-top: 14px;
  color: var(--navy-900);
}

.order-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 14px;
  animation: fadeSlideUp var(--dur-med) var(--ease-out) both;
  transition: box-shadow var(--dur-fast);
}

.order-card:hover {
  box-shadow: var(--shadow-sm);
}

.order-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.order-id {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--navy-800);
}

.order-status {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
}

.status-advance-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast) var(--ease-out);
}

.status-advance-btn:hover {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .06);
  transform: translateY(-1px);
}

.status-advance-btn .advance-arrow {
  opacity: .55;
  font-size: 11px;
}

.status-review {
  background: #EDEFF3;
  color: var(--ink-soft);
}

.status-pending {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-cancelled {
  background: #F1E4E4;
  color: #8a4a4a;
}

.status-processing {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-shipping {
  background: var(--cyan-100);
  color: var(--cyan-600);
}

.status-done {
  background: var(--success-bg);
  color: var(--success);
}

.order-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--ink-soft);
  padding: 4px 0;
}

.order-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--ink-soft);
}

.order-foot strong {
  color: var(--navy-900);
  font-family: var(--font-display);
  font-size: 16px;
}

.order-timeline {
  display: flex;
  align-items: flex-start;
  margin: 16px 0 18px;
  padding: 4px 2px;
}

.timeline-step {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 7px;
}

.timeline-step .dot {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #E7ECF3;
  border: 2px solid #E7ECF3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  flex-shrink: 0;
  transition: background var(--dur-med) var(--ease-out), border-color var(--dur-med) var(--ease-out);
  z-index: 1;
}

.timeline-step .line {
  position: absolute;
  top: 9px;
  left: calc(-50% + 10px);
  width: calc(100% - 20px);
  height: 2px;
  background: #E7ECF3;
  z-index: 0;
}

.timeline-step:first-child .line {
  display: none;
}

.timeline-step .lbl {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.3;
}

.timeline-step.done .dot {
  background: var(--cyan-500);
  border-color: var(--cyan-500);
}

.timeline-step.done .line {
  background: var(--cyan-500);
}

.timeline-step.done .lbl {
  color: var(--navy-800);
}

.timeline-step.current .dot {
  background: var(--navy-900);
  border-color: var(--navy-900);
}

.timeline-step.current .dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--navy-900);
  animation: ringPulse 1.8s ease-out infinite;
}

.timeline-step.current .lbl {
  color: var(--navy-900);
  font-weight: 700;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: box-shadow var(--dur-fast), transform var(--dur-fast);
  animation: fadeSlideUp var(--dur-med) var(--ease-out) both;
}

.stat-card-alert {
  background: var(--gold-bg);
  border-color: var(--gold);
}

.stat-card-alert .stat-label {
  color: var(--gold);
}

.stat-card-alert .stat-value {
  color: #8a6414;
}

.stat-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.stat-label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 8px;
}

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--navy-900);
}

.admin-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color var(--dur-fast);
}

.tab-btn.active {
  color: var(--navy-900);
  border-color: var(--cyan-500);
}

.admin-panel {
  animation: fadeSlideUp var(--dur-med) var(--ease-out);
}

.admin-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
}

.admin-list-wrap h3 {
  font-size: 15px;
  margin-bottom: 14px;
}

.admin-list-wrap {
  overflow-x: auto;
}

.admin-list-wrap .admin-table {
  min-width: 640px;
}

.media-upload-section {
  margin-bottom: 18px;
}

.media-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.media-upload-item {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--border);
}

.media-upload-item img,
.media-upload-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-upload-item .cover-tag {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(26, 44, 77, .75);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  padding: 2px 0;
}

.media-upload-item .remove-media-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast);
}

.media-upload-item .remove-media-btn:hover {
  background: var(--danger);
}

.image-preview {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  overflow: hidden;
  flex-shrink: 0;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-label {
  display: inline-block;
  background: var(--paper);
  border: 1px solid var(--border);
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-800);
  transition: border-color var(--dur-fast);
}

.file-label:hover {
  border-color: var(--cyan-500);
}

.hint-text {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 6px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.admin-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-soft);
  padding: 12px 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr {
  transition: background var(--dur-fast);
}

.admin-table tbody tr:hover {
  background: var(--paper);
}

.row-needs-review {
  background: var(--gold-bg);
}

.row-needs-review:hover {
  background: #F8ECC7;
}

/* Đơn vừa được mở từ thông báo / nút trong email: nháy nhẹ để dễ thấy giữa danh sách dài */
.order-card.order-flash {
  animation: fadeSlideUp var(--dur-med) var(--ease-out) both, orderFlash 3.4s ease-out 1;
}

.admin-table tr.order-flash>td {
  animation: rowFlash 3.4s ease-out 1;
}

@keyframes orderFlash {

  0%,
  60% {
    outline: 3px solid var(--cyan-500);
    outline-offset: 3px;
  }

  100% {
    outline: 3px solid rgba(35, 171, 219, 0);
    outline-offset: 3px;
  }
}

@keyframes rowFlash {

  0%,
  60% {
    box-shadow: inset 0 2px 0 var(--cyan-500), inset 0 -2px 0 var(--cyan-500), inset 0 0 0 999px rgba(35, 171, 219, .14);
  }

  100% {
    box-shadow: inset 0 2px 0 rgba(35, 171, 219, 0), inset 0 -2px 0 rgba(35, 171, 219, 0), inset 0 0 0 999px rgba(35, 171, 219, 0);
  }
}

.cell-media img,
.cell-media .product-emoji {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.cell-media .product-emoji {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cyan-100);
}

.cell-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.icon-action {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-spring);
}

.icon-action:hover {
  background: var(--cyan-100);
  transform: translateY(-1px);
}

.icon-action.danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.role-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.role-badge.admin {
  background: var(--navy-800);
  color: #fff;
}

.role-badge.user {
  background: var(--cyan-100);
  color: var(--cyan-600);
}

.voucher-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.voucher-status-badge.on {
  background: var(--success-bg);
  color: var(--success);
}

.voucher-status-badge.off {
  background: #EDEFF3;
  color: var(--ink-soft);
}

.status-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 600;
  background: #fff;
}

.you-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--cyan-600);
  margin-left: 6px;
}

.avatar-lg {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--navy-800);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-display);
  flex-shrink: 0;
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.profile-summary h3 {
  font-size: 18px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-summary p {
  color: var(--ink-soft);
  font-size: 13.5px;
}

.form-card h3 {
  font-size: 15.5px;
  margin-bottom: 18px;
}

.form-card input:disabled {
  background: var(--paper);
  color: var(--ink-soft);
  cursor: not-allowed;
}

.danger-zone {
  border-color: var(--danger-bg);
}

.danger-zone h3 {
  color: var(--danger);
}

.profile-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 28px;
  align-items: start;
}

.profile-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: left;
  width: 100%;
  transition: background .15s, color .15s;
}

.profile-nav-btn:hover {
  background: var(--paper);
  color: var(--navy-800);
}

.profile-nav-btn.active {
  background: var(--navy-800);
  color: #fff;
}

.profile-content {
  max-width: 560px;
}

.profile-panel {
  animation: fadeIn .25s ease;
}

.footer {
  background: var(--navy-900);
  color: #C5D2E5;
  margin-top: 60px;
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-logo {
  height: 34px;
  width: 34px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.footer-brand p {
  font-size: 13px;
  color: #8DA1BF;
}

.footer-copy {
  font-size: 12.5px;
  color: #7186A5;
}

.conn-banner {
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 10px 16px;
  display: none;
}

.conn-banner.show {
  display: block;
  animation: fadeSlideUp var(--dur-med) var(--ease-out);
}

.setup-banner {
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 12px 16px;
  display: none;
}

.setup-banner.show {
  display: block;
  animation: fadeSlideUp var(--dur-med) var(--ease-out);
}

@media (max-width:860px) {
  .modal-content-grid {
    grid-template-columns: 1fr;
  }

  .modal-media {
    min-height: 200px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .chat-admin-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .chat-conv-list-wrap {
    max-height: 200px;
  }

  .chat-admin-thread-wrap {
    height: 440px;
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .profile-nav-btn {
    width: auto;
  }

  .checkout-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width:700px) {
  .search-bar {
    display: none;
  }

  .header-inner {
    height: 64px;
  }

  .nav-actions {
    gap: 2px;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
  }

  .hamburger {
    display: flex;
  }

  .header.mobile-open .search-bar {
    display: flex;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0 16px 0 20px;
    max-width: none;
    background: #fff;
    box-shadow: var(--shadow-md);
    border-radius: 0;
    height: 60px;
    border-bottom: 1px solid var(--border);
  }

  .hero {
    padding: 52px 0 40px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  .product-emoji {
    font-size: 40px;
  }

  .form-row-2 {
    grid-template-columns: 1fr;
  }

  .account-name {
    display: none;
  }

  .cart-row {
    grid-template-columns: 56px 1fr;
    row-gap: 8px;
    padding-right: 40px;
  }

  .cart-row-subtotal {
    grid-column: 2;
    text-align: left;
  }

  .qty-control {
    grid-column: 2;
  }

  .cart-row-remove {
    position: absolute;
    top: 12px;
    right: 12px;
  }

  .filter-sort {
    margin-left: 0;
    width: 100%;
  }

  .filter-price {
    width: 100%;
  }

  .filter-price input {
    flex: 1;
    width: auto;
  }

  .timeline-step .lbl {
    font-size: 9.5px;
  }

  .bank-reminder-body {
    flex-direction: column;
  }

  .chat-panel {
    width: min(346px, calc(100vw - 32px));
  }

  .chat-tab-panel {
    height: min(60vh, 380px);
  }

  .bank-qr-img {
    width: 150px;
    height: 150px;
    align-self: center;
  }

  .modal-tabs {
    padding: 0 20px;
  }

  .modal-tab-panel {
    padding: 16px 20px 24px;
  }

  .voucher-row {
    flex-direction: column;
  }

  .review-summary {
    flex-wrap: wrap;
  }
}

/* ===== Form thêm/sửa sản phẩm chi tiết + ảnh/video ===== */
.admin-grid.admin-grid-product {
  grid-template-columns: 1fr;
}

.pf-form {
  padding: 28px 30px;
}

.pf-section {
  padding: 22px 0 6px;
  border-top: 1px solid var(--border);
}

.pf-section:first-of-type {
  margin-top: 6px;
}

.pf-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--navy-900);
  margin: 0 0 6px;
}

.pf-step {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--navy-800);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pf-section-hint {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 0 0 16px;
}

.pf-field {
  margin-top: 6px;
  margin-bottom: 16px;
}

.pf-field-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: 6px;
}

.pf-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--paper);
  padding: 22px 16px;
  text-align: center;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.pf-dropzone.dragover {
  border-color: var(--cyan-500);
  background: var(--cyan-100);
}

.pf-drop-icon {
  font-size: 30px;
  line-height: 1;
  margin-bottom: 6px;
}

.pf-drop-or {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
}

.pf-dropzone .file-label {
  display: inline-flex;
  margin: 8px 0 0;
  cursor: pointer;
}

.pf-form .media-upload-grid {
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  margin: 14px 0 6px;
}

.media-upload-item.is-video {
  background: #0F1A30;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-upload-item.is-video img {
  position: absolute;
  inset: 0;
  opacity: .55;
}

.video-chip {
  position: relative;
  z-index: 1;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.media-upload-item .set-cover-btn {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: var(--gold);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-upload-item .set-cover-btn:hover {
  background: var(--gold);
  color: #fff;
}

.video-add-row {
  display: flex;
  gap: 8px;
}

.video-add-row input {
  flex: 1;
  min-width: 0;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.pf-price-hint {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--success);
  min-height: 18px;
  margin: -6px 0 14px;
}

.pf-price-hint.warn {
  color: var(--danger);
}

.pf-char-count {
  font-weight: 500;
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-left: 6px;
}

.spec-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr 32px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.pf-actions {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.admin-sub {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* ===== Video trong carousel ===== */
.carousel-slide.video-slide {
  background: #000;
}

.carousel-slide video {
  object-fit: contain;
  background: #000;
}

.carousel-slide iframe {
  width: 100%;
  height: 100%;
  min-height: 280px;
  border: 0;
  background: #000;
}

.video-poster {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  background: #000;
  cursor: pointer;
}

.video-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .85;
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--navy-900);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
  box-shadow: var(--shadow-md);
}

.carousel-dot.is-video {
  border-radius: 2px;
}

/* ===== Giá gốc, giảm giá, thông tin chi tiết trong modal ===== */
.price-old {
  text-decoration: line-through;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: .72em;
  margin-left: 8px;
}

.discount-tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: var(--rose);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  z-index: 2;
}

.modal-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  margin: 12px 0 0;
  padding: 12px 14px;
  background: var(--paper);
  border-radius: 10px;
  font-size: 12.5px;
}

.modal-meta dt {
  color: var(--ink-soft);
}

.modal-meta dd {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}

.highlight-list {
  margin: 0 0 16px;
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.highlight-list li {
  margin: 4px 0;
}

.modal-desc.pre {
  white-space: pre-line;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.spec-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.spec-table td:first-child {
  width: 38%;
  background: var(--paper);
  font-weight: 600;
  color: var(--navy-800);
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.tag-chip {
  background: var(--cyan-100);
  color: var(--cyan-600);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

@media (max-width:700px) {
  .pf-form {
    padding: 20px 16px;
  }

  .form-row-3 {
    grid-template-columns: 1fr;
  }

  .video-add-row {
    flex-direction: column;
  }

  .spec-row {
    grid-template-columns: 1fr 32px;
  }

  .spec-row .spec-v {
    grid-column: 1;
  }

  .spec-row .icon-action {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

/* ==== UX-REFRESH START ==== */
/* Lớp giao diện làm mới (UI/UX v2). Nằm cuối file để ghi đè có chủ đích các quy tắc phía trên. */

[hidden] { display: none !important; }
html.modal-open { overflow: hidden; }

.skip-link {
  position: fixed;
  left: 12px;
  top: -64px;
  z-index: 1000;
  background: var(--navy-900);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: 12px; }
main:focus { outline: none; }

/* ---------- Tiện ích dùng chung ---------- */
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 2px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cyan-600);
}
.link-btn:hover { color: var(--navy-800); text-decoration: underline; }

.section-count {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
}

.nw { white-space: nowrap; }

.empty-ico { font-size: 46px; line-height: 1; }
.empty-state h3 { font-size: 19px; }
.empty-state p { max-width: 400px; line-height: 1.55; }

/* ---------- Giá ---------- */
.price-now,
.price-old { white-space: nowrap; }
.product-price .price-old { margin-left: 0; }

/* ---------- Header & điều hướng (desktop) ---------- */
.main-nav-link svg { display: none; }
.nav-mobile-only { display: none; }

/* Thanh tìm kiếm phải co được (trước đây có chiều rộng tối thiểu nên header tràn ở 701–860px) */
.search-bar { min-width: 0; }
.search-bar input { min-width: 0; width: 100%; }
@media (max-width: 900px) {
  #accountMenu .btn-primary { display: none; } /* màn hẹp: Đăng ký nằm trong trang Đăng nhập */
}

@media (min-width: 701px) {
  .header-inner { height: 68px; }
  .main-nav { padding-top: 2px; padding-bottom: 2px; }
}

/* ---------- Khung mobile: header gọn + thanh tab dưới ---------- */
@media (max-width: 700px) {
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .container { padding: 0 16px; }

  .header-inner { height: 60px; gap: 8px; }
  .logo-mark { width: 38px; height: 38px; }

  /* Thanh tìm kiếm luôn hiện thay vì ẩn sau nút menu */
  .search-bar {
    display: flex;
    flex: 1;
    min-width: 0;
    max-width: none;
    height: 42px;
    padding: 0 3px 0 14px;
  }
  .search-bar input { min-width: 0; }
  .hamburger { display: none !important; }
  .hide-mobile { display: none !important; }

  .nav-actions { gap: 0; margin-left: 0; }
  .icon-btn { width: 40px; height: 40px; }
  .account-btn { padding: 3px; }
  .avatar { width: 32px; height: 32px; }

  /* Chưa đăng nhập: bỏ chuông + chat, chỉ còn nút Đăng nhập (Đăng ký nằm ở màn Đăng nhập & tab "Tôi") */
  body:not(.is-auth) .notif-dropdown,
  body:not(.is-auth) .chat-dropdown { display: none; }
  #accountMenu .btn-primary { display: none; }
  #accountMenu .btn-ghost { height: 40px; padding: 0 14px; font-size: 13px; }

  /* Bảng thả xuống: bung ngang gọn trong màn hình, không tràn ra ngoài */
  .dropdown-panel.notif-panel,
  .dropdown-panel.chat-panel {
    position: fixed;
    top: 66px;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 150px);
  }
  #dropdownPanel {
    position: fixed;
    top: 66px;
    right: 10px;
    left: auto;
    min-width: 210px;
  }

  /* Thanh tab cố định dưới đáy màn hình */
  .main-nav-wrap {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    background: rgba(255, 255, 255, .97);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 22px rgba(26, 44, 77, .08);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .main-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    padding: 0;
    max-width: none;
  }
  .nav-mobile-only { display: flex; }
  .main-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 58px;
    padding: 8px 2px 7px;
    font-size: 11px;
    font-weight: 600;
  }
  .main-nav-link svg { display: block; width: 22px; height: 22px; }
  .main-nav-link.active::after {
    left: 28%;
    right: 28%;
    top: 0;
    bottom: auto;
    height: 3px;
    border-radius: 0 0 3px 3px;
  }
  .main-nav-link .badge { top: 4px; right: calc(50% - 24px); }

  .toast { bottom: calc(78px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); }

  /* iOS tự phóng to khi ô nhập < 16px — ép 16px để trang không bị nhảy zoom */
  input:not([type=checkbox]):not([type=radio]):not([type=range]),
  select,
  textarea { font-size: 16px !important; }

  .view.container { padding-top: 20px; padding-bottom: 36px; }
  .section-head { margin: 28px 0 14px; }
  .section-head h2 { font-size: 20px; }
  .view.container > .section-head:first-child { margin-top: 0; }
  .footer { margin-top: 36px; padding: 28px 0; }
}

/* ---------- Thẻ sản phẩm ---------- */
.product-grid { gap: 18px; }

.product-card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  container-type: inline-size;
}
.product-card::after { display: none; }

@media (hover: hover) {
  .product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: #BFE6F4;
  }
}
@media (hover: none) {
  .product-card:hover { transform: none; box-shadow: none; border-color: var(--border); }
  .product-card:hover .product-img,
  .product-card:hover .product-emoji { transform: none; }
}

.product-media { flex-shrink: 0; }

.discount-tag {
  position: absolute;
  left: 10px;
  top: 10px;
  bottom: auto;
  z-index: 2;
  background: var(--rose);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(224, 80, 126, .35);
}

/* Huy hiệu đếm ảnh/video chỉ có nghĩa trên thẻ sản phẩm; ở giỏ hàng/bảng admin thì ẩn (tránh lơ lửng sai chỗ) */
.media-count-badge { display: none; }
.product-media .media-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  bottom: 10px;
  right: 10px;
  z-index: 1;
}

.soldout-ribbon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  background: rgba(26, 44, 77, .9);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.product-card.is-soldout .product-img,
.product-card.is-soldout .product-emoji { filter: grayscale(1); opacity: .5; }

.product-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 12px 14px 14px;
}

.product-cat {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--cyan-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-name {
  font-size: 14.5px;
  line-height: 1.35;
  min-height: calc(1.35em * 2);
  margin-bottom: 6px;
}
.product-name:focus-visible { outline-offset: 3px; }

.product-card .rating-row { margin-bottom: 6px; }
.product-card .stock-badge { margin-bottom: 6px; }
.product-card .stock-badge.in { display: none; } /* "Còn hàng" là trạng thái mặc định — chỉ nêu khi sắp hết/hết */

.product-footer { margin-top: auto; gap: 10px; padding-top: 4px; }

.product-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
  row-gap: 0;
  font-size: 17px;
  line-height: 1.3;
}
.product-price .price-old { font-size: 12.5px; }

.product-actions { gap: 8px; }

.btn-add,
.btn-buy-now {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  min-width: 0;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 999px;
}
.product-actions .btn-add,
.product-actions .btn-buy-now { padding: 0 12px; }

/* "Thêm" là hành động phụ (viền), "Mua ngay" là hành động chính (đặc) */
.btn-add {
  flex: 1 1 0;
  background: #fff;
  color: var(--navy-800);
  border: 1.5px solid var(--border);
}
.btn-add:hover { background: var(--paper); border-color: var(--navy-800); }
.btn-add .ic-check,
.btn-add .lbl-added { display: none; }
.btn-add.added {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.btn-add.added .ic-cart,
.btn-add.added .lbl-add { display: none; }
.btn-add.added .ic-check,
.btn-add.added .lbl-added { display: inline; }
.btn-add:disabled,
.btn-buy-now:disabled {
  background: #EEF2F7;
  color: #9AA7BA;
  border-color: #E3E9F1;
  box-shadow: none;
  cursor: not-allowed;
}

/* Thẻ hẹp (điện thoại, lưới dày): nút "Thêm" chỉ còn biểu tượng, gọn mà không rớt dòng */
@container (max-width: 205px) {
  .product-body { padding: 10px 11px 12px; }
  .product-name { font-size: 13.5px; }
  .product-price { font-size: 15.5px; }
  /* Dùng .product-actions … để thắng quy tắc gốc ".product-actions .btn-add { flex: 1 }" (độ ưu tiên cao hơn ".btn-add") */
  .product-actions .btn-add { flex: 0 0 40px; width: 40px; padding: 0 !important; }
  .btn-add .lbl-add,
  .btn-add .lbl-added { display: none !important; }
  .product-actions .btn-buy-now { flex: 1 1 0; padding: 0 8px !important; }
}

/* ---------- Trang chủ ---------- */
.hero h1 { text-wrap: balance; }

.section-head h2 + .section-count { margin: 0 auto 0 12px; }

.home-cats-sec { margin-top: 28px; }
.home-cats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.cat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.cat-card:hover {
  border-color: var(--cyan-500);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.cat-card-ico {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border-radius: 12px;
  background: var(--cyan-100);
}
.cat-card-txt { display: flex; flex-direction: column; min-width: 0; }
.cat-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-card-n { font-size: 12px; color: var(--ink-soft); }

.featured-more { display: flex; justify-content: center; margin-top: 28px; }

/* ---------- Trang sản phẩm + bộ lọc ---------- */
.filter-bar { border-radius: 16px; padding: 14px 16px; gap: 12px; }
.filter-clear { display: none; }
.filter-bar.has-filters .filter-clear { display: inline; }
.filter-price input { min-width: 0; }
.filter-sort { cursor: pointer; }

@media (min-width: 701px) {
  .view.container > .section-head:first-child { margin-top: 8px; }
}

@media (max-width: 700px) {
  .hero { padding: 40px 0 34px; }
  .hero h1 { font-size: 25px; }
  .hero-sub { font-size: 15px; margin-bottom: 22px; }

  .product-grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 12px; }

  /* Danh mục ở trang chủ: vuốt ngang */
  .home-cats {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin: 0 -16px;
    padding: 2px 16px 6px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .home-cats::-webkit-scrollbar { display: none; }
  .cat-card { flex: 0 0 auto; min-width: 160px; scroll-snap-align: start; }

  /* Bộ lọc: chip vuốt ngang, các ô còn lại xếp gọn */
  .filter-bar { padding: 12px; }
  .filter-chips {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -12px;
    padding: 0 12px 4px;
    scrollbar-width: none;
  }
  .filter-chips::-webkit-scrollbar { display: none; }
  .filter-aux { gap: 10px 14px; }
  .filter-price { flex: 1 1 100%; }
}

/* ---------- Cửa sổ chi tiết sản phẩm ---------- */
#productModal.modal-overlay { padding: 24px; }
#productModal .modal-box {
  display: flex;
  flex-direction: column;
  max-width: 1020px;
  max-height: min(92vh, 880px);
  overflow: hidden;
  border-radius: 24px;
}
#productModalContent {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
#productModal .modal-close {
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  z-index: 20;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.pm {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  grid-template-areas:
    "gallery info"
    "gallery buy"
    "gallery details"
    "tabs    tabs";
  column-gap: 32px;
  align-items: start;
}
.pm-gallery { grid-area: gallery; position: sticky; top: 0; margin: 28px 0 0 28px; }
.pm-info { grid-area: info; padding: 28px 28px 0 0; }
.pm-buy { grid-area: buy; padding: 6px 28px 0 0; }
.pm-details { grid-area: details; padding: 6px 28px 0 0; }
.pm-tabs { grid-area: tabs; margin-top: 28px; padding-bottom: 8px; }

/* Thư viện ảnh/video */
.pm-gallery .modal-media {
  aspect-ratio: 1 / 1;
  min-height: 0;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #F4F7FB;
}
.pm-gallery .carousel-track { height: 100%; }
.pm-gallery .carousel-slide { min-height: 0; }
.pm-gallery .carousel-slide img { object-fit: contain; }
.pm-gallery .wishlist-heart { top: 12px; right: 12px; width: 38px; height: 38px; }

.carousel-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  background: rgba(26, 44, 77, .72);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.carousel-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.carousel-thumbs::-webkit-scrollbar { display: none; }
.carousel-thumb {
  position: relative;
  flex: 0 0 64px;
  height: 64px;
  overflow: hidden;
  background: #F4F7FB;
  border: 2px solid transparent;
  border-radius: 10px;
  opacity: .72;
  transition: opacity var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.carousel-thumb:hover { opacity: 1; }
.carousel-thumb.active { opacity: 1; border-color: var(--cyan-500); }
.carousel-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 26, 48, .45);
  color: #fff;
  font-size: 15px;
}

/* Thông tin chính */
.pm-cat {
  display: block;
  margin-right: 52px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--cyan-600);
}
.pm-info h2 { font-size: 24px; line-height: 1.25; margin: 6px 52px 10px 0; }
.pm-info .rating-row.lg { margin-bottom: 12px; }
.pm-pricebox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 2px 0 12px;
  padding: 14px 16px;
  background: var(--paper);
  border-radius: 14px;
}
.pm-price {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--navy-900);
}
.pm-price .price-old { margin-left: 10px; font-size: 16px; }
.pm-save {
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--rose);
  background: var(--rose-bg);
  border-radius: 999px;
}
.pm-info .stock-badge { margin-bottom: 0; font-size: 13px; }

/* Khối mua hàng */
.pm-buy { margin-top: 14px; }
.pm-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}
.pm-buy-actions { display: flex; gap: 10px; }
.pm-buy-actions .btn { flex: 1; height: 48px; padding: 0 16px; }
.pm-buy-actions .btn-primary { flex: 1.2; }
.pm-buy-actions .btn svg { flex-shrink: 0; }

/* Mô tả ngắn, điểm nổi bật, thông tin nhanh */
.pm-details .modal-desc { margin: 12px 0 14px; }
.highlight-list { list-style: none; padding: 0; margin: 0 0 14px; }
.highlight-list li {
  position: relative;
  margin: 6px 0;
  padding-left: 24px;
  font-size: 14px;
  color: var(--ink);
}
.highlight-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 1px;
  width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--success);
  background: var(--success-bg);
  border-radius: 50%;
}
.pm-details .modal-meta { margin-top: 4px; }

/* Tab Mô tả / Thông số / Đánh giá */
.pm-tabs .modal-tabs { margin-top: 0; padding: 0 28px; }
.pm-tabs .modal-tab-panel { padding: 20px 28px 24px; }
.modal-tab-btn[aria-selected="true"] { color: var(--navy-900); border-color: var(--cyan-500); }

@keyframes sheetUp {
  from { transform: translateY(48px); opacity: .5; }
  to { transform: none; opacity: 1; }
}

@media (max-width: 860px) and (min-width: 701px) {
  .pm { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); column-gap: 22px; }
  .pm-gallery { margin-left: 20px; }
  .pm-info h2 { font-size: 21px; }
  .pm-price { font-size: 26px; }
}

/* Điện thoại: hộp thoại thành "tấm trượt" đáy + thanh mua hàng dính đáy */
@media (max-width: 700px) {
  #productModal.modal-overlay { padding: 0; align-items: flex-end; }
  #productModal .modal-box {
    max-width: none;
    max-height: 94vh;
    max-height: 94dvh;
    border-radius: 22px 22px 0 0;
    animation: sheetUp .3s var(--ease-out);
  }
  #productModal .modal-close { top: 10px; right: 10px; width: 38px; height: 38px; }

  .pm { display: flex; flex-direction: column; align-items: stretch; }
  .pm-cat, .pm-info h2 { margin-right: 0; }
  .pm-gallery { position: relative; margin: 0; }
  .pm-gallery .modal-media {
    border-radius: 0;
    border-width: 0 0 1px;
    max-height: 56vh;
  }
  .pm-gallery .wishlist-heart { top: 10px; right: auto; left: 10px; }
  .carousel-thumbs { padding: 10px 16px 0; margin-top: 0; }

  .pm-info { padding: 16px 16px 0; }
  .pm-info h2 { font-size: 20px; }
  .pm-price { font-size: 26px; }
  .pm-details { padding: 6px 16px 0; }
  .pm-tabs { margin-top: 20px; }
  .pm-tabs .modal-tabs { padding: 0 16px; }
  .pm-tabs .modal-tab-panel { padding: 16px 16px 24px; }

  .pm-buy {
    order: 99;
    position: sticky;
    bottom: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 20px rgba(26, 44, 77, .08);
  }
  .pm-qty { margin: 0; }
  .pm-qty-label { display: none; }
  .pm-buy-actions { flex: 1; gap: 8px; }
  .pm-buy-actions .btn { height: 46px; padding: 0 12px; font-size: 14px; }
  .pm-buy-actions .btn-ghost { flex: 0 0 48px; padding: 0; }
  .pm-add-label { display: none; }
  .modal-meta { grid-template-columns: 1fr 1fr; }
}

/* ---------- Giỏ hàng ---------- */
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}
.cart-layout .cart-list { margin-bottom: 0; }

.cart-row {
  grid-template-columns: 76px minmax(0, 1fr) auto 112px 36px;
  grid-template-areas: "media info qty sub rm";
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
}
.cart-row-media { grid-area: media; width: 76px; height: 76px; border-radius: 12px; position: relative; cursor: pointer; }
.cart-row-info { grid-area: info; min-width: 0; }
.cart-row > .qty-control { grid-area: qty; height: 38px; }
.cart-row-subtotal { grid-area: sub; min-width: 0; }
.cart-row-remove {
  grid-area: rm;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-row-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
  line-height: 1.35;
}
.cart-row-name:hover { color: var(--cyan-600); }
.cart-row-price { font-size: 13px; }
.cart-row-price .price-old { font-size: 12px; margin-left: 6px; }
.cart-row-note { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--warning); }
.qty-control .qty-num { min-width: 32px; text-align: center; font-weight: 600; font-size: 14px; }
.qty-control button { width: 36px; height: 100%; min-height: 34px; }
.qty-control button:disabled { color: #B7C0CE; cursor: not-allowed; background: transparent; }

.cart-summary {
  position: sticky;
  top: 104px;
  max-width: none;
  margin: 0;
  padding: 22px;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.cart-summary h3 { font-size: 17px; margin-bottom: 16px; }
.sum-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--ink-soft);
}
.sum-row.save span:last-child { color: var(--success); font-weight: 600; }
.cart-summary .cart-total-row {
  margin: 14px 0 10px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.cart-summary .cart-total-row strong { font-size: 24px; }
.sum-note { margin-bottom: 16px; font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); }
.cart-actions { display: grid; gap: 10px; }

@media (max-width: 860px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr); }
  .cart-summary { position: static; }
}
@media (max-width: 700px) {
  .cart-row {
    grid-template-columns: 68px minmax(0, 1fr) auto;
    grid-template-areas:
      "media info rm"
      "media qty sub";
    row-gap: 8px;
    column-gap: 12px;
    padding: 12px;
  }
  .cart-row-media { width: 68px; height: 68px; }
  .cart-row-subtotal { text-align: right; align-self: center; }
  .cart-row-remove { position: static; justify-self: end; align-self: start; }
  .cart-row > .qty-control { justify-self: start; }
}

/* ---------- Trang quản trị ---------- */
#adminOrderList,
#adminProductList,
#adminUserList,
#adminVoucherList { overflow-x: auto; }
.admin-table { min-width: 560px; }

/* Nút Lưu luôn nằm trong tầm mắt khi form dài */
.pf-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: 22px;
  padding: 14px 0 6px;
  background: linear-gradient(to top, #fff 72%, rgba(255, 255, 255, 0));
  border-top: 0;
}

/* Các tab quản trị: vuốt ngang thay vì bị cắt */
.admin-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs .tab-btn { flex-shrink: 0; white-space: nowrap; }

@media (max-width: 700px) {
  /* Bảng sản phẩm: bỏ cột Danh mục để vừa màn hình điện thoại */
  #adminProductList .admin-table { min-width: 0; }
  #adminProductList th:nth-child(3),
  #adminProductList td:nth-child(3) { display: none; }
  .admin-table th, .admin-table td { padding-left: 8px; padding-right: 8px; }
  .pf-form { padding: 18px 14px; }
  .pf-actions { padding-bottom: calc(6px + 0px); bottom: calc(62px + env(safe-area-inset-bottom)); }
}
@media (max-width: 700px) {
  .stat-card { padding: 14px; }
  .stat-value { font-size: 19px; }
}
/* ==== UX-REFRESH END ==== */
