/* ========================================
   龙慧云商城 CSS — 基于 Neo Design System
   手机优先，480px 最大宽度居中
   ======================================== */

/* ── 布局容器 ── */
.shop-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--neo-bg, #F5F7FA);
  position: relative;
  padding-bottom: 80px; /* 底部操作栏预留 */
}

/* ── 顶部导航栏 ── */
.shop-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  height: 50px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.shop-header .back-link {
  display: flex;
  align-items: center;
  color: var(--neo-text, #1F2937);
  text-decoration: none;
  font-size: 15px;
  padding: 6px 4px;
  border-radius: 8px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.shop-header .back-link:active {
  background: #F3F4F6;
}

.shop-header .back-link svg {
  width: 20px;
  height: 20px;
}

.shop-header .header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--neo-text, #1F2937);
  flex: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-header .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 60px;
  justify-content: flex-end;
}

.shop-header .cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--neo-text, #1F2937);
  text-decoration: none;
  transition: background 0.2s;
}

.shop-header .cart-btn:active {
  background: #F3F4F6;
}

.shop-header .cart-btn svg {
  width: 22px;
  height: 22px;
}

/* 购物车角标 */
.cart-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  background: #EF4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 100px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  border: 1.5px solid #fff;
}

/* ── 商城横幅 ── */
.shop-hero {
  margin: 12px 14px 0;
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
  border-radius: 14px;
  padding: 20px 18px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.shop-hero::before {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  top: -80px;
  right: -60px;
}

.shop-hero::after {
  content: '';
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  bottom: -50px;
  right: 20px;
}

.shop-hero .hero-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}

.shop-hero .hero-subtitle {
  font-size: 13px;
  opacity: 0.85;
  position: relative;
  z-index: 1;
}

.shop-hero .hero-tag {
  display: inline-block;
  margin-top: 10px;
  background: rgba(255,255,255,0.25);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 100px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

/* ── 分类标签横向滚动 ── */
.category-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 14px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  background: #fff;
  color: var(--neo-text-sub, #6B7280);
  border: 1.5px solid #E5E7EB;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.category-tab:active {
  transform: scale(0.96);
}

.category-tab.active {
  background: var(--neo-cyan, #2563EB);
  color: #fff;
  border-color: var(--neo-cyan, #2563EB);
  font-weight: 600;
}

/* ── 商品网格（2列） ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px 14px;
}

/* ── 商品卡片 ── */
.product-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.15);
}

.product-card:active {
  transform: translateY(0);
}

.product-card .card-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 正方形 */
  background: #EFF6FF;
  overflow: hidden;
}

