/* =============================================================================
   base.css — shared by ALL pages (split from styles.css 2026-07-16)
   Tokens / reveal / hover / toast / confirm modal / user dropdown / cart nav /
   header polish (S12.5) / S13 mobile audit / img fallback / floating Zalo CTA
   ============================================================================= */
/* ==================== Adsngam.com — Cream Light Theme ==================== */

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: #FFFFFF;
  color: #0C2340;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  background-image:
    radial-gradient(ellipse 800px 600px at 10% -10%, rgba(11, 46, 99, 0.10), transparent 50%),
    radial-gradient(ellipse 600px 500px at 90% 10%, rgba(27, 79, 160, 0.08), transparent 50%),
    radial-gradient(ellipse 700px 500px at 50% 100%, rgba(245, 182, 34, 0.14), transparent 50%);
}

/* S13 mobile audit — safety net toàn site:
   - chặn horizontal scroll do blob trang trí / element tràn mép
   - cho modal cuộn được trên màn hình thấp (375×667) thay vì bị cắt đầu */
html, body { overflow-x: hidden; }
.confirm-modal-backdrop { overflow-y: auto; }
.confirm-modal { max-height: 90vh; overflow-y: auto; }

/* Desktop rộng: nới container nội dung từ 8/12 (1280px) lên ~10/12 (~83vw).
   Chỉ áp ≥1536px (nơi 83vw ≥ 1280) nên KHÔNG bao giờ co hẹp màn nhỏ hơn. */
@media (min-width: 1536px) {
  .max-w-7xl {
    max-width: min(83.333vw, 1720px);
  }
}

/* Display headings */
.font-display {
  letter-spacing: -0.02em;
  font-weight: 800;
}

/* ==================== Scroll Reveal Animations ==================== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal[data-reveal-delay="50"] { transition-delay: 50ms; }
.reveal[data-reveal-delay="100"] { transition-delay: 100ms; }
.reveal[data-reveal-delay="150"] { transition-delay: 150ms; }
.reveal[data-reveal-delay="200"] { transition-delay: 200ms; }
.reveal[data-reveal-delay="300"] { transition-delay: 300ms; }

/* ==================== Hover animations for buttons ==================== */
/* Primary CTA buttons get a subtle lift + soft shadow on hover */
.btn-hover {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              background-color 0.2s ease;
  will-change: transform;
}

.btn-hover:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 12px 28px -10px rgba(11, 46, 99, 0.4);
}

.btn-hover:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 0.1s;
}

