/* HAIT3D Live Storefront Interactive Sheets, Detail Views, Modals & Status UI */

.hait-livebar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 11px;
  color: #5A4A40;
}
.hait-livebar .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(90, 74, 64, 0.14);
}
.hait-livebar .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b88a44;
}
.hait-livebar .dot.ok { background: #3b8d56; }
.hait-livebar .dot.err { background: #b8443c; }
.hait-livebar a {
  color: #F7F4ED;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Strict frame containment for all pages, grids & cards inside 375x812 phone screen */
.screen, .pages, .page, .mallsub {
  max-width: 100%;
  overflow-x: hidden;
}
.prodgrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 12px;
  width: 100%;
  max-width: 100%;
}
.subfeat {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  width: 100%;
  max-width: 100%;
}
.prod, .sf {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.prod .pimg {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}
.prod .pimg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.prod .pn, .sf .sfcap {
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Interactive affordances on existing HAIT3D template elements */
.brand { cursor: pointer; }
.hf-card, .prod, .sf, .feedcard, .memcard, .orders > div, .list > div, .so-chips span, .so-his div, .feedhero-down, .cart-empty {
  cursor: pointer;
}
.hf-card:active, .prod:active, .sf:active, .feedcard:active, .orders > div:active, .list > div:active {
  opacity: 0.84;
}
.list > div::after {
  content: "›";
  margin-left: 8px;
  color: #9C8878;
  font-size: 15px;
}
.list > div span {
  margin-left: auto;
}
.cart-go {
  cursor: pointer;
  user-select: none;
}
.cart-go.disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* Always show cart FAB cleanly once past splash */
.cartfab.live-show {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
}

/* Search results inside #searchOv */
.so-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.so-btn {
  border: none;
  background: #3E2F26;
  color: #F7F4ED;
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
}
.so-results {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 18px;
}
.so-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(90, 74, 64, 0.12);
  cursor: pointer;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.so-item img {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  background: #EFE9DF;
  flex-shrink: 0;
}
.so-item-info {
  flex: 1 1 auto;
  min-width: 0;
}
.so-item-info b {
  display: block;
  font-size: 13px;
  color: #2B211B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.so-item-info small {
  display: block;
  font-size: 11px;
  color: #7E6D61;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.so-item-price {
  font-size: 13px;
  font-weight: 600;
  color: #2B211B;
  flex-shrink: 0;
}

/* Fullscreen slide-over sheet strictly contained inside .screen below .statusbar */
.hait-sheet {
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  max-height: calc(100% - 46px);
  z-index: 65;
  background: #F5F1E9;
  display: none;
  flex-direction: column;
  overflow: hidden;
  color: #2B211B;
  box-sizing: border-box;
}
.hait-sheet.show {
  display: flex;
}
.hait-sheet-head {
  height: 48px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(90, 74, 64, 0.12);
  background: rgba(245, 241, 233, 0.96);
  backdrop-filter: blur(8px);
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
}
.hait-sheet-back, .hait-sheet-act {
  border: none;
  background: transparent;
  color: #4A3B33;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  flex: 0 0 auto;
  min-width: 48px;
}
.hait-sheet-back { text-align: left; }
.hait-sheet-act { text-align: right; }
.hait-sheet-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #2B211B;
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hait-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}
.hait-sheet-body::-webkit-scrollbar { width: 0; }
.hait-sheet-foot {
  padding: 10px 14px 18px;
  border-top: 1px solid rgba(90, 74, 64, 0.12);
  background: #F5F1E9;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
}
.hait-sheet-foot > .hs-btn,
.hait-sheet-foot > a.hs-btn {
  flex: 1 1 0;
  min-width: 0;
}

/* Cards, forms, chips, buttons inside sheet — all locked inside width */
.hs-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(90, 74, 64, 0.11);
  border-radius: 14px;
  padding: 13px;
  margin-bottom: 12px;
  overflow: hidden;
}
.hs-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.35;
  color: #2B211B;
  overflow-wrap: anywhere;
}
.hs-card h4 {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.35;
  color: #4A3B33;
  overflow-wrap: anywhere;
}
.hs-muted {
  font-size: 12px;
  color: #7E6D61;
  line-height: 1.55;
  margin: 4px 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.hs-banner {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #EFE8DC;
  border: 1px solid rgba(90, 74, 64, 0.14);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 11px;
  color: #5A4A40;
  line-height: 1.55;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}
.hs-error {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #FBECEB;
  border: 1px solid rgba(184, 68, 60, 0.25);
  color: #8F2C26;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}
.hs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  background: #2B211B;
  color: #F7F4ED;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hs-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.hs-btn.secondary {
  background: transparent;
  color: #2B211B;
  border: 1px solid rgba(43, 33, 27, 0.35);
}
.hs-btn.small {
  width: auto;
  padding: 6px 12px;
  font-size: 12px;
}
.hs-btn.danger {
  background: transparent;
  color: #9C2F27;
  border: 1px solid rgba(156, 47, 39, 0.35);
}
.hs-btn.wechat {
  background: #07C160;
  color: #FFFFFF;
}
.hs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
.hs-row > * {
  min-width: 0;
}
.hs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0;
  max-width: 100%;
}
.hs-chip {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(90, 74, 64, 0.22);
  background: #FAF7F1;
  color: #3E2F26;
  font-size: 12px;
  cursor: pointer;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  text-align: left;
  line-height: 1.3;
}
.hs-chip.on {
  background: #2B211B;
  color: #F7F4ED;
  border-color: #2B211B;
}
.hs-chip:disabled {
  opacity: 0.4;
  text-decoration: line-through;
  cursor: not-allowed;
}
.hs-hero-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  background: #EAE2D6;
  margin-bottom: 12px;
  display: block;
}
.hs-price {
  font-size: 20px;
  font-weight: 600;
  color: #2B211B;
  margin: 4px 0 6px;
}
.hs-price small {
  font-size: 12px;
  font-weight: 400;
  color: #8C7A6B;
  text-decoration: line-through;
  margin-left: 6px;
}
.hs-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
  width: 100%;
  min-width: 0;
}
.hs-field label {
  font-size: 12px;
  color: #5A4A40;
}
.hs-field input, .hs-field select, .hs-field textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(90, 74, 64, 0.22);
  background: #FFFDF9;
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 13px;
  color: #2B211B;
  font-family: inherit;
}
.hs-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 12px;
  padding-bottom: 2px;
  max-width: 100%;
}
.hs-tabs::-webkit-scrollbar { height: 0; }
.hs-tab {
  border: 1px solid rgba(90, 74, 64, 0.18);
  background: rgba(255, 255, 255, 0.68);
  color: #5A4A40;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  flex: 0 0 auto;
}
.hs-tab.on {
  background: #2B211B;
  color: #F7F4ED;
  border-color: #2B211B;
}
.hs-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #EAE2D6;
  color: #4A3B33;
  flex-shrink: 0;
}
.hs-badge.ok { background: #DFEFE4; color: #266039; }
.hs-badge.warn { background: #F5E6D3; color: #7C4F16; }
.hs-check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  color: #5A4A40;
  line-height: 1.5;
  margin: 10px 0 12px;
}
.hs-check-row input {
  margin-top: 2px;
  flex-shrink: 0;
}
.hs-link {
  color: #2B211B;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
}
.hs-step-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.hs-step-pill {
  flex: 1;
  text-align: center;
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(90, 74, 64, 0.08);
  color: #7E6D61;
}
.hs-step-pill.on {
  background: #2B211B;
  color: #F7F4ED;
}

/* Toast strictly inside .screen */
.hait-toast {
  position: absolute;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  z-index: 90;
  background: rgba(35, 27, 22, 0.92);
  color: #F7F4ED;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  max-width: 82%;
  text-align: center;
  display: none;
  pointer-events: none;
}
.hait-toast.show { display: block; }

/* Category live banner & filter pills inside #p-mall */
.hait-cat-live-bar {
  margin: 0 0 12px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(90, 74, 64, 0.12);
  font-size: 11px;
  color: #6B5B50;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.hait-cat-showcase {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(90, 74, 64, 0.12);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 14px;
  cursor: pointer;
}
.hait-cat-showcase img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.hait-cat-showcase-body {
  padding: 12px 14px;
}
.hait-cat-showcase-body h4 {
  margin: 4px 0 4px;
  font-size: 15px;
  color: #2B211B;
}
.hait-cat-showcase-body p {
  margin: 0;
  font-size: 12px;
  color: #7E6D61;
  line-height: 1.5;
}
.hf-dots i.on {
  background: #2B211B !important;
  opacity: 1 !important;
}