.product-card .card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.product-card .card-quick-add {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  background: var(--neo-cyan, #2563EB);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(37,99,235,0.4);
  transition: transform 0.15s, background 0.15s;
  z-index: 2;
}

.product-card .card-quick-add:active {
  transform: scale(0.9);
  background: #1D4ED8;
}

.product-card .card-quick-add svg {
  width: 14px;
  height: 14px;
}

.product-card .card-body {
  padding: 10px 12px 12px;
}

.product-card .card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--neo-text, #1F2937);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card .card-desc {
  font-size: 11px;
  color: var(--neo-text-sub, #6B7280);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.product-card .price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.product-card .card-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--neo-cyan, #2563EB);
}

.product-card .card-original {
  font-size: 11px;
  color: var(--neo-text-muted, #9CA3AF);
  text-decoration: line-through;
}

/* ── 价格标签 ── */
.price-tag .price-now {
  font-size: 18px;
  font-weight: 700;
  color: var(--neo-cyan, #2563EB);
}

.price-tag .price-now small {
  font-size: 12px;
  font-weight: 400;
}

.price-tag .price-origin {
  font-size: 12px;
  color: var(--neo-text-muted, #9CA3AF);
  text-decoration: line-through;
  margin-left: 6px;
}

/* ── 商品详情页 ── */
.product-detail {
  padding-bottom: 80px;
}

.product-detail .detail-hero {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1/1;
  background: #EFF6FF;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-detail .detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.product-detail .detail-body {
  padding: 18px 16px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.detail-tag {
  padding: 3px 10px;
  background: #EFF6FF;
  color: var(--neo-cyan, #2563EB);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
}

.detail-sales {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  color: var(--neo-text-muted, #9CA3AF);
  vertical-align: middle;
}

.detail-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--neo-text, #1F2937);
  margin-bottom: 6px;
  line-height: 1.4;
}

.detail-desc {
  font-size: 13px;
  color: var(--neo-text-sub, #6B7280);
  line-height: 1.6;
  margin-bottom: 14px;
}

.detail-section {
  margin-bottom: 18px;
}

.detail-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--neo-text, #1F2937);
  margin-bottom: 10px;
}

/* 规格选择按钮 */
.spec-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spec-btn {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  background: #fff;
  color: var(--neo-text, #1F2937);
  border: 1.5px solid #E5E7EB;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.spec-btn:active {
  transform: scale(0.97);
}

.spec-btn.active {
  background: #EFF6FF;
  border-color: var(--neo-cyan, #2563EB);
  color: var(--neo-cyan, #2563EB);
  font-weight: 600;
}

.spec-btn .spec-price {
  font-size: 12px;
  color: var(--neo-text-sub, #6B7280);
}

.spec-btn.active .spec-price {
  color: var(--neo-cyan, #2563EB);
}

/* 数量选择器 */
.quantity-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quantity-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1.5px solid #E5E7EB;
  background: #fff;
  color: var(--neo-text, #1F2937);
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  line-height: 1;
}

.quantity-btn:active {
  background: #EFF6FF;
  border-color: var(--neo-cyan, #2563EB);
  color: var(--neo-cyan, #2563EB);
}

.quantity-num {
  font-size: 16px;
  font-weight: 600;
  color: var(--neo-text, #1F2937);
  min-width: 30px;
  text-align: center;
}

/* 详情图文区 */
.detail-content {
  background: #fff;
  border-radius: 14px;
  margin: 0 14px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.detail-content h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--neo-text, #1F2937);
}

.detail-content p {
  font-size: 13px;
  color: var(--neo-text-sub, #6B7280);
  line-height: 1.7;
}

/* ── 底部固定操作栏 ── */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-top: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 10px;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  z-index: 200;
}

.bottom-bar .bar-total {
  flex: 1;
}

.bottom-bar .total-label {
  font-size: 11px;
  color: var(--neo-text-muted, #9CA3AF);
}

.bottom-bar .total-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--neo-cyan, #2563EB);
}

/* ── 购物车页 ── */
.cart-page {
  padding: 0;
}

.cart-page .cart-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  padding: 0 14px;
  height: 50px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.cart-page .cart-list {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 90px; /* 底部结算栏预留 */
}

/* 购物车行 */
.cart-item {
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.cart-item .item-img-wrap {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: #EFF6FF;
}

.cart-item .item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item .item-info {
  flex: 1;
  min-width: 0;
}

.cart-item .item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--neo-text, #1F2937);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item .item-spec {
  font-size: 11px;
  color: var(--neo-text-muted, #9CA3AF);
  margin-bottom: 6px;
}

.cart-item .item-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--neo-cyan, #2563EB);
}

.cart-item .item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.cart-item .item-delete {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: #FEE2E2;
  color: #EF4444;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 12px;
  flex-shrink: 0;
}

.cart-item .item-delete:active {
  background: #FECACA;
}

/* ── 空状态 ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 14px;
}

.empty-state .empty-icon {
  width: 72px;
  height: 72px;
  background: #EFF6FF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state .empty-icon svg {
  width: 36px;
  height: 36px;
  color: var(--neo-cyan, #2563EB);
  opacity: 0.6;
}

.empty-state .empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--neo-text, #1F2937);
}

.empty-state .empty-desc {
  font-size: 13px;
  color: var(--neo-text-sub, #6B7280);
  text-align: center;
}

/* ── 骨架屏加载态 ── */
.skeleton {
  background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.skeleton-img {
  width: 100%;
  padding-top: 100%;
  background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

/* ── 通用主按钮（商城用） ── */
.shop-btn-primary {
  flex: 1;
  height: 44px;
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  user-select: none;
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}

.shop-btn-primary:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.shop-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.shop-btn-ghost {
  height: 44px;
  padding: 0 20px;
  background: #fff;
  color: var(--neo-cyan, #2563EB);
  border: 1.5px solid var(--neo-cyan, #2563EB);
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  user-select: none;
}

.shop-btn-ghost:active {
  background: #EFF6FF;
  transform: scale(0.98);
}

.shop-btn-danger-ghost {
  height: 44px;
  padding: 0 20px;
  background: #fff;
  color: #EF4444;
  border: 1.5px solid #FEE2E2;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  user-select: none;
}

.shop-btn-danger-ghost:active {
  background: #FFF5F5;
  transform: scale(0.98);
}

/* ── 底部结算栏（购物车页） ── */
.cart-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-top: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 12px;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  z-index: 200;
}

.cart-bottom-bar .cart-total {
  flex: 1;
}

.cart-bottom-bar .cart-total-label {
  font-size: 12px;
  color: var(--neo-text-muted, #9CA3AF);
}

.cart-bottom-bar .cart-total-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--neo-cyan, #2563EB);
}

/* ── 支付成功弹窗 ── */
.pay-success-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pay-success-box {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 320px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.pay-success-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #2563EB, #3B82F6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37,99,235,0.4);
}

.pay-success-icon svg {
  width: 32px;
  height: 32px;
  color: #fff;
}

.pay-success-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--neo-text, #1F2937);
}

.pay-success-desc {
  font-size: 13px;
  color: var(--neo-text-sub, #6B7280);
  text-align: center;
  line-height: 1.6;
}

/* ── 商城页底部免责 ── */
.shop-footer {
  text-align: center;
  padding: 20px 14px;
  font-size: 11px;
  color: var(--neo-text-muted, #9CA3AF);
  line-height: 1.6;
}

/* ── 快速加购成功提示动画 ── */
@keyframes add-bounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.add-bounce {
  animation: add-bounce 0.3s ease;
}

/* ── 响应式：横屏 / 大屏手机适配 ── */
@media (max-width: 360px) {
  .product-card .card-name {
    font-size: 12px;
  }
  .product-card .card-desc {
    font-size: 10px;
  }
}
