/* Helaplus Estates — app-specific components on top of helaplus.css */

/* ---------- Tenant mobile app shell ---------- */
.hp-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--hp-bg);
  border-left: 1px solid var(--hp-border);
  border-right: 1px solid var(--hp-border);
}

.hp-shell-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--hp-dark-green);
  color: #fff;
  padding: 14px 18px calc(14px + env(safe-area-inset-top, 0px)) 18px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hp-shell-header .title { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.hp-shell-header .subtitle { font-size: 12px; color: #a7f3d0; }
.hp-shell-header a, .hp-shell-header a:hover { color: #a7f3d0; text-decoration: none; }

.hp-shell-content {
  flex: 1;
  padding: 18px 16px calc(96px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hp-bottomnav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--hp-surface);
  border-top: 1px solid var(--hp-border);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.hp-bottomnav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 4px 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--hp-text-muted);
  text-decoration: none;
  position: relative;
}

.hp-bottomnav a .ico { font-size: 20px; line-height: 1; }
.hp-bottomnav a.active { color: var(--hp-mid-green); }
.hp-bottomnav a.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--hp-light-green);
}

.hp-bottomnav .badge-dot {
  position: absolute;
  top: 6px;
  left: calc(50% + 6px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--hp-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Widgets ---------- */
.hp-hero-card {
  background: linear-gradient(135deg, var(--hp-dark-green), var(--hp-mid-green));
  color: #fff;
  border-radius: var(--hp-radius-lg);
  padding: 22px;
  box-shadow: var(--hp-shadow);
}

.hp-hero-card .big { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.hp-hero-card .muted { color: #a7f3d0; font-size: 13px; }

.hp-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.hp-quick-grid a {
  background: var(--hp-surface);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--hp-text);
  text-decoration: none;
  box-shadow: var(--hp-shadow-sm);
}

.hp-quick-grid a:hover { border-color: var(--hp-light-green); text-decoration: none; }
.hp-quick-grid .ico { font-size: 22px; }

.hp-list { display: flex; flex-direction: column; }
.hp-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hp-border);
  text-decoration: none;
  color: var(--hp-text);
}
.hp-list-item:last-child { border-bottom: none; }
.hp-list-item:hover { text-decoration: none; }
.hp-list-item .grow { flex: 1; min-width: 0; }
.hp-list-item .main { font-weight: 600; font-size: 14px; }
.hp-list-item .sub { font-size: 12px; color: var(--hp-text-muted); }
.hp-list-item .right { text-align: right; font-size: 13px; white-space: nowrap; }

.hp-icon-chip {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: #f0fdf4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}

/* ---------- Product grid ---------- */
.hp-product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.hp-product {
  background: var(--hp-surface);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hp-product .thumb {
  font-size: 42px;
  text-align: center;
  padding: 20px 8px 12px;
  background: #f0fdf4;
}

.hp-product .info { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.hp-product .name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.hp-product .price { font-size: 14px; font-weight: 800; color: var(--hp-dark-green); }
.hp-product .unit { font-size: 11px; color: var(--hp-text-muted); }

.hp-cat-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.hp-cat-scroll::-webkit-scrollbar { display: none; }

.hp-cat-chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--hp-border);
  background: var(--hp-surface);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--hp-text);
  text-decoration: none;
}
.hp-cat-chip.active { background: var(--hp-dark-green); color: #fff; border-color: var(--hp-dark-green); }
.hp-cat-chip:hover { text-decoration: none; }

/* ---------- Order tracking timeline ---------- */
.hp-track { display: flex; align-items: flex-start; margin: 8px 0; }
.hp-track-step { flex: 1; text-align: center; position: relative; }
.hp-track-step .dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: #e2e8f0; color: var(--hp-text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  position: relative; z-index: 1;
}
.hp-track-step.done .dot { background: var(--hp-light-green); color: var(--hp-dark-green); }
.hp-track-step .lbl { font-size: 11px; margin-top: 6px; color: var(--hp-text-muted); }
.hp-track-step.done .lbl { color: var(--hp-dark-green); font-weight: 600; }
.hp-track-step::before {
  content: '';
  position: absolute;
  top: 14px;
  left: -50%;
  width: 100%;
  height: 3px;
  background: #e2e8f0;
}
.hp-track-step:first-child::before { display: none; }
.hp-track-step.done::before { background: var(--hp-light-green); }

/* ---------- Chat ---------- */
.hp-chat { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.hp-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
}
.hp-bubble .meta { font-size: 10px; opacity: 0.7; margin-top: 4px; }
.hp-bubble.them { background: var(--hp-surface); border: 1px solid var(--hp-border); border-bottom-left-radius: 4px; align-self: flex-start; }
.hp-bubble.me { background: var(--hp-dark-green); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.hp-bubble.me .meta { color: #a7f3d0; }

.hp-chat-input {
  position: sticky;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  background: var(--hp-bg);
  padding: 8px 0 4px;
}
.hp-chat-input form { display: flex; gap: 8px; }
.hp-chat-input input { flex: 1; }

/* ---------- Misc ---------- */
.hp-fab {
  position: fixed;
  right: max(18px, calc(50% - 240px + 18px));
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--hp-dark-green);
  color: #fff;
  border: none;
  font-size: 26px;
  box-shadow: var(--hp-shadow-lg);
  cursor: pointer;
  z-index: 95;
  display: flex; align-items: center; justify-content: center;
}

.hp-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hp-text-muted);
  margin: 4px 0 -6px;
}

.hp-kv { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; border-bottom: 1px dashed var(--hp-border); }
.hp-kv:last-child { border-bottom: none; }
.hp-kv .k { color: var(--hp-text-muted); }
.hp-kv .v { font-weight: 600; }

.hp-bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding: 8px 0; }
.hp-bar-chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.hp-bar-chart .bars { display: flex; gap: 4px; align-items: flex-end; height: 100%; }
.hp-bar-chart .bar { width: 18px; border-radius: 4px 4px 0 0; min-height: 3px; }
.hp-bar-chart .bar.a { background: #cbd5e1; }
.hp-bar-chart .bar.b { background: var(--hp-light-green); }
.hp-bar-chart .lbl { font-size: 11px; color: var(--hp-text-muted); }

.hp-avatar { width: 36px; height: 36px; }
.hp-avatar { display: inline-flex; }

@media (min-width: 481px) {
  .hp-shell { box-shadow: 0 0 40px rgba(0,0,0,0.06); }
}