/* Arrow inside button slides forward on hover */
.btn-hover svg {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-hover:hover svg {
  transform: translateX(3px);
}

/* Ghost / secondary buttons — subtle border + background tint */
.btn-ghost {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              background-color 0.2s ease,
              border-color 0.2s ease;
}

.btn-ghost:hover {
  transform: translateY(-2px);
  background-color: rgba(12, 35, 64, 0.04);
  border-color: rgba(11, 46, 99, 0.4);
}

.btn-ghost:active {
  transform: translateY(0);
}

/* Card hover lift — applies via .group hover */
.card-hover {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.25s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px -16px rgba(11, 46, 99, 0.22);
  border-color: rgba(11, 46, 99, 0.4);
}

/* Nav link hover */
.nav-link {
  position: relative;
  transition: color 0.2s ease;
  /* Gọn nhẹ kiểu web thịnh hành (Apple v.v.) — chữ thường, weight vừa, không
     giãn chữ. Bản uppercase/800/0.06em cũ khiến mục dài ("Về chúng tôi") quá
     rộng, ở viewport ~1024-1150px "Bài viết" và "Đăng nhập" chạm sát nhau. */
  font-weight: 500;
  font-size: 14px;
}

/* Gạch chân cam nav — đã bỏ theo yêu cầu (giữ hover đổi màu chữ) */
.nav-link::after {
  content: none;
}

.nav-link:hover::after {
  transform: scaleX(1);
}

/* Logo gentle pulse on hover */
.logo-hover {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.logo-hover:hover {
  transform: scale(1.05);
}

/* ==================== Reduced motion ==================== */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.is-visible,
  .btn-hover,
  .btn-ghost,
  .card-hover,
  .nav-link::after,
  .logo-hover {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==================== Custom scrollbar (light) ==================== */
@media (min-width: 1024px) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-track {
    background: #F6F9FD;
  }
  ::-webkit-scrollbar-thumb {
    background: #C6D5E9;
    border-radius: 10px;
    border: 2px solid #F6F9FD;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: #0B2E63;
  }
}

/* ==================== Selection ==================== */
::selection {
  background: rgba(11, 46, 99, 0.25);
  color: #0C2340;
}

/* ==================== Focus styles ==================== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #0B2E63;
  outline-offset: 2px;
  border-radius: 8px;
}

/* ==================== Pulse animation ==================== */
@keyframes softPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.animate-pulse {
  animation: softPulse 2s ease-in-out infinite;
}

/* ==================== Subtle paper texture (optional grain) ==================== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.bg-clip-text {
  -webkit-background-clip: text;
  background-clip: text;
}

/* ============ Toast notifications ============ */
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

#toastRoot {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 48px);
}

.toast {
  background-color: #5BA85A;
  color: #FFFFFF;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 12px 28px -10px rgba(91, 168, 90, 0.45),
              0 4px 12px -4px rgba(0, 0, 0, 0.08);
  animation: toastSlideIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.is-error {
  background-color: #E01000;
  box-shadow: 0 12px 28px -10px rgba(224, 16, 0, 0.45),
              0 4px 12px -4px rgba(0, 0, 0, 0.08);
}

@media (max-width: 640px) {
  #toastRoot {
    top: 16px;
    left: 16px;
    right: 16px;
    align-items: stretch;
  }
  .toast {
    text-align: center;
    white-space: normal;
  }
}

/* Reduced motion respect (extend existing rule) */
@media (prefers-reduced-motion: reduce) {
  .auth-card,
  .toast,
  .google-btn.is-loading .google-btn-text::before,
  .spinner {
    animation: none !important;
  }
  .google-btn:hover,
  .google-btn:active {
    transform: none !important;
  }
}


/* ---- Confirm modal + shared modal keyframes (used: account/admin/blog/checkout/login + user dropdown) ---- */
/* ---- Confirm modal ---- */
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.confirm-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(12, 35, 64, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.2s ease-out;
}

.confirm-modal-backdrop.hidden {
  display: none;
}

.confirm-modal {
  background-color: #FFFFFF;
  border-radius: 24px;
  padding: 28px;
  padding-top: 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 60px -20px rgba(12, 35, 64, 0.4);
  animation: modalScaleIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

/* Modal close X button — góc trên phải. Tránh click backdrop để đóng nhầm
   (vd verify mail modal, mất state phải re-send). */
.modal-close-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(246, 249, 253, 0.85);
  color: #3D556F;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid #C6D5E9;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
  line-height: 1;
  padding: 0;
  z-index: 1;
}
.modal-close-x:hover {
  background: #0B2E63;
  color: #FFFFFF;
  transform: scale(1.08);
}
.modal-close-x:focus-visible {
  outline: 2px solid #0B2E63;
  outline-offset: 2px;
}


/* ---- User dropdown (navbar logged-in state) ---- */
.user-nav-dropdown {
  min-width: 200px;
  z-index: 60;
  border: 1px solid #DCE6F4;
  box-shadow: 0 12px 32px -12px rgba(12, 35, 64, 0.18);
  animation: modalScaleIn 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.user-nav-dropdown a,
.user-nav-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #3D556F;
  font-size: 14px;
  font-weight: 500;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.user-nav-dropdown a:hover,
.user-nav-dropdown button:hover {
  background-color: rgba(11, 46, 99, 0.08);
  color: #0C2340;
}

.user-nav-dropdown hr {
  border: 0;
  border-top: 1px solid #DCE6F4;
  margin: 6px 4px;
}

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
  .confirm-modal-backdrop,
  .confirm-modal,
  .user-nav-dropdown {
    animation: none !important;
  }
}


/* ==================== Cart icon trong navbar (S12.4) ====================
   Cart đã được ẩn toàn site — mọi giao dịch chuyển sang Zalo/Messenger.
   Giữ markup để admin/checkout cũ vẫn hoạt động nội bộ. */
.cart-nav-btn {
  position: relative;
  display: none !important;
}

.cart-nav-btn .cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #0B2E63;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid #FFFFFF;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.cart-nav-btn .cart-badge.is-empty {
  display: none;
}


/* ==================== Header polish + animations (S12.5) ====================
   Áp cho mọi trang có chung navbar (index/login/account/learn/blog/admin/checkout).
   Target qua existing markup: header.fixed, .logo-hover, .nav-link,
   [data-user-dropdown-trigger], [data-user-avatar], .cart-nav-btn, .cart-badge.
   KHÔNG cần edit HTML — toàn bộ pages đều hưởng. */

