/* ==========================================================================
   MOE Cart Theme
   在原有购物车模板结构上做视觉覆盖，不改动下单/支付表单逻辑。
   作用域：body（由 common.tpl 注入）
   ========================================================================== */

body {
  --mc-bg: #ffffff;
  --mc-ink: #0b0f19;
  --mc-sub: #5b6472;
  --mc-muted: #98a2b3;
  --mc-line: #e5eaf1;
  --mc-blue: #2f74d4;
  --mc-blue-soft: #eaf3ff;
  --mc-card: #ffffff;
  --mc-shadow: 0 18px 40px rgba(24, 54, 100, .1);
  background: var(--mc-bg);
  color: var(--mc-ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 背景 ---------- */
body .main-content {
  min-height: 100vh;
  background:
    radial-gradient(760px 420px at 82% 2%, rgba(142, 190, 255, .16), transparent 65%),
    radial-gradient(620px 380px at 8% 30%, rgba(255, 208, 236, .12), transparent 66%),
    #fff;
}

body .page-content {
  padding: 96px 0 80px;
}

body .page-content > .container-fluid {
  width: auto;
  max-width: none;
  margin: 0 24px;
  padding-left: 0;
  padding-right: 0;
}

/* ---------- 顶部栏 ---------- */
body #page-topbar {
  height: 72px;
  background: rgba(255, 255, 255, .9);
  border-bottom: 1px solid var(--mc-line);
  box-shadow: none;
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  z-index: 1030;
}

body #page-topbar .navbar-header {
  height: 72px;
  padding: 0 28px;
  align-items: center;
}

body #page-topbar .navbar-brand-box {
  width: auto !important;
  padding: 0 !important;
  background: transparent !important;
}

body #page-topbar .logo-lg img {
  height: 38px;
  width: auto;
}

body #page-topbar .logo-sm img {
  height: 34px;
  width: auto;
}

body #vertical-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-right: 8px;
  color: var(--mc-ink);
  background: #f4f7fb;
  border-radius: 50%;
}

body #page-header-search-dropdown {
  display: none !important;
}

/* ---------- 左侧菜单（恢复显示，浅色化） ---------- */
body .vertical-menu {
  top: 72px;
  background: #fff !important;
  border-right: 1px solid var(--mc-line);
  box-shadow: none;
}

body[data-sidebar] #sidebar-menu ul li a {
  margin: 4px 10px;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--mc-sub);
  border-radius: 10px;
  transition: background-color .2s ease, color .2s ease;
}

body[data-sidebar] #sidebar-menu ul li a i {
  margin-right: 8px;
  font-size: 18px;
  color: var(--mc-muted);
}

body[data-sidebar] #sidebar-menu ul li a:hover,
body[data-sidebar] #sidebar-menu ul li a.active,
body[data-sidebar] #sidebar-menu .mm-active > a {
  color: var(--mc-blue) !important;
  background: var(--mc-blue-soft) !important;
}

body[data-sidebar] #sidebar-menu ul li a:hover i,
body[data-sidebar] #sidebar-menu .mm-active > a i {
  color: var(--mc-blue) !important;
}

/* 子菜单与会员中心保持一致，避免展开后字号/间距变大 */
body[data-sidebar] #sidebar-menu ul li ul.sub-menu li a,
body[data-sidebar] .vertical-menu .sub-menu a {
  margin: 2px 10px;
  padding: 9px 14px 9px 34px;
  font-size: 13px;
  color: var(--mc-sub);
  border-radius: 10px;
}

body[data-sidebar] #sidebar-menu ul li ul.sub-menu li ul.sub-menu li a {
  padding-left: 46px;
  font-size: 12.5px;
}

body[data-sidebar] #sidebar-menu ul li ul.sub-menu li a:hover,
body[data-sidebar] #sidebar-menu ul li ul.sub-menu li a.active {
  color: var(--mc-blue) !important;
  background: var(--mc-blue-soft) !important;
}

body[data-sidebar] .vertical-menu .simplebar-content {
  padding-top: 12px;
}

