/* ============ 顶部导航栏（详情页用） ============ */
.nav-bar {
  position: sticky;
  top: var(--safe-top);
  z-index: 40;
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--border);
}
.nav-bar.dark {
  background: transparent;
  border-bottom: none;
  color: #fff;
}
.nav-bar .back-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-bar.dark .back-btn { background: rgba(255, 255, 255, 0.18); color: #fff; }
.nav-bar .nav-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  margin: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-bar .nav-right {
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ============ 卡片 ============ */
.card {
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.card-pad { padding: 12px; }

/* 区块容器 */
.section {
  margin: 12px;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.section-pad { padding: 14px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 8px;
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
}
.section-more {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  background: var(--bg-gray);
  color: var(--text-1);
  transition: all 0.15s;
  cursor: pointer;
  white-space: nowrap;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(200, 22, 29, 0.25);
}
.btn-gold {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(200, 22, 29, 0.25);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
}
.btn-outline-primary {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}
.btn-block { display: flex; width: 100%; padding: 12px; font-size: 15px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ============ 价格 ============ */
.price {
  color: var(--primary);
  font-weight: 700;
  font-family: "DIN Alternate", "Helvetica Neue", sans-serif;
}
.price .symbol { font-size: 12px; margin-right: 1px; }
.price .int { font-size: 18px; line-height: 1; }
.price .dec { font-size: 12px; }
.price-original {
  color: var(--text-4);
  font-size: 11px;
  text-decoration: line-through;
  margin-left: 4px;
}

/* ============ 标签徽章 ============ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  font-size: 10px;
  line-height: 14px;
  border-radius: 3px;
  background: var(--bg-gray);
  color: var(--text-3);
  margin-right: 4px;
}
.tag-primary { background: var(--primary-light); color: var(--primary); }
.tag-gold { background: var(--primary-light); color: var(--primary); }
.tag-success { background: #E8F5E9; color: var(--success); }

/* 角标（商品卡片右上） */
.corner-badge {
  position: absolute;
  top: 0;
  left: 0;
  padding: 2px 6px;
  font-size: 10px;
  color: #fff;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 8px 0 8px 0;
  z-index: 2;
}
.corner-badge.gold { background: linear-gradient(90deg, var(--primary), var(--primary-dark)); }

/* ============ 商品卡片（瀑布流） ============ */
.product-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  position: relative;
  transition: transform 0.15s;
}
.product-card:active { transform: scale(0.98); }
.product-card .img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-gray);
  overflow: hidden;
}
.product-card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.product-img-local {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
  display: block;
}
.product-card:hover .img-wrap img { transform: scale(1.05); }
.product-card .info {
  padding: 8px 10px 10px;
}
.product-card .name {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-1);
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}
.product-card .origin {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.product-card .bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 6px;
}
.product-card .sales {
  font-size: 10px;
  color: var(--text-4);
}
/* 加购小按钮 */
.cart-add-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(200, 22, 29, 0.3);
  transition: transform 0.15s;
}
.cart-add-btn:active { transform: scale(0.85); }

/* ============ 商品列表（横排）============ */
.product-row {
  display: flex;
  background: #fff;
  padding: 12px;
  gap: 10px;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}
.product-row .img-wrap {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  background: var(--bg-gray);
  overflow: hidden;
  flex-shrink: 0;
}
.product-row .img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-row .info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}
.product-row .name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-row .origin {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}
.product-row .bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 6px;
}

/* ============ 店铺卡片 ============ */
.shop-card {
  display: flex;
  align-items: center;
  background: #fff;
  padding: 12px;
  border-radius: 10px;
  gap: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  margin-bottom: 8px;
}
.shop-card .logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(145deg, #FFEDEE, #FFD6D8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}
.shop-card .logo svg {
  display: block;
  color: inherit;
}
.shop-card .info { flex: 1; min-width: 0; }
.shop-card .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 2px;
}
.shop-card .desc {
  font-size: 11px;
  color: var(--text-3);
}
.shop-card .follow {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ============ 数量步进器 ============ */
.stepper {
  display: inline-flex;
  align-items: center;
  background: var(--bg-gray);
  border-radius: 14px;
  overflow: hidden;
}
.stepper button {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  font-size: 16px;
  color: var(--text-1);
  cursor: pointer;
}
.stepper button:active { background: rgba(0, 0, 0, 0.05); }
.stepper .num {
  min-width: 28px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

/* ============ 空状态 ============ */
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-3);
}
.empty .icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}
.empty .text { font-size: 13px; }
.empty .sub { font-size: 12px; margin-top: 4px; color: var(--text-4); }

/* ============ 瀑布流容器 ============ */
.waterfall {
  columns: 2;
  column-gap: 8px;
}
.waterfall > * {
  break-inside: avoid;
  margin-bottom: 8px;
}

/* 横向滚动列表 */
.scroll-x {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 8px;
  padding: 0 12px 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  max-width: 100%;
  min-width: 0;
  cursor: grab;
}
.scroll-x:active { cursor: grabbing; }
.scroll-x.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x > * { flex-shrink: 0; scroll-snap-align: start; }
.scroll-x img {
  -webkit-user-drag: none;
  user-select: none;
}

/* ============ Tab 切换条 ============ */
.tabs-bar {
  display: flex;
  background: #fff;
  padding: 0 12px;
  height: 44px;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  border-bottom: 0.5px solid var(--border);
}
.tabs-bar::-webkit-scrollbar { display: none; }
.tabs-bar .tab-item {
  font-size: 14px;
  color: var(--text-2);
  white-space: nowrap;
  position: relative;
  padding: 8px 0;
  cursor: pointer;
  flex-shrink: 0;
}
.tabs-bar .tab-item.active {
  color: var(--primary);
  font-weight: 700;
}
.tabs-bar .tab-item.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

/* ============ 搜索框 ============ */
.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-gray);
  border-radius: 18px;
  padding: 7px 14px;
  gap: 6px;
  flex: 1;
}
.search-box input {
  flex: 1;
  background: transparent;
  font-size: 13px;
  border: none;
  outline: none;
  color: var(--text-1);
}
.search-box input::placeholder { color: var(--text-4); }
.search-box .icon {
  color: var(--text-3);
  font-size: 14px;
}

/* ============ Divider ============ */
.divider {
  height: 0.5px;
  background: var(--border);
  margin: 8px 0;
}

/* ============ Tag 小标签（馆/产地）============ */
.region-tag {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  border-radius: 4px;
  background: var(--primary-light);
  color: var(--primary);
  margin-right: 4px;
}
.origin-tag {
  display: inline-block;
  padding: 1px 5px;
  font-size: 10px;
  border-radius: 3px;
  background: var(--primary-light);
  color: var(--primary);
  margin-right: 4px;
}
