/* ═══════════════════════════════════════════════════════════════════════════
   YNEX 4.1 FRONTEND DESIGN SYSTEM (tpl=ynex)
   Modern De-Cardified E-Commerce, Community & Asset Workbench
   Desktop (>=992px) & Mobile App Suite (<=991.98px)
   ═══════════════════════════════════════════════════════════════════════════ */

:root,
body.theme-ynex {
  --ynex-primary: #845adf;
  --ynex-primary-rgb: 132, 90, 223;
  --ynex-primary-hover: #7246d1;
  --ynex-primary-light: rgba(132, 90, 223, 0.14);
  --ynex-primary-border: rgba(132, 90, 223, 0.32);

  --ynex-secondary: #23b7e5;
  --ynex-secondary-rgb: 35, 183, 229;
  --ynex-secondary-light: rgba(35, 183, 229, 0.14);

  --ynex-success: #26bf94;
  --ynex-success-rgb: 38, 191, 148;
  --ynex-success-light: rgba(38, 191, 148, 0.14);

  --ynex-warning: #f5b849;
  --ynex-warning-rgb: 245, 184, 73;
  --ynex-warning-light: rgba(245, 184, 73, 0.14);

  --ynex-danger: #e6533c;
  --ynex-danger-rgb: 230, 83, 60;
  --ynex-danger-light: rgba(230, 83, 60, 0.14);

  /* Override Legacy Theme Variables */
  --bg: #11131e !important;
  --bg2: #161926 !important;
  --card: #1a1c27 !important;
  --card-hover: #212432 !important;
  --border: rgba(255, 255, 255, 0.075) !important;
  --action: #845adf !important;
  --action-dark: #6e42c9 !important;
  --action-light: rgba(132, 90, 223, 0.14) !important;
  --accent: #a584f3 !important;
  --accent2: #23b7e5 !important;
  --money: #26bf94 !important;
  --money-light: rgba(38, 191, 148, 0.14) !important;
  --gold: #f5b849 !important;
  --text: #f0f2f8 !important;
  --muted: #8c9097 !important;
  --grad-head: linear-gradient(135deg, #1a1c27 0%, #1e1b36 100%) !important;
  --grad-action: linear-gradient(135deg, #845adf 0%, #6b40c9 100%) !important;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.28) !important;
  --shadow-lg: 0 12px 34px rgba(0, 0, 0, 0.48) !important;
}

body.theme-ynex {
  background-color: #11131e !important;
  background-image:
    radial-gradient(850px 420px at 15% -5%, rgba(132, 90, 223, 0.10), transparent 65%),
    radial-gradient(750px 380px at 88% 0%, rgba(35, 183, 229, 0.07), transparent 60%) !important;
  color: #f0f2f8 !important;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0.01em;
}

/* ─── 1. Ynex Top Utility Strip (Desktop) ─── */
.ynex-util-bar {
  background: #0d0f18;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  font-size: 0.76rem;
  color: #8c9097;
  padding: 5px 0;
}
.ynex-util-bar a {
  color: #8c9097;
  text-decoration: none;
  transition: color 0.15s ease;
}
.ynex-util-bar a:hover {
  color: #a584f3;
}
.ynex-util-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #26bf94;
  box-shadow: 0 0 8px #26bf94;
  display: inline-block;
}

/* ─── 2. Ynex Desktop Main Header ─── */
body.theme-ynex .navbar.desktop-navbar {
  background: rgba(26, 28, 39, 0.92) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.075) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
  padding: 0.55rem 0;
}
.ynex-brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #845adf 0%, #23b7e5 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  box-shadow: 0 3px 12px rgba(132, 90, 223, 0.38);
}
.ynex-search-group {
  position: relative;
  max-width: 440px;
  width: 100%;
}
.ynex-search-group .form-control {
  background: #11131e !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: 8px !important;
  padding: 0.45rem 4.8rem 0.45rem 2.25rem !important;
  font-size: 0.85rem;
  color: #f0f2f8 !important;
  height: 38px;
}
.ynex-search-group .form-control:focus {
  border-color: #845adf !important;
  box-shadow: 0 0 0 3px rgba(132, 90, 223, 0.18) !important;
}
.ynex-search-group .ynex-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #8c9097;
  font-size: 0.88rem;
  pointer-events: none;
}
.ynex-search-group .ynex-search-kbd {
  position: absolute;
  right: 42px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #8c9097;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.ynex-search-group .ynex-search-submit {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: 4px;
  border: none;
  background: rgba(132, 90, 223, 0.18);
  color: #a584f3;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 0.82rem;
  transition: all 0.15s ease;
}
.ynex-search-group .ynex-search-submit:hover {
  background: #845adf;
  color: #fff;
}

