/* 选品配置 — 手机内页 */
.ps-viewport {
  background: #f1f5f9;
}

.ps-viewport .app-scroll.ps-scroll {
  padding-bottom: 8px;
}

.ps-viewport.has-fab .app-scroll.ps-scroll {
  padding-bottom: 132px;
}

.ps-fab-area {
  padding: 14px 18px 18px;
  background: #fff;
  flex-shrink: 0;
  border-top: 1px solid #eef2f7;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}

.ps-fab-area[hidden] {
  display: none !important;
}

/* 底部操作区：上方生成张数，下方操作按钮，参考确认弹层结构 */
.ps-fab-area--stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ps-fab-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ps-fab-count-label {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  line-height: 1;
}

.ps-fab-count-unit {
  display: none;
}

.ps-fab-count-value {
  width: 44px;
  height: 36px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-left: 1px solid #dbe3f0;
  border-right: 1px solid #dbe3f0;
  background: #fff;
}

.ps-stepper--fab {
  display: inline-flex;
  align-items: center;
  gap: 0;
  width: auto;
  height: 36px;
  overflow: hidden;
  border: 1px solid #dbe3f0;
  border-radius: 8px;
  background: #fff;
}

.ps-stepper--fab .ps-stepper-btn {
  width: 44px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.ps-stepper--fab .ps-stepper-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ps-stepper-input--sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.ps-fab-actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.ps-fab-actions .ps-fab-cancel {
  display: none !important;
}

.ps-fab-main {
  flex: 1;
  min-width: 0;
  width: 100%;
  border-radius: 8px;
}

.ps-header {
  background: #fff;
}

.ps-scroll {
  padding: 12px 14px 24px;
  background: linear-gradient(180deg, #eef4ff 0%, #f1f5f9 120px);
}

.ps-page-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  padding: 8px 2px 14px;
  letter-spacing: 0.02em;
}

/* 与页面灰底、白卡片统一：浅灰轨道 + 白底选中，避免大块蓝/白反差 */
.ps-segmented {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 16px;
  background: rgba(226, 232, 240, 0.55);
  border-radius: 12px;
  border: none;
  box-shadow: none;
}

.ps-seg-item {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 6px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  line-height: 1.25;
  min-height: 40px;
  letter-spacing: 0.01em;
}

.ps-seg-item.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.ps-seg-item:not(.active):active {
  color: #475569;
}

.ps-scheme-block {
  margin-bottom: 14px;
}

.ps-scheme-label {
  display: block;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 8px;
  padding-left: 2px;
}

.ps-select-wrap {
  position: relative;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ps-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  padding: 14px 40px 14px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
}

.ps-select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 0;
}

.ps-select-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #94a3b8;
  pointer-events: none;
}

.ps-scheme-desc {
  margin: 10px 2px 0;
  font-size: 13px;
  line-height: 1.5;
  color: #64748b;
}

.ps-smart-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ps-smart-hero {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 14px 14px 16px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.ps-smart-hero-art {
  margin: -4px -4px 10px;
  border-radius: 12px;
  overflow: hidden;
}

.ps-smart-svg {
  display: block;
  width: 100%;
  height: auto;
}

.ps-smart-hero-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.ps-smart-hero-desc {
  font-size: 13px;
  line-height: 1.55;
  color: #64748b;
}

.ps-special-needs-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ps-special-needs-btn:active {
  border-color: #bfdbfe;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.ps-special-needs-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #eff6ff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.ps-special-needs-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ps-special-needs-text strong {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.ps-special-needs-text small {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.35;
}

.ps-special-needs-arrow {
  color: #cbd5e1;
  font-size: 12px;
  flex-shrink: 0;
}

.ps-smart-needs-sheet {
  max-height: 88%;
  display: flex;
  flex-direction: column;
}

.ps-smart-zone-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px 12px;
  padding: 0 2px 4px;
  max-height: min(52vh, 420px);
}

.ps-smart-zone-scroll .ps-category-list {
  gap: 10px;
}

.ps-smart-zone-scroll .ps-category-card {
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.ps-sheet-primary {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 8px;
}

.ps-panel[hidden] {
  display: none !important;
}

.ps-category-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ps-category-card--pulse {
  animation: ps-zone-pulse 0.6s ease 2;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

@keyframes ps-zone-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.45);
  }
}

.ps-category-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px 14px 18px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.ps-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ps-category-body {
  background: #fff;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ps-category-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.ps-category-bar {
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  flex-shrink: 0;
}