/* Animated gradient line dưới header */
header.fixed {
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

header.fixed::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(11, 46, 99, 0.35) 18%,
    rgba(27, 79, 160, 0.45) 50%,
    rgba(245, 182, 34, 0.35) 82%,
    transparent 100%
  );
  opacity: 0.85;
  pointer-events: none;
}

/* Brand logo nhấn mạnh */
.logo-hover {
  position: relative;
  padding: 4px 8px 4px 4px;
  border-radius: 12px;
  transition: background-color 0.3s ease;
}

.logo-hover:hover {
  background: linear-gradient(135deg, rgba(11, 46, 99, 0.06), rgba(27, 79, 160, 0.06));
}

.logo-hover img {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
}

.logo-hover:hover img {
  transform: rotate(-8deg) scale(1.08);
  box-shadow: 0 8px 22px -6px rgba(11, 46, 99, 0.55), 0 0 0 3px rgba(11, 46, 99, 0.18);
}

.logo-hover span {
  transition: letter-spacing 0.3s cubic-bezier(0.22, 1, 0.36, 1), filter 0.3s ease;
}

.logo-hover:hover span {
  letter-spacing: -0.025em;
  filter: drop-shadow(0 0 10px rgba(11, 46, 99, 0.28));
}

/* Nav link micro-lift on hover (existing underline expand giữ nguyên) */
header .nav-link {
  transition: color 0.25s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

header .nav-link:hover {
  transform: translateY(-1px);
}

/* User dropdown trigger — gradient pill + animated avatar ring + online dot */
[data-user-dropdown-trigger] {
  position: relative;
  background: linear-gradient(135deg, rgba(11, 46, 99, 0.08), rgba(27, 79, 160, 0.08)) !important;
  border: 1px solid rgba(11, 46, 99, 0.18);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}

[data-user-dropdown-trigger]:hover {
  background: linear-gradient(135deg, rgba(11, 46, 99, 0.16), rgba(27, 79, 160, 0.16)) !important;
  border-color: rgba(11, 46, 99, 0.42);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -8px rgba(11, 46, 99, 0.42);
}

[data-user-dropdown-trigger] [data-user-avatar] {
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 3.5px rgba(11, 46, 99, 0.4);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
}

[data-user-dropdown-trigger]:hover [data-user-avatar] {
  transform: rotate(8deg) scale(1.06);
}

/* "Online" dot ở góc avatar */
[data-user-dropdown-trigger]::before {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 30px;
  width: 9px;
  height: 9px;
  background: #5BA85A;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
  z-index: 3;
  pointer-events: none;
}

/* User name luôn rõ; tăng max-width một chút để fit tên Việt */
[data-user-dropdown-trigger] [data-user-name] {
  max-width: 130px !important;
  font-weight: 600 !important;
  color: #0C2340 !important;
}

/* Caret xoay khi dropdown mở */
[data-user-dropdown-trigger] svg:last-child {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-user-dropdown-trigger][aria-expanded="true"] svg:last-child {
  transform: rotate(180deg);
}

/* Cart button — gradient bg + bounce + shake icon + animated badge */
.cart-nav-btn {
  background: linear-gradient(135deg, rgba(27, 79, 160, 0.12), rgba(11, 46, 99, 0.10)) !important;
  border: 1px solid rgba(27, 79, 160, 0.28);
  transition: background 0.35s ease, border-color 0.35s ease,
              transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s ease !important;
}

.cart-nav-btn:hover {
  background: linear-gradient(135deg, rgba(27, 79, 160, 0.25), rgba(11, 46, 99, 0.20)) !important;
  border-color: rgba(27, 79, 160, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -7px rgba(27, 79, 160, 0.5);
}

.cart-nav-btn > span:first-child {
  display: inline-block;
}

/* Cart badge */
.cart-nav-btn .cart-badge:not(.is-empty)::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 2px solid rgba(11, 46, 99, 0.55);
  pointer-events: none;
}

/* Mobile menu button polish */
#mobileMenuBtn {
  border-radius: 10px;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

#mobileMenuBtn:hover {
  color: #0B2E63;
  background: rgba(11, 46, 99, 0.08);
  transform: scale(1.08);
}

