/* THINY SHOP — Mobile shop styles */

.thiny-shop {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  color: var(--c-fg);
  font-family: var(--font-sans);
  position: relative;
  overflow: hidden;
}
.thiny-shop-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.thiny-shop-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

/* ---- Header ---- */
.thiny-shop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 12px;
}
.thiny-shop-header-tight { padding: 16px 18px 8px; }
.thiny-shop-header h2 { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.thiny-shop-hi { font-size: 12px; color: var(--c-fg-3); }
.thiny-shop-greet { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin-top: 2px; }
.thiny-shop-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}

/* ---- Search button ---- */
.thiny-shop-search {
  margin: 4px 18px 12px;
  display: flex; align-items: center; gap: 8px;
  width: calc(100% - 36px);
  padding: 12px 14px;
  background: var(--c-mute);
  border-radius: 12px;
  color: var(--c-fg-3);
  font-size: 14px;
}
.thiny-shop-searchbar {
  margin: 4px 18px 14px;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--c-mute);
  border-radius: 12px;
}
.thiny-shop-searchbar input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--c-fg);
}
.thiny-shop-searchbar input::placeholder { color: var(--c-fg-3); }

/* ---- Hero banner ---- */
.thiny-shop-hero {
  margin: 4px 18px 20px;
  padding: 22px 20px;
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
  border-radius: 18px;
  color: white;
  position: relative;
  overflow: hidden;
  min-height: 120px;
}
.thiny-shop-hero-tag {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.thiny-shop-hero-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.thiny-shop-hero-sub { font-size: 12px; opacity: 0.85; margin-top: 6px; max-width: 200px; }
.thiny-shop-hero-art {
  position: absolute; top: 0; right: 0; bottom: 0; width: 50%; pointer-events: none;
}
.thiny-shop-hero-blob {
  position: absolute; width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  top: -30px; right: -30px;
}
.thiny-shop-hero-blob2 {
  position: absolute; width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
  bottom: -20px; right: 30px;
}

/* ---- Sections ---- */
.thiny-shop-section { margin-bottom: 22px; }
.thiny-shop-section-head {
  padding: 0 18px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.thiny-shop-section-head h3 { font-size: 15px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }

/* ---- Categories ---- */
.thiny-shop-cats {
  display: flex; gap: 12px;
  padding: 0 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.thiny-shop-cats::-webkit-scrollbar { display: none; }
.thiny-shop-cat {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  flex-shrink: 0;
  font-size: 11px; font-weight: 500;
  color: var(--c-fg-2);
}
.thiny-shop-cat-img {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: var(--c-mute);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.thiny-shop-cat-img .thiny-prodimg { width: 100% !important; height: 100% !important; border-radius: 16px; }

/* ---- Grid ---- */
.thiny-shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 18px;
}
.thiny-shop-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 14px;
  overflow: hidden;
  text-align: left;
  transition: transform 0.15s;
}
.thiny-shop-card:active { transform: scale(0.97); }
.thiny-shop-card-img {
  position: relative;
  background: var(--c-mute);
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.thiny-shop-card-img .thiny-prodimg { width: 90% !important; height: 90% !important; }
.thiny-shop-heart {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-fg-2);
  backdrop-filter: blur(4px);
}
.thiny-shop-tag {
  position: absolute; top: 8px; left: 8px;
  background: var(--c-warn);
  color: white;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.thiny-shop-card-body { padding: 10px 12px 12px; }
.thiny-shop-card-name {
  font-size: 13px; font-weight: 600; line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 34px;
}
.thiny-shop-card-meta {
  display: flex; align-items: center; gap: 3px;
  font-size: 11px;
  color: var(--c-fg-2);
  margin-bottom: 6px;
}
.thiny-shop-card-meta svg { color: #F5B800; }
.thiny-shop-card-price { font-size: 15px; font-weight: 700; color: var(--c-accent); letter-spacing: -0.01em; }

/* ---- Horizontal list ---- */
.thiny-shop-hlist {
  display: flex; gap: 12px;
  padding: 0 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.thiny-shop-hlist::-webkit-scrollbar { display: none; }
.thiny-shop-hcard {
  flex-shrink: 0;
  width: 140px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 12px;
  padding: 10px;
  text-align: left;
  display: flex; flex-direction: column; gap: 6px;
}
.thiny-shop-hcard .thiny-prodimg { width: 100% !important; height: 110px !important; }
.thiny-shop-hcard-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.thiny-shop-hcard-price { font-size: 13px; font-weight: 700; color: var(--c-accent); }

/* ---- Category tabs ---- */
.thiny-shop-cattabs {
  display: flex; gap: 6px;
  padding: 0 18px 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.thiny-shop-cattabs::-webkit-scrollbar { display: none; }
.thiny-shop-cattabs button {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--c-mute);
  font-size: 12px; font-weight: 500;
  color: var(--c-fg-2);
}
.thiny-shop-cattabs button.active {
  background: var(--c-fg);
  color: var(--c-bg);
}

/* ============= DETAIL ============= */
.thiny-shop-detail { padding-bottom: 80px !important; }
.thiny-shop-detail-bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: transparent;
}
.thiny-shop-circle {
  width: 36px; height: 36px;
  background: var(--c-surface);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  color: var(--c-fg);
}
.thiny-shop-detail-hero {
  background: var(--c-mute);
  margin: 0 18px;
  border-radius: 18px;
  height: 280px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.thiny-shop-detail-hero .thiny-prodimg { width: 80% !important; height: 80% !important; }
.thiny-shop-detail-body { padding: 18px; }
.thiny-shop-detail-cat { font-size: 11px; color: var(--c-fg-3); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.thiny-shop-detail-name { font-size: 20px; font-weight: 700; margin: 4px 0 8px; letter-spacing: -0.02em; line-height: 1.25; }
.thiny-shop-detail-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.thiny-shop-rating { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.thiny-shop-rating svg { color: #F5B800; }
.thiny-shop-instock { font-size: 11px; color: var(--c-ok); font-weight: 600; }
.thiny-shop-detail-price {
  font-size: 28px;
  font-weight: 800;
  color: var(--c-accent);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.thiny-shop-detail-section { padding: 12px 0; border-top: 1px solid var(--c-line); }
.thiny-shop-detail-label { font-size: 12px; color: var(--c-fg-3); margin-bottom: 6px; font-weight: 600; }
.thiny-shop-detail-desc { font-size: 13px; color: var(--c-fg-2); line-height: 1.6; margin: 0; }

.thiny-shop-qty {
  display: inline-flex; align-items: center;
  background: var(--c-mute);
  border-radius: 100px;
  padding: 4px;
}
.thiny-shop-qty button {
  width: 32px; height: 32px;
  background: var(--c-surface);
  border-radius: 50%;
  font-size: 18px;
  font-weight: 600;
  color: var(--c-fg);
}
.thiny-shop-qty span { padding: 0 14px; font-weight: 700; font-size: 15px; }

.thiny-shop-detail-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--c-surface);
  border-top: 1px solid var(--c-line);
  padding: 12px 16px 26px;
  display: flex; align-items: center; gap: 12px;
}
.thiny-shop-detail-bottom-price { flex-shrink: 0; }
.thiny-shop-detail-total { font-size: 18px; font-weight: 800; color: var(--c-accent); letter-spacing: -0.01em; }
.thiny-shop-detail-add {
  flex: 1;
  background: var(--c-accent);
  color: var(--c-accent-ink);
  border-radius: 100px;
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.2s;
}
.thiny-shop-detail-add:active { background: var(--c-accent-2); }
.thiny-shop-detail-add.added { background: var(--c-ok); }

/* ============= CART ============= */
.thiny-shop-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 80px 24px;
  text-align: center;
}
.thiny-shop-empty h3 { font-size: 16px; font-weight: 700; margin: 8px 0 4px; }
.thiny-shop-btn-primary {
  background: var(--c-accent);
  color: var(--c-accent-ink);
  padding: 10px 24px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 14px;
}

.thiny-shop-cartlist {
  padding: 0 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.thiny-shop-cartrow {
  display: flex; align-items: center; gap: 12px;
  padding: 10px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 12px;
}
.thiny-shop-cartinfo { flex: 1; min-width: 0; }
.thiny-shop-cartname { font-size: 13px; font-weight: 600; line-height: 1.3; }
.thiny-shop-cartprice { font-size: 14px; font-weight: 700; color: var(--c-accent); margin-top: 4px; }
.thiny-shop-cartqty {
  display: inline-flex; align-items: center;
  background: var(--c-mute);
  border-radius: 100px;
  padding: 3px;
}
.thiny-shop-cartqty button {
  width: 26px; height: 26px;
  background: var(--c-surface);
  border-radius: 50%;
  font-size: 15px; font-weight: 600;
}
.thiny-shop-cartqty span { padding: 0 8px; font-weight: 700; font-size: 12px; min-width: 18px; text-align: center; }

.thiny-shop-summary {
  background: var(--c-mute);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 18px 100px;
  display: flex; flex-direction: column; gap: 6px;
}
.thiny-shop-sumrow {
  display: flex; justify-content: space-between;
  font-size: 13px;
}
.thiny-shop-sumrow-total {
  font-size: 16px;
  font-weight: 700;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--c-line);
}

/* ============= CHECKOUT ============= */
.thiny-shop-co-section { padding: 16px 18px 8px; }
.thiny-shop-co-label { font-size: 12px; color: var(--c-fg-3); font-weight: 600; margin-bottom: 8px; }
.thiny-shop-co-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 12px;
}
.thiny-shop-co-card > svg { color: var(--c-accent); flex-shrink: 0; }
.thiny-shop-co-card > div { flex: 1; min-width: 0; }
.thiny-shop-paylist { display: flex; flex-direction: column; gap: 8px; }
.thiny-shop-payrow {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 12px;
  text-align: left;
  transition: all 0.15s;
}
.thiny-shop-payrow.active { border-color: var(--c-accent); background: var(--c-accent-soft); }
.thiny-shop-payradio {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--c-line-2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.thiny-shop-payrow.active .thiny-shop-payradio { border-color: var(--c-accent); }
.thiny-shop-payradio > div {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--c-accent);
}
.thiny-shop-payinfo { flex: 1; }
.thiny-shop-co-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0;
}

/* ============= ORDERS ============= */
.thiny-shop-orderlist {
  padding: 0 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.thiny-shop-order {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 14px;
  padding: 14px;
}
.thiny-shop-order-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.thiny-shop-orderstatus {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
}
.thiny-shop-orderstatus-shipped { background: var(--c-accent-soft); color: var(--c-accent); }
.thiny-shop-orderstatus-delivered { background: var(--c-ok-bg); color: var(--c-ok); }
.thiny-shop-orderstatus-pending { background: var(--c-warn-bg); color: var(--c-warn); }
.thiny-shop-orderstatus-packing { background: var(--c-info-bg); color: var(--c-info); }
.thiny-shop-order-items {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 0;
  border-top: 1px solid var(--c-line);
  border-bottom: 1px solid var(--c-line);
}
.thiny-shop-order-item {
  display: flex; align-items: center; gap: 10px;
}
.thiny-shop-order-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px;
}
.thiny-shop-order-foot strong { font-size: 15px; color: var(--c-accent); }

/* ============= PROFILE ============= */
.thiny-shop-profile-hero {
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
  color: white;
  padding: 28px 20px 22px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.thiny-shop-profile-pic {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  font-weight: 700;
  border: 3px solid rgba(255,255,255,0.4);
  margin-bottom: 4px;
}
.thiny-shop-profile-name { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.thiny-shop-profile-tier {
  font-size: 11px;
  opacity: 0.85;
}
.thiny-shop-profile-tier span {
  background: rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 100px;
  font-weight: 700;
  margin-right: 4px;
}
.thiny-shop-profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  margin-top: 14px;
}
.thiny-shop-profile-stats > div {
  background: rgba(255,255,255,0.18);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.thiny-shop-profile-stats .thiny-fg-3 { color: rgba(255,255,255,0.85) !important; }
.thiny-shop-profile-num { font-size: 16px; font-weight: 700; }

.thiny-shop-profile-list {
  padding: 16px 18px;
  display: flex; flex-direction: column;
  background: var(--c-surface);
  margin: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--c-line);
}
.thiny-shop-profile-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 4px;
  text-align: left;
  border-bottom: 1px solid var(--c-line);
}
.thiny-shop-profile-item:last-child { border-bottom: none; }
.thiny-shop-profile-item > svg { color: var(--c-accent); }
.thiny-shop-profile-item-body { flex: 1; }

.thiny-shop-signout {
  margin: 0 18px;
  padding: 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-err);
  width: calc(100% - 36px);
}

/* ============= AUTH ============= */
.thiny-shop-auth { padding: 0 !important; }
.thiny-shop-auth-hero {
  text-align: center;
  padding: 32px 18px 16px;
}
.thiny-shop-auth-hero h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 12px 0 4px; }
.thiny-shop-auth-hero p { margin: 0; font-size: 13px; }
.thiny-shop-auth-logo {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: var(--c-accent);
  color: var(--c-accent-ink);
  font-size: 32px;
  font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  letter-spacing: -0.02em;
  box-shadow: 0 10px 30px color-mix(in oklab, var(--c-accent) 30%, transparent);
}
.thiny-shop-auth-seg {
  display: flex; gap: 4px;
  margin: 8px 18px 18px;
  background: var(--c-mute);
  padding: 4px;
  border-radius: 10px;
}
.thiny-shop-auth-seg button {
  flex: 1;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-fg-2);
  border-radius: 6px;
}
.thiny-shop-auth-seg button.active {
  background: var(--c-surface);
  color: var(--c-fg);
  box-shadow: var(--shadow-sm);
}
.thiny-shop-auth-form {
  padding: 0 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.thiny-shop-input { display: flex; flex-direction: column; gap: 4px; }
.thiny-shop-input label { font-size: 12px; color: var(--c-fg-3); font-weight: 600; }
.thiny-shop-input input {
  padding: 12px 14px;
  background: var(--c-mute);
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  color: var(--c-fg);
}
.thiny-shop-input input:focus { border-color: var(--c-accent); background: var(--c-surface); }
.thiny-shop-auth-check {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0;
}
.thiny-shop-checkbox {
  width: 18px; height: 18px;
  border-radius: 5px;
  background: var(--c-accent);
  color: white;
  display: flex; align-items: center; justify-content: center;
}
.thiny-shop-auth-cta {
  background: var(--c-accent);
  color: var(--c-accent-ink);
  padding: 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  margin-top: 4px;
}
.thiny-shop-auth-divider {
  text-align: center;
  position: relative;
  font-size: 12px;
  color: var(--c-fg-3);
  margin: 8px 0;
}
.thiny-shop-auth-divider::before, .thiny-shop-auth-divider::after {
  content: ""; position: absolute; top: 50%; width: calc(50% - 28px); height: 1px; background: var(--c-line);
}
.thiny-shop-auth-divider::before { left: 0; }
.thiny-shop-auth-divider::after { right: 0; }
.thiny-shop-auth-social {
  padding: 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

/* ============= BOTTOM NAV ============= */
.thiny-shop-nav {
  display: flex;
  background: var(--c-surface);
  border-top: 1px solid var(--c-line);
  padding: 8px 4px 26px;
  flex-shrink: 0;
}
.thiny-shop-nav button {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0;
  font-size: 10px; font-weight: 500;
  color: var(--c-fg-3);
  position: relative;
}
.thiny-shop-nav button.active { color: var(--c-accent); font-weight: 700; }
.thiny-shop-nav-cart-icon { position: relative; }
.thiny-shop-nav-badge {
  position: absolute;
  top: -4px; right: -8px;
  min-width: 16px; height: 16px;
  background: var(--c-err);
  color: white;
  border-radius: 100px;
  font-size: 9px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--c-surface);
}

/* Lang support: Lao */
.lang-lo .thiny-shop-hi,
.lang-lo .thiny-shop-greet,
.lang-lo .thiny-h1,
.lang-lo .thiny-h2 {
  font-family: "Noto Sans Lao", var(--font-sans);
}
.lang-th .thiny-shop-hi,
.lang-th .thiny-shop-greet {
  font-family: "IBM Plex Sans Thai", "Noto Sans Thai", var(--font-sans);
}
