/* ShopCuaAi Super-App Theme (Pure Mẫu 10: Light-First #f2f4f8 + Cobalt #2563eb + Emerald #16a34a + Graphite Dark #0d1117) */

:root {
  --bg: #f2f4f8;
  --bg-elev: #ffffff;
  --surface-subtle: #e9eef6;
  --text: #0f172a;
  --muted: #5b6472;
  --line: rgba(15, 23, 42, 0.09);
  --line-strong: rgba(15, 23, 42, 0.13);
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: rgba(37, 99, 235, 0.10);
  --shop-price: #16a34a;
  --shop-action: #2563eb;
  --shop-action-hover: #1d4ed8;
  --shop-action-text: #ffffff;
  --rose: #ea580c;
  --market-ink: #2563eb;
  --market-tint: rgba(37, 99, 235, 0.09);
  --market-edge: rgba(37, 99, 235, 0.24);
  --shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
  --shadow-hover: 0 14px 32px rgba(37, 99, 235, 0.11);
  --store-title: "Outfit", "Be Vietnam Pro", system-ui, sans-serif;
  --store-copy: "Be Vietnam Pro", system-ui, sans-serif;
}

html.dark {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --surface-subtle: #1f2631;
  --text: #f0f6fc;
  --muted: #8b949e;
  --line: rgba(240, 246, 252, 0.10);
  --line-strong: rgba(240, 246, 252, 0.15);
  --brand: #3b82f6;
  --brand-strong: #60a5fa;
  --brand-soft: rgba(59, 130, 246, 0.15);
  --shop-price: #34d399;
  --shop-action: #2563eb;
  --shop-action-hover: #3b82f6;
  --shop-action-text: #ffffff;
  --rose: #fb923c;
  --market-ink: #60a5fa;
  --market-tint: rgba(59, 130, 246, 0.14);
  --market-edge: rgba(59, 130, 246, 0.30);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.36);
  --shadow-hover: 0 16px 36px rgba(0, 0, 0, 0.56);
}

body.is-superapp-shell,
html.dark body.is-superapp-shell {
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body.is-superapp-shell h1,
body.is-superapp-shell h2,
body.is-superapp-shell h3,
body.is-superapp-shell .brand-mark span {
  font-family: "Outfit", "Be Vietnam Pro", system-ui, sans-serif;
}

body.is-superapp-shell .site-ambient-backdrop {
  background: radial-gradient(60% 45% at 80% 0%, rgba(37, 99, 235, 0.045), transparent 65%);
}

html.dark body.is-superapp-shell .site-ambient-backdrop {
  background: radial-gradient(60% 45% at 80% 0%, rgba(59, 130, 246, 0.06), transparent 65%);
}

/* ---------- Unified Symmetric Desktop Container (Header / Main / Footer Flush) ---------- */
body.is-superapp-shell .shop-header__inner,
body.is-superapp-shell > main,
body.is-superapp-shell .shop-footer > div {
  max-width: 1380px !important;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Header & Search Pill ---------- */
body.is-superapp-shell .shop-header,
html.dark body.is-superapp-shell .shop-header {
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  border-bottom: 1px solid var(--line-strong);
}

body.is-superapp-shell .desktop-nav .nav-link:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

body.is-superapp-shell .desktop-nav .nav-link.is-active,
body.is-superapp-shell .mobile-bottom-nav .mobile-bottom-nav__item.is-active,
html.dark body.is-superapp-shell .mobile-bottom-nav .mobile-bottom-nav__item.is-active {
  color: var(--brand);
}

body.is-superapp-shell .desktop-nav .nav-link.is-active::before,
body.is-superapp-shell .mobile-bottom-nav .mobile-bottom-nav__item.is-active::before {
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 26%, transparent);
}

body.is-superapp-shell .sa-search-pill {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--muted);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

body.is-superapp-shell .sa-search-pill:hover {
  border-color: var(--brand);
  color: var(--text);
  background: var(--bg-elev);
}

.sa-search-pill__text,
.sa-search-pill__kbd {
  display: none;
}

@media (min-width: 768px) {
  body.is-superapp-shell .sa-search-pill {
    width: clamp(210px, 24vw, 310px);
    padding: 0 12px;
    justify-content: flex-start;
  }

  .sa-search-pill__text {
    display: inline;
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
  }

  .sa-search-pill__kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 5px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--bg-elev);
    border: 1px solid var(--line-strong);
    color: var(--muted);
  }
}

