/* 菜品卡片 (Dish Card Layout) */
.dish-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: default;
}

/* 仅对真正有截断、可展开的卡片开启小手光标与悬停微动效+主题色强化边框 */
.dish-card.is-expandable {
  cursor: pointer;
}

.dish-card.is-expandable:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 128, 0, 0.45);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 128, 0, 0.18);
}

.dish-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dish-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

/* 低调的菜品编号 (id)：去掉点号后采用半透明弱化字色与轻量字体，保持主次层次 */
.dish-id {
  color: var(--text-subdued);
  font-size: 0.9em;
  font-weight: 600;
  margin-right: 6px;
  letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.dish-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.dish-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

/* 占位空槽：当卡片悬浮脱标时占住网格位置，保证周围兄弟卡片纹丝不动 */
.dish-card-placeholder {
  visibility: hidden;
  pointer-events: none;
}

/* 整个菜品卡片完整悬浮覆盖：展开整个胶囊本体，无缝展示全部文字 */
.dish-card.is-floating-expanded {
  position: absolute;
  z-index: 70;
  border-color: rgba(255, 128, 0, 0.6);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 128, 0, 0.25);
  background-color: var(--bg-surface);
  transform: translateY(-2px);
  animation: cardFloatPop 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.dish-card.is-floating-expanded .dish-desc {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
  color: var(--text-primary);
}

@keyframes cardFloatPop {
  from {
    opacity: 0.9;
    transform: translateY(0);
  }
  to {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.dish-media {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
  position: relative;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface-hover);
}

.dish-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  transition: transform 0.3s ease;
  display: block;
}

.dish-card:hover .dish-img {
  transform: scale(1.05);
}

.dish-placeholder {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subdued);
  font-size: 1.8rem;
}

/* 加购按钮：跨贴在图片右下角外侧，不设黑色边框，保持纯粹主题亮色 */
.add-btn {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 128, 0, 0.45);
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  z-index: 5;
}

.add-btn:hover {
  transform: scale(1.12);
  background-color: var(--color-primary-hover);
}

.add-btn:active {
  transform: scale(0.95);
}

/* 右侧独立购物车 Sidebar (通顶、全屏高度、完全独立侧栏) */
.basket-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--basket-width);
  height: 100vh;
  background-color: var(--bg-surface);
  border-left: 1px solid var(--color-border);
  border-top: none;
  border-right: none;
  border-bottom: none;
  border-radius: 0;
  padding: 24px 20px;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  z-index: 110;
}

.basket-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.close-basket-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background-color: var(--color-primary-subtle);
  border: 1px solid rgba(255, 128, 0, 0.25);
  color: var(--color-primary);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  outline: none;
  transition: background-color 0.2s, color 0.2s, transform 0.15s, border-color 0.2s;
}

.close-basket-btn:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  transform: scale(1.05);
}

.close-basket-btn:active {
  transform: scale(0.95);
}

/* 履约切换药丸 (Delivery / Collection) */
.fulfillment-tabs {
  display: flex;
  background-color: var(--bg-canvas);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--color-border);
}

.ful-btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ful-btn.is-active {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 履约图标：默认使用 currentColor，支持独立自定义颜色 */
.ful-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  /* 默认未选中时温润灰，选中或高亮时可通过 --ful-icon-color 自定义 */
  color: var(--ful-icon-color, var(--text-subdued));
  transition: color 0.2s, transform 0.2s;
}

/* 激活态默认图标颜色（如截图中的暖橙/原色，或直接使用当前主题品牌色） */
.ful-btn.is-active .ful-icon {
  --ful-icon-color: var(--color-primary); /* 可自由改成任意颜色，如 #f36805 */
}

