/* =====================================================
   MO — Modern UI 2026
   ===================================================== */
:root {
  --primary: #4f46e5;
  --primary-2: #7c3aed;
  --primary-soft: rgba(79, 70, 229, .12);
  --accent: #f97316;
  --accent-2: #fb923c;
  --success: #10b981;
  --danger: #ef4444;
  --bg: #f1f5f9;
  --bg-elevated: #ffffff;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --border: rgba(15, 23, 42, .08);
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow: 0 8px 30px rgba(15,23,42,.08);
  --shadow-lg: 0 20px 50px rgba(15,23,42,.12);
  --radius: 1rem;
  --radius-sm: .75rem;
  --nav-h: 72px;
  --ease: cubic-bezier(.22,1,.36,1);
}

[data-theme="dark"] {
  --primary: #818cf8;
  --primary-2: #a78bfa;
  --primary-soft: rgba(129,140,248,.15);
  --bg: #0b1220;
  --bg-elevated: #111827;
  --text: #f1f5f9;
  --text-2: #94a3b8;
  --text-3: #64748b;
  --border: rgba(148,163,184,.12);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 8px 30px rgba(0,0,0,.35);
  --shadow-lg: 0 20px 50px rgba(0,0,0,.45);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(79,70,229,.08), transparent 50%),
    radial-gradient(900px 500px at 100% 0%, rgba(249,115,22,.06), transparent 45%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; height: auto; }

/* ---------- Navbar glass ---------- */
.navbar {
  min-height: var(--nav-h);
  background: rgba(255,255,255,.75) !important;
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm);
  z-index: 1030;
}
[data-theme="dark"] .navbar {
  background: rgba(17,24,39,.8) !important;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  border-radius: 12px;
  font-size: 1.15rem;
  box-shadow: 0 8px 20px rgba(79,70,229,.35);
  transition: transform .25s var(--ease);
}
.navbar-brand:hover .logo-icon { transform: rotate(-8deg) scale(1.05); }
.navbar-brand {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--text) !important;
}

/* Search pill */
.search-form { width: 100%; max-width: 440px; }
.search-form .form-control {
  border-radius: 999px 0 0 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  padding: .65rem 1.25rem;
  box-shadow: inset 0 1px 2px rgba(15,23,42,.03);
  transition: border-color .2s, box-shadow .2s;
}
.search-form .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.search-form .btn {
  border-radius: 0 999px 999px 0;
  padding: .65rem 1.2rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: none;
  box-shadow: 0 6px 16px rgba(79,70,229,.3);
}

.btn-post {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
  border: none !important;
  font-weight: 600;
  border-radius: 999px !important;
  padding: .5rem 1.1rem !important;
  box-shadow: 0 8px 20px rgba(249,115,22,.35);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.btn-post:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(249,115,22,.45);
  color: #fff !important;
}

.btn-theme-toggle {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .2s, background .2s;
}
.btn-theme-toggle:hover {
  transform: scale(1.08);
  color: var(--primary);
  background: var(--primary-soft);
}

/* ---------- Region bar ---------- */
.region-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 1.1rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(79,70,229,.08), rgba(249,115,22,.06));
  border: 1px solid var(--border);
}
.region-bar strong { color: var(--primary); }

/* ---------- Section titles ---------- */
.section-title {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -.3px;
  margin-bottom: 1rem;
  color: var(--text);
}
.section-title::before {
  content: '';
  width: 4px; height: 1.15em;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
}

/* ---------- Categories ---------- */
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none !important;
  padding: 1.15rem .75rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
  height: 100%;
  color: var(--text);
}
.category-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: rgba(79,70,229,.25);
  color: var(--text);
}
.category-card .icon-wrap {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--primary-soft), rgba(124,58,237,.08));
  color: var(--primary);
  font-size: 1.45rem;
  margin-bottom: .7rem;
  transition: transform .35s var(--ease), background .3s;
}
.category-card:hover .icon-wrap {
  transform: scale(1.1) rotate(-6deg);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(79,70,229,.35);
}
.category-card span,
.category-card .cat-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.3;
}
.category-card:hover .cat-name { color: var(--text); }