/* Reduce motion: tắt animation nhưng giữ hover state */
@media (prefers-reduced-motion: reduce) {
  header.fixed::after,
  [data-user-dropdown-trigger] [data-user-avatar],
  [data-user-dropdown-trigger]::before,
  .cart-nav-btn .cart-badge::after,
  .cart-nav-btn:hover > span:first-child,
  .cart-nav-btn .cart-badge:not(.is-empty),
  header .btn-hover.bg-ink::after,
  header .btn-hover.btn-zalo::after {
    animation: none !important;
  }
  .logo-hover img,
  .logo-hover span,
  [data-user-dropdown-trigger],
  .cart-nav-btn,
  .cart-nav-btn > span:first-child,
  #mobileMenuBtn,
  header .nav-link {
    transition: none !important;
  }
}

/* =============================================================================
   S13 — Mobile audit safety overrides (≤640px)
   Aim: prevent horizontal scroll, ensure touch targets ≥44px, modal full-width.
   ============================================================================= */

@media (max-width: 640px) {
  body { word-break: break-word; }

  h1, h2, h3 {
    overflow-wrap: break-word;
  }

  /* Modal: full-width with safe gutters trên màn hình nhỏ */
  .confirm-modal-backdrop .confirm-modal,
  .product-detail-modal,
  .verify-modal {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    margin: 12px auto !important;
  }

  /* Touch targets ≥44px cho icon buttons */
  .cart-nav-btn,
  #mobileMenuBtn,
  [data-user-dropdown-trigger],
  .modal-close-x,
  .product-detail-close {
    min-width: 44px;
    min-height: 44px;
  }

  /* S13 audit — touch target ≥44px cho control chính mọi trang (mobile) */
  .admin-action-btn,
  .admin-filter button,
  .admin-nav-item,
  .admin-status-select,
  .account-nav-item,
  .order-filter button,
  .course-tab-btn,
  .lesson-nav-btn,
  .explore-btn,
  .comm-cat-tabs button,
  .comm-join-btn,
  .blog-category-pills button {
    min-height: 44px;
  }
  /* Nút icon vuông ≥44px */
  .qty-btn,
  .cart-item-remove,
  .password-toggle,
  .post-detail-close,
  .admin-featured-toggle,
  .admin-banner-demo .banner-close {
    min-width: 44px;
    min-height: 44px;
  }
  /* Nút Zalo mobile trong navbar (w-10 h-10 = 40px → 44px) */
  a[aria-label="Zalo"],
  a[title*="Zalo"].w-10 {
    min-width: 44px;
    min-height: 44px;
  }
  /* CTA pill dùng py-2/py-2.5 (36-40px) rải rác nhiều trang (blog featured,
     tai-khoan, khoa-hoc-cua-toi, thanh-toan) — cùng gốc với bản admin-only đã
     vá trong admin.css, nhưng đây site-wide nên sửa ở base.css (2026-09-04). */
  a.rounded-full.py-2,
  a.rounded-full.py-2\.5,
  button.rounded-full.py-2,
  button.rounded-full.py-2\.5 {
    min-height: 44px;
  }
  /* Footer nav link — mỗi link đứng riêng 1 dòng trong <li>, không có nguy cơ
     lệch dòng như .legal-links (link chen giữa câu văn dài) nên nới đủ hẳn
     44px thay vì 8px "gần sát" cũ (2026-09-03, đo được 36px thực tế — dưới
     chuẩn 01-mandatory.md). .legal-links giữ nguyên 8px, lý do gốc vẫn đúng. */
  footer a:not([aria-label]):not([class*="rounded-full"]):not([class*="w-9"]):not([class*="w-11"]):not([class*="w-10"]) {
    display: inline-block;
    padding-block: 12px;
  }
  .legal-links a {
    display: inline-block;
    padding-block: 8px;
  }
  /* Link ngắn kiểu nhãn/CTA (không phải chôn giữa câu dài) — đẩy gần sát 44px hơn
     .legal-links vì không tạo khoảng trắng lệch giữa dòng văn bản dài (2026-08-31) */
  .tap-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  /* Footer newsletter form — stack vertically */
  form[data-newsletter-form] {
    flex-direction: column;
    align-items: stretch;
    gap: 8px !important;
    max-width: 100% !important;
  }
  form[data-newsletter-form] input,
  form[data-newsletter-form] button {
    width: 100%;
  }

  /* Resource tabs — gợi ý scrollable */
  .resource-tabs {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  /* Admin form grid — stack 1 col trên màn hình nhỏ */
  .admin-form-grid.cols-2,
  .admin-form-grid.cols-3 {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
}

/* Tablet ≤768px — admin tables compact */
@media (max-width: 768px) {
  .admin-shell .data-table {
    font-size: 13px;
  }
  .admin-shell .data-table th[data-col-priority="3"],
  .admin-shell .data-table td[data-col-priority="3"] {
    display: none;
  }
}

/* =============================================================================
   B17 — Image fallback placeholder
   Khi auth-api.js setupImageFallback() swap <img> src sang inline SVG monogram,
   class .img-placeholder được apply để styled cho consistent look.
   ============================================================================= */
.img-placeholder {
  background: linear-gradient(135deg, #0B2E63 0%, #1B4FA0 60%, #FFFFFF 100%);
  object-fit: contain;
  /* Inline SVG đã có rounded corners nên không override radius ở đây */
}


/* P1.2b (2026-07-16): block "GIÁ ẨN TOÀN SITE" đã GỠ — giá hiển thị công khai
   trở lại, chỉnh từ admin. Floating Zalo CTA đã bỏ hẳn 2026-08-31 theo yêu
   cầu user — xem script.js đã xóa IIFE injectFloatingZalo(). */

/* ===== Background lưới tĩnh dùng chung MỌI TRANG ===== */
.tech-grid-bg { position: fixed; inset: 0; z-index: -10; pointer-events: none; overflow: hidden;
  background-image: linear-gradient(to right, rgba(12,35,64,0.045) 1px, transparent 1px), linear-gradient(to bottom, rgba(12,35,64,0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 55%, transparent 100%); }
.tech-grid-bg::after { content:""; position:absolute; inset:0;
  background: radial-gradient(600px 420px at 18% 12%, rgba(11,46,99,0.08), transparent 70%), radial-gradient(560px 400px at 85% 20%, rgba(27,79,160,0.06), transparent 70%), radial-gradient(700px 480px at 60% 95%, rgba(245,182,34,0.10), transparent 70%); }

/* ==================== CTA: Zalo xanh + nút Mua rực lửa (S13.1) ====================
   `.btn-zalo`     — nút "Liên hệ Zalo" theo màu thương hiệu Zalo #0068FF.
   `.btn-buy-fire` — mọi nút Mua / Thanh toán: nền gradient cam static, không animation.
   `.cta-row`      — cặp nút [Mua ngay][Liên hệ Zalo] nằm CÙNG MỘT HÀNG, 2 cột đều.
   Đặt ở base.css vì mọi trang đều load file này. Animation gate reduce-motion ở cuối. */

.btn-zalo {
  background-color: #0068FF;
  color: #FFFFFF;
}

.btn-zalo:hover {
  background-color: #0052D4;
  box-shadow: 0 12px 28px -10px rgba(0, 104, 255, 0.55);
}

/* Halo của .btn-hover đổi sang tông xanh cho khớp nút Zalo (home.css định nghĩa ::before) */
.btn-zalo.btn-hover::before {
  background: linear-gradient(90deg, rgba(0, 104, 255, 0.6), rgba(11, 46, 99, 0.5), rgba(0, 104, 255, 0.6));
}

/* ---- Nút Mua: cam static, không hiệu ứng lửa ---- */
.btn-buy-fire {
  border: 0;
  font-weight: 700;
  color: #FFFFFF !important;
  background: linear-gradient(135deg, #0B2E63 0%, #082249 100%) !important;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
}

.btn-buy-fire:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -10px rgba(11, 46, 99, 0.45);
}

.btn-buy-fire:active {
  transform: translateY(0);
}

/* ---- Cặp nút Mua + Zalo trên CÙNG 1 hàng ---- */
.cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
}

.cta-row > a {
  width: 100%;
  min-width: 0;
}

/* Hẹp dần → thu padding + cỡ chữ để 2 nút vẫn nằm 1 hàng, không bị cắt chữ */
@media (max-width: 640px) {
  .cta-row { gap: 8px; }
  .cta-row > a {
    padding-left: 10px;
    padding-right: 10px;
    font-size: 12.5px;
    gap: 5px;
  }
}

/* Rất hẹp → rút gọn nhãn "Liên hệ Zalo" còn "Zalo" (span .cta-lbl-long) */
@media (max-width: 520px) {
  .cta-row .cta-lbl-long { display: none; }
  .cta-row > a { font-size: 12px; padding-left: 8px; padding-right: 8px; }
}

/* ==================== Giá giảm màu đỏ (S13.2) ==================== */

:root {
  --sale-red: #E01000;
  --sale-red-hi: #FF3B1F;
}

.light-ring,
.card-hover,
.grid-card {
  position: relative;
}

/* Viền sáng chạy vòng quanh thẻ ĐÃ BỎ (2026-08-27, bớt hiệu ứng động phô trương).
   .light-ring/.card-hover/.grid-card giữ position:relative cho các dùng khác. */

/* ---- Giá đã giảm: đỏ + nổi bật ---- */
.price-orig {
  color: #9A9093;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  font-weight: 600;
}

.price-sale {
  color: var(--sale-red);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 14px rgba(224, 16, 0, 0.25);
}

.price-off {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, var(--sale-red-hi), var(--sale-red));
  color: #FFFFFF;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 9px;
  box-shadow: 0 4px 12px -4px rgba(224, 16, 0, 0.55);
}

.price-save {
  color: var(--sale-red);
  font-weight: 700;
}

/* Khung giá của thẻ đang giảm — nền đỏ nhạt + viền đỏ */
.price-box-sale {
  background: linear-gradient(160deg, rgba(224, 16, 0, 0.09), rgba(255, 255, 255, 0.5) 65%) !important;
  border-color: rgba(224, 16, 0, 0.3) !important;
}

/* ==================== Hub Sidebar Master-Detail (2026-08-28) ==================== */
/* Dùng cho: gioi-thieu.html, dich-vu.html, cong-cu.html, khoa-hoc.html */

.hub-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 1024px) {
  .hub-shell {
    flex-direction: row;
    gap: 32px;
    align-items: flex-start;
  }
}

.hub-sidebar {
  position: sticky;
  top: 88px;
  flex-shrink: 0;
}

@media (max-width: 1023px) {
  .hub-sidebar {
    position: relative;
    top: 0;
    width: 100%;
  }
}

@media (min-width: 1024px) {
  .hub-sidebar {
    width: 280px;
  }
}

.hub-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: #FFFFFF;
  border: 1px solid #DCE6F4;
  border-radius: 20px;
  padding: 8px;
}

