/* ─── CayTea App 2026 ─── */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0d0d0a;
  --bg2:      #141410;
  --bg3:      #1a1a14;
  --surface:  rgba(255,255,255,0.05);
  --surface2: rgba(255,255,255,0.08);
  --border:   rgba(255,255,255,0.09);
  --text:     #f0ece0;
  --text-dim: rgba(240,236,224,0.5);
  --gold:     #c9a84c;
  --gold-dim: rgba(201,168,76,0.15);
  --green:    #4a7c59;
  --radius-sm: 12px;
  --radius:   20px;
  --radius-lg: 28px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --nb-h:     72px;
  --font: 'Geist', 'Inter', system-ui, sans-serif;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="light"] {
  --bg:       #f7f4ee;
  --bg2:      #ede9df;
  --bg3:      #e4dfd2;
  --surface:  rgba(0,0,0,0.04);
  --surface2: rgba(0,0,0,0.07);
  --border:   rgba(0,0,0,0.1);
  --text:     #1a1a12;
  --text-dim: rgba(26,26,18,0.5);
  --gold:     #a8862c;
  --gold-dim: rgba(168,134,44,0.12);
  --green:    #3a6b47;
}

html { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  max-width: 430px;
  margin: 0 auto;
  overflow-x: hidden;
  position: relative;
  transition: background var(--transition), color var(--transition);
}

/* ─── Status Bar ─── */
.status-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 20px 4px;
  font-size: 12px; font-weight: 600; color: var(--text-dim);
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
}
.sb-icons { display: flex; gap: 8px; align-items: center; font-size: 10px; }

/* ─── App Shell ─── */
.app-shell {
  min-height: calc(100vh - 30px);
  padding-bottom: calc(var(--nb-h) + var(--safe-bot));
  position: relative;
}

/* ─── Screens ─── */
.screen {
  display: none;
  flex-direction: column;
  padding: 0 0 16px;
  animation: screenIn 0.28s cubic-bezier(0.4,0,0.2,1);
  min-height: calc(100vh - 30px - var(--nb-h));
}
.screen.active { display: flex; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ─── Topbar ─── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 10px;
  position: sticky; top: 30px; z-index: 50;
  background: var(--bg);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-actions { display: flex; gap: 8px; }
.topbar-greeting { font-size: 12px; color: var(--text-dim); }
.topbar-name { font-size: 16px; font-weight: 600; }
.screen-title { font-family: var(--serif); font-size: 26px; font-weight: 300; }

.app-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  overflow: hidden; background: var(--bg3);
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}
.app-avatar img { width: 100%; height: 100%; object-fit: cover; }

.icon-btn {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); border-radius: 50%;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.icon-btn:active { transform: scale(0.92); }

.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #e84040; border: 2px solid var(--bg);
}

/* ─── Hero Card ─── */
.hero-card {
  margin: 8px 16px 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #1a2e18, #0d1f0c);
  border: 1px solid rgba(74,124,89,0.3);
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  min-height: 180px;
  display: flex; align-items: flex-end;
  cursor: pointer;
}
.hero-card-bg {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 50%, rgba(74,124,89,0.2), transparent 60%),
              radial-gradient(circle at 20% 80%, rgba(201,168,76,0.1), transparent 50%);
}
.hero-card-content { position: relative; z-index: 1; flex: 1; }
.hc-tag {
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--green); font-weight: 600; display: block; margin-bottom: 8px;
}
.hc-title {
  font-family: var(--serif); font-size: 28px; font-weight: 300;
  line-height: 1.2; color: var(--text); margin-bottom: 6px;
}
.hc-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 16px; }
.hc-footer { display: flex; align-items: center; gap: 16px; }
.hc-price { font-family: var(--serif); font-size: 22px; color: var(--gold); }
.hc-btn {
  background: var(--gold); color: #0d0d0a;
  border: none; border-radius: 99px;
  padding: 10px 20px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  font-family: var(--font);
}
.hc-btn:active { transform: scale(0.95); opacity: 0.9; }
.hero-card-img {
  font-size: 72px; position: absolute; right: 20px; top: 50%;
  transform: translateY(-50%); opacity: 0.8;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.4));
  pointer-events: none;
}

/* ─── Section Header ─── */
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 20px 10px;
}
.section-header h3 { font-size: 18px; font-weight: 600; }
.see-all { background: none; border: none; color: var(--gold); font-size: 13px; cursor: pointer; font-family: var(--font); }

/* ─── Category Chips ─── */
.chips-row {
  display: flex; gap: 8px; padding: 0 20px 4px;
  overflow-x: auto; scrollbar-width: none;
}
.chips-row::-webkit-scrollbar { display: none; }
.chip {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-dim); padding: 8px 16px;
  border-radius: 99px; font-size: 13px; white-space: nowrap;
  cursor: pointer; transition: all var(--transition);
  font-family: var(--font);
}
.chip.active, .chip:active {
  background: var(--gold-dim); border-color: var(--gold);
  color: var(--gold); font-weight: 500;
}