.ps-add-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  color: var(--primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

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

.ps-category-empty {
  text-align: center;
  font-size: 13px;
  color: #cbd5e1;
  padding: 8px 0 4px;
}

.ps-panel-placeholder {
  padding-top: 8px;
}

.ps-empty-state {
  background: #fff;
  border-radius: 16px;
  padding: 32px 20px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.ps-empty-state > i {
  font-size: 36px;
  color: #93c5fd;
  margin-bottom: 12px;
}

.ps-empty-state p {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.ps-empty-state span {
  display: block;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 16px;
}

.ps-btn-outline {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}

.ps-btn-outline:active {
  background: #dbeafe;
}

/* —— 添加方式底部弹层 —— */
/* 覆盖整台「手机屏幕」，弹层不再相对浏览器窗口 fixed */
.ps-phone-layer {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.ps-phone-layer.is-active,
.ps-phone-layer:has(.ps-sheet-backdrop.show),
.ps-phone-layer:has(.ps-bottom-sheet.show),
.ps-phone-layer:has(.ps-fullscreen:not([hidden])) {
  pointer-events: auto;
}

/* 产品替换跳转：仅展示购物产品层，隐藏选品配置主界面 */
html.pr-replace-shop-entry .app-viewport.ps-viewport {
  visibility: hidden;
  pointer-events: none;
}

/* —— 全屏：确认生成信息 —— */
.ps-ai-confirm {
  z-index: 20;
  flex-direction: column;
  background: #fff;
}

.ps-ai-confirm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px 10px 4px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
  background: #fff;
}

.ps-ai-confirm-header .ps-icon-btn {
  color: #64748b;
  background: transparent;
  width: 40px;
  height: 40px;
}

.ps-ai-confirm-title {
  flex: 1;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  line-height: 1.3;
}

.ps-ai-confirm-header-spacer {
  width: 40px;
  flex-shrink: 0;
}

.ps-ai-confirm-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px 16px;
  background: #f8fafc;
}

.ps-ai-zone {
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 12px 12px 10px;
  margin-bottom: 12px;
}

.ps-ai-zone:last-child {
  margin-bottom: 0;
}

.ps-ai-zone-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.ps-ai-zone-title .ps-category-bar {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--primary);
  flex-shrink: 0;
}

.ps-ai-empty {
  margin: 0;
  padding: 4px 0 6px;
  font-size: 13px;
  color: #94a3b8;
}

.ps-ai-item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ps-ai-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  background: #fafbfc;
}

.ps-ai-item-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e2e8f0;
}

.ps-ai-item-thumb--cat {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: var(--primary);
  font-size: 22px;
}

.ps-ai-item-body {
  flex: 1;
  min-width: 0;
}

.ps-ai-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
  word-break: break-word;
}

.ps-ai-item-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.35;
}

.ps-ai-item-price {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 700;
  color: #ea580c;
}

.ps-ai-confirm-footer {
  flex-shrink: 0;
  padding: 16px 16px 18px;
  padding-bottom: max(18px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #f1f5f9;
  background: #fff;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}

.ps-ai-count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.ps-ai-count-label {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}

.ps-ai-count-row .ps-stepper {
  width: 130px;
  height: 38px;
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  border: 1px solid #dbe3f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.ps-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.ps-stepper-btn {
  width: 40px;
  min-height: 36px;
  border: none;
  background: #fff;
  font-size: 20px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.ps-ai-count-row .ps-stepper-btn {
  width: 43px;
  min-height: 0;
  color: #94a3b8;
  font-size: 20px;
}

.ps-stepper-btn:active {
  background: #f1f5f9;
}

.ps-stepper-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ps-stepper-input {
  width: 48px;
  min-height: 36px;
  border: none;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  background: #fff;
  font-family: inherit;
  padding: 0;
}

.ps-ai-count-row .ps-stepper-input {
  width: 44px;
  min-height: 0;
  border-left-color: #dbe3f0;
  border-right-color: #dbe3f0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.ps-ai-confirm-actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.ps-btn-ai-cancel {
  flex: 0 0 30%;
  min-width: 108px;
  min-height: 46px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 15px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  font-family: inherit;
}

.ps-btn-ai-submit {
  flex: 1;
  min-height: 46px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}

.ps-btn-ai-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ps-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.ps-sheet-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.ps-bottom-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  transform: translateY(100%);
  max-height: 72%;
  background: #fff;
  border-radius: 20px 20px 0 0;
  z-index: 2;
  padding: 8px 16px 20px;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.12);
  pointer-events: auto;
}

.ps-bottom-sheet.show {
  transform: translateY(0);
}

.ps-sheet-handle {
  width: 36px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  margin: 4px auto 12px;
}

.ps-sheet-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
}