.hub-nav::-webkit-scrollbar { display: none; }

@media (min-width: 1024px) {
  .hub-nav {
    flex-direction: column;
    overflow-x: visible;
  }
}

.hub-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 500;
  font-size: 15px;
  color: #3D556F;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
  text-align: left;
  font-family: inherit;
  text-decoration: none;
  min-height: 44px;
  scroll-snap-align: start;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.hub-nav-item:hover {
  background-color: rgba(11, 46, 99, 0.06);
  color: #0C2340;
}

@media (min-width: 1024px) {
  .hub-nav-item.is-active {
    background-color: rgba(11, 46, 99, 0.1);
    color: #0B2E63;
    box-shadow: inset 3px 0 0 #0B2E63;
    font-weight: 600;
  }
}

@media (max-width: 1023px) {
  .hub-nav-item.is-active {
    background-color: #0B2E63;
    color: #FFFFFF;
    font-weight: 600;
  }
}

.hub-panel-area {
  flex: 1;
  min-width: 0;
  background: #FFFFFF;
  border: 1px solid #DCE6F4;
  border-radius: 20px;
  padding: 28px;
}

@media (max-width: 639px) {
  .hub-panel-area { padding: 20px; }
}

.hub-panel[hidden] { display: none; }

/* Bù trừ header fixed 64px khi hub-tabs.js cuộn tới panel (scrollIntoView) —
   thiếu dòng này panel bị cuộn lên tận y=0, đúng tiêu đề panel nằm khuất sau
   header trong suốt (2026-09-04, phát hiện qua audit mobile). */
