/* 自助下单 · 现代交互（门店弹层 / 饮品宫格 / 规格芯片） */
:root {
  --om-green: #16a34a;
  --om-green-dark: #15803d;
  --om-green-soft: #ecfdf3;
  --om-line: #f0f0f0;
  --om-muted: #999;
  --om-text: #222;
  --om-sheet-z: 10050;
}

body.om-ready {
  background: #f5f5f5 !important;
  background-image: none !important;
}

.om-app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.06);
  padding-bottom: 28px;
}

.om-app .card,
.om-app .card-body {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0 !important;
  margin: 0;
}

.om-mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 16px 14px;
}
.om-mode {
  position: relative;
  border: 1.5px solid #e5e7eb;
  background: #fafafa;
  border-radius: 12px;
  padding: 16px 10px;
  font-size: 14px;
  font-weight: 600;
  color: #444;
  cursor: pointer;
  text-align: center;
}
.om-mode .om-mode-icon {
  display: block;
  font-size: 22px;
  margin-bottom: 6px;
  line-height: 1;
}
.om-mode.active {
  border-color: var(--om-green);
  background: #fff;
  color: var(--om-text);
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.15);
}
.om-mode.active::after {
  content: "✓";
  position: absolute;
  right: 8px;
  bottom: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--om-green);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.om-form {
  margin: 0 12px;
  border: 1px solid var(--om-line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
/* 多账号下拉开时放开裁剪，避免最后几项被切掉 */
.om-app:has(#cardIds.is-card-open) .om-form,
.om-app:has(#cardIds .bootstrap-select.show) .om-form {
  overflow: visible;
}

.om-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--om-line);
  background: #fff;
  width: 100%;
  text-align: left;
}
.om-row:last-child {
  border-bottom: none;
}
.om-label {
  flex: 0 0 52px;
  font-size: 14px;
  font-weight: 600;
  color: var(--om-text);
}
.om-value {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--om-muted);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.om-value.is-set {
  color: var(--om-green);
  font-weight: 600;
}
.om-chevron {
  flex: 0 0 auto;
  color: #ccc;
  font-size: 16px;
  line-height: 1;
}
button.om-row {
  border: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
button.om-row:active {
  background: #fafafa;
}

.om-row input.om-input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  text-align: right;
  font-size: 14px;
  color: var(--om-text);
  min-width: 0;
}
.om-row input.om-input::placeholder {
  color: #bbb;
}

/* 隐藏旧 bootstrap-select，保留 DOM 供逻辑复用 */
.om-legacy-host {
  position: fixed !important;
  left: -10000px !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.om-app #goodsPage {
  margin: 0;
  display: block;
}
.om-app #goodsPage .goods-col {
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.om-app #goodsPage .goods-col > .cup-title,
.om-app #goodsPage .goods-col > .input-group,
.om-app #goodsPage .goods-col > .bootstrap-select,
.om-app #goodsPage .goods-col > select,
.om-app #goodsPage .goods-col select.form-control {
  display: none !important;
}
.om-app #goodsPage .goods-config-area {
  display: block !important;
  padding: 4px 14px 12px !important;
  background: #fff !important;
  border: 0 !important;
  border-radius: 0 !important;
  margin: 0 !important;
}
.om-app #goodsPage .option-container {
  margin: 10px 0 4px;
}
.om-app #goodsPage .option-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--om-text);
  margin-bottom: 8px;
  padding: 0;
}
.om-app #goodsPage .radio-btn-group {
  gap: 8px;
}
.om-app #goodsPage .select-option {
  flex: 0 0 auto;
  min-width: auto;
  border-radius: 10px;
  padding: 8px 12px !important;
  background: #f3f4f6;
  border: 1.5px solid transparent;
  font-size: 13px;
  color: #444;
}
.om-app #goodsPage .select-option.active {
  background: var(--om-green-soft) !important;
  color: var(--om-green) !important;
  border-color: var(--om-green) !important;
  font-weight: 700;
}

.om-drink-picker {
  border-bottom: 1px solid var(--om-line);
}

.om-actions {
  margin: 16px 16px 8px;
}
.om-submit {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--om-green);
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.28);
  cursor: pointer;
}
.om-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.om-submit-secondary {
  margin-top: 10px;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.28);
  cursor: pointer;
}
.om-actions.is-order-only .om-submit-secondary {
  margin-top: 0;
}