body #page-topbar .header-item {
  height: 40px;
  color: var(--mc-ink);
  border-radius: 50%;
}

body #page-topbar .noti-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 4px;
  background: #f4f7fb;
  border-radius: 50%;
  transition: background-color .2s ease, color .2s ease;
}

body #page-topbar .noti-icon:hover {
  background: var(--mc-blue-soft);
  color: var(--mc-blue);
}

body #page-topbar a[href="message"] {
  display: none !important;
}

body #page-topbar .pointer a {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  color: #fff !important;
  background: var(--mc-blue);
  border-radius: 6px;
  transition: background-color .2s ease;
}

body #page-topbar .pointer a:hover {
  background: #1f5cb0;
}

/* ---------- 页脚 ---------- */
body .footer {
  height: auto;
  padding: 22px 24px;
  color: var(--mc-muted);
  background: transparent;
  border-top: 1px solid var(--mc-line);
}

/* ---------- 页面头部 / 步骤 ---------- */
body .page-title-box {
  display: none !important;
}

.moe-cart-head {
  margin: 0 0 26px;
}

.moe-cart-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--mc-muted);
}

.moe-cart-crumbs a {
  color: var(--mc-sub);
}

.moe-cart-crumbs a:hover {
  color: var(--mc-blue);
}

.moe-cart-head h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--mc-ink);
}

.moe-cart-head p {
  max-width: 760px;
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--mc-sub);
}

.cart-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cart-steps .cstep {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--mc-sub);
  background: #fff;
  border: 1px solid var(--mc-line);
  border-radius: 999px;
}

.cart-steps .cstep b {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: 700;
  color: var(--mc-blue);
  background: var(--mc-blue-soft);
  border-radius: 50%;
}

.cart-steps .cstep.active {
  color: #fff;
  background: var(--mc-blue);
  border-color: var(--mc-blue);
}

.cart-steps .cstep.active b {
  color: var(--mc-blue);
  background: #fff;
}

.cart-steps .cstep.done {
  color: var(--mc-blue);
  border-color: rgba(47, 116, 212, .35);
}

/* ---------- 通用卡片 / 按钮 / 表单 ---------- */
body .card {
  background: var(--mc-card);
  border: 1px solid var(--mc-line);
  border-radius: 18px;
  box-shadow: none;
}

body .card-body {
  padding: 26px;
}

body .card-footer {
  background: transparent;
  border-top: 1px solid var(--mc-line);
}

body .btn {
  border-radius: 8px;
  font-weight: 600;
}

body .btn-primary {
  color: #fff;
  background: var(--mc-blue);
  border-color: var(--mc-blue);
}

body .btn-primary:hover,
body .btn-primary:focus {
  background: #1f5cb0;
  border-color: #1f5cb0;
}

body .btn-outline-primary {
  color: var(--mc-blue);
  border-color: var(--mc-blue);
}

body .btn-outline-primary:hover {
  color: #fff;
  background: var(--mc-blue);
}

body .form-control,
body .custom-select {
  min-height: 40px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--mc-ink);
  background-color: #fff;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  box-shadow: none;
}

body .form-control:focus,
body .custom-select:focus {
  border-color: var(--mc-blue);
  box-shadow: 0 0 0 3px rgba(47, 116, 212, .12);
}

body .custom-control-label::before {
  border-color: #cfd8e3;
}

body .custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--mc-blue);
  border-color: var(--mc-blue);
}

body .breadcrumb {
  margin: 0;
  background: transparent;
}

/* ---------- 产品类型 / 区域 ---------- */
body .firstgroup_box,
body .secondgroup_box {
  padding: 0 !important;
  margin-bottom: 26px !important;
  background: transparent !important;
  border: 0 !important;
}

body .firstgroup_box_prov,
body .secondgroup_box_area {
  margin: 0 0 12px !important;
  padding: 0 !important;
  font-size: 14px !important;
  font-weight: 700;
  color: var(--mc-ink) !important;
}

body .yy-bl {
  display: inline-block;
  width: 4px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  background: var(--mc-blue);
  border-radius: 2px;
}