.hub-panel { scroll-margin-top: 84px; }

/* Nội dung văn bản trong trang con (2026-08-28) — căn đều 2 bên (justify).
   Áp cho đoạn mô tả trong sidebar master-detail + nội dung chính sách
   (policy-accordion.js fetch nguyên .prose-legal nên style theo luôn). */
.hub-panel p,
.prose-legal p {
  text-align: justify;
  text-align-last: left;
}

/* Heading trong panel/trang chính sách. Từng nâng lên 36-44px (2026-09-02) vì
   Tailwind text-2xl mặc định 24px dưới chuẩn cũ — sau đó user phản hồi 36-44px
   NGƯỢC LẠI quá to so với web thịnh hành (2026-09-03, tham chiếu apple.com/vn),
   hạ về khoảng giữa 28-36px. Đây là điểm chỉnh duy nhất cần sửa để ăn hết mọi
   trang dùng chung (.hub-panel: khoa-hoc/dich-vu/cong-cu/gioi-thieu; .prose-legal:
   dieu-khoan/bao-mat/hinh-thuc-thanh-toan/chinh-sach-doi-tra/chinh-sach-ban-giao)
   — specificity (0,1,1) thắng .text-2xl (0,1,0) không cần !important. */
.hub-panel h2,
.prose-legal h2 {
  font-size: clamp(1.75rem, 1.5rem + 1vw, 2.25rem);
}