/* ---------- Product cards ---------- */
.product-card {
  position: relative;
  background: var(--bg-elevated);
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), box-shadow .35s;
  height: 100%;
}
.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}
.product-card .card-img-wrap {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: linear-gradient(135deg, #e2e8f0, #f8fafc);
}
[data-theme="dark"] .product-card .card-img-wrap {
  background: linear-gradient(135deg, #1e293b, #0f172a);
}
.product-card .card-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.product-card:hover .card-img-wrap img {
  transform: scale(1.08);
}
.product-card .card-img-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(15,23,42,.35), transparent 45%);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.product-card:hover .card-img-wrap::after { opacity: 1; }

.product-card .badge-condition {
  position: absolute;
  top: .75rem; left: .75rem;
  z-index: 2;
  font-size: .7rem;
  font-weight: 700;
  padding: .35rem .65rem;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.2);
}
.badge-moi, .badge-condition.badge-moi { background: rgba(16,185,129,.9); color: #fff; }
.badge-nhu_moi, .badge-condition.badge-nhu_moi { background: rgba(59,130,246,.9); color: #fff; }
.badge-tot, .badge-condition.badge-tot { background: rgba(99,102,241,.9); color: #fff; }
.badge-kha, .badge-condition.badge-kha { background: rgba(245,158,11,.9); color: #fff; }
.badge-cu, .badge-condition.badge-cu { background: rgba(100,116,139,.9); color: #fff; }

.product-card .btn-fav,
.btn-fav {
  position: absolute;
  top: .75rem; right: .75rem;
  z-index: 3;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.9);
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, color .2s, background .2s;
}
.btn-fav-form { position: absolute; top: .75rem; right: .75rem; z-index: 3; margin: 0; }
.btn-fav-form .btn-fav { position: static; }
.product-card .btn-fav:hover,
.product-card .btn-fav.active,
.btn-fav:hover, .btn-fav.active {
  color: var(--danger);
  transform: scale(1.1);
  background: #fff;
}
[data-theme="dark"] .btn-fav { background: rgba(17,24,39,.9); color: var(--text-2); }

.product-card .card-body {
  padding: .9rem 1rem 1.05rem;
}
.product-card .card-title {
  font-size: .92rem;
  font-weight: 600;
  margin: 0 0 .35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
  min-height: 2.6em;
  line-height: 1.35;
}
.product-card .price {
  font-size: 1.05rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent), #ef4444);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -.3px;
}
.product-card .meta {
  font-size: .75rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: .25rem;
}
.product-card .meta i { font-size: .8rem; }

/* ---------- Region overlay ---------- */
.mo-region-overlay,
.mo-splash {
  position: fixed; inset: 0;
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(10px);
  padding: 1rem;
  animation: fadeIn .35s var(--ease);
}
.mo-region-overlay.d-none { display: none !important; }
.mo-region-box {
  width: 100%; max-width: 520px;
  background: var(--bg-elevated);
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: popIn .4s var(--ease);
}
.region-btn {
  border-radius: .75rem !important;
  font-weight: 600;
  transition: transform .15s, box-shadow .15s;
}
.region-btn:hover, .region-btn.active {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(79,70,229,.2);
}

.mo-splash {
  background: linear-gradient(135deg, #4f46e5, #7c3aed 50%, #f97316);
  color: #fff;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -.5px;
  text-align: center;
  transition: opacity .6s;
}
.mo-splash.hide { opacity: 0; pointer-events: none; }

@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes floatY {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ---------- Forms / cards generic ---------- */
.card {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  padding: .65rem .9rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
  background: var(--bg-elevated);
  color: var(--text);
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: none;
  box-shadow: 0 6px 16px rgba(79,70,229,.25);
}
.btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 10px 22px rgba(79,70,229,.35);
}
.btn-outline-primary {
  border-color: rgba(79,70,229,.35);
  color: var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
}

/* ---------- Detail page ---------- */
.product-gallery img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.text-price, .price-lg {
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent), #ef4444);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Footer ---------- */
footer, .site-footer {
  margin-top: auto;
  background: linear-gradient(180deg, transparent, rgba(15,23,42,.03));
  border-top: 1px solid var(--border);
  color: var(--text-2);
  padding: 2.5rem 0 1.5rem;
}
[data-theme="dark"] footer, [data-theme="dark"] .site-footer {
  background: #070b12;
}
.footer-link {
  color: var(--text-2);
  text-decoration: none;
  transition: color .2s;
}
.footer-link:hover { color: var(--primary); }

/* ---------- Chat ---------- */
#chatBox {
  background: var(--bg);
  border-radius: var(--radius-sm);
}

/* ---------- Empty / skeleton ---------- */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}
.empty-state .empty-icon {
  width: 76px; height: 76px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.8rem;
  animation: floatY 3s ease-in-out infinite;
}
.empty-state h5 { font-weight: 700; }
.empty-state p { color: var(--text-2); }

.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f8fafc 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.2s ease-in-out infinite;
  border-radius: 8px;
}
[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card .sk-img { height: 160px; }
.skeleton-card .sk-line { height: 14px; margin: 10px 12px; }
.skeleton-card .sk-line.short { width: 40%; }

/* ---------- Dark overrides for bootstrap surfaces ---------- */
[data-theme="dark"] .card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .list-group-item {
  background: var(--bg-elevated) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] .text-muted { color: var(--text-3) !important; }
[data-theme="dark"] .bg-light { background: #0f172a !important; }
[data-theme="dark"] .bg-white { background: var(--bg-elevated) !important; }
[data-theme="dark"] .table { color: var(--text); }
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background: #0f172a !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 767.98px) {
  :root { --nav-h: 64px; }
  .product-card .card-title { font-size: .85rem; min-height: 2.4em; }
  .product-card .price { font-size: .95rem; }
  .category-card { padding: .9rem .5rem; }
  .category-card .icon-wrap { width: 48px; height: 48px; font-size: 1.25rem; }
  .search-form { max-width: 100%; }
}

/* Stagger entrance for grids */
.product-card, .category-card {
  animation: cardIn .5s var(--ease) both;
}
.row > [class*="col-"]:nth-child(1) .product-card,
.row > [class*="col-"]:nth-child(1) .category-card { animation-delay: .02s; }
.row > [class*="col-"]:nth-child(2) .product-card,
.row > [class*="col-"]:nth-child(2) .category-card { animation-delay: .05s; }
.row > [class*="col-"]:nth-child(3) .product-card,
.row > [class*="col-"]:nth-child(3) .category-card { animation-delay: .08s; }
.row > [class*="col-"]:nth-child(4) .product-card,
.row > [class*="col-"]:nth-child(4) .category-card { animation-delay: .11s; }
.row > [class*="col-"]:nth-child(5) .product-card,
.row > [class*="col-"]:nth-child(5) .category-card { animation-delay: .14s; }
.row > [class*="col-"]:nth-child(6) .product-card,
.row > [class*="col-"]:nth-child(6) .category-card { animation-delay: .17s; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* Upload hints */
.upload-hint { font-size: .85rem; color: var(--text-3); font-weight: 400; }
.upload-error { color: var(--danger); font-size: .875rem; }

/* ===== Promo slider + category panel ===== */
.mo-promo-slider {
  min-height: 280px;
  border-radius: 1.1rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.mo-promo-slide {
  min-height: 280px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding: 1.75rem;
  background-size: cover;
  background-position: center;
  position: relative;
}
.mo-promo-slide::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(15,23,42,.75) 0%, rgba(15,23,42,.25) 55%, transparent 100%);
}
.mo-promo-1 {
  background-image:
    linear-gradient(135deg, #4f46e5 0%, #7c3aed 45%, #f97316 100%);
}
.mo-promo-2 {
  background-image:
    linear-gradient(135deg, #0ea5e9 0%, #6366f1 50%, #8b5cf6 100%);
}
.mo-promo-3 {
  background-image:
    linear-gradient(135deg, #059669 0%, #10b981 40%, #34d399 100%);
}
.mo-promo-content {
  position: relative;
  z-index: 1;
  color: #fff;
  max-width: 90%;
}
.mo-promo-content h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -.3px;
  margin: .4rem 0 .35rem;
}
.mo-promo-content p {
  opacity: .92;
  font-size: .92rem;
  margin-bottom: .85rem;
  max-width: 36ch;
}
.mo-promo-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .25rem .6rem;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(6px);
}
.mo-promo-slider .carousel-indicators [data-bs-target] {
  width: 8px; height: 8px;
  border-radius: 50%;
  background-color: rgba(255,255,255,.5);
}
.mo-promo-slider .carousel-indicators .active {
  background-color: #fff;
}
.mo-promo-slider .carousel-control-prev,
.mo-promo-slider .carousel-control-next {
  width: 12%;
  opacity: .85;
}

.mo-cat-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  padding: 1rem 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.mo-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .55rem;
}
.mo-cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none !important;
  padding: .65rem .35rem;
  border-radius: .85rem;
  background: var(--bg);
  border: 1px solid transparent;
  color: var(--text-2);
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s, color .2s;
}
.mo-cat-item:hover {
  transform: translateY(-3px);
  border-color: rgba(79,70,229,.25);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}
.mo-cat-ico {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.15rem;
  margin-bottom: .35rem;
  transition: background .25s, color .25s, transform .25s;
}
.mo-cat-item:hover .mo-cat-ico {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  transform: scale(1.08);
}
.mo-cat-label {
  font-size: .68rem;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 991.98px) {
  .mo-promo-slider, .mo-promo-slide { min-height: 220px; }
  .mo-cat-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 575.98px) {
  .mo-cat-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Confirm delete modal ===== */
.mo-confirm-modal .modal-dialog {
  max-width: 400px;
}
.mo-confirm-card {
  text-align: center;
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 1.25rem !important;
  box-shadow: 0 25px 50px rgba(15, 23, 42, .2);
  background: var(--bg-elevated, #fff);
  animation: moConfirmPop .35s cubic-bezier(.22,1,.36,1);
}
@keyframes moConfirmPop {
  from { opacity: 0; transform: scale(.92) translateY(12px); }
  to { opacity: 1; transform: none; }
}
.mo-confirm-icon {
  width: 72px; height: 72px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem;
  color: #fff;
  background: linear-gradient(135deg, #f43f5e, #ef4444 50%, #f97316);
  box-shadow: 0 12px 28px rgba(239, 68, 68, .4);
  animation: moIconPulse 1.8s ease-in-out infinite;
}
@keyframes moIconPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 12px 28px rgba(239,68,68,.4); }
  50% { transform: scale(1.05); box-shadow: 0 16px 36px rgba(239,68,68,.55); }
}
.mo-confirm-title {
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: .5rem;
  color: var(--text, #0f172a);
}
.mo-confirm-text {
  color: var(--text-2, #64748b);
  font-size: .92rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.mo-confirm-danger {
  background: linear-gradient(135deg, #f43f5e, #ef4444) !important;
  border: none !important;
  box-shadow: 0 8px 20px rgba(239,68,68,.35);
  transition: transform .2s, box-shadow .2s;
}
.mo-confirm-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(239,68,68,.45);
}
.mo-confirm-modal .modal-backdrop.show {
  backdrop-filter: blur(4px);
}

.mo-cat-item {
  border: none;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
}
.mo-cat-item.active {
  border-color: rgba(79,70,229,.35);
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.mo-cat-item.active .mo-cat-ico {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}
#moFeedGrid { transition: opacity .25s ease; }


/* Logo */
.mo-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.28);
  transition: transform .25s cubic-bezier(.22,1,.36,1);
}
.navbar-brand:hover .mo-logo-icon {
  transform: rotate(-6deg) scale(1.06);
}


/* ===== Brand logo (lively) ===== */
.mo-logo-wrap {
  position: relative;
  display: inline-flex;
  line-height: 0;
}
.mo-logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
  transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s;
}
.navbar-brand:hover .mo-logo-icon {
  transform: rotate(-8deg) scale(1.08);
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.45);
}
.mo-logo-spark {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 0 2px #fff, 0 0 12px rgba(251, 191, 36, .8);
  animation: moSpark 1.8s ease-in-out infinite;
}
@keyframes moSpark {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: .85; }
}
.mo-brand-text {
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.7px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
[data-theme="dark"] .mo-brand-text {
  background: linear-gradient(135deg, #a5b4fc, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* =====================================================
   Graphics quality tiers (data-gfx / .gfx-*)
   ===================================================== */

/* ---- LOW: máy yếu ---- */
html.gfx-low,
html[data-gfx="low"] {
  scroll-behavior: auto !important;
}
html.gfx-low *,
html[data-gfx="low"] * {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
html.gfx-low .mo-logo-spark,
html[data-gfx="low"] .mo-logo-spark {
  display: none !important;
}
html.gfx-low .navbar,
html[data-gfx="low"] .navbar {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: var(--bg-elevated, #fff) !important;
}
html.gfx-low .product-card,
html.gfx-low .category-card,
html.gfx-low .mo-cat-item,
html.gfx-low .mo-promo-slider,
html[data-gfx="low"] .product-card,
html[data-gfx="low"] .category-card,
html[data-gfx="low"] .mo-cat-item,
html[data-gfx="low"] .mo-promo-slider {
  box-shadow: none !important;
  transform: none !important;
}
html.gfx-low .product-card:hover,
html.gfx-low .category-card:hover,
html.gfx-low .mo-cat-item:hover,
html[data-gfx="low"] .product-card:hover,
html[data-gfx="low"] .category-card:hover,
html[data-gfx="low"] .mo-cat-item:hover {
  transform: none !important;
  box-shadow: none !important;
}
html.gfx-low .product-card:hover .card-img-wrap img,
html[data-gfx="low"] .product-card:hover .card-img-wrap img {
  transform: none !important;
}
html.gfx-low .skeleton,
html[data-gfx="low"] .skeleton {
  animation: none !important;
  background: #e2e8f0 !important;
}
html.gfx-low .mo-promo-slide,
html[data-gfx="low"] .mo-promo-slide {
  background-attachment: scroll !important;
}
html.gfx-low .carousel-item {
  transition: none !important;
}

/* ---- MEDIUM ---- */
html.gfx-medium .navbar,
html[data-gfx="medium"] .navbar {
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}
html.gfx-medium .product-card:hover,
html[data-gfx="medium"] .product-card:hover {
  transform: translateY(-4px);
}
html.gfx-medium .mo-logo-spark,
html[data-gfx="medium"] .mo-logo-spark {
  animation-duration: 2.5s;
}

/* ---- HIGH: full effects (default CSS) ---- */

/* Quality picker UI */
.mo-gfx-menu .dropdown-item.active {
  background: var(--primary-soft, rgba(79,70,229,.12));
  color: var(--primary, #4f46e5);
  font-weight: 600;
}
.mo-gfx-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.mo-gfx-dot.low { background: #94a3b8; }
.mo-gfx-dot.medium { background: #f59e0b; }
.mo-gfx-dot.high { background: #22c55e; }
.mo-gfx-dot.auto { background: linear-gradient(90deg,#94a3b8,#22c55e); }


/* ===== Back to top ===== */
.mo-back-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.5rem;
  z-index: 1040;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.9);
  transition: opacity .3s ease, transform .3s cubic-bezier(.22,1,.36,1), visibility .3s;
}
.mo-back-top.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.mo-back-top-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: #fff;
  font-size: 1.5rem;
  background: linear-gradient(145deg, #4f46e5 0%, #7c3aed 55%, #a855f7 100%);
  box-shadow:
    0 8px 24px rgba(79, 70, 229, 0.4),
    0 0 0 1px rgba(255,255,255,0.12) inset;
  transition: transform .25s cubic-bezier(.22,1,.36,1), box-shadow .25s;
}
.mo-back-top:hover .mo-back-top-inner {
  transform: translateY(-3px);
  box-shadow:
    0 14px 32px rgba(79, 70, 229, 0.5),
    0 0 0 1px rgba(255,255,255,0.18) inset;
}
.mo-back-top:active .mo-back-top-inner {
  transform: translateY(0) scale(0.96);
}
.mo-back-top i {
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.15));
}

/* Low graphics: simpler */
html.gfx-low .mo-back-top-inner,
html[data-gfx="low"] .mo-back-top-inner {
  box-shadow: 0 2px 8px rgba(0,0,0,.2) !important;
  background: #4f46e5 !important;
}
html.gfx-low .mo-back-top,
html[data-gfx="low"] .mo-back-top {
  transition: opacity .15s linear !important;
}

@media (max-width: 575.98px) {
  .mo-back-top {
    right: 1rem;
    bottom: 1rem;
    width: 44px;
    height: 44px;
  }
  .mo-back-top-inner {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 1.35rem;
  }
}

/* ===== Navbar layout 2026 ===== */
.mo-navbar {
  min-height: 68px;
  padding-top: .55rem;
  padding-bottom: .55rem;
  background: rgba(255,255,255,.82) !important;
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--border, rgba(15,23,42,.08));
  box-shadow: 0 1px 0 rgba(15,23,42,.03);
}
[data-theme="dark"] .mo-navbar {
  background: rgba(17,24,39,.88) !important;
}
.mo-nav-inner {
  gap: .75rem;
}
.mo-brand {
  display: inline-flex !important;
  align-items: center;
  gap: .55rem;
  margin-right: .5rem;
  padding: 0;
}
.mo-brand-text {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -.6px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed 60%, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Search */
.mo-search {
  width: 100%;
  max-width: 420px;
  flex: 1 1 auto;
}
.mo-search-box {
  display: flex;
  align-items: center;
  background: var(--bg, #f1f5f9);
  border: 1px solid var(--border, rgba(15,23,42,.08));
  border-radius: 999px;
  padding: .15rem .15rem .15rem .95rem;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.mo-search-box:focus-within {
  background: var(--bg-elevated, #fff);
  border-color: rgba(79,70,229,.45);
  box-shadow: 0 0 0 4px rgba(79,70,229,.12);
}
.mo-search-ico {
  color: var(--text-3, #94a3b8);
  margin-right: .4rem;
  font-size: .95rem;
}
.mo-search-box .form-control {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: .45rem .25rem;
  font-size: .92rem;
}
.mo-search-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  flex-shrink: 0;
  transition: transform .2s, box-shadow .2s;
}
.mo-search-btn:hover {
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(79,70,229,.35);
}

/* Right actions */
.mo-nav-actions {
  gap: .2rem;
}
.mo-nav-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 500;
  color: var(--text-2, #475569) !important;
  padding: .45rem .7rem !important;
  border-radius: 999px;
}
.mo-nav-link:hover {
  color: var(--primary, #4f46e5) !important;
  background: var(--primary-soft, rgba(79,70,229,.1));
}
.mo-btn-post {
  display: inline-flex !important;
  align-items: center;
  gap: .35rem;
  font-weight: 600;
  color: #fff !important;
  background: linear-gradient(135deg, #f97316, #fb923c) !important;
  border-radius: 999px !important;
  padding: .45rem 1rem !important;
  box-shadow: 0 6px 16px rgba(249,115,22,.35);
  transition: transform .2s, box-shadow .2s;
}
.mo-btn-post:hover {
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(249,115,22,.45);
}
.mo-nav-divider {
  width: 1px;
  height: 24px;
  background: var(--border, rgba(15,23,42,.12));
  margin: 0 .35rem;
  list-style: none;
}
.mo-icon-btn {
  width: 40px;
  height: 40px;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
  color: var(--text-2, #475569) !important;
  transition: background .2s, color .2s, transform .2s;
}
.mo-icon-btn:hover {
  background: var(--primary-soft, rgba(79,70,229,.12));
  color: var(--primary, #4f46e5) !important;
}
.mo-icon-btn.dropdown-toggle::after { display: none; }
.no-caret.dropdown-toggle::after { display: none !important; }
.mo-badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border: 2px solid #fff;
}
.mo-user-btn {
  display: inline-flex !important;
  align-items: center;
  gap: .45rem;
  padding: .25rem .45rem .25rem .25rem !important;
  border-radius: 999px !important;
  color: var(--text, #0f172a) !important;
}
.mo-user-btn:hover {
  background: var(--primary-soft, rgba(79,70,229,.1));
}
.mo-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(79,70,229,.25);
}
.mo-user-name {
  font-weight: 600;
  font-size: .9rem;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mo-btn-register {
  border: 1px solid rgba(79,70,229,.35);
  border-radius: 999px !important;
  padding: .4rem .9rem !important;
  font-weight: 600;
  color: var(--primary, #4f46e5) !important;
}
.mo-btn-register:hover {
  background: var(--primary, #4f46e5);
  color: #fff !important;
}

@media (max-width: 991.98px) {
  .mo-search { max-width: 100%; }
  .mo-nav-actions {
    padding-top: .75rem;
    border-top: 1px solid var(--border, rgba(15,23,42,.08));
    margin-top: .5rem;
    gap: .35rem;
  }
  .mo-btn-post { justify-content: center; }
}