.om-app .cart-compute-panel {
  margin: 12px 16px 0;
  border-radius: 12px;
  border-color: #e5e7eb;
}
.om-app #tips-container {
  margin: 18px 16px;
  border-radius: 12px;
}
.om-app #cardIds {
  padding: 0 14px 8px;
  border-bottom: 1px solid var(--om-line);
}
.om-app #cardIds:empty {
  display: none;
}

/* 底部弹层 */
.om-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: var(--om-sheet-z);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.om-mask.show {
  opacity: 1;
  pointer-events: auto;
}
.om-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: calc(var(--om-sheet-z) + 1);
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  border-radius: 18px 18px 0 0;
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  transform: translateY(110%);
  transition: transform 0.28s ease;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
}
.om-sheet.show {
  transform: translateY(0);
}
.om-sheet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid #f3f4f6;
}
.om-sheet-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  color: #666;
  font-size: 18px;
  line-height: 32px;
  cursor: pointer;
  flex: 0 0 auto;
}
.om-sheet-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f5f5f5;
  border-radius: 999px;
  padding: 8px 14px;
}
.om-sheet-search input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 14px;
  min-width: 0;
}
.om-sheet-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 12px 24px;
  flex: 1;
}
.om-sheet-empty,
.om-sheet-loading {
  text-align: center;
  color: #999;
  padding: 40px 12px;
  font-size: 14px;
}

/* 门店列表卡片 */
.om-shop-item {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
  text-align: left;
  padding: 12px 4px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
}
.om-shop-item:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.om-shop-item.is-active .om-shop-name {
  color: var(--om-green);
}
.om-shop-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.om-shop-name {
  font-size: 15px;
  font-weight: 700;
  color: #222;
  line-height: 1.35;
}
.om-shop-dist {
  flex: 0 0 auto;
  font-size: 12px;
  color: #888;
}
.om-shop-addr {
  margin-top: 4px;
  font-size: 12px;
  color: #888;
  line-height: 1.4;
}
.om-shop-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: #999;
}
.om-shop-status {
  color: var(--om-green);
  font-weight: 600;
}
.om-shop-item.is-closed .om-shop-status {
  color: #ef4444;
}

/* 饮品宫格 */
.om-goods-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.om-goods-card {
  position: relative;
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fff;
  padding: 0 0 10px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.om-goods-card.is-active {
  border-color: var(--om-green);
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.2);
}
.om-goods-card.is-soldout {
  opacity: 1;
  background: #f8fafc;
  border-color: #e2e8f0;
  cursor: not-allowed;
}
.om-goods-card.is-soldout .om-goods-thumb {
  filter: grayscale(1);
}
.om-goods-card.is-soldout .om-goods-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
}
.om-goods-card.is-soldout .om-goods-name {
  color: #94a3b8;
}
.om-goods-card.is-soldout .om-goods-price {
  color: #94a3b8;
  text-decoration: line-through;
}
.om-goods-soldout-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  min-width: 44px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.om-goods-soldout-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fee2e2;
  color: #dc2626;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  vertical-align: middle;
}
.om-sheet-tip {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 13px;
  line-height: 1.45;
}
.om-goods-thumb {
  height: 84px;
  background: linear-gradient(160deg, #f8fafc, #eef2ff 55%, #ecfdf5);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.om-goods-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.om-goods-thumb.is-fallback span,
.om-goods-thumb .om-goods-fallback {
  font-size: 22px;
  font-weight: 700;
  color: #16a34a;
  opacity: 0.85;
}
.om-goods-radio {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid #ccc;
  background: #fff;
}
.om-goods-card.is-active .om-goods-radio {
  border-color: var(--om-green);
  background: var(--om-green);
  box-shadow: inset 0 0 0 3px #fff;
}
.om-goods-name {
  margin: 8px 8px 0;
  font-size: 12px;
  font-weight: 600;
  color: #222;
  line-height: 1.35;
  min-height: 32px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.om-goods-price {
  margin: 4px 8px 0;
  font-size: 12px;
  color: #ef4444;
  font-weight: 700;
}

@media (min-width: 481px) {
  .om-mask,
  .om-sheet {
    left: 50%;
    right: auto;
    width: 480px;
    transform: translate(-50%, 110%);
  }
  .om-sheet.show {
    transform: translate(-50%, 0);
  }
  .om-mask {
    transform: none;
    width: 100vw;
    left: 0;
  }
}