/* H1 mobile floor cho bao-mat.html/privacy.html (2026-09-02) — Tailwind
   text-4xl render 36px dưới 640px, dưới sàn H1 40-80px của
   05-design-system.md (audit sitewide 2026-09-02, item G/33). sm:text-5xl
   (48px) ở ≥640px đã đúng chuẩn, giữ nguyên — chỉ ghi đè phần dưới sàn.
   Scoped bằng #id vì class `text-4xl sm:text-5xl` lặp lại y hệt trên 4
   trang .prose-legal khác (dieu-khoan/hinh-thuc-thanh-toan/chinh-sach-doi-tra/
   chinh-sach-ban-giao) — không đổi chung ở đây để tránh vượt phạm vi sửa
   (chỉ bao-mat.html trong lần audit này; các trang kia có finding H1 riêng). */
@media (max-width: 639px) {
  #privacy-h1 { font-size: 2.5rem; }
}

/* ==================== Hub Filter variant (2026-08-28) ==================== */
/* Dùng cho: cong-dong.html, blog.html — sidebar là BỘ LỌC, không phải nội dung riêng */

.hub-filter-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 1024px) {
  .hub-filter-shell {
    flex-direction: row;
    gap: 32px;
    align-items: flex-start;
  }
}

.hub-filter-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hub-filter-nav::-webkit-scrollbar { display: none; }

@media (min-width: 1024px) {
  .hub-filter-nav {
    flex-direction: column;
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 88px;
    gap: 4px;
  }
}