/* ─── 3. Ynex Category & Hot-Search Ribbon ─── */
body.theme-ynex .cat-nav.desktop-catnav {
  background: #151722 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065) !important;
  padding: 6px 0;
}
body.theme-ynex .cat-nav a {
  padding: 5px 12px !important;
  margin-right: 4px;
  border-radius: 6px !important;
  border-bottom: none !important;
  font-size: 0.82rem !important;
  font-weight: 500;
  color: #a3a8b8 !important;
  transition: all 0.15s ease;
}
body.theme-ynex .cat-nav a:hover {
  background: rgba(132, 90, 223, 0.1) !important;
  color: #d2c2fb !important;
}
body.theme-ynex .cat-nav a.active {
  background: rgba(132, 90, 223, 0.18) !important;
  color: #b79dfa !important;
  border: 1px solid rgba(132, 90, 223, 0.35) !important;
  font-weight: 600;
}
body.theme-ynex .hot-kw-bar {
  background: #11131e !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  padding: 6px 0 !important;
}
body.theme-ynex .hot-kw-tag {
  border-radius: 5px !important;
  padding: 2px 9px !important;
  font-size: 0.75rem !important;
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  color: #8c9097 !important;
}
body.theme-ynex .hot-kw-tag:hover {
  background: rgba(132, 90, 223, 0.14) !important;
  border-color: rgba(132, 90, 223, 0.4) !important;
  color: #b79dfa !important;
}