/* ─── Cards Scroll ─── */
.cards-scroll {
  display: flex; gap: 12px;
  padding: 12px 20px 4px;
  overflow-x: auto; scrollbar-width: none;
}
.cards-scroll::-webkit-scrollbar { display: none; }

.prod-card {
  min-width: 150px; max-width: 150px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer; flex-shrink: 0;
  transition: transform var(--transition);
  position: relative;
}
.prod-card:active { transform: scale(0.96); }
.prod-card-img {
  height: 110px;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
}
.prod-card-info { padding: 10px 12px 12px; }
.prod-cat { font-size: 10px; color: var(--text-dim); letter-spacing: 0.5px; text-transform: uppercase; }
.prod-name { font-size: 14px; font-weight: 500; margin: 2px 0 4px; }
.prod-price { font-size: 14px; color: var(--gold); font-family: var(--serif); }
.prod-add {
  position: absolute; bottom: 12px; right: 10px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--green); color: #fff; border: none;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.prod-add:active { transform: scale(0.88); }

/* ─── Ritual Banner ─── */
.ritual-banner {
  margin: 16px; padding: 18px 20px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; transition: all var(--transition);
}
.ritual-banner:active { transform: scale(0.98); }
.rb-label { font-size: 10px; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.rb-title { font-size: 16px; font-weight: 600; }
.rb-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.rb-icon { font-size: 40px; }

/* ─── Stats Row ─── */
.stats-row {
  display: flex; gap: 10px; padding: 0 16px 16px;
}
.stat-pill {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 8px;
  text-align: center;
}
.sp-num { display: block; font-family: var(--serif); font-size: 20px; color: var(--gold); }
.sp-label { font-size: 10px; color: var(--text-dim); }

/* ─── Shop Grid ─── */
.shop-grid { display: flex; flex-direction: column; gap: 3px; padding: 0 16px; }
.shop-item {
  display: flex; gap: 16px; align-items: center;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  cursor: pointer; transition: all var(--transition);
}
.shop-item:active { transform: scale(0.98); }
.si-img {
  width: 64px; height: 64px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.si-info { flex: 1; }
.si-name { font-size: 15px; font-weight: 500; margin-bottom: 2px; }
.si-desc { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.si-row { display: flex; align-items: center; justify-content: space-between; }
.si-price { font-family: var(--serif); font-size: 16px; color: var(--gold); }
.si-price.gold { color: var(--gold); }
.si-add {
  background: var(--green); color: #fff; border: none;
  border-radius: 99px; padding: 6px 14px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: var(--font); transition: all var(--transition);
}
.si-add:active { opacity: 0.8; transform: scale(0.95); }
.si-add.gold-btn { background: var(--gold); color: #000; }

.premium-item { border-color: rgba(201,168,76,0.25); background: var(--gold-dim); }

/* ─── Learn ─── */
.learn-list { display: flex; flex-direction: column; gap: 3px; padding: 0 16px 16px; }
.learn-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  cursor: pointer; transition: all var(--transition);
}
.learn-item:active { transform: scale(0.98); }
.li-emoji { font-size: 28px; width: 40px; text-align: center; flex-shrink: 0; }
.li-info { flex: 1; }
.li-name { font-size: 15px; font-weight: 500; }
.li-latin { font-size: 11px; color: var(--text-dim); font-style: italic; }
.li-tag { font-size: 11px; color: var(--green); margin-top: 2px; }
.li-power { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 56px; }
.li-bar {
  width: 56px; height: 4px; background: var(--surface2); border-radius: 99px; overflow: hidden;
}
.li-bar div { height: 100%; background: linear-gradient(90deg, var(--green), var(--gold)); border-radius: 99px; }
.li-power span { font-size: 10px; color: var(--text-dim); }

.ritual-steps-card {
  margin: 0 16px 16px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.ritual-steps-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.brew-steps { display: flex; flex-direction: column; gap: 14px; }
.brew-step { display: flex; align-items: center; gap: 14px; }
.bs-num {
  font-family: var(--serif); font-size: 24px; color: var(--gold-dim);
  min-width: 32px; font-weight: 300;
}
.brew-step strong { display: block; font-size: 14px; margin-bottom: 1px; }
.brew-step small { color: var(--text-dim); font-size: 12px; }

/* ─── Profile ─── */
.profile-hero {
  margin: 0 16px 16px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 20px;
  text-align: center;
}
.ph-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: #0d0d0a;
  margin: 0 auto 12px;
}
.ph-name { font-size: 18px; font-weight: 600; }
.ph-email { font-size: 13px; color: var(--text-dim); margin: 2px 0 12px; }
.ph-badge {
  display: inline-block; background: var(--gold-dim);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold); font-size: 12px; font-weight: 500;
  padding: 4px 12px; border-radius: 99px;
}

.profile-stats {
  display: flex; margin: 0 16px 16px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.ps-item {
  flex: 1; padding: 18px 12px; text-align: center;
  border-right: 1px solid var(--border);
}
.ps-item:last-child { border-right: none; }
.ps-num { display: block; font-family: var(--serif); font-size: 22px; color: var(--gold); }
.ps-label { font-size: 11px; color: var(--text-dim); }

.profile-menu { display: flex; flex-direction: column; gap: 3px; padding: 0 16px; }
.pm-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  font-size: 15px; color: var(--text); cursor: pointer;
  transition: all var(--transition); font-family: var(--font);
  text-align: left; width: 100%;
}
.pm-item:active { transform: scale(0.98); }
.pm-item > span:first-child { font-size: 18px; width: 24px; }
.pm-item > span:nth-child(2) { flex: 1; }
.pm-item > span:last-child, .pm-badge { color: var(--text-dim); font-size: 13px; }
.pm-badge {
  background: var(--gold-dim); color: var(--gold);
  border: 1px solid rgba(201,168,76,0.3);
  font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 99px;
}

/* ─── Cart ─── */
.cart-list { flex: 1; padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.cart-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 60px 0; }
.ce-icon { font-size: 56px; opacity: 0.4; }
.ce-text { font-size: 16px; color: var(--text-dim); }
.ce-btn {
  background: var(--gold); color: #0d0d0a;
  border: none; border-radius: 99px;
  padding: 12px 28px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: var(--font);
}

.cart-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
}
.ci-icon { font-size: 28px; }
.ci-name { flex: 1; font-size: 14px; font-weight: 500; }
.ci-price { color: var(--gold); font-family: var(--serif); font-size: 15px; }
.ci-remove {
  background: none; border: none; color: var(--text-dim);
  font-size: 16px; cursor: pointer; padding: 4px;
  transition: color var(--transition);
}
.ci-remove:hover { color: #e84040; }

.cart-footer {
  position: sticky; bottom: 0; background: var(--bg);
  padding: 16px; border-top: 1px solid var(--border);
}
.cf-total { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 15px; }
.cf-price { font-family: var(--serif); font-size: 20px; color: var(--gold); }
.cf-btn {
  width: 100%; background: var(--gold); color: #0d0d0a;
  border: none; border-radius: var(--radius-sm);
  padding: 16px; font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: var(--font);
  transition: all var(--transition);
}
.cf-btn:active { opacity: 0.9; transform: scale(0.99); }

/* ─── Bottom Nav ─── */
.bottom-nav {
  display: flex;
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  height: var(--nb-h);
  padding-bottom: var(--safe-bot);
  z-index: 200;
  backdrop-filter: blur(20px);
}
.bn-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; background: none; border: none;
  color: var(--text-dim); cursor: pointer;
  font-family: var(--font); transition: color var(--transition);
  padding: 8px 0;
  position: relative;
}
.bn-item.active { color: var(--gold); }
.bn-icon { font-size: 20px; }
.bn-label { font-size: 10px; font-weight: 500; }

.cart-badge {
  position: absolute; top: 4px; right: calc(50% - 18px);
  background: #e84040; color: #fff;
  font-size: 10px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg2);
}

