:root {
  --primary: #0F3D6E;
  --primary-dark: #092647;
  --gold: #D4AF37;
  --gold-light: #F5E199;
  --bg: #F4F6F9;
  --card: #FFFFFF;
  --text: #1E293B;
  --muted: #64748B;
  --danger: #DC2626;
  --success: #16A34A;
  --border: #E2E8F0;
  --radius: 14px;
  --shadow: 0 4px 14px rgba(15, 61, 110, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Noto Sans Myanmar', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 82px;
  line-height: 1.55;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  border-bottom: 2px solid var(--gold);
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}
.brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: #fff;
}
.brand h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1.2;
}
.brand span {
  font-size: 0.78rem;
  color: #E2E8F0;
  display: block;
}
.header-actions {
  display: flex;
  gap: 8px;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), #B8860B);
  color: #092647;
  border: none;
  padding: 7px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}
.btn-outline-light {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  padding: 7px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
}

/* Emergency / Announcement Banner */
.announcement-banner {
  display: none;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}
.announcement-banner.show { display: block; }
.announcement-banner.emergency {
  background: var(--danger);
  color: #fff;
}
.announcement-banner.info {
  background: var(--gold-light);
  color: var(--primary-dark);
  border-bottom: 1px solid var(--gold);
}

/* Main Container */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px;
}

/* Search Box */
.search-wrap {
  position: relative;
  margin-bottom: 12px;
}
.search-wrap input {
  width: 100%;
  padding: 12px 44px 12px 16px;
  border-radius: 26px;
  border: 1.5px solid var(--border);
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  box-shadow: var(--shadow);
  outline: none;
}
.search-wrap input:focus {
  border-color: var(--primary);
}
.search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.1rem;
}

/* Emergency Ambulance Free Notice */
.free-ambulance-pill {
  display: none;
  background: #FEF2F2;
  color: var(--danger);
  border: 1px solid #FECACA;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
}
.free-ambulance-pill.show { display: block; }

/* Category Pills */
.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.category-pills::-webkit-scrollbar { display: none; }
.pill {
  white-space: nowrap;
  padding: 7px 14px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.84rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.card-img-wrap {
  position: relative;
  height: 170px;
  background: #E2E8F0;
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.badge-cat {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 61, 110, 0.9);
  color: var(--gold-light);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-free {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--danger);
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
}
.card-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.card-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.card-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: 8px;
}
.card-desc {
  font-size: 0.86rem;
  color: #334155;
  margin-bottom: 12px;
  flex: 1;
}

/* Action Buttons */
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}
.act-btn {
  flex: 1;
  min-width: 85px;
  text-align: center;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.act-call { background: var(--success); color: #fff; }
.act-map { background: var(--primary); color: #fff; }
.act-share { background: #F1F5F9; color: var(--text); border: 1px solid var(--border); }
.act-lock { background: var(--gold); color: var(--primary-dark); width: 100%; }

.social-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.social-chip {
  font-size: 0.75rem;
  padding: 4px 9px;
  border-radius: 8px;
  text-decoration: none;
  color: #fff;
  font-weight: 600;
}
.soc-msgr { background: #0084FF; }
.soc-viber { background: #7360F2; }
.soc-tg { background: #229ED9; }

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 4px 10px;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-family: inherit;
  cursor: pointer;
  flex: 1;
}
.nav-item .icon { font-size: 1.25rem; }
.nav-item.active {
  color: var(--primary);
  font-weight: 700;
}

/* Floating Chat Button & Box */
.chat-fab {
  position: fixed;
  bottom: 84px;
  right: 16px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--gold-light);
  border: 2px solid var(--gold);
  font-size: 1.4rem;
  box-shadow: 0 6px 18px rgba(15, 61, 110, 0.35);
  cursor: pointer;
  z-index: 120;
}
.chat-box {
  display: none;
  position: fixed;
  bottom: 84px;
  right: 16px;
  width: min(350px, calc(100vw - 32px));
  height: 440px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
  z-index: 130;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
}
.chat-box.open { display: flex; }
.chat-header {
  background: var(--primary);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.92rem;
}
.chat-header button {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}
.chat-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #F8FAFC;
}
.msg {
  max-width: 82%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  word-wrap: break-word;
}
.msg.user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
}
.msg.admin {
  align-self: flex-start;
  background: #E2E8F0;
  color: var(--text);
}
.chat-input-area {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.chat-input-area input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.86rem;
  outline: none;
}
.chat-input-area button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0 14px;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(9, 38, 71, 0.65);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: #fff;
  width: min(460px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 16px;
  padding: 20px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: #F1F5F9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
}
.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  margin: 8px 0 12px;
  font-size: 0.95rem;
}
.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
  grid-column: 1 / -1;
}
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: #0F172A;
  color: #fff;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 0.85rem;
  z-index: 300;
  display: none;
}
.toast.show { display: block; }