/* 文本分组布局 */
.ful-text-group {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.ful-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.ful-btn:not(.is-active) .ful-name {
  color: var(--text-secondary);
}

.ful-time {
  font-size: 0.72rem;
  color: var(--text-subdued);
  display: block;
  font-weight: 400;
}

/* 订单准入条件区 (始终位于列表前方，高亮提醒 vs 满足后弱化单行) */
.basket-conditions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.condition-item {
  border-radius: var(--radius-sm);
  transition: background-color 0.25s ease, border-color 0.25s ease, padding 0.2s ease, opacity 0.2s ease;
}

/* 1. 未满足条件：高亮警示态 (橙色微晶提醒) */
.condition-item.is-highlight {
  background-color: var(--color-primary-subtle);
  border: 1px dashed rgba(255, 128, 0, 0.38);
  padding: 10px 12px;
  color: #ffaa54;
}

/* 2. 满足条件：失去高亮，弱化为一行精致低调字 */
.condition-item:not(.is-highlight) {
  background-color: transparent;
  border: 1px solid transparent;
  padding: 3px 4px;
  color: var(--text-subdued);
  font-size: 0.78rem;
}

.condition-item:not(.is-highlight):hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.condition-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.35;
}

.condition-icon {
  font-size: 0.85rem;
  flex-shrink: 0;
}

.condition-item:not(.is-highlight) .condition-text {
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.condition-item.is-highlight .condition-text {
  font-size: 0.82rem;
  font-weight: 500;
  color: #ffaa54;
}

/* 营业时间之外 Pre-order 条件提示卡片 (中性低调灰框，信息类友善提醒) */
.condition-item.preorder-condition {
  background-color: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 13px !important;
  animation: fadeInPreorder 0.25s ease-out;
}

/* 自提模式到店取餐地址友好提示卡片 (延续 Pre-order 的中性精致灰框风格) */
.condition-item.collection-info-condition {
  background-color: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px !important;
  animation: fadeInPreorder 0.25s ease-out;
}

.collection-info-header {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}

.collection-info-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.collection-info-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.1px;
}

.collection-info-title strong {
  font-weight: 700;
  color: #ffffff;
  margin-left: 2px;
}

.collection-address-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-left: 20px; /* 与上方小图标对齐 */
}

.collection-store-addr {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
  word-break: break-word;
  white-space: normal; /* 彻底打破截断，完整展示完整地址 */
  flex: 1;
  min-width: 0;
}

.collection-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-top: -1px;
}

.collection-action-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  text-decoration: none;
  line-height: 1;
  transition: all 0.18s ease;
  user-select: none;
  box-sizing: border-box;
}

.collection-action-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-1px);
}

.collection-action-btn:active {
  transform: scale(0.92);
}

.collection-action-btn.is-copied {
  background: rgba(52, 199, 89, 0.18);
  border-color: rgba(52, 199, 89, 0.5);
  color: #34c759;
}

.collection-btn-icon {
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@keyframes fadeInPreorder {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.preorder-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.preorder-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.preorder-header-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.1px;
}

.preorder-description {
  font-size: 0.78rem;
  line-height: 1.42;
  color: var(--text-secondary);
  margin: 0;
}

/* 营业时间卡片：外框纯净几何变形体系 (绝对锚定左上角起点向右向下舒展) */
.preorder-time-chip {
  align-self: flex-start;
  margin-left: 0;
  margin-right: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 183px;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
  padding: 3px 10px;
  margin-top: 3px;
  cursor: pointer;
  outline: none;
  user-select: none;
  overflow: hidden;
  transition: width 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              border-radius 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.2s ease,
              border-color 0.2s ease,
              padding 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.preorder-time-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
}

.preorder-time-chip:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.preorder-chip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 18px;
}

.preorder-chip-left {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  /* 文字绝对静止，不使用任何 transform */
}

.preorder-clock-icon {
  stroke: var(--text-secondary);
  flex-shrink: 0;
}

.preorder-chevron-icon {
  stroke: var(--text-subdued);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.15s ease;
  flex-shrink: 0;
}

.preorder-time-chip:hover .preorder-chevron-icon {
  stroke: var(--text-secondary);
}