body .firstgroup_box_group {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 0 !important;
}

body .yy-bth {
  float: none !important;
  width: 100% !important;
  max-width: 100%;
  padding: 0 !important;
  margin: 0 !important;
}

body .firstgroup_item,
body .secondgroup_item {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  width: 100%;
  height: auto !important;
  padding: 12px 16px !important;
  color: var(--mc-ink) !important;
  background: #fff !important;
  border: 1px solid var(--mc-line) !important;
  border-radius: 12px !important;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

body .firstgroup_item:hover,
body .secondgroup_item:hover {
  border-color: var(--mc-blue) !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(24, 54, 100, .1);
}

body .firstgroup_item.active,
body .secondgroup_item.active {
  color: #fff !important;
  background: linear-gradient(120deg, #2f74d4 0%, #3f8ae6 100%) !important;
  border-color: #2f74d4 !important;
  box-shadow: 0 10px 24px rgba(47, 116, 212, .28);
}

body .firstgroup_item.active .yy-bth-text,
body .secondgroup_item.active .yy-bth-text,
body .firstgroup_item.active a,
body .secondgroup_item.active a {
  color: #fff !important;
}

body .yy-bth-text {
  display: block;
  margin: 0 !important;
  color: inherit !important;
  font-size: 14px !important;
  line-height: 1.4;
}

body .yy-bth-text-a {
  font-size: 16px !important;
  font-weight: 700;
}

body .yy-bth-text-b {
  font-size: 12px !important;
  opacity: .72;
}

body .secondgroup_item img {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
}

/* ---------- 产品卡片 ---------- */
body .cartitem {
  border: 1px solid var(--mc-line);
  border-radius: 16px;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

body .cartitem:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 116, 212, .5);
  box-shadow: var(--mc-shadow);
}

body .cartitem h4 {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--mc-ink);
}

body .cartitem .card-text {
  font-size: 13px;
  line-height: 1.8;
  color: var(--mc-sub);
}

body .cartitem {
  overflow: hidden;
  border: 1px solid var(--mc-line) !important;
  background: #fff !important;
}

body .cartitem .card-footer {
  margin: 16px 0 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 0 16px 16px;
  box-shadow: none !important;
}

body .cartitem .card-footer a {
  display: block;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #fff !important;
  text-align: center;
  background: var(--mc-blue) !important;
  border: 0 !important;
  border-radius: 0 !important;
  transition: background-color .2s ease;
}

body .cartitem .card-footer a:hover {
  background: #1f5cb0 !important;
}

body .cartitem .card-footer a[style*="not-allowed"] {
  background: #c3cad6 !important;
}

body .cartitem [style*="--bs-btn-hover-bg"] {
  color: var(--mc-blue) !important;
}

/* ---------- 购物车 / 结算 ---------- */
body .goods_info {
  padding: 14px 0;
  border-bottom: 1px dashed var(--mc-line);
}

body .goods_info .title {
  font-size: 14px;
  font-weight: 600;
}

body .price-num {
  color: var(--mc-blue);
  font-weight: 700;
}

body .submit-btn {
  height: 48px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--mc-blue);
  border: 0;
  border-radius: 8px;
}

body .submit-btn:hover {
  background: #1f5cb0;
}

body .mobile-bottom-total {
  background: #fff;
  border-top: 1px solid var(--mc-line);
  box-shadow: 0 -10px 30px rgba(24, 54, 100, .08);
}

body .checkboxDiv,
body .addfunds-payment {
  border-radius: 10px;
}

body .table thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--mc-muted);
  text-transform: uppercase;
  border-color: var(--mc-line);
}

body .table td {
  border-color: var(--mc-line);
}

body .alert {
  border-radius: 10px;
}

/* ---------- 完成页 ---------- */
body .twitter-bs-wizard .nav-link {
  border-radius: 8px;
}

