/* goodsList.css —— 商品列表首页 */

.home-page { background: var(--bg); }

/* ---------- 顶部 ---------- */
.home-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--primary-grad);
  padding: 10px 14px 12px;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 4px 14px rgba(255, 90, 40, .22);
}
.loc-row { display: flex; align-items: center; justify-content: space-between; color: #fff; margin-bottom: 9px; }
.loc { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 3px; }
.loc-arrow { font-size: 12px; }
.shop-meta { font-size: 11px; opacity: .9; }

.search-box {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 19px;
  height: 38px;
  padding: 0 14px;
  gap: 8px;
}
.search-box .s-ico { font-size: 15px; }
.search-box input { flex: 1; min-width: 0; font-size: 14px; }
.search-box .s-cancel { color: #fff; font-size: 14px; display: none; padding-left: 6px; }
.search-box.focus .s-cancel { display: block; color: var(--primary); }

/* ---------- 轮播（真实图片） ---------- */
.banner-wrap {
  position: relative;
  margin: 12px 12px 0;
  border-radius: 14px;
  overflow: hidden;
  height: 156px;
}
.banner-track { display: flex; height: 100%; transition: transform .45s ease; }
.banner-item {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}
.banner-item .b-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.banner-item .b-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- 限时秒杀 ---------- */
.seckill-wrap {
  margin: 12px 12px 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff1ec, #ffe3ee);
  overflow: hidden;
}
.seckill-wrap .sk-head { display: flex; align-items: center; gap: 8px; padding: 11px 13px 4px; }
.seckill-wrap .sk-title { font-size: 15.5px; font-weight: 800; color: #e8302a; }
.seckill-wrap .sk-timer {
  background: #2e2d33;
  color: #ffd86f;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 5px;
  padding: 2px 7px;
  font-family: "DIN Alternate", Arial, sans-serif;
  letter-spacing: 1px;
}
.seckill-wrap .sk-tip { margin-left: auto; font-size: 11px; color: #b98a6a; }
.sk-track {
  display: flex;
  gap: 9px;
  padding: 8px 13px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sk-track::-webkit-scrollbar { display: none; }
.sk-item {
  flex: 0 0 104px;
  background: #fff;
  border-radius: 10px;
  padding: 6px 6px 8px;
  text-align: center;
}
.sk-item .sk-img {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}
.sk-item .sk-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sk-item .sk-name { font-size: 11.5px; color: #444; margin-top: 5px; }
.sk-item .sk-price { margin-top: 2px; line-height: 1.2; }
.sk-item .sk-price b { color: #ff3d2e; font-size: 15px; font-family: "DIN Alternate", Arial, sans-serif; }
.sk-item .sk-price b::before { content: "¥"; font-size: 10px; }
.sk-item .sk-price span { color: #bbb; font-size: 10px; text-decoration: line-through; margin-left: 3px; }
.sk-item .sk-progress {
  position: relative;
  height: 12px;
  background: #ffe3dc;
  border-radius: 6px;
  margin: 5px 2px 5px;
  overflow: hidden;
}
.sk-item .sk-progress i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ff7b46, #ff3d2a); border-radius: 6px; }
.sk-item .sk-progress span { position: relative; z-index: 1; font-size: 8.5px; color: #b3342a; line-height: 12px; }
.sk-item .sk-btn {
  width: 100%;
  height: 24px;
  border-radius: 12px;
  background: var(--primary-grad);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

/* ---------- 排序筛选条 ---------- */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 12px 8px;
  background: #fff;
  border-radius: 10px;
  padding: 4px;
}
.sort-item {
  flex: 1;
  text-align: center;
  font-size: 12.5px;
  color: #666;
  padding: 7px 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.sort-item.on { color: var(--primary); font-weight: 700; background: #fff3ef; }
.sort-item .price-arrow { font-style: normal; font-size: 11px; }
/* 左侧渐变蒙层：仅在文字区域增强可读性，不全屏遮挡 */
.banner-item .b-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.62) 0%, rgba(0,0,0,.28) 45%, rgba(0,0,0,0) 70%);
}
.banner-item .b-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 20px;
  color: #fff;
  max-width: 68%;
}
.banner-item .b-badge {
  display: inline-block;
  background: var(--primary-grad);
  font-size: 10.5px;
  padding: 2px 9px;
  border-radius: 10px;
  margin-bottom: 7px;
  width: fit-content;
  box-shadow: 0 2px 8px rgba(255,80,40,.4);
}
.banner-item .b-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 0 2px 6px rgba(0,0,0,.5), 0 0 2px rgba(0,0,0,.4);
}
.banner-item .b-sub {
  font-size: 12.5px;
  margin-top: 6px;
  opacity: .95;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.banner-dots {
  position: absolute;
  bottom: 9px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
  z-index: 3;
}
.banner-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.55); transition: all .3s; }
.banner-dots i.on { width: 16px; background: #fff; }

/* ---------- 金刚区（12 入口：两行横向滚动） ---------- */
.quick-grid {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: 24%;
  gap: 14px 4px;
  padding: 16px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.quick-grid::-webkit-scrollbar { display: none; }
.quick-item { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: #444; }
.quick-item .q-ico {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff5f0, #ffe8df);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  transition: transform .15s;
}
.quick-item:nth-child(4n+1) .q-ico { background: linear-gradient(135deg,#ffeae6,#ffd0c4); }
.quick-item:nth-child(4n+2) .q-ico { background: linear-gradient(135deg,#e0ecff,#c4d9ff); }
.quick-item:nth-child(4n+3) .q-ico { background: linear-gradient(135deg,#eee6ff,#d4c5ff); }
.quick-item:nth-child(4n+4) .q-ico { background: linear-gradient(135deg,#e6f7ec,#c4f0d4); }
.quick-item:active .q-ico { transform: scale(.92); }

/* ---------- 公告 ---------- */
.notice-bar {
  margin: 0 12px 10px;
  background: #fff8ec;
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 12.5px;
  color: #a06a12;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 点餐区 ---------- */
.menu-wrap {
  display: flex;
  align-items: flex-start;
  margin: 0 12px 10px;
  border-radius: var(--radius);
  min-height: 60vh;
}
.cat-bar {
  width: 78px;
  flex-shrink: 0;
  background: #f3f3f5;
  border-radius: var(--radius) 0 0 var(--radius);
  position: sticky;
  top: 110px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}
.cat-item {
  padding: 9px 4px;
  text-align: center;
  font-size: 12px;
  color: #555;
  position: relative;
  line-height: 1.3;
}
.cat-item .c-emoji { display: block; font-size: 16px; margin-bottom: 2px; }
.cat-item.active {
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  border-radius: var(--radius) 0 0 var(--radius);
}
.cat-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--primary-grad);
}

.goods-col {
  flex: 1;
  min-width: 0;
  background: #fff;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding-bottom: 10px;
}
.g-group-title {
  font-size: 13px;
  font-weight: 700;
  color: #333;
  padding: 14px 12px 6px;
  position: sticky;
  top: 110px;
  background: #fff;
  z-index: 5;
  border-left: 3px solid var(--cat-color, var(--primary));
  margin-left: 0;
  padding-left: 9px;
}

/* 商品卡片 */
.goods-card {
  display: flex;
  gap: 11px;
  padding: 12px;
  border-bottom: 1px solid #f7f7f7;
}
.goods-card:active { background: #fafafa; }
.g-img {
  width: 88px;
  height: 88px;
  border-radius: 10px;
  flex-shrink: 0;
  background: #f6f0e8;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.g-img .g-emoji { font-size: 34px; }
.g-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.g-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.g-name { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.g-tags { margin-bottom: 3px; min-height: 17px; }
.g-desc { font-size: 11.5px; color: #999; line-height: 1.45; margin-bottom: 4px; }
.g-sub { font-size: 11px; color: #aaa; margin-bottom: 5px; }
.g-bottom { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; }
.g-bottom .price { font-size: 18px; }

/* ---------- 搜索视图 ---------- */
.search-view { padding: 12px 0 0; background: var(--bg); min-height: 60vh; }
.search-hot { padding: 4px 16px 12px; }
.search-hot .sh-title { font-size: 13px; color: #999; margin-bottom: 10px; }
.search-hot .sh-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.search-hot .sh-tag {
  background: #fff;
  border-radius: 15px;
  padding: 6px 14px;
  font-size: 12.5px;
  color: #555;
}
.search-result-tip { padding: 12px 16px 0; font-size: 13px; color: #999; }

/* ---------- 底部购物车横条（fixed 固定，限宽居中与 .page 对齐） ---------- */
.cart-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  bottom: calc(var(--tab-h, 56px) + env(safe-area-inset-bottom));
  z-index: 91;
  overflow: hidden;
  transition: transform .25s ease;
}
.cart-bar.hidden { transform: translateX(-50%) translateY(100%); }
.cart-bar .cb-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.cart-bar .cb-icon {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.cart-bar .cb-icon .badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #ff3b30;
  color: #fff;
  font-size: 8px;
  min-width: 12px;
  height: 12px;
  border-radius: 6px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
}
.cart-bar .cb-info { min-width: 0; flex: 1; overflow: hidden; }
.cart-bar .cb-total {
  font-size: 13px;
  font-weight: 700;
  color: #222;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-bar .cb-total::before { content: "¥"; font-size: 10px; margin-right: 1px; }
.cart-bar .cb-total.empty { color: #bbb; font-weight: 500; font-size: 12px; }
.cart-bar .cb-total.empty::before { content: ""; }
.cart-bar .cb-fee {
  font-size: 9px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-bar .cb-btn {
  height: 26px;
  padding: 0 12px;
  border-radius: 13px;
  background: #e0e0e0;
  color: #aaa;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all .2s;
}
.cart-bar.active .cb-btn {
  background: var(--primary-grad);
  color: #fff;
  box-shadow: 0 3px 10px rgba(255, 80, 40, 0.4);
}
/* 空车时整个横条隐藏 */
.cart-bar:not(.active) { display: none; }
.cart-bar .cb-icon.bump { animation: bump .35s ease; }
@keyframes bump {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.25); }
  70% { transform: scale(0.9); }
}
