:root {
  --brand-red: #D9232E;
  --brand-red-dark: #B51822;
  --brand-gold: #FFD23F;
  --bg-white: #FFFFFF;
  --bg-silver: #F5F6F8;
  --btn-buy: #009E49;
  --btn-buy-dark: #007D39;
  --btn-share: #FF6B00;
  --btn-share-dark: #DC5800;
  --btn-zalo: #0068FF;
  --text-main: #111827;
  --text-muted: #374151;
}

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 399px) {
  html {
    font-size: 17px;
  }
}

body {
  margin: 0;
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-silver);
  color: var(--text-main);
  line-height: 1.48;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

/* Đảm bảo mọi vùng chạm tối thiểu 48px để người lớn tuổi dễ bấm ngoài trời */
.touch-btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-weight: 700;
  border-radius: 0.75rem;
  transition: transform 0.12s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.touch-btn:active {
  transform: scale(0.97);
}

.touch-btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 3px solid var(--brand-gold);
  outline-offset: 2px;
}

/* Logo tròn chữ Hán 陈 */
.logo-crest {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  border: 3px solid var(--brand-gold);
  background: radial-gradient(circle at 35% 30%, #ef333f, #a7141d);
  color: var(--brand-gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Serif SC', 'Times New Roman', serif;
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

/* Dải minh bạch chạy nhẹ nhàng, tạm dừng khi chạm/rê chuột */
.ticker-wrap {
  position: relative;
  z-index: 30;
  min-height: 46px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(90deg, #FFFFFF 0%, #FFFBEB 50%, #FFFFFF 100%);
  border-bottom: 2px solid #FDE68A;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.ticker-track {
  display: flex;
  align-items: center;
  width: max-content;
  white-space: nowrap;
  will-change: transform;
  animation: tickerScroll 26s linear infinite;
}

.ticker-item {
  flex-shrink: 0;
  padding-right: 4rem;
}

.ticker-wrap:hover .ticker-track,
.ticker-wrap:active .ticker-track {
  animation-play-state: paused;
}

@keyframes tickerScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Thanh danh mục cuộn ngang mượt trên mobile */
.cat-scroll {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.cat-scroll::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  min-height: 52px;
  border: 2px solid #D1D5DB;
  background-color: var(--bg-white);
  color: var(--text-main);
  transition: all 0.15s ease;
}

.cat-pill.active {
  background-color: var(--brand-red);
  border-color: var(--brand-red-dark);
  color: #FFFFFF;
  box-shadow: 0 4px 10px rgba(217, 35, 46, 0.28);
}

/* Thẻ sản phẩm độ tương phản cao */
.product-card {
  background: var(--bg-white);
  border: 2px solid #E5E7EB;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-card:hover {
  border-color: #D1D5DB;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.1);
}

/* Thanh điều hướng đáy cố định (3 nút) */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background-color: var(--brand-red);
  border-top: 3px solid var(--brand-gold);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.18);
}

.voice-fab {
  width: 72px;
  height: 72px;
  border-radius: 9999px;
  background: linear-gradient(145deg, #FF6B00, #D9232E);
  border: 4px solid var(--brand-gold);
  color: #FFFFFF;
  margin-top: -26px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.voice-fab:active {
  transform: scale(0.94);
}

/* Hiệu ứng sóng âm AI */
.voice-pulse {
  position: relative;
}

.voice-pulse::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 9999px;
  border: 3px solid rgba(255, 210, 63, 0.75);
  animation: voiceWave 1.8s ease-out infinite;
  pointer-events: none;
}

@keyframes voiceWave {
  0% {
    transform: scale(0.95);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.28);
    opacity: 0;
  }
}

/* Modal nền tối dễ tập trung */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(17, 24, 39, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
    padding: 1rem;
  }
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-panel {
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-white);
  border-radius: 1.25rem 1.25rem 0 0;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
  animation: slideUpModal 0.18s ease-out;
}

@media (min-width: 640px) {
  .modal-panel {
    border-radius: 1.25rem;
  }
}

@keyframes slideUpModal {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Thanh theo dõi 4 bước kiểu Amazon */
.step-dot {
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  border: 2px solid #D1D5DB;
  background: #FFFFFF;
  color: #6B7280;
  flex-shrink: 0;
}

.step-dot.done {
  background: var(--btn-buy);
  border-color: var(--btn-buy);
  color: #FFFFFF;
}

.step-dot.current {
  background: var(--btn-share);
  border-color: var(--btn-share);
  color: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.22);
}

.step-line {
  height: 4px;
  flex: 1;
  background: #E5E7EB;
  border-radius: 999px;
}

.step-line.done {
  background: var(--btn-buy);
}

/* Toast thông báo */
.toast-item {
  background: #111827;
  color: #FFFFFF;
  border: 2px solid var(--brand-gold);
  border-radius: 0.85rem;
  padding: 0.85rem 1.1rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  animation: slideUpModal 0.18s ease-out;
}