body .progress {
  height: 6px;
  background: #eef2f7;
  border-radius: 999px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 992px) {
  body #page-topbar .navbar-header {
    padding: 0 16px;
  }

  body .page-content {
    padding-top: 88px;
  }

  body .page-content > .container-fluid {
    width: auto;
    margin: 0 12px;
  }

  body .card-body {
    padding: 20px;
  }

  .moe-cart-head h1 {
    font-size: 28px;
  }

  body .firstgroup_item,
  body .secondgroup_item {
    min-width: 132px;
    padding: 10px 14px !important;
  }
}

@media (max-width: 575px) {
  body #page-topbar {
    height: 64px;
  }

  body #page-topbar .navbar-header {
    height: 64px;
  }

  body #page-topbar .logo-lg img,
  body #page-topbar .logo-sm img {
    height: 32px;
  }

  body .page-content {
    padding-top: 80px;
  }

  body .moe-cart-head h1 {
    font-size: 24px;
  }

  body .cart-steps .cstep {
    padding: 7px 11px;
    font-size: 11.5px;
  }
}

/* ---------- 与首页一致的蓝色主色 / 去除旧紫色 ---------- */
body {
  --primary: #2f74d4;
  --bs-global: #2f74d4;
  --bs-global-o-0: rgba(47, 116, 212, 0);
  --bs-primary: #2f74d4;
  --bs-btn-bg: #2f74d4;
  --bs-btn-border-color: #2f74d4;
  --bs-btn-hover-bg: #2f74d4;
  --bs-btn-hover-border-color: #2f74d4;
  --bs-btn-active-bg: #2f74d4;
  --bs-btn-active-border-color: #2f74d4;
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-color: #fff;
  --btn-active-border-color: #2f74d4;
}

body .firstgroup_box .firstgroup_box_prov,
body .secondgroup_box .secondgroup_box_area {
  color: var(--mc-ink) !important;
}

body .firstgroup_box .firstgroup_item.active,
body .secondgroup_box .secondgroup_item.active {
  color: #fff !important;
  background: linear-gradient(120deg, #2f74d4 0%, #3f8ae6 100%) !important;
  border-color: #2f74d4 !important;
}

body .cartitem h4 {
  color: var(--mc-ink) !important;
}

/* ---------- 动漫头图 ---------- */
.moe-cart-head {
  position: relative;
  min-height: 120px;
  padding-right: 200px;
}

.moe-cart-head::after {
  content: "";
  position: absolute;
  top: -26px;
  right: 0;
  width: 190px;
  height: 165px;
  background: url("/themes/web/moe/assets/img/hero-anime.png") center / contain no-repeat;
  opacity: .95;
  pointer-events: none;
}

@media (max-width: 768px) {
  .moe-cart-head {
    padding-right: 0;
    min-height: 0;
  }

  .moe-cart-head::after {
    display: none;
  }
}

/* 侧栏淡蓝渐变与当前页高亮 */
body .vertical-menu {
  background: linear-gradient(180deg, #f7fbff 0, #ffffff 220px) !important;
}

body[data-sidebar] #sidebar-menu a[href="/cart"] {
  color: var(--mc-blue) !important;
  background: var(--mc-blue-soft) !important;
}

body[data-sidebar] #sidebar-menu a[href="/cart"] i {
  color: var(--mc-blue) !important;
}

/* ---------- 产品列表：与分组区域左右对齐 ---------- */
body .card:has(.cartitem) {
  margin: 0 0 8px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body .card:has(.cartitem) > .card-body {
  padding: 0 !important;
}

body .card:has(.cartitem) > .card-body > .row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
  margin: 0 !important;
}