.ps-sheet-sub {
  text-align: center;
  font-size: 13px;
  color: #64748b;
  margin: 4px 0 16px;
}

.ps-method-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.ps-method-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s;
}

.ps-method-row:active {
  background: #f8fafc;
  border-color: #bfdbfe;
}

.ps-method-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.ps-method-icon.scan {
  background: #eff6ff;
  color: var(--primary);
}

.ps-method-icon.cart {
  background: #fef3c7;
  color: #d97706;
}

.ps-method-text {
  flex: 1;
  min-width: 0;
}

.ps-method-text strong {
  display: block;
  font-size: 15px;
  color: #0f172a;
  margin-bottom: 2px;
}

.ps-method-text small {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.35;
}

.ps-method-arrow {
  color: #cbd5e1;
  font-size: 12px;
}

.ps-sheet-cancel {
  width: 100%;
  padding: 14px;
  border: none;
  background: #f1f5f9;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  font-family: inherit;
}

/* —— 全屏：扫一扫 / 云店（手机框内） —— */
.ps-phone-layer .ps-fullscreen {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ps-phone-layer .ps-fullscreen.ps-scan {
  background: #0f172a;
  color: #fff;
}

.ps-phone-layer .ps-fullscreen.ps-shop {
  background: #f1f5f9;
  color: #0f172a;
}

.ps-fullscreen[hidden] {
  display: none !important;
}

.ps-scan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(0, 0, 0, 0.35);
}

.ps-scan-header span {
  font-size: 16px;
  font-weight: 600;
}

.ps-icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ps-fullscreen.ps-scan .ps-icon-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.ps-shop-header .ps-icon-btn {
  background: #f1f5f9;
  color: #475569;
}

.ps-scan-viewport {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ps-scan-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ps-scan-mock {
  position: relative;
  z-index: 1;
  text-align: center;
}

.ps-scan-frame {
  width: 240px;
  height: 240px;
  position: relative;
  margin: 0 auto 20px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
}

.ps-scan-frame .corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 3px solid #60a5fa;
}

.ps-scan-frame .tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.ps-scan-frame .tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.ps-scan-frame .bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.ps-scan-frame .br { bottom: 0; right: 0; border-left: none; border-top: none; }

.ps-scan-line {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #3b82f6, transparent);
  animation: ps-scan-move 2s ease-in-out infinite;
}

@keyframes ps-scan-move {
  0%, 100% { top: 12%; opacity: 0.6; }
  50% { top: 88%; opacity: 1; }
}

.ps-scan-hint {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.ps-scan-actions {
  display: flex;
  justify-content: space-around;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.4);
}

.ps-scan-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.ps-scan-action i {
  font-size: 22px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ps-scan-action.primary i {
  background: var(--primary);
}

/* —— 全屏：云店选品 —— */
.ps-shop .ps-shop-body--product {
  flex: 1;
  min-height: 0;
}

.ps-shop:not(.mode-category-multi) .ps-shop-body--cat-pick {
  display: none !important;
}

.ps-shop.mode-category-multi .ps-shop-body--product {
  display: none !important;
}

.ps-shop.mode-category-multi .ps-shop-body--cat-pick {
  flex: 1;
  min-height: 0;
}

.ps-shop.mode-category-multi .ps-shop-search,
.ps-shop.mode-category-multi .ps-shop-cart-mini {
  display: none !important;
}

.ps-shop:not(.mode-category-multi) .ps-btn-confirm-cats {
  display: none !important;
}

.ps-shop.mode-category-multi #shopAddToCart,
.ps-shop.mode-category-multi #shopBuyNow {
  display: none !important;
}

.ps-shop.mode-category-multi .ps-btn-confirm-cats {
  display: block;
  flex: 1;
}

.ps-shop-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.ps-shop-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 8px 12px;
}

.ps-shop-search i {
  color: #94a3b8;
  font-size: 14px;
}

.ps-shop-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

.ps-shop-cart-mini {
  position: relative;
  width: 40px;
  height: 40px;
  border: none;
  background: #eff6ff;
  border-radius: 10px;
  color: var(--primary);
  font-size: 18px;
  cursor: pointer;
}

.ps-shop-cart-mini .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  background: #ef4444;
  color: #fff;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
}

.ps-shop-cart-mini .badge.show {
  display: flex;
}

.ps-shop-context {
  flex-shrink: 0;
  font-size: 12px;
  color: #64748b;
  padding: 8px 14px;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
}

.ps-shop-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.ps-shop-type-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ps-type-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 12px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.ps-type-card.selected {
  border-color: var(--primary);
  background: #eff6ff;
}

