/* ==========================================================================
   menu.css   页面1：首页点餐 专属样式
   ========================================================================== */

/* ---------- 顶部店铺信息栏（吸顶固定，与分类导航叠层） ---------- */
.shop-header {
  position: sticky;
  top: 0;
  z-index: 16;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-gold);
}

.shop-logo {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: var(--text-on-accent);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 0 2px var(--bg-page), 0 0 0 3px var(--border-gold), 0 4px 14px rgba(246, 184, 63, 0.3);
}
.shop-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.shop-name {
  font-family: var(--font-display);
  font-size: var(--font-size-md);
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent-primary-soft);
  font-size: 10px;
  font-weight: 700;
  color: var(--status-success);
}

.shop-contact-line {
  margin-top: 2px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 顶栏右侧：语言切换（上）+ 桌号徽章（下） ---------- */
.shop-header-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.lang-switch {
  display: flex;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-gold);
  overflow: hidden;
}
.lang-btn {
  border: none;
  background: transparent;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}
.lang-btn.active {
  background: var(--accent-gradient);
  color: var(--text-on-accent);
}

.table-badge {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-primary-soft);
}
.table-badge-label {
  font-size: 10px;
  color: var(--accent-primary);
}
.table-badge-value {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-primary);
}

/* ---------- 店铺封面图 ---------- */
.cover-section {
  margin-bottom: var(--space-sm);
}

.cover-banner {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  box-shadow: var(--shadow-card);
}

/* 轮播滑道：横向排列所有 slide，靠 transform 切换，touch-action 让触摸滑动不被浏览器纵向滚动抢走 */
.cover-track {
  display: flex;
  height: 118px;
  transition: transform 0.35s ease;
  touch-action: pan-y;
}

.cover-slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  background:
    radial-gradient(circle at 50% 40%, rgba(246, 184, 63, 0.16), transparent 60%),
    linear-gradient(180deg, #171717 0%, #0d0d0d 100%);
}

/* 模糊铺满的背景层：填满整个窄条，不留空白，纯装饰用，不承载信息 */
.cover-slide-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(18px) brightness(0.55) saturate(1.15);
  transform: scale(1.15); /* 放大一点，避免模糊后边缘露出锯齿/透明像素 */
  z-index: 0;
  -webkit-user-drag: none;
  user-select: none;
}

/* 照片区：默认铺满整条；有配文时收窄到右侧，给左边文字让出空间 */
.cover-slide-photo {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.cover-slide.has-caption .cover-slide-photo {
  left: auto;
  right: 0;
  width: 58%;
}

/* 前景图：完整显示整张照片，绝不裁切，保证顾客能看清是什么菜 */
.cover-slide-fg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}

/* 配文：写在照片旁边空出来的位置，圆润黑体 + 金色，居中显示更工整对称 */
.cover-slide-caption {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  width: 42%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  box-sizing: border-box;
  text-align: center;
}
.cover-slide-caption span {
  font-family: var(--font-rounded);
  font-weight: 400; /* 圆体本身笔画已经比较粗，不需要再加粗 */
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.5px;
  color: var(--gold-light);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
  white-space: pre-line; /* 保留后台填写时手动按的换行 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 四角金色装饰角标，呼应高级菜单质感（挂在外层 banner 上，不随 slide 切换重复出现） */
.cover-banner::before,
.cover-banner::after,
.cover-banner .corner-tl,
.cover-banner .corner-br {
  content: "";
  position: absolute;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-color: var(--gold-light);
  border-style: solid;
  opacity: 0.85;
  pointer-events: none;
}
.cover-banner::before {
  top: 12px;
  left: 12px;
  border-width: 2px 0 0 2px;
}
.cover-banner::after {
  top: 12px;
  right: 12px;
  border-width: 2px 2px 0 0;
}
.cover-banner .corner-tl {
  bottom: 12px;
  left: 12px;
  border-width: 0 0 2px 2px;
}
.cover-banner .corner-br {
  bottom: 12px;
  right: 12px;
  border-width: 0 2px 2px 0;
}

/* 轮播圆点指示器，叠在说明文字条上方一点，只有多张 Poster 时才会有内容 */
.cover-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 5px;
  pointer-events: none;
}
.cover-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: width 0.2s ease, background 0.2s ease;
}
.cover-dot.active {
  width: 16px;
  border-radius: 3px;
  background: var(--gold-light);
}