/* ---------- Buttons, User Avatar & Chat Widget ---------- */
body.is-superapp-shell .btn-primary,
html.dark body.is-superapp-shell .btn-primary,
body.is-superapp-shell .btn-primary:disabled:hover {
  background: var(--shop-action);
  background-image: none;
  color: var(--shop-action-text);
  border: 1px solid transparent;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--shop-action) 22%, transparent);
}

body.is-superapp-shell .btn-primary:hover:enabled,
body.is-superapp-shell a.btn-primary:hover {
  background: var(--shop-action-hover);
  color: var(--shop-action-text);
}

body.is-superapp-shell .user-menu__avatar {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

body.is-superapp-shell .live-chat__toggle {
  background: #2563eb;
  background-image: none;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

body.is-superapp-shell .live-chat__toggle:hover {
  background: #1d4ed8;
}

/* ---------- Showcase Hero (Neutral Slate #0f172a + Cobalt #2563eb + Emerald #34d399) ---------- */
body.is-superapp-shell .market-showcase {
  margin-bottom: 24px;
}

body.is-superapp-shell .market-stage {
  background: #0f172a;
  border-color: var(--line-strong);
  border-radius: 20px;
}

body.is-superapp-shell .market-slide__media::after {
  background: linear-gradient(90deg, #0f172a, rgba(15, 23, 42, 0.82) 18%, transparent 50%);
}

@media (max-width: 600px) {
  body.is-superapp-shell .market-slide__media::after {
    background: linear-gradient(90deg, #0f172a, transparent 20%), linear-gradient(0deg, #0f172a, transparent 25%);
  }
}

body.is-superapp-shell .market-eyebrow {
  color: #60a5fa;
}

body.is-superapp-shell .market-stage .store-picker {
  color: #f8fafc;
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

body.is-superapp-shell .market-stage .store-picker:is(:hover, [aria-expanded="true"]) {
  border-color: #3b82f6;
}

.store-picker-menu--stage [aria-selected="true"]::after {
  color: #60a5fa;
}

body.is-superapp-shell .market-offer__values strong,
body.is-superapp-shell .market-stage .market-offer strong:is([data-live-variant-price], [data-live-product-price]) {
  color: #34d399;
  text-shadow: none !important;
}

body.is-superapp-shell .market-stage .offer-facts__stock:not(.is-out):not(.is-checking) {
  color: #34d399;
}

body.is-superapp-shell .market-stage .market-buy:not(:disabled):not([aria-disabled="true"]) {
  background: #2563eb;
  background-image: none;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.34);
}

body.is-superapp-shell .market-stage .market-buy:not(:disabled):not([aria-disabled="true"]) span {
  color: #ffffff;
}

body.is-superapp-shell .market-stage .market-buy:hover:not(:disabled):not([aria-disabled="true"]) {
  background: #1d4ed8;
  border-color: transparent;
  color: #ffffff;
}

body.is-superapp-shell .market-pin {
  background: #2563eb;
  color: #ffffff;
}

/* ---------- Brand Logo Bubbles (Mẫu 10) ---------- */
.sa-brand-section {
  margin-bottom: 18px;
}

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

.sa-section-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.sa-section-title svg {
  width: 18px;
  height: 18px;
  color: var(--brand);
}

.sa-brand-bubbles {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: none;
}

.sa-brand-bubbles::-webkit-scrollbar {
  display: none;
}

.sa-bubble {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 6px 14px 6px 8px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.sa-bubble__ring {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--surface-subtle);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.sa-bubble__ring img {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: contain;
}

.sa-bubble__ring svg {
  width: 16px;
  height: 16px;
}

.sa-bubble:hover,
.sa-bubble.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  transform: translateY(-1px);
}

/* ---------- Horizontal Deep Deals Strip (Mẫu 10) ---------- */
.sa-deal-section {
  margin-bottom: 20px;
}

.sa-deal-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: none;
}

.sa-deal-strip::-webkit-scrollbar {
  display: none;
}

.sa-deal-card {
  flex: 0 0 auto;
  width: 248px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 11px 13px;
  border-radius: 15px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.sa-deal-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}

.sa-deal-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  padding: 7px;
  object-fit: contain;
}

.sa-deal-card__info {
  min-width: 0;
}

.sa-deal-card__name {
  display: block;
  font-family: var(--store-title);
  font-size: 0.85rem;
  font-weight: 750;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sa-deal-card__prices {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.sa-deal-card__now {
  font-family: var(--store-title);
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--shop-price);
  font-variant-numeric: tabular-nums;
}

.sa-deal-card__compare {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 0.72rem;
}

.sa-deal-card__compare del {
  color: var(--muted);
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

.sa-deal-card__pct {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 800;
  background: var(--rose);
  color: #ffffff;
}

/* ---------- Quick Filter & Sort Bar ---------- */
.sa-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.sa-filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sa-pill {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sa-pill:hover {
  border-color: var(--brand);
  color: var(--text);
}

.sa-pill.is-active {
  background: var(--shop-action);
  color: var(--shop-action-text);
  border-color: transparent;
}

.sa-filter-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.sa-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.sa-sort-select {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
}

/* ---------- Product Cards Grid (Mẫu 10) ---------- */
body.is-superapp-shell .catalog-grid {
  gap: 18px;
}

@media (min-width: 960px) {
  body.is-superapp-shell .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1340px) {
  body.is-superapp-shell .catalog-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

body.is-superapp-shell .catalog-grid .product-card {
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body.is-superapp-shell .catalog-grid article.product-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: var(--shadow-hover);
}

body.is-superapp-shell .catalog-grid .product-card.sa-filtered-out {
  display: none !important;
}

.sa-cover-discount {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--rose);
  color: #ffffff;
  font-family: var(--store-title);
  font-size: 0.74rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 10px rgba(234, 88, 12, 0.25);
}

.sa-cover-discount[hidden] {
  display: none;
}

body.is-superapp-shell .catalog-grid .product-card__body {
  padding: 14px 16px 16px;
  gap: 7px;
}

body.is-superapp-shell .catalog-grid .product-card__title {
  font-family: var(--store-title);
  font-size: 1.04rem;
  font-weight: 750;
  line-height: 1.3;
}

body.is-superapp-shell .catalog-grid .product-card__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding-top: 11px;
  margin-top: auto;
  border-top: 1px solid var(--line);
}

body.is-superapp-shell .catalog-grid .product-card__price-wrap {
  width: auto;
  min-width: 0;
}

body.is-superapp-shell .catalog-grid .product-card .product-card__price {
  font-family: var(--store-title);
  color: var(--shop-price);
  text-shadow: none !important;
}

html.dark body.is-superapp-shell .catalog-grid .product-card .product-card__price {
  color: var(--shop-price);
  text-shadow: none !important;
}

body.is-superapp-shell .catalog-grid .product-card__original-price {
  color: var(--muted);
  opacity: 0.85;
}

body.is-superapp-shell .price-discount-badge {
  background: rgba(234, 88, 12, 0.11);
  border-color: rgba(234, 88, 12, 0.26);
  color: #c2410c;
}

html.dark body.is-superapp-shell .price-discount-badge {
  background: rgba(251, 146, 60, 0.16);
  border-color: rgba(251, 146, 60, 0.34);
  color: #fdba74;
}

.sa-card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 10px;
  background: var(--shop-action);
  color: var(--shop-action-text);
  font-size: 0.79rem;
  font-weight: 750;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.16s ease, transform 0.15s ease;
}

body.is-superapp-shell .catalog-grid .product-card:is(:hover, :focus-within) .sa-card-cta {
  background: var(--shop-action-hover);
  transform: translateY(-1px);
}

@media (max-width: 639px) {
  .sa-card-cta {
    display: none;
  }
}

/* ---------- Filter Empty State ---------- */
.sa-filter-empty {
  margin-top: 14px;
  padding: 36px 20px;
  text-align: center;
  border-radius: 16px;
  border: 1px dashed var(--line-strong);
  background: var(--bg-elev);
}

.sa-filter-empty p {
  color: var(--muted);
  margin-bottom: 12px;
  font-size: 0.92rem;
}