/* ─── Bottom Sheet ─── */
.bottom-sheet {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(100%);
  bottom: 0; width: 100%; max-width: 430px;
  background: var(--bg2); border-radius: 24px 24px 0 0;
  border: 1px solid var(--border);
  z-index: 500; transition: transform 0.36s cubic-bezier(0.4,0,0.2,1);
  max-height: 85vh; overflow-y: auto;
}
.bottom-sheet.open { transform: translateX(-50%) translateY(0); }
.bs-handle {
  width: 40px; height: 4px; background: var(--border);
  border-radius: 99px; margin: 12px auto 0;
}
.bs-content { padding: 20px 20px 40px; }
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 490; opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.sheet-backdrop.active { opacity: 1; pointer-events: all; }

/* Sheet content */
.bs-emoji { font-size: 64px; text-align: center; display: block; margin-bottom: 16px; }
.bs-title { font-family: var(--serif); font-size: 28px; font-weight: 300; margin-bottom: 4px; }
.bs-latin { font-size: 12px; color: var(--gold); font-style: italic; margin-bottom: 16px; }
.bs-desc { font-size: 14px; color: var(--text-dim); line-height: 1.7; margin-bottom: 20px; }
.bs-benefits { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.bs-benefit {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 99px; padding: 6px 14px; font-size: 12px; color: var(--text-dim);
}
.bs-add-btn {
  width: 100%; background: var(--gold); color: #0d0d0a;
  border: none; border-radius: var(--radius-sm);
  padding: 16px; font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: var(--font);
}

/* ─── Toast ─── */
.toast {
  position: fixed; bottom: calc(var(--nb-h) + 16px);
  left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg);
  padding: 12px 24px; border-radius: 99px;
  font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: all 0.3s;
  z-index: 1000; white-space: nowrap;
  max-width: 280px; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Light Mode Hero Card Adjust ─── */
[data-theme="light"] .hero-card {
  background: linear-gradient(135deg, #1a3e20, #0d2e12);
}
[data-theme="light"] .hc-title { color: #f0ece0; }
[data-theme="light"] .hc-tag { color: #6ab07e; }
[data-theme="light"] .hc-sub { color: rgba(240,236,224,0.6); }

/* Scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