.hub-filter-nav button {
  padding: 10px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  background: #FFFFFF;
  border: 1px solid #DCE6F4;
  color: #3D556F;
  min-height: 44px;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

@media (min-width: 1024px) {
  .hub-filter-nav button {
    text-align: left;
    border-radius: 14px;
  }
}

.hub-filter-nav button:hover {
  border-color: rgba(11, 46, 99, 0.35);
  color: #0C2340;
}

.hub-filter-nav button.is-active {
  background: #0B2E63;
  border-color: #0B2E63;
  color: #FFFFFF;
}

.hub-filter-content {
  flex: 1;
  min-width: 0;
}

/* ==================== Policy Accordion (2026-08-28) — dùng trong gioi-thieu.html ==================== */

.policy-accordion-item { border: 1px solid #DCE6F4; border-radius: 16px; overflow: hidden; }
.policy-accordion-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: #FFFFFF; border: 0; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 15px; color: #0C2340; text-align: left;
  min-height: 44px;
}
.policy-accordion-btn .chevron { transition: transform .2s ease; color: #5B6E8C; }
.policy-accordion-item.is-open .chevron { transform: rotate(180deg); }
.policy-accordion-body { padding: 0 20px 20px; display: none; }
.policy-accordion-item.is-open .policy-accordion-body { display: block; }
.policy-accordion-next {
  margin-top: 16px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: #0B2E63; text-decoration: none;
}
.policy-accordion-loading { padding: 16px 0; color: #5B6E8C; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .hub-nav-item, .hub-filter-nav button, .policy-accordion-btn .chevron { transition: none !important; }
}

/* ==================== Dark-Tech Depth Tokens (2026-08-29) ====================
   Chiều sâu tĩnh (shadow/blur/gradient) — KHÔNG animation liên tục.
   Spec: docs/superpowers/specs/2026-08-29-dark-tech-depth-tokens-design.md */
:root {
  --surface-dark: #081B33;
  --surface-dark-2: #0F2A52;
  --glow-cyan: #22D3EE;
  --glow-cyan-soft: rgba(34, 211, 238, 0.35);
  --glow-gold-soft: rgba(245, 182, 34, 0.35);
  --text-on-dark: #F5F8FF;
  --text-on-dark-2: #A9B9D6;
}

/* Elevation — shadow đa lớp, 3 tier tĩnh */
.elev-1 {
  box-shadow:
    0 1px 2px rgba(11, 46, 99, 0.08),
    0 8px 20px -12px rgba(11, 46, 99, 0.18);
}
.elev-2 {
  box-shadow:
    0 2px 4px rgba(11, 46, 99, 0.10),
    0 20px 40px -16px rgba(11, 46, 99, 0.28),
    0 0 0 1px rgba(11, 46, 99, 0.05);
}
.elev-3 {
  box-shadow:
    0 4px 8px rgba(11, 46, 99, 0.12),
    0 32px 64px -20px rgba(11, 46, 99, 0.35);
}
.elev-3.on-dark {
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.3),
    0 32px 64px -20px rgba(0, 0, 0, 0.5),
    0 0 40px -8px var(--glow-cyan-soft);
}

/* Glass panel — kính mờ, dùng trên nền tối (mặc định) hoặc nền sáng (.on-light) */
.glass-panel {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.glass-panel.on-light {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(11, 46, 99, 0.12);
}

/* Fallback thật khi trình duyệt không hỗ trợ backdrop-filter — @supports not, không phải cascade */
@supports not (backdrop-filter: blur(1px)) {
  .glass-panel {
    background: var(--surface-dark-2);
  }
  .glass-panel.on-light {
    background: rgba(255, 255, 255, 0.92);
  }
}

/* Mesh nền tối — TĨNH, tự chứa lưới kẻ + blob gradient, không phụ thuộc .tech-grid-bg toàn site */
.mesh-dark-bg {
  position: relative;
  background-color: var(--surface-dark);
  background-image:
    linear-gradient(to right, rgba(245, 248, 255, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(245, 248, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  overflow: hidden;
}
.mesh-dark-bg::before {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 40% 35% at 15% 20%, var(--glow-gold-soft), transparent 60%),
    radial-gradient(ellipse 45% 40% at 85% 75%, var(--glow-cyan-soft), transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 100%, rgba(15, 42, 82, 0.6), transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}
.mesh-dark-bg > * {
  position: relative;
  z-index: 1;
}

/* Viền bevel tĩnh — KHÔNG animation (khác .light-ring xoay đã xoá 2026-08-27) */
.edge-glow {
  position: relative;
}
.edge-glow::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(245, 182, 34, 0.5), rgba(34, 211, 238, 0.25), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ==================== Dark Hero Panel + moved Eyebrow Chip (2026-08-30) ====================
   Rollout của hệ token 2026-08-29 lên 5 trang hub. Spec:
   docs/superpowers/specs/2026-08-30-dark-hero-panel-rollout-design.md */

/* Class TIỆN LỢI — gộp mesh-dark-bg + elev-3.on-dark + edge-glow thành 1 class cho hero block,
   KHÔNG thay thế 3 primitive gốc (vẫn dùng riêng ở carousel trang chủ, không đụng ở đây). */
.hero-dark-panel {
  position: relative;
  background-color: var(--surface-dark);
  background-image:
    linear-gradient(to right, rgba(245, 248, 255, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(245, 248, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  overflow: hidden;
  border-radius: 1.5rem;
  padding: 2.5rem 1.75rem;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.3),
    0 32px 64px -20px rgba(0, 0, 0, 0.5),
    0 0 40px -8px var(--glow-cyan-soft);
}
.hero-dark-panel::before {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 40% 35% at 15% 20%, var(--glow-gold-soft), transparent 60%),
    radial-gradient(ellipse 45% 40% at 85% 75%, var(--glow-cyan-soft), transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 100%, rgba(15, 42, 82, 0.6), transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}
.hero-dark-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(245, 182, 34, 0.5), rgba(34, 211, 238, 0.25), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.hero-dark-panel > * {
  position: relative;
  z-index: 1;
}
@media (min-width: 640px) {
  .hero-dark-panel { padding: 3.5rem 3rem; }
}

/* Chuyển từ home.css sang đây (2026-08-30) — .eyebrow-chip dùng ở cong-dong.html nhưng
   cong-dong.html không link home.css, chip trước giờ hiện KHÔNG style. Đây là vị trí đúng
   vì class này dùng ngoài trang chủ. */
.eyebrow-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid rgba(198, 213, 233, 0.9);
  background: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #3D556F;
}
.eyebrow-chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #0B2E63;
  box-shadow: 0 0 0 3px rgba(11, 46, 99, 0.18);
}
.eyebrow-chip.on-dark {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-on-dark);
}
.eyebrow-chip.on-dark .dot {
  background: #F5B622;
  box-shadow: 0 0 0 3px rgba(245, 182, 34, 0.25);
}

/* Gradient text an toàn cho nền tối — thay bg-gradient-to-r from-accent (navy, gần như biến mất
   trên nền .hero-dark-panel cũng navy đậm). #F5B622=accent-3, #1B4FA0=accent-2 (không có CSS var
   tương ứng, dùng hex thẳng — nhất quán với cách carousel đã làm). */
.gradient-text-dark {
  background: linear-gradient(90deg, #F5B622, var(--glow-cyan), #5B9BD5);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