/* ---------- 分类导航（吸顶固定，叠在店铺信息栏下方，菜品列表在其下方滚动） ---------- */
.category-nav-wrap {
  position: sticky;
  top: 60px; /* 与压缩后 .shop-header 的实际高度对齐，两层吸顶叠加不重叠 */
  z-index: 15;
  background: var(--bg-page);
  margin-bottom: var(--space-sm);
}

.category-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  padding: 6px 44px;
  scrollbar-width: none;
}
.category-nav::-webkit-scrollbar {
  display: none;
}

/* 左右箭头：兜底手势滑动不灵敏的情况，点击即可切换查看分类 */
.cat-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  color: var(--bg-card);
  background: var(--accent-gradient);
  border: 2px solid var(--gold-light);
  box-shadow: 0 4px 14px rgba(246, 184, 63, 0.45);
  z-index: 1;
}
.cat-nav-arrow:active {
  transform: translateY(-50%) scale(0.92);
}
.cat-nav-prev {
  left: 2px;
}
.cat-nav-next {
  right: 2px;
}
.cat-nav-arrow.is-hidden {
  display: none;
}

.category-pill {
  flex-shrink: 0;
  padding: 6px 15px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-raised);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  font-size: var(--font-size-sm);
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.category-pill.active {
  background: var(--accent-gradient);
  color: var(--text-on-accent);
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(246, 184, 63, 0.3);
}

/* ---------- 菜品列表 ---------- */
.dish-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dish-row {
  display: flex;
  gap: var(--space-sm);
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
}

.dish-thumb {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 35%, rgba(246, 184, 63, 0.22), transparent 65%),
    linear-gradient(160deg, #201a0c, #141210);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  overflow: hidden;
}
.dish-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dish-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.dish-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.dish-desc {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dish-price {
  font-size: var(--font-size-md);
  font-weight: 800;
  color: var(--accent-primary);
  margin-top: 2px;
}

.dish-action {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.qty-control .qty-value {
  min-width: 18px;
  text-align: center;
  font-size: var(--font-size-md);
  font-weight: 600;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-raised);
  color: var(--accent-primary);
  border: 1px solid var(--border-accent);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-btn:active {
  transform: scale(0.9);
}

/* 加号：金色圆形实心；减号：深色圆形 + 金色边框（沿用 .qty-btn 默认样式） */
.qty-plus {
  background: var(--accent-gradient);
  color: var(--text-on-accent);
  border-color: transparent;
}

/* 售罄状态 */
.dish-row.is-sold-out .dish-thumb {
  filter: grayscale(1);
  opacity: 0.5;
}
.dish-row.is-sold-out .dish-name,
.dish-row.is-sold-out .dish-desc,
.dish-row.is-sold-out .dish-price {
  color: var(--status-disabled-text);
}
.sold-out-badge {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--status-disabled-bg);
  color: var(--status-disabled-text);
  font-size: var(--font-size-sm);
  font-weight: 600;
  border: 1px solid var(--border-default);
}

/* ---------- 菜单规则提示 ---------- */
.rule-tip {
  margin-top: var(--space-sm);
  padding: 8px var(--space-md);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-accent);
  background: var(--accent-primary-soft);
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  text-align: center;
}

/* ---------- 底部购物车栏 ---------- */
.cart-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.cart-summary {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  min-width: 0;
}

.cart-icon-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--status-badge-bg);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-badge.is-empty {
  display: none;
}

.cart-count {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.cart-total {
  font-size: var(--font-size-lg);
  font-weight: 800;
  color: var(--accent-primary);
  text-shadow: 0 0 12px rgba(246, 184, 63, 0.35);
}

.btn-checkout {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.3;
  padding: 10px 24px;
}
.btn-checkout-main {
  font-size: var(--font-size-md);
  font-weight: 700;
}
.btn-checkout-sub {
  font-size: 11px;
  opacity: 0.8;
}
.btn-checkout:disabled {
  background: var(--status-disabled-bg);
  color: var(--status-disabled-text);
  box-shadow: none;
}