body .card:has(.cartitem) > .card-body > .row > [class*="col-"] {
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body .card:has(.cartitem) .cartitem {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0 !important;
}

body .card:has(.cartitem) .cartitem > .card-body {
  flex: 1 1 auto;
}

/* 分组/区域卡片：消除旧主题外边距造成的右侧溢出 */
body .firstgroup_box_group > * {
  min-width: 0;
}

body .firstgroup_box_group > .yy-bth {
  height: 100%;
}

body .firstgroup_box_group .firstgroup_item,
body .firstgroup_box_group .secondgroup_item {
  height: 100% !important;
  margin: 0 !important;
  overflow: hidden;
}

body .yy-bth-text {
  white-space: normal !important;
  overflow-wrap: anywhere;
}

body .text-primary,
body .yy-bth.text-primary {
  color: var(--mc-blue) !important;
}

/* ---------- 商品描述：各分组统一为 moe 规格行 ---------- */
body .cartitem .card-text {
  margin-bottom: 0 !important;
  font-size: 13px !important;
  line-height: 1.9 !important;
  color: var(--mc-sub) !important;
}

/* 套餐一：li + span 规格列表 */
body .cartitem .card-text li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;
  list-style: none;
  border-bottom: 1px dashed var(--mc-line);
}

body .cartitem .card-text li:last-child {
  border-bottom: 0;
}

body .cartitem .card-text li span:first-child {
  flex: 0 0 auto;
  color: var(--mc-muted);
  white-space: nowrap;
}

body .cartitem .card-text li span:last-child {
  color: var(--mc-ink);
  text-align: right;
  overflow-wrap: anywhere;
}

/* 套餐二：xyy-spec 结构化规格 */
body .cartitem .xyy-spec {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  overflow: visible !important;
  color: var(--mc-sub) !important;
  background: transparent !important;
  border-radius: 0 !important;
  font-size: 13px !important;
  line-height: 1.9 !important;
}

body .cartitem .xyy-row {
  padding: 6px 0 !important;
  background: transparent !important;
  border-bottom: 1px dashed var(--mc-line) !important;
}

body .cartitem .xyy-row:hover {
  background: transparent !important;
}

body .cartitem .xyy-label {
  padding-left: 0 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: var(--mc-muted) !important;
}

body .cartitem .xyy-label::before {
  display: none !important;
}

body .cartitem .xyy-value {
  flex: 1 1 auto !important;
  margin-left: 12px !important;
  font-size: 13px !important;
  color: var(--mc-ink) !important;
}

body .cartitem .xyy-tag {
  flex: 0 0 auto !important;
  min-width: 0 !important;
  margin-left: auto !important;
  padding: 2px 8px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: var(--mc-blue) !important;
  background: var(--mc-blue-soft) !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}

body .cartitem .xyy-banner {
  margin-top: 10px !important;
  padding: 8px 0 !important;
  background: var(--mc-blue-soft) !important;
  border-radius: 10px !important;
}

body .cartitem .xyy-banner-item + .xyy-banner-item::before {
  height: 24px !important;
  background: rgba(47, 116, 212, .2) !important;
}

body .cartitem .xyy-banner-title {
  font-size: 12.5px !important;
  color: var(--mc-blue) !important;
}

body .cartitem .xyy-banner-sub {
  font-size: 11px !important;
  color: var(--mc-sub) !important;
}

/* 套餐三：tftable 表格规格 */
body .cartitem .tftable {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 13px !important;
}

body .cartitem .tftable td {
  padding: 6px 0 !important;
  color: var(--mc-ink) !important;
  vertical-align: middle !important;
  border-width: 0 0 1px 0 !important;
  border-style: dashed !important;
  border-color: var(--mc-line) !important;
}

body .cartitem .tftable tr:last-child td {
  border-bottom: 0 !important;
}

body .cartitem .tftable td:first-child {
  color: var(--mc-muted) !important;
  white-space: nowrap;
}

body .cartitem .tftable b {
  font-weight: 400 !important;
}

body .cartitem .xyy_card,
body .cartitem .xyy_card2 {
  float: none !important;
  display: inline-block !important;
  height: auto !important;
  margin: 0 0 0 8px !important;
  padding: 1px 8px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 18px !important;
  color: var(--mc-blue) !important;
  background: var(--mc-blue-soft) !important;
  border: 0 !important;
  border-radius: 999px !important;
}

/* 分组列数：大屏 6 列、中屏 4 列、手机 2 列 */
@media (max-width: 1200px) {
  body .firstgroup_box_group {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  body .firstgroup_box_group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
