/* Consumer storefront — high-conversion Chinese e-com flavor. */
@import url("../../colors_and_type.css");
@import url("https://unpkg.com/@tabler/icons-webfont@latest/dist/tabler-icons.min.css");

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #131316; font-family: var(--font-sans); height: 100%; }

:root { --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes fade-up { 0% { opacity: 0; transform: translateY(8px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes pulse-ring { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes shimmer-grad {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.stage {
  min-height: 100vh;
  padding: 32px 0;
  display: flex; gap: 32px; flex-wrap: wrap; align-items: flex-start; justify-content: center;
  background: linear-gradient(180deg, #131316 0%, #0A0A0C 100%);
}
.phone {
  width: 380px; height: 800px;
  background: var(--surface);
  border-radius: 36px;
  border: 8px solid #2A2A30;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.5);
  overflow: hidden; position: relative; display: flex; flex-direction: column;
}
.phone .notch { position: absolute; left: 50%; top: 6px; width: 100px; height: 20px; background: #2A2A30; border-radius: 999px; transform: translateX(-50%); z-index: 5; }
.status { height: 32px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; background: var(--surface); font-family: var(--font-sans); font-size: 13px; font-weight: 500; color: var(--on-surface); }
.status .right { display: flex; gap: 6px; align-items: center; }
.viewport { flex: 1; min-height: 0; background: var(--surface); overflow: hidden; display: flex; flex-direction: column; }

.kit-header { width: 100%; text-align: center; padding-top: 6px; }
.kit-header h1 { color: #fff; font-family: var(--font-display); font-weight: 500; font-size: 18px; margin: 0; }
.kit-header p { color: rgba(255,255,255,0.5); font-family: var(--font-sans); font-size: 12px; margin: 4px 0 16px; }
.stage-label { font-family: var(--font-sans); font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.7); text-align: center; margin-bottom: 8px; letter-spacing: 0.05em; text-transform: uppercase; }
.phone-wrap { display: flex; flex-direction: column; align-items: center; }

/* Shop topbar — search-first, no brand chip */
.shop-topbar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border-bottom: var(--border-thin) solid var(--outline-variant);
}
.shop-topbar .searchbox {
  flex: 1;
  display: flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: 16px;
  background: var(--surface-container-low);
  font-family: var(--font-sans); font-size: 13px; color: var(--on-surface-variant);
}
.shop-topbar .ic { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.shop-topbar .ic i { font-size: 20px; color: var(--on-surface); }
.shop-topbar .ic.alert { position: relative; }
.shop-topbar .ic.alert::after { content: ""; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--thaihao-primary); }

.scroll { flex: 1; overflow: auto; padding: 0; display: flex; flex-direction: column; }
.scroll > * { animation: fade-up 320ms var(--ease-out-quint) both; flex-shrink: 0; }

/* Hero live banner — big colored block with live badge */
.hero-live {
  margin: 12px 12px 0;
  border-radius: 12px;
  position: relative;
  height: 180px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--thaihao-primary) 0%, #5A0011 60%, #2C0008 100%);
  background-size: 200% 200%;
  animation: shimmer-grad 10s ease-in-out infinite;
  color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 14px;
  cursor: pointer;
}
.hero-live .live-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 9999px;
  font-family: var(--font-sans); font-size: 11px; font-weight: 500;
  width: fit-content;
}
.hero-live .live-tag .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; position: relative; }
.hero-live .live-tag .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #fff; animation: pulse-ring 1.6s ease-out infinite; }
.hero-live .info { display: flex; align-items: flex-end; gap: 10px; }
.hero-live .info .kol-pic {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 500; font-size: 16px;
  flex-shrink: 0;
}
.hero-live .info .text { flex: 1; min-width: 0; }
.hero-live .info .title { font-family: var(--font-display); font-size: 18px; font-weight: 500; line-height: 1.2; }
.hero-live .info .meta { font-family: var(--font-sans); font-size: 12px; opacity: 0.9; margin-top: 2px; }
.hero-live .viewers { font-family: var(--font-mono); font-size: 12px; font-weight: 500; opacity: 0.9; }

/* Category strip — horizontal scroll */
.cat-strip {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 14px 12px; -webkit-overflow-scrolling: touch;
}
.cat-strip::-webkit-scrollbar { display: none; }
.cat-strip .cat {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 56px; text-align: center;
}
.cat-strip .cat .cat-ic { width: 48px; height: 48px; border-radius: 12px; background: var(--surface-container-low); display: flex; align-items: center; justify-content: center; }
.cat-strip .cat .cat-ic i { font-size: 22px; color: var(--thaihao-primary); }
.cat-strip .cat .cat-name { font-family: var(--font-sans); font-size: 11px; color: var(--on-surface); white-space: nowrap; }

/* Section header */
.sec-head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 4px 14px 8px;
}
.sec-head h2 { font-family: var(--font-display); font-size: 16px; font-weight: 500; margin: 0; color: var(--on-surface); }
.sec-head .more { margin-left: auto; font-family: var(--font-sans); font-size: 12px; color: var(--on-surface-variant); }

/* KOL recommend horizontal row */
.kol-rec {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 0 12px 12px; -webkit-overflow-scrolling: touch;
}
.kol-rec::-webkit-scrollbar { display: none; }
.kol-rec .item {
  flex-shrink: 0; width: 132px; border-radius: 10px;
  background: var(--surface-container-lowest);
  border: var(--border-thin) solid var(--outline-variant);
  overflow: hidden;
}
.kol-rec .item .pic {
  height: 132px;
  display: flex; align-items: flex-end; padding: 8px;
}
.kol-rec .item .pic .name { color: #fff; font-family: var(--font-sans); font-size: 11px; font-weight: 500; }
.kol-rec .item .body { padding: 8px 10px; }
.kol-rec .item .title { font-family: var(--font-sans); font-size: 12px; color: var(--on-surface); line-height: 1.3; max-height: 32px; overflow: hidden; }
.kol-rec .item .price { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--thaihao-primary); margin-top: 4px; }

/* Product grid */
.grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 0 12px 12px;
}
.product {
  background: var(--surface-container-lowest);
  border: var(--border-thin) solid var(--outline-variant);
  border-radius: 10px; overflow: hidden;
  transition: transform 220ms var(--ease-out-quint), box-shadow 220ms var(--ease-out-quint);
  position: relative;
}
.product:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -10px rgba(0,0,0,0.16); }
.product:active { transform: scale(0.98); }
.product .pic {
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.product .pic .badge {
  position: absolute; left: 6px; top: 6px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  color: #fff; font-family: var(--font-sans); font-size: 10px; font-weight: 500;
  padding: 2px 6px; border-radius: 4px;
  animation: ec-float 2.6s ease-in-out infinite;
}
.product .info { padding: 8px 10px 10px; }
.product .name { font-family: var(--font-sans); font-size: 12px; color: var(--on-surface); line-height: 1.3; max-height: 32px; overflow: hidden; }
.product .price { font-family: var(--font-mono); font-size: 15px; font-weight: 500; color: var(--thaihao-primary); margin-top: 6px; }
.product .ccy { font-size: 10px; color: var(--on-surface-variant); margin-left: 2px; }
.product .sold { font-family: var(--font-sans); font-size: 10px; color: var(--on-surface-variant); margin-top: 2px; }

/* Trust strip on product detail */
.trust-strip {
  display: flex; gap: 4px;
  padding: 8px 12px;
  border-top: var(--border-thin) solid var(--outline-variant);
  border-bottom: var(--border-thin) solid var(--outline-variant);
  background: var(--surface);
}
.trust-strip .item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px;
}
.trust-strip .item i { color: var(--color-text-on-success); font-size: 18px; }
.trust-strip .item span { font-family: var(--font-sans); font-size: 10px; color: var(--on-surface); }

/* Live view */
.live-view { flex: 1; position: relative; overflow: hidden; background: #000; display: flex; flex-direction: column; }
.live-stream {
  flex: 1; position: relative;
  background: linear-gradient(135deg, #800017 0%, #5A0011 30%, #2C0008 60%, #0A0004 100%);
  display: flex; align-items: center; justify-content: center;
}
.live-stream .center {
  color: #fff; font-family: var(--font-display); font-size: 13px; opacity: 0.5;
  letter-spacing: 0.1em;
}
/* Stream overlay UI */
.stream-overlay { position: absolute; inset: 0; pointer-events: none; }
.stream-overlay > * { pointer-events: auto; }
.stream-top {
  position: absolute; top: 12px; left: 12px; right: 12px;
  display: flex; align-items: center; gap: 10px;
}
.stream-host {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 9999px;
  color: #fff; font-family: var(--font-sans); font-size: 12px; font-weight: 500;
}
.stream-host .pic { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #fff; background: rgba(255,255,255,0.2); display:flex; align-items:center; justify-content:center; font-family: var(--font-display); font-size: 12px; }
.stream-host .follow { background: var(--thaihao-primary); padding: 2px 8px; border-radius: 9999px; font-size: 11px; margin-left: 4px; }
.stream-stats { margin-left: auto; display: flex; gap: 6px; }
.stream-stats .chip {
  background: rgba(0,0,0,0.35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: #fff; padding: 4px 10px; border-radius: 9999px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}
.stream-stats .chip.live { background: var(--thaihao-primary); color: #fff; }
.stream-stats .chip .dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; }

.stream-chat {
  position: absolute; bottom: 96px; left: 12px; width: 240px;
  display: flex; flex-direction: column; gap: 4px;
  pointer-events: none;
}
.stream-chat .msg {
  background: rgba(0,0,0,0.35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: #fff; padding: 5px 10px; border-radius: 12px;
  font-family: var(--font-sans); font-size: 11px;
  display: inline-flex; gap: 6px; align-self: flex-start;
}
.stream-chat .msg .who { color: var(--color-text-on-warning); font-weight: 500; }

/* Active product overlay — sticky at bottom */
.stream-product {
  position: absolute; bottom: 12px; left: 12px; right: 12px;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 8px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.stream-product .pic { width: 44px; height: 44px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); color: #fff; font-weight: 500; }
.stream-product .info { flex: 1; min-width: 0; }
.stream-product .name { font-family: var(--font-sans); font-size: 12px; font-weight: 500; color: var(--on-surface); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stream-product .deal { font-family: var(--font-mono); font-size: 11px; color: var(--thaihao-primary); margin-top: 2px; }
.stream-product .price { font-family: var(--font-mono); font-size: 15px; font-weight: 500; color: var(--thaihao-primary); }
.stream-product button {
  background: var(--gradient-primary); color: #fff; border: none;
  height: 36px; padding: 0 14px; border-radius: 9999px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500; cursor: pointer;
  box-shadow: 0 6px 18px -4px rgba(172, 0, 34, 0.55);
  transition: transform 180ms var(--ease-out-quint), box-shadow 180ms var(--ease-out-quint);
}
.stream-product button:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -6px rgba(172, 0, 34, 0.7); }

.stream-toolbar {
  position: absolute; right: 12px; bottom: 96px;
  display: flex; flex-direction: column; gap: 12px;
}
.stream-toolbar .tool {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0,0,0,0.35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer;
}
.stream-toolbar .tool i { font-size: 20px; }
.stream-toolbar .tool .badge { position: absolute; transform: translate(14px, -14px); background: var(--thaihao-primary); color: #fff; border-radius: 9999px; padding: 1px 5px; font-size: 9px; font-family: var(--font-mono); }

/* Product detail page */
.pd-gallery {
  aspect-ratio: 1 / 1;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.pd-gallery .pos { position: absolute; right: 12px; bottom: 12px; background: rgba(0,0,0,0.5); color: #fff; padding: 3px 10px; border-radius: 9999px; font-family: var(--font-mono); font-size: 11px; backdrop-filter: blur(8px); }
.pd-block { padding: 14px; background: var(--surface-container-lowest); border-bottom: 6px solid var(--surface); }
.pd-price { display: flex; align-items: baseline; gap: 6px; }
.pd-price .now { font-family: var(--font-mono); font-size: 28px; font-weight: 500; color: var(--thaihao-primary); }
.pd-price .iso { font-family: var(--font-mono); font-size: 14px; color: var(--on-surface-variant); }
.pd-price .was { font-family: var(--font-mono); font-size: 13px; color: var(--on-surface-variant); text-decoration: line-through; margin-left: 6px; }
.pd-title { font-family: var(--font-sans); font-size: 15px; font-weight: 500; color: var(--on-surface); line-height: 1.4; margin-top: 6px; }
.pd-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.pd-tags .tag { background: var(--thaihao-primary-tint); color: var(--thaihao-primary); padding: 3px 8px; border-radius: 4px; font-family: var(--font-sans); font-size: 11px; font-weight: 500; }

.pd-endorse {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-container-low);
  padding: 10px 14px;
  margin: 12px 14px 0;
  border-radius: 10px;
}
.pd-endorse .pic { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--font-display); font-weight: 500; font-size: 13px; }
.pd-endorse .text { flex: 1; }
.pd-endorse .name { font-family: var(--font-sans); font-size: 12px; font-weight: 500; }
.pd-endorse .quote { font-family: var(--font-sans); font-size: 11px; color: var(--on-surface-variant); margin-top: 1px; }
.pd-endorse .replay { color: var(--thaihao-primary); font-size: 11px; font-family: var(--font-sans); font-weight: 500; }

/* Cart */
.cart-item {
  display: grid; grid-template-columns: 72px 1fr auto;
  gap: 10px; padding: 12px 14px;
  border-bottom: var(--border-thin) solid var(--outline-variant);
  background: var(--surface-container-lowest);
}
.cart-item .pic { width: 72px; height: 72px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--font-display); font-weight: 500; }
.cart-item .info .name { font-family: var(--font-sans); font-size: 13px; font-weight: 500; color: var(--on-surface); line-height: 1.3; }
.cart-item .info .variant { font-family: var(--font-sans); font-size: 11px; color: var(--on-surface-variant); margin-top: 2px; }
.cart-item .info .price { font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--thaihao-primary); margin-top: 6px; }
.cart-item .qty { display: flex; align-items: center; gap: 8px; align-self: flex-end; font-family: var(--font-mono); font-size: 13px; }
.cart-item .qty button { width: 22px; height: 22px; border-radius: 50%; border: 0.5px solid var(--outline-variant); background: var(--surface-container-lowest); color: var(--on-surface); cursor: pointer; }

.cart-summary {
  margin: 12px 14px 0;
  padding: 12px 14px;
  background: var(--surface-container-lowest);
  border-radius: 10px;
}
.cart-summary .line { display: flex; align-items: baseline; padding: 4px 0; }
.cart-summary .line .k { font-family: var(--font-sans); font-size: 13px; color: var(--on-surface-variant); }
.cart-summary .line .v { margin-left: auto; font-family: var(--font-mono); font-size: 13px; color: var(--on-surface); }
.cart-summary .line.total { padding-top: 10px; margin-top: 6px; border-top: var(--border-thin) solid var(--outline-variant); }
.cart-summary .line.total .k { font-size: 14px; color: var(--on-surface); font-weight: 500; }
.cart-summary .line.total .v { font-size: 18px; font-weight: 500; color: var(--thaihao-primary); }

.cart-foot {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface-container-lowest);
  border-top: var(--border-thin) solid var(--outline-variant);
}
.cart-foot .total .k { font-family: var(--font-sans); font-size: 11px; color: var(--on-surface-variant); }
.cart-foot .total .v { font-family: var(--font-mono); font-size: 20px; font-weight: 500; color: var(--thaihao-primary); }
.cart-foot button { margin-left: auto; background: var(--gradient-primary); color: #fff; border: none; height: 44px; padding: 0 24px; border-radius: 9999px; font-family: var(--font-sans); font-size: 15px; font-weight: 500; cursor: pointer; box-shadow: 0 6px 18px -4px rgba(172, 0, 34, 0.4); transition: transform 180ms var(--ease-out-quint), box-shadow 180ms var(--ease-out-quint); }
.cart-foot button:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -6px rgba(172, 0, 34, 0.55); }

/* Bottom tab nav — Tabler filled icons */
.bottombar { height: 64px; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface-container-lowest); border-top: var(--border-thin) solid var(--outline-variant); padding-bottom: 4px; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--on-surface-variant); cursor: pointer; transition: color 160ms; }
.tab i { font-size: 22px; }
.tab span { font-family: var(--font-sans); font-size: 10px; }
.tab.active { color: var(--thaihao-primary); }

/* Block-color helper for product placeholders */
.bg-rice { background: linear-gradient(135deg, #E8B842 0%, #D49C28 100%); }
.bg-rose { background: linear-gradient(135deg, #F286A0 0%, #D44472 100%); }
.bg-cream { background: linear-gradient(135deg, #F5E6D8 0%, #D9B894 100%); color: #5B403F !important; }
.bg-coffee { background: linear-gradient(135deg, #8B5A3C 0%, #5A3820 100%); }
.bg-tea { background: linear-gradient(135deg, #6E9E5C 0%, #466632 100%); }
.bg-silk { background: linear-gradient(135deg, #B5739C 0%, #6E3A5C 100%); }
.bg-spice { background: linear-gradient(135deg, #C53A2C 0%, #7E1F18 100%); }
.bg-honey { background: linear-gradient(135deg, #E0A02E 0%, #A86E18 100%); }