/* 排班列表折叠区 (使用原生 CSS Grid 0fr -> 1fr 平滑伸缩，无 scale，文字百分之百平稳) */
.preorder-schedule-drawer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.2s ease,
              margin-top 0.25s ease;
  opacity: 0;
  margin-top: 0;
  overflow: hidden;
}

.preorder-schedule-drawer-inner {
  min-height: 0;
  overflow: hidden;
}

.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* 展开态：保持左上角锚定不变，仅向右扩展至 100% 并向下展开，内部文字零变形 */
.preorder-time-chip.is-expanded {
  align-self: flex-start;
  width: 100%;
  border-radius: var(--radius-sm) !important;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
  padding: 8px 12px 11px;
}

.preorder-time-chip.is-expanded .preorder-chevron-icon {
  transform: rotate(180deg);
}

.preorder-time-chip.is-expanded .preorder-schedule-drawer {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 9px;
}

.schedule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  line-height: 1.45;
  padding: 1px 4px;
  border-radius: 3px;
}

/* 双模式 (Collection & Delivery) 对齐样式 */
.schedule-table-header {
  display: grid;
  grid-template-columns: 46px 1fr 1fr;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-subdued);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 0 4px 4px 4px;
  margin-bottom: 3px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.schedule-row-dual {
  display: grid;
  grid-template-columns: 46px 1fr 1fr;
  align-items: center;
  gap: 6px;
}

.schedule-table-header .col-time,
.schedule-row-dual .col-time {
  text-align: right;
  white-space: nowrap;
}

.schedule-day {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.schedule-time {
  color: rgba(255, 255, 255, 0.85);
  font-family: monospace, monospace;
  font-weight: 500;
  text-align: right;
  letter-spacing: -0.2px;
}

/* 当日轻量指示 */
.schedule-row.is-today {
  background: rgba(255, 255, 255, 0.05);
}

.schedule-row.is-today .schedule-day {
  color: #ffffff;
  font-weight: 600;
}

.schedule-row.is-today .schedule-time {
  color: #ffffff;
  font-weight: 600;
}

/* 满足时隐藏进度条 */
.condition-item:not(.is-highlight) .min-progress-track {
  display: none;
}

.min-progress-track {
  width: 100%;
  height: 5px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.min-progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--color-primary);
  transition: width 0.3s ease;
}

/* 地址条件输入面板 */
.address-input-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.address-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffaa54;
  transition: color 0.2s ease;
}

.address-title-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

/* 提交按钮：精致高对比度微型按钮 */
.delivery-submit-btn {
  background: rgba(255, 128, 0, 0.15);
  border: 1px solid rgba(255, 128, 0, 0.5);
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  outline: none;
  transition: all 0.18s ease;
  line-height: 1.4;
  white-space: nowrap;
}

.delivery-submit-btn:hover {
  background: var(--color-primary);
  color: #111111;
  border-color: var(--color-primary);
  box-shadow: 0 0 8px rgba(255, 128, 0, 0.4);
}

.delivery-submit-btn:active {
  transform: scale(0.96);
}

/* 标题错误态：洋红警告 */
.address-panel-title.address-panel-title--error {
  color: #ff3b69;
}

.address-title-err-text {
  font-weight: 600;
  margin-left: 4px;
  display: inline;
}

/* 提示行内嵌入的 Switch to Collection 切换链接 */
.address-switch-collection-link {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 0 3px;
  display: inline;
  line-height: inherit;
  transition: all 0.15s ease;
}

.address-switch-collection-link:hover {
  color: var(--color-primary);
  text-shadow: 0 0 8px rgba(255, 128, 0, 0.4);
}

.address-switch-collection-link:active {
  transform: scale(0.96);
}

/* 圆形小 i 提示图标 */
.info-circle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #ff2d55;
  color: #ff2d55;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: monospace, sans-serif;
  line-height: 1;
  box-shadow: 0 0 6px rgba(255, 45, 85, 0.4);
}