.ps-type-check {
  font-size: 20px;
  color: #94a3b8;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}

.ps-type-card.selected .ps-type-check {
  color: var(--primary);
}

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

.ps-type-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}

.ps-type-sub {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #94a3b8;
}

.ps-shop-footer-btns .ps-btn-confirm-cats {
  flex: 1;
}

.ps-shop-footer-btns .ps-btn-confirm-cats:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ps-picked-row--cat .ps-picked-cat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.ps-picked-row--cat .ps-picked-tag {
  font-size: 11px;
  color: var(--primary);
  background: #eff6ff;
  padding: 2px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.ps-shop-cats {
  width: 92px;
  flex-shrink: 0;
  background: #fff;
  overflow-y: auto;
  border-right: 1px solid #e2e8f0;
}

.ps-shop-cat {
  display: block;
  width: 100%;
  padding: 14px 8px;
  border: none;
  background: transparent;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
  text-align: center;
  line-height: 1.35;
  font-family: inherit;
  border-left: 3px solid transparent;
}

.ps-shop-cat.active {
  color: var(--primary);
  font-weight: 600;
  background: #eff6ff;
  border-left-color: var(--primary);
}

.ps-shop-products-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 12px;
  background: #f1f5f9;
}

.ps-shop-products {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ps-product-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff;
  border-radius: 10px;
  padding: 8px;
  border: 1px solid #e8edf3;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.ps-product-card:active {
  background: #f8fafc;
}

.ps-product-card.selected {
  border-color: #3b82f6;
  background: #f8fbff;
}

.ps-product-thumb {
  position: relative;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: #e8ecf1;
}

.ps-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ps-product-select-mark {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3b82f6;
  color: #fff;
  font-size: 9px;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.ps-product-card.selected .ps-product-select-mark {
  opacity: 1;
  transform: scale(1);
}

.ps-product-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 1px;
}

.ps-product-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.ps-product-title-line {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}

.ps-product-brand {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  color: #0369a1;
  background: #e0f2fe;
  padding: 1px 5px;
  border-radius: 4px;
}

.ps-product-name {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
}

.ps-product-price-inline {
  flex-shrink: 0;
  display: flex;
  align-items: baseline;
  gap: 1px;
  white-space: nowrap;
  padding-top: 1px;
}

.ps-product-price {
  font-size: 15px;
  font-weight: 800;
  color: #dc2626;
  font-variant-numeric: tabular-nums;
}

.ps-product-unit {
  font-size: 10px;
  font-weight: 500;
  color: #94a3b8;
}

.ps-product-meta-full {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: #64748b;
  word-break: break-word;
}

/* legacy — older card markup */
.ps-product-top,
.ps-product-row1,
.ps-product-title-wrap,
.ps-product-price-wrap,
.ps-product-price-row,
.ps-product-meta-row,
.ps-product-meta-line,
.ps-product-sub,
.ps-product-chip,
.ps-product-spec,
.ps-product-brand-row {
  /* superseded */
}

.ps-product-info,
.ps-product-head,
.ps-product-foot {
  /* legacy */
}

.ps-product-meta {
  font-size: 11px;
  color: #64748b;
}

.ps-shop-footer {
  flex-shrink: 0;
  background: #fff;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}

.ps-shop-footer-info {
  margin-bottom: 10px;
}

.ps-shop-total-label {
  font-size: 12px;
  color: #94a3b8;
  margin-right: 6px;
}

.ps-shop-total {
  font-size: 18px;
  font-weight: 700;
  color: #ef4444;
}

.ps-shop-footer-btns {
  display: flex;
  gap: 10px;
}

.ps-btn-cart-add,
.ps-btn-buy-now {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.ps-btn-cart-add {
  background: #eff6ff;
  color: var(--primary);
  border: 1px solid #bfdbfe;
}

.ps-btn-buy-now {
  background: linear-gradient(180deg, #3b82f6 0%, var(--primary) 100%);
  color: #fff;
}

.ps-category-body.has-items {
  align-items: stretch;
  justify-content: flex-start;
  padding: 8px;
  min-height: auto;
}

.ps-category-body.has-items .ps-category-empty {
  display: none;
}

.ps-picked-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ps-picked-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 12px;
}

.ps-picked-row img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
}

.ps-picked-row .name {
  flex: 1;
  color: #334155;
  line-height: 1.3;
}

.ps-picked-row .price {
  color: #ef4444;
  font-weight: 600;
  flex-shrink: 0;
}

.ps-picked-row button {
  border: none;
  background: transparent;
  color: #94a3b8;
  padding: 4px;
  cursor: pointer;
}