/* ─── 4. Ynex Typography, Cards, Ribbons & Headers ─── */
body.theme-ynex .card {
  background: #1a1c27 !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22) !important;
}
body.theme-ynex .card-header {
  background: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065) !important;
  padding: 0.85rem 1.15rem;
}
.ynex-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}
.ynex-section-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #f0f2f8;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  position: relative;
  padding-left: 11px;
}
.ynex-section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 3.5px;
  border-radius: 3px;
  background: linear-gradient(180deg, #845adf, #23b7e5);
}
body.theme-ynex .section-title::before {
  background: linear-gradient(180deg, #845adf, #23b7e5) !important;
  width: 4px !important;
}

/* De-Cardified Ynex Stat Ribbon (Connected Strip with Dashed Dividers) */
.ynex-kpi-strip {
  background: #1a1c27;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
}
.ynex-kpi-item {
  flex: 1 1 200px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-right: 1px dashed rgba(255, 255, 255, 0.08);
  text-decoration: none !important;
  transition: background 0.18s ease;
}
.ynex-kpi-item:last-child {
  border-right: none;
}
.ynex-kpi-item:hover {
  background: rgba(132, 90, 223, 0.06);
}
.ynex-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.ynex-kpi-icon.purple { background: rgba(132, 90, 223, 0.15); color: #a584f3; }
.ynex-kpi-icon.cyan   { background: rgba(35, 183, 229, 0.15); color: #23b7e5; }
.ynex-kpi-icon.green  { background: rgba(38, 191, 148, 0.15); color: #26bf94; }
.ynex-kpi-icon.amber  { background: rgba(245, 184, 73, 0.15); color: #f5b849; }
.ynex-kpi-icon.coral  { background: rgba(230, 83, 60, 0.15);  color: #e6533c; }

/* ─── 5. Ynex E-Commerce Product Cards & Simple List ─── */
.ynex-prod-card {
  background: #1a1c27 !important;
  border: 1px solid rgba(255, 255, 255, 0.075) !important;
  border-radius: 0.5rem !important;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.ynex-prod-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #845adf, #23b7e5);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
}
.ynex-prod-card:hover {
  transform: translateY(-4px);
  border-color: rgba(132, 90, 223, 0.45) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45) !important;
}
.ynex-prod-card:hover::before {
  opacity: 1;
}
.ynex-prod-thumb {
  position: relative;
  height: 158px;
  background: #121420;
  overflow: hidden;
}
.ynex-prod-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.32s ease;
}
.ynex-prod-card:hover .ynex-prod-thumb img {
  transform: scale(1.05);
}
.ynex-thumb-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 1;
}
.ynex-cat-float {
  background: rgba(17, 19, 30, 0.82);
  backdrop-filter: blur(6px);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 500;
}
.ynex-prod-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.ynex-prod-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f0f2f8;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}
.ynex-prod-foot {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.075);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ynex-price {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-weight: 700;
  color: #26bf94 !important;
  font-size: 1.12rem;
}

/* Ynex Simple Row List */
.ynex-simple-wrap {
  background: #1a1c27;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 0.5rem;
  overflow: hidden;
}
.ynex-simple-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}
.ynex-simple-row:last-child {
  border-bottom: none;
}
.ynex-simple-row:hover {
  background: rgba(132, 90, 223, 0.06);
  border-left-color: #845adf;
}

/* ─── 6. Ynex Buttons, Pills & Filter Toolbar ─── */
body.theme-ynex .btn-action,
body.theme-ynex .btn-primary {
  background: linear-gradient(135deg, #845adf 0%, #6e42c9 100%) !important;
  border: 1px solid #845adf !important;
  color: #fff !important;
  border-radius: 6px !important;
  box-shadow: 0 3px 12px rgba(132, 90, 223, 0.32) !important;
  font-weight: 600;
}
body.theme-ynex .btn-action:hover,
body.theme-ynex .btn-primary:hover {
  background: linear-gradient(135deg, #7348cf 0%, #5c32b5 100%) !important;
  box-shadow: 0 5px 16px rgba(132, 90, 223, 0.48) !important;
  transform: translateY(-1px);
}
body.theme-ynex .btn-outline-action,
body.theme-ynex .btn-outline-primary {
  color: #a584f3 !important;
  border-color: rgba(132, 90, 223, 0.45) !important;
  background: rgba(132, 90, 223, 0.06) !important;
  border-radius: 6px !important;
}
body.theme-ynex .btn-outline-action:hover,
body.theme-ynex .btn-outline-primary:hover {
  background: #845adf !important;
  color: #fff !important;
  border-color: #845adf !important;
}
body.theme-ynex .cat-pill {
  border-radius: 6px !important;
  padding: 5px 13px !important;
  font-size: 0.82rem !important;
  background: #1a1c27 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #a3a8b8 !important;
  margin: 3px !important;
}
body.theme-ynex .cat-pill:hover,
body.theme-ynex .cat-pill.active {
  background: rgba(132, 90, 223, 0.18) !important;
  color: #c4b0ff !important;
  border-color: #845adf !important;
  box-shadow: 0 2px 10px rgba(132, 90, 223, 0.25) !important;
}
body.theme-ynex .market-toolbar {
  background: #1a1c27 !important;
  border: 1px solid rgba(255, 255, 255, 0.075) !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22) !important;
}
body.theme-ynex .sort-chip.active {
  color: #b79dfa !important;
  background: rgba(132, 90, 223, 0.16) !important;
  border: 1px solid rgba(132, 90, 223, 0.38) !important;
  box-shadow: none !important;
}
body.theme-ynex .view-switch-item.active {
  background: linear-gradient(135deg, #845adf, #6e42c9) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(132, 90, 223, 0.38) !important;
}

/* ─── 7. Ynex Personal Center & Sidebar ─── */
body.theme-ynex .pc-menu .list-group-item {
  background: transparent !important;
  border: none !important;
  border-left: 3px solid transparent !important;
  border-radius: 0 6px 6px 0 !important;
  color: #949eb7 !important;
  padding: 8px 12px !important;
  font-size: 0.85rem;
  margin-bottom: 2px;
  transition: all 0.15s ease;
}
body.theme-ynex .pc-menu .list-group-item:hover {
  background: rgba(132, 90, 223, 0.08) !important;
  color: #d2c2fb !important;
}
body.theme-ynex .pc-menu .list-group-item.active {
  background: rgba(132, 90, 223, 0.15) !important;
  color: #b79dfa !important;
  border-left-color: #845adf !important;
  font-weight: 600;
  box-shadow: none !important;
}

/* ─── 8. Ynex Tables & Pagination ─── */
body.theme-ynex .table thead th {
  background: #141622 !important;
  color: #8c9097 !important;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075) !important;
  padding: 10px 12px;
}
body.theme-ynex .table tbody td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  padding: 10px 12px;
  font-size: 0.86rem;
}
body.theme-ynex .pagination {
  gap: 4px;
}
body.theme-ynex .page-link {
  background: #1a1c27 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
  border-radius: 6px !important;
  margin: 0 !important;
  padding: 6px 12px !important;
  font-size: 0.84rem !important;
  font-weight: 500;
  transition: all 0.15s ease;
}
body.theme-ynex .page-link:hover {
  background: rgba(132, 90, 223, 0.16) !important;
  border-color: rgba(132, 90, 223, 0.45) !important;
  color: #fff !important;
}
body.theme-ynex .page-item.active .page-link {
  background: linear-gradient(135deg, #845adf, #6e42c9) !important;
  border-color: #845adf !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(132, 90, 223, 0.35);
}
body.theme-ynex .page-item.disabled .page-link {
  background: rgba(26, 28, 39, 0.45) !important;
  border-color: rgba(255, 255, 255, 0.04) !important;
  color: #5b6275 !important;
}

/* ─── 9. Ynex Mobile App Suite (<= 991.98px) ─── */
@media (max-width: 991.98px) {
  body.theme-ynex main {
    padding-top: calc(100px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body.theme-ynex .mobile-sticky-top {
    background: rgba(22, 25, 38, 0.96) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(132, 90, 223, 0.22) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45) !important;
  }
  body.theme-ynex .m-top-nav-btn.active {
    background: linear-gradient(135deg, #845adf, #6e42c9) !important;
    box-shadow: 0 2px 8px rgba(132, 90, 223, 0.4) !important;
  }
  body.theme-ynex .m-search-box {
    background: #11131e !important;
    border: 1.5px solid rgba(132, 90, 223, 0.38) !important;
    border-radius: 10px !important;
    padding: 2px 4px 2px 12px !important;
  }
  body.theme-ynex .m-search-ico {
    color: #a584f3 !important;
  }
  body.theme-ynex .m-search-btn {
    background: linear-gradient(135deg, #845adf, #6e42c9) !important;
    border-radius: 7px !important;
    box-shadow: 0 2px 8px rgba(132, 90, 223, 0.35) !important;
  }
  body.theme-ynex .mobile-tabbar {
    background: rgba(22, 25, 38, 0.97) !important;
    border-top: 1px solid rgba(132, 90, 223, 0.22) !important;
  }
  body.theme-ynex .tabbar-item.active,
  body.theme-ynex .tabbar-item.active .tabbar-icon i,
  body.theme-ynex .tabbar-item.active .tabbar-label {
    color: #a584f3 !important;
  }
  body.theme-ynex .tabbar-plus-circle {
    background: linear-gradient(135deg, #845adf, #23b7e5) !important;
    box-shadow: 0 4px 14px rgba(132, 90, 223, 0.5) !important;
    border-color: #161926 !important;
  }
  .ynex-kpi-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  .ynex-kpi-item {
    padding: 10px 12px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
  }
}