.alert-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary);
  display: inline-block;
  animation: pulseDot 1.6s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.address-fields-row {
  display: flex;
  gap: 8px;
}

.address-fields-row.contact-fields-row {
  margin-bottom: 7px;
}

.address-name-input {
  flex: 1.1;
  min-width: 0;
}

.address-mobile-input {
  flex: 1;
  min-width: 0;
}

.basket-input {
  background: var(--bg-canvas);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 0.8rem;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.basket-input::placeholder {
  color: var(--text-subdued);
  opacity: 0.6;
}

.basket-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(255, 128, 0, 0.25);
}

/* 邮编/输入框错误态：洋红色圆框与微光 */
.basket-input.basket-input--error {
  border-color: #ff2d55 !important;
  box-shadow: 0 0 0 2px rgba(255, 45, 85, 0.28) !important;
  color: #ffffff;
  animation: inputShake 0.4s ease;
}

@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.address-street-input {
  flex: 1;
  min-width: 0;
}

.address-postcode-input {
  width: 100px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: center;
}

/* 摘要卡片两行展示结构 */
.address-summary-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.address-summary-contact {
  color: #ffffff;
  font-weight: 600;
  font-size: 0.77rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.address-summary-location {
  color: var(--text-secondary);
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 单行弱化状态下的修改按钮 */
.condition-edit-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.74rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 2px 4px;
  margin-left: auto;
  border-radius: 2px;
  transition: color 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.condition-edit-btn:hover {
  color: var(--color-primary-hover);
  background-color: var(--color-primary-subtle);
}

/* 购物车底部费用行中的未输入地址引导链接 (主题高亮) */
.delivery-prompt-link {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 2px 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: color 0.15s ease, transform 0.15s ease;
  line-height: 1;
}

.delivery-prompt-link:hover {
  color: var(--color-primary-hover);
  transform: translateX(2px);
}

.delivery-prompt-link:active {
  transform: scale(0.96);
}

/* 条件区受点击呼叫时的聚焦光晕动效 */
.condition-focus-pulse {
  animation: conditionFocusPulse 1.2s ease;
}

@keyframes conditionFocusPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 128, 0, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(255, 128, 0, 0.25); border-color: var(--color-primary); }
  100% { box-shadow: 0 0 0 0 rgba(255, 128, 0, 0); }
}

/* 购物车内容中间弹性槽 (列表或空提示在此区域伸缩，底栏永远固定在最底端) */
.cart-scroll-area {
  flex: 1;
  min-height: 140px;
  overflow-y: auto;
  margin-bottom: 16px;
  padding-right: 4px;
}

.cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  margin: 2px 0;
  border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.2s ease;
}

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

/* 新增菜品低调渐显入场动效：带圆角呼吸空隙的胶囊高亮块，随后以悠长舒缓的 ease-out 优雅隐退 */
.cart-item.item-freshly-added {
  animation: fadeInFreshItem 2.8s cubic-bezier(0.2, 0.8, 0.25, 1) forwards;
}

@keyframes fadeInFreshItem {
  0% {
    opacity: 0;
    transform: translateY(4px);
    background-color: rgba(255, 128, 0, 0.16);
    box-shadow: 0 0 0 1px rgba(255, 128, 0, 0.12);
  }
  12% {
    opacity: 1;
    transform: translateY(0);
    background-color: rgba(255, 128, 0, 0.16);
    box-shadow: 0 0 0 1px rgba(255, 128, 0, 0.12);
  }
  38% {
    opacity: 1;
    transform: translateY(0);
    background-color: rgba(255, 128, 0, 0.16);
    box-shadow: 0 0 0 1px rgba(255, 128, 0, 0.12);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    background-color: transparent;
    box-shadow: 0 0 0 1px rgba(255, 128, 0, 0);
  }
}

.cart-item-info {
  flex: 1;
  padding-right: 8px;
}

.cart-item-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cart-item-price {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-surface-hover);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}

.step-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.95rem;
}

.step-btn:hover {
  color: var(--color-primary);
}

