/* CryingSea Cart — 商店/侧栏/产品卡片/步骤条（与 product.tpl 等模板类名对应） */

/* 主内容区全宽：抵消 container-fluid 内边距，铺满侧栏右侧可视区域 */
body.body-csc-cart .main-content .page-content > .container-fluid {
  max-width: none !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.body-csc-cart .uc-page-title-strip {
  width: 100% !important;
  margin: 0 0 8px !important;
  padding: 12px 16px !important;
  box-sizing: border-box;
}

body.body-csc-cart .csc-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 16px 0 0;
  box-sizing: border-box;
}

.csc-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.csc-shop-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  width: 100%;
}

.csc-shop-main {
  min-width: 0;
}

/* —— 侧栏分类 —— */
.csc-sidebar {
  position: sticky;
  top: 88px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  height: auto;
  background: var(--csc-surface, #fff);
  border: 1px solid var(--csc-line, #ebebeb);
  border-left: none;
  border-radius: 0 var(--csc-radius, 14px) var(--csc-radius, 14px) 0;
  box-shadow: var(--csc-shadow, 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06));
  overflow: hidden;
}

.csc-sidebar-toggle {
  display: none;
}

.csc-sidebar-toggle__icon {
  font-size: 22px;
  line-height: 1;
}

.csc-sidebar-search {
  padding: 16px;
  border-bottom: 1px solid var(--csc-line, #ebebeb);
}

.csc-search-box {
  position: relative;
}

.csc-search-box .form-control {
  height: 40px;
  padding-left: 38px;
  border-radius: 10px;
  border: 1px solid var(--csc-line, #ebebeb);
  font-size: 14px;
}

.csc-search-box .form-control:focus {
  border-color: var(--csc-brand, #1d5cff);
  box-shadow: 0 0 0 3px var(--csc-brand-glow, rgba(29, 92, 255, 0.22));
}

.csc-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--csc-muted, #8c8c8c);
  font-size: 18px;
  cursor: pointer;
  z-index: 1;
}

.csc-sidebar-nav {
  flex: 1 1 auto;
  padding: 8px;
  min-height: 0;
  overflow-y: auto;
}

.csc-cat-item {
  margin-bottom: 4px;
}

.csc-cat-l1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--csc-ink-2, #434343);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.csc-cat-l1:hover,
.csc-cat-l1.is-active {
  background: rgba(29, 92, 255, 0.08);
  color: var(--csc-brand, #1d5cff);
}

.csc-cat-arrow {
  font-size: 18px;
  transition: transform 0.2s ease;
}

.csc-cat-item.is-open .csc-cat-arrow {
  transform: rotate(90deg);
}

.csc-cat-sub {
  display: none;
  padding: 4px 0 8px 8px;
}

.csc-cat-item.is-open .csc-cat-sub {
  display: block;
}

.csc-sub-link {
  display: block;
  padding: 8px 12px 8px 20px;
  border-radius: 8px;
  color: var(--csc-ink-2, #434343);
  font-size: 13px;
  text-decoration: none !important;
  transition: background 0.15s ease, color 0.15s ease;
}

.csc-sub-link:hover {
  background: rgba(29, 92, 255, 0.06);
  color: var(--csc-brand, #1d5cff);
}

.csc-sub-link.is-active {
  background: var(--csc-brand, #1d5cff);
  color: #fff !important;
  font-weight: 600;
}

.csc-sidebar-empty {
  flex: 1 1 auto;
  padding: 24px 16px;
  text-align: center;
  color: var(--csc-muted, #8c8c8c);
  font-size: 14px;
}

/* —— 区域标题 —— */
.csc-region-hd {
  margin-bottom: 20px;
}

.csc-region-hd__title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  color: var(--csc-ink, #141414);
  letter-spacing: -0.02em;
}

.csc-region-hd__desc {
  margin: 0;
  font-size: 14px;
  color: var(--csc-muted, #8c8c8c);
  line-height: 1.6;
}

.csc-login-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 10px;
  background: rgba(29, 92, 255, 0.06);
  border: 1px solid rgba(29, 92, 255, 0.15);
  font-size: 14px;
  color: var(--csc-ink-2, #434343);
}

.csc-login-tip i {
  color: var(--csc-brand, #1d5cff);
  font-size: 18px;
  margin-top: 2px;
}

.csc-login-tip a {
  color: var(--csc-brand, #1d5cff);
  font-weight: 600;
}

/* —— 产品网格 —— */
.csc-prod-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

.csc-prod-item {
  display: flex;
  flex-direction: column;
  background: var(--csc-surface, #fff);
  border: 1px solid var(--csc-line, #ebebeb);
  border-radius: var(--csc-radius, 14px);
  box-shadow: var(--csc-shadow, 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06));
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.csc-prod-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(29, 92, 255, 0.1);
}

.csc-prod-item__hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--csc-line, #ebebeb);
}

.csc-prod-item__title {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.4;
  color: var(--csc-ink, #141414);
}

.csc-prod-item__tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff7e6;
  color: #d46b08;
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}

.csc-prod-item__stock {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--csc-muted, #8c8c8c);
  white-space: nowrap;
}

.csc-prod-item__stock.is-warn {
  color: #d46b08;
}

.csc-prod-item__stock.is-danger {
  color: #cf1322;
}

.csc-prod-item__body {
  flex: 1;
  padding: 14px 20px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--csc-ink-2, #434343);
}

.csc-prod-item__body ul {
  margin: 0;
  padding-left: 18px;
}

.csc-prod-item__body li {
  margin-bottom: 4px;
}

.csc-prod-item__ft {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--csc-line, #ebebeb);
  background: #fafbfe;
}

.csc-price-main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 4px;
}

.csc-price-currency {
  font-size: 14px;
  font-weight: 600;
  color: var(--csc-brand, #1d5cff);
}

.csc-price-amount {
  font-size: 26px;
  font-weight: 700;
  color: var(--csc-brand, #1d5cff);
  letter-spacing: -0.02em;
  line-height: 1;
}

.csc-price-from,
.csc-price-period {
  font-size: 12px;
  color: var(--csc-muted, #8c8c8c);
}

.csc-price-original {
  margin-top: 4px;
  font-size: 12px;
  color: var(--csc-muted, #8c8c8c);
  text-decoration: line-through;
}

.csc-price-trial {
  margin-top: 4px;
  font-size: 12px;
  color: #d46b08;
}

.csc-btn-buy-block,
.csc-btn-soldout-block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.csc-btn-buy-block {
  background: var(--csc-brand, #1d5cff);
  color: #fff !important;
  box-shadow: 0 6px 16px var(--csc-brand-glow, rgba(29, 92, 255, 0.22));
}

.csc-btn-buy-block:hover {
  background: #0a46dc;
  transform: translateY(-1px);
}

.csc-btn-soldout-block {
  background: #f5f5f5;
  color: var(--csc-muted, #8c8c8c) !important;
  cursor: not-allowed;
}

.csc-pager {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

.csc-pager .pagination .page-link {
  border-radius: 8px;
  margin: 0 2px;
  color: var(--csc-ink-2, #434343);
}

.csc-pager .pagination .page-item.active .page-link {
  background: var(--csc-brand, #1d5cff);
  border-color: var(--csc-brand, #1d5cff);
}

/* —— 步骤条（div 结构） —— */
.csc-steps {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: none;
  margin: 0 0 28px;
  padding: 0;
}

.csc-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--csc-muted, #8c8c8c);
  white-space: nowrap;
}

.csc-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f0f0f0;
  color: var(--csc-muted, #8c8c8c);
  font-size: 13px;
  font-weight: 700;
}

.csc-step.is-current {
  color: var(--csc-brand, #1d5cff);
  font-weight: 600;
}

.csc-step.is-current .csc-step__num {
  background: var(--csc-brand, #1d5cff);
  color: #fff;
}

.csc-step.is-done {
  color: var(--csc-ink-2, #434343);
}

.csc-step.is-done .csc-step__num {
  background: rgba(29, 92, 255, 0.12);
  color: var(--csc-brand, #1d5cff);
}

.csc-step-line {
  flex: 1;
  height: 2px;
  min-width: 24px;
  margin: 0 8px;
  background: #ebebeb;
  border-radius: 1px;
}

.csc-step-line.is-done {
  background: var(--csc-brand, #1d5cff);
}

/* —— 结算区块 —— */
.csc-checkout-body {
  padding-bottom: 24px;
}

.csc-block {
  background: var(--csc-surface, #fff);
  border: 1px solid var(--csc-line, #ebebeb);
  border-radius: var(--csc-radius, 14px);
  box-shadow: var(--csc-shadow, 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06));
  overflow: hidden;
}

.csc-block-hd {
  padding: 16px 20px;
  border-bottom: 1px solid var(--csc-line, #ebebeb);
  font-size: 16px;
  font-weight: 650;
  color: var(--csc-ink, #141414);
}

.csc-block-bd {
  padding: 20px;
}

.csc-order-aside {
  position: sticky;
  top: 88px;
}

.csc-order-aside .csc-block-bd {
  max-height: 60vh;
  overflow-y: auto;
}

.csc-line-item {
  padding: 16px 0;
  border-bottom: 1px dashed var(--csc-line, #ebebeb);
}

.csc-line-item:last-child {
  border-bottom: none;
}

.csc-order-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0 8px;
  margin-top: 8px;
  border-top: 1px solid var(--csc-line, #ebebeb);
  font-size: 15px;
}

.csc-order-total strong {
  font-size: 22px;
  color: var(--csc-brand, #1d5cff);
}

/* —— 完成页 —— */
.csc-done-panel {
  max-width: 520px;
  margin: 48px auto;
  padding: 48px 32px;
  text-align: center;
  background: var(--csc-surface, #fff);
  border: 1px solid var(--csc-line, #ebebeb);
  border-radius: 20px;
  box-shadow: var(--csc-shadow, 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06));
}

.csc-done-panel > i {
  font-size: 64px;
  color: #00b578;
  display: block;
  margin-bottom: 20px;
}

.csc-done-panel h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.csc-done-panel p {
  color: var(--csc-muted, #8c8c8c);
  margin-bottom: 28px;
  line-height: 1.7;
}

.csc-done-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.csc-done-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  height: 44px;
  padding: 0 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
}

.csc-done-actions a.primary {
  background: var(--csc-brand, #1d5cff);
  color: #fff !important;
}

.csc-done-actions a.ghost {
  background: #f5f5f5;
  color: var(--csc-ink-2, #434343) !important;
}

/* —— 购物车页背景 —— */
body.body-csc-cart .main-content,
body.body-csc-cart .page-content {
  background: var(--csc-bg, #f7f8fc) !important;
}

body.body-csc-cart .main-content .page-content {
  padding-top: var(--uc-topbar-h, 48px) !important;
}

/* —— 响应式：手机端左侧抽屉，产品区全宽 —— */
.csc-sidebar-backdrop {
  display: none;
}

@media (max-width: 991px) {
  body.body-csc-cart .csc-page {
    padding: 0 12px;
  }

  body.body-csc-cart.csc-sidebar-open,
  body.csc-sidebar-open.body-csc-cart {
    overflow: hidden;
  }

  body.body-csc-cart .uc-page-title-strip {
    padding: 12px !important;
  }

  .csc-shop-layout {
    display: block;
    position: relative;
  }

  .csc-shop-main {
    width: 100%;
    margin-left: 0;
    padding-left: 0;
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    min-width: 0;
  }

  .csc-sidebar {
    position: fixed;
    left: 0;
    top: var(--uc-topbar-h, 48px);
    bottom: 0;
    width: min(280px, 88vw);
    min-height: auto;
    align-self: auto;
    z-index: 1051;
    border-left: none;
    border-radius: 0 16px 16px 0;
    transform: translateX(-105%);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    overflow: hidden;
    box-shadow: none;
  }

  .csc-shop-layout.is-sidebar-open .csc-sidebar {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.18);
  }

  .csc-sidebar-toggle {
    display: flex;
    position: fixed;
    left: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 52px;
    height: 52px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--csc-line, #ebebeb);
    border-radius: 50%;
    background: #fff;
    color: var(--csc-brand, #1d5cff);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
    z-index: 1060;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .csc-shop-layout.is-sidebar-open .csc-sidebar-toggle {
    background: #fff;
    color: var(--csc-brand, #1d5cff);
    border: 1px solid var(--csc-line, #ebebeb);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.16);
  }

  .csc-sidebar-toggle__icon {
    font-size: 24px;
  }

  .csc-shop-layout.is-sidebar-open .csc-sidebar-backdrop {
    display: block;
  }

  .csc-sidebar-backdrop {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--uc-topbar-h, 48px);
    bottom: 0;
    z-index: 1050;
    background: rgba(15, 23, 42, 0.45);
  }

  .csc-order-aside {
    position: static;
  }

  .csc-steps {
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .csc-step span:not(.csc-step__num) {
    display: none;
  }

  .csc-prod-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .csc-login-tip {
    font-size: 13px;
  }

  .csc-login-tip p {
    margin: 0;
    line-height: 1.5;
  }
}

@media (max-width: 768px) {
  .csc-prod-grid {
    grid-template-columns: 1fr;
  }

  .csc-prod-item__ft {
    flex-direction: column;
    align-items: stretch;
  }

  .csc-btn-buy-block,
  .csc-btn-soldout-block {
    width: 100%;
  }

  .csc-region-hd__title {
    font-size: 20px;
  }
}