.step-count {
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 14px;
  text-align: center;
}

/* 费用汇总 */
.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.subtotal-label-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.subtotal-action-btn {
  background: none;
  border: none;
  padding: 0 0 1px 0;
  margin: 0;
  font-size: inherit;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.35);
  transition: color 0.15s ease, border-color 0.15s ease;
  line-height: 1.2;
}

.subtotal-action-btn:hover {
  color: var(--text-primary);
  border-bottom-color: rgba(255, 255, 255, 0.7);
}

.clear-cart-confirm-btn {
  background: rgba(255, 128, 0, 0.12);
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.4;
  white-space: nowrap;
  animation: fadeInConfirm 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.15s ease;
}

.clear-cart-confirm-btn:hover {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 128, 0, 0.4);
}

@keyframes fadeInConfirm {
  from {
    opacity: 0;
    transform: scale(0.92) translateX(-3px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateX(0);
  }
}

.summary-total {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

/* 结账主按钮 */
.checkout-btn {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, var(--color-primary), #e67300);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 18px;
  box-shadow: 0 4px 14px rgba(255, 128, 0, 0.4);
  transition: transform 0.15s, opacity 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.checkout-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.checkout-btn:not(:disabled):hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--color-primary-hover), #ff8000);
}

/* 结账按钮：超出配送范围警示态 (洋红圆框 + 半透明白底，与橘红主色彻底区分，引导切换为自提) */
.checkout-btn.checkout-btn--warning {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 2px solid #ff2d55 !important;
  color: #ff3b69 !important;
  box-shadow: 0 0 16px rgba(255, 45, 85, 0.25) !important;
  cursor: pointer !important;
  opacity: 1 !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 2px !important;
  height: 54px !important;
  padding: 4px 16px !important;
  transition: all 0.2s ease !important;
  animation: warningButtonPulse 2.4s infinite ease-in-out;
}

.checkout-btn.checkout-btn--warning:hover {
  background: rgba(255, 45, 85, 0.12) !important;
  border-color: #ff4d73 !important;
  color: #ffffff !important;
  box-shadow: 0 0 22px rgba(255, 45, 85, 0.45) !important;
  transform: translateY(-1px);
}

.checkout-btn-warning-hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: #ff6b8b;
  line-height: 1.1;
  letter-spacing: 0.2px;
}

.checkout-btn-warning-action {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
}

.checkout-btn.checkout-btn--warning:hover .checkout-btn-warning-hint {
  color: #ffccd5;
}

/* PayPal 按钮容器条件未满足置灰态 */
#paypal-button-container.is-disabled {
  filter: grayscale(100%) opacity(0.35);
  pointer-events: none !important;
  cursor: not-allowed !important;
  user-select: none;
  transition: filter 0.25s ease, opacity 0.25s ease;
}

#paypal-button-container {
  transition: filter 0.25s ease, opacity 0.25s ease;
}

@keyframes warningButtonPulse {
  0%, 100% {
    border-color: #ff2d55;
    box-shadow: 0 0 14px rgba(255, 45, 85, 0.22);
  }
  50% {
    border-color: #ff4d73;
    box-shadow: 0 0 24px rgba(255, 45, 85, 0.5);
  }
}

.delivery-fee-out-of-range {
  color: #ff2d55;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.address-dist-badge {
  display: inline-flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  letter-spacing: 0.2px;
}

/* 移动端底部悬浮结账胶囊条 */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  height: 56px;
  background-color: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-pill);
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 100;
  cursor: pointer;
}

.mobile-badge {
  background-color: rgba(0, 0, 0, 0.25);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
}

/* 切换分类：温润深沉的呼吸感色彩过渡 */
.category-block {
  border-radius: var(--radius-card);
  padding: 14px 16px;
  margin: -14px -16px;
}

/* 动效主体：高亮就位平稳停顿，随后以悠长舒缓的 ease-out 自然漫漫隐退 */
.category-highlight-flash {
  animation: categoryGentleBreathe 3.0s cubic-bezier(0.2, 0.8, 0.25, 1) forwards;
}

/* 呼吸节奏：快速升至峰值 -> 充分稳定停顿 -> 悠长舒缓平滑退隐 */
@keyframes categoryGentleBreathe {
  0% {
    background-color: rgba(255, 128, 0, 0);
    box-shadow: 0 0 0 0 rgba(255, 128, 0, 0), 0 0 0 rgba(0, 0, 0, 0);
  }
  15% {
    background-color: rgba(255, 128, 0, 0.13);
    box-shadow: 0 0 0 1.5px rgba(255, 140, 0, 0.38), 0 8px 32px rgba(255, 128, 0, 0.16);
  }
  42% {
    background-color: rgba(255, 128, 0, 0.13);
    box-shadow: 0 0 0 1.5px rgba(255, 140, 0, 0.38), 0 8px 32px rgba(255, 128, 0, 0.16);
  }
  100% {
    background-color: rgba(255, 128, 0, 0);
    box-shadow: 0 0 0 0 rgba(255, 128, 0, 0), 0 0 0 rgba(0, 0, 0, 0);
  }
}

/* Tab 按钮点击微回弹手感 */
.cat-tab:active {
  transform: scale(0.94);
}

/* 加购飞入动画 (Fly to cart ghost item) */
.fly-ghost-badge {
  position: fixed;
  z-index: 9999;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-primary), #e65c00);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  box-shadow: 0 4px 16px rgba(255, 128, 0, 0.45);
  pointer-events: none;
  transition: transform 0.65s cubic-bezier(0.18, 0.89, 0.32, 1.15), opacity 0.65s ease-in;
}

/* 结账按钮及容器吸收弹性反馈 */
#paypal-button-container.cart-bump,
.cart-checkout.cart-bump,
.checkout-btn.cart-bump {
  animation: checkoutButtonPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkoutButtonPop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 128, 0, 0.6);
  }
  70% {
    transform: scale(0.98);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

/* 移动端底部条吸收反馈 */
.mobile-bottom-bar.cart-bump {
  animation: cartAbsorb 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cartAbsorb {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.025) translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 128, 0, 0.25);
  }
  65% {
    transform: scale(0.99) translateY(1px);
  }
  100% {
    transform: scale(1) translateY(0);
    box-shadow: var(--shadow-card);
  }
}

/* 搜索结果关键词高亮：使用次级透明度主题色，层次柔和精致 */
.search-highlight {
  background-color: rgba(255, 128, 0, 0.22);
  color: #ffb86c;
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(255, 128, 0, 0.18);
}

/* 异常菜品胶囊：洋红边框 (Magenta Border) 与错误标记 */
.dish-card.dish-card-error {
  border-color: #ff007f !important;
  box-shadow: 0 0 0 1px rgba(255, 0, 127, 0.4), 0 4px 16px rgba(255, 0, 127, 0.18) !important;
}

.dish-card.dish-card-error:hover {
  border-color: #ff1493 !important;
  box-shadow: 0 0 0 1.5px rgba(255, 20, 147, 0.6), 0 6px 20px rgba(255, 0, 127, 0.28) !important;
}

/* 圆圈i错误提示图标 */
.dish-id-error-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-pill);
  background-color: rgba(255, 0, 127, 0.15);
  border: 1.5px solid #ff007f;
  color: #ff007f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  font-family: monospace, sans-serif;
  cursor: help;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(255, 0, 127, 0.35);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.dish-id-error-badge:hover {
  transform: scale(1.15);
  background-color: #ff007f;
  color: #fff;
}

.dish-id-error-badge .dish-error-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background-color: #1e1e24;
  color: #fff;
  border: 1px solid #ff007f;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-sans);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), 0 0 10px rgba(255, 0, 127, 0.3);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  transform: translateY(4px);
  z-index: 20;
}

.dish-id-error-badge:hover .dish-error-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

