/* ================================================================
   METUPS MARKETPLACE — COMPLETE DESIGN SYSTEM
   Mobile-first  |  Teal × Blue × Green brand
   Fonts: Nunito (headings/bold UI) + DM Sans (body copy)
   ================================================================ */

/* ── 1. GOOGLE FONTS ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ── 2. DESIGN TOKENS ────────────────────────────────────────── */
:root {
  /* ── Brand palette ── */
  --teal:           #4DD9C0;
  --teal-dark:      #2BB8A0;
  --teal-deeper:    #1A9E89;
  --teal-light:     #E2FAF6;
  --teal-mid:       #B3F0E6;

  --blue:           #1B44C8;
  --blue-dark:      #1234A0;
  --blue-light:     #EAF0FF;
  --blue-mid:       #C2D0F5;

  --green:          #22C55E;
  --green-dark:     #16A34A;
  --green-light:    #DCFCE7;

  --orange:         #F97316;
  --orange-light:   #FFF1E6;

  --red:            #EF4444;
  --red-dark:       #DC2626;
  --red-light:      #FEE2E2;

  --yellow:         #F59E0B;
  --yellow-light:   #FFFBEB;

  /* ── Neutrals ── */
  --white:          #FFFFFF;
  --bg:             #F2F5F9;
  --bg-alt:         #E8ECF2;
  --card:           #FFFFFF;
  --border:         #E2E8F0;
  --border-dark:    #CBD5E1;

  --text:           #0F172A;
  --text-secondary: #334155;
  --text-muted:     #64748B;
  --text-light:     #94A3B8;
  --text-xlight:    #CBD5E1;

  /* ── Semantic ── */
  --bubble-out:     #D1FAE5;
  --bubble-in:      #FFFFFF;
  --bubble-system:  #F1F5F9;

  /* ── Layout ── */
  --nav-height:     60px;
  --bottom-bar:     64px;
  --max-w:          430px;

  /* ── Radii ── */
  --radius-xs:    4px;
  --radius-sm:    8px;
  --radius:       12px;
  --radius-lg:    16px;
  --radius-xl:    20px;
  --radius-pill:  999px;

  /* ── Shadows ── */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.06);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 12px rgba(0,0,0,.10), 0 1px 3px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.13), 0 2px 6px rgba(0,0,0,.06);
  --shadow-xl: 0 16px 40px rgba(0,0,0,.16), 0 4px 10px rgba(0,0,0,.07);

  /* ── Typography ── */
  --font-head: 'Nunito',  sans-serif;
  --font-body: 'DM Sans', sans-serif;

  /* ── Motion ── */
  --ease:        cubic-bezier(.4, 0, .2, 1);
  --ease-out:    cubic-bezier(.0, 0, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast:    120ms;
  --dur:         200ms;
  --dur-slow:    300ms;

  /* Desktop sidebar width */
  --sidebar-w: 260px;
}

/* Sidebar hidden on mobile — shown only by the desktop @media rule */
.sidebar-nav { display: none; }

/* ── 3. RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  background: var(--bg-alt);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

img     { display: block; max-width: 100%; object-fit: cover; }
a       { text-decoration: none; color: inherit; }
button  { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
ul, ol  { list-style: none; }

/* ── 4. APP SHELL ────────────────────────────────────────────── */
.app-shell {
  width: 100%;
  max-width: var(--max-w);
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 60px rgba(0,0,0,.15);
}

/* ── 5. PAGE WRAPPER ─────────────────────────────────────────── */
.page {
  padding-top: var(--nav-height);
  padding-bottom: calc(var(--bottom-bar) + 16px);
  min-height: 100dvh;
}

/* ================================================================
   6. TOP NAVIGATION BAR
   ================================================================ */
.top-nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  height: var(--nav-height);
  background: var(--teal);
  display: flex;
  align-items: center;
  padding: 0 10px;
  z-index: 200;
  gap: 4px;
  border-bottom: 1px solid var(--teal-mid);
  box-shadow: 0 2px 10px rgba(77,217,192,.22);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--blue);
  letter-spacing: -0.5px;
  flex: 1;
  min-width: 0;
}

.nav-logo svg { width: 32px; height: 32px; flex-shrink: 0; }

/* Icon cluster */
.nav-icons {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

/* Individual icon button */
.nav-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.1rem;
  color: var(--blue);
  transition: background var(--dur) var(--ease);
  flex-shrink: 0;
}

.nav-icon-btn:hover  { background: rgba(0,0,0,.07); }
.nav-icon-btn:active { background: rgba(0,0,0,.13); transform: scale(.94); }
.nav-icon-btn.active { background: rgba(27,68,200,.1); }

/* Badge bubble */
.nav-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 16px;
  height: 16px;
  background: var(--red);
  color: var(--white);
  font-size: 0.58rem;
  font-weight: 800;
  font-family: var(--font-head);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--teal);
  pointer-events: none;
  line-height: 1;
  animation: badgePop .3s var(--ease-spring);
}

@keyframes badgePop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* Nav avatar */
.nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-light);
  border: 2.5px solid var(--blue);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.75rem;
  color: var(--blue);
  flex-shrink: 0;
}

.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Page title strip */
.page-title-bar {
  background: var(--teal-light);
  padding: 10px 16px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--teal-mid);
}

.page-title-bar h1 {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.3px;
}

/* ================================================================
   7. SEARCH BAR
   ================================================================ */
.search-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px;
  background: var(--teal-light);
  border-bottom: 1px solid var(--teal-mid);
  /* Fix: push below the fixed top nav on mobile */
  margin-top: var(--nav-height);
}

.search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0 14px;
  transition: border-color var(--dur) var(--ease),
              box-shadow   var(--dur) var(--ease);
}

.search-bar:focus-within {
  border-color: var(--teal-dark);
  box-shadow: 0 0 0 3px rgba(77,217,192,.2);
}

.search-bar i {
  color: var(--text-muted);
  font-size: 0.88rem;
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text);
  background: transparent;
  padding: 10px 0;
  min-width: 0;
}

.search-bar input::placeholder { color: var(--text-xlight); }

.search-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: var(--blue);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  transition: background var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
  box-shadow: 0 2px 8px rgba(27,68,200,.3);
}

.search-btn:hover  { background: var(--blue-dark); }
.search-btn:active { transform: scale(.92); }

/* Location row */
.location-row {
  padding: 4px 14px 10px;
  background: var(--teal-light);
}

.location-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease),
              box-shadow   var(--dur) var(--ease);
}

.location-pill:hover {
  border-color: var(--teal-dark);
  box-shadow: 0 0 0 2px rgba(77,217,192,.18);
}

.location-pill .fa-map-marker-alt { color: var(--blue); font-size: 0.75rem; }
.location-pill .fa-chevron-down   { color: var(--text-light); font-size: 0.6rem; }

/* Filter drawer */
.filter-drawer {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: slideDown var(--dur-slow) var(--ease-out);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ================================================================
   8. PRODUCT GRID & CARDS
   ================================================================ */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 10px 4px;
}

/* Card */
.product-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
  -webkit-user-select: none;
  user-select: none;
}

.product-card:hover  { box-shadow: var(--shadow); }
.product-card:active { transform: scale(.97); box-shadow: var(--shadow-xs); }

/* Image area */
.product-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--teal-light);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s var(--ease);
  will-change: transform;
}

.product-card:hover .product-card-img img { transform: scale(1.05); }

.img-placeholder {
  font-size: 2.6rem;
  color: var(--orange);
  opacity: .6;
}

/* Heart / save button */
.card-heart {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-light);
  border: 1.5px solid rgba(255,255,255,.6);
  transition: color var(--dur) var(--ease),
              background var(--dur) var(--ease),
              transform var(--dur-fast) var(--ease-spring);
}

.card-heart:hover  { transform: scale(1.12); color: var(--red); }
.card-heart.saved  { color: var(--red); background: var(--white); }
.card-heart:active { transform: scale(.88); }

/* SOLD overlay */
.sold-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  background: var(--green);
  color: var(--white);
  font-family: var(--font-head);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 6px rgba(34,197,94,.4);
}

/* Card body */
.product-card-body {
  padding: 8px 10px 10px;
}

.card-price {
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 900;
  color: var(--green);
  line-height: 1.2;
  margin-bottom: 3px;
}

.card-title {
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================================================================
   9. FLOATING ACTION BUTTON
   ================================================================ */
.fab {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(calc(-50% + 90px));
  width: 54px;
  height: 54px;
  background: var(--green);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  z-index: 150;
  box-shadow: 0 4px 18px rgba(34,197,94,.45),
              0 1px 4px  rgba(34,197,94,.25);
  transition: background var(--dur) var(--ease),
              transform  var(--dur) var(--ease-spring),
              box-shadow var(--dur) var(--ease);
  -webkit-user-select: none;
  user-select: none;
}

.fab:hover  { background: var(--green-dark); box-shadow: 0 6px 22px rgba(34,197,94,.5); }
.fab:active { transform: translateX(calc(-50% + 90px)) scale(.9); }

/* ================================================================
   10. BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--dur) var(--ease),
              color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              transform var(--dur-fast) var(--ease);
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  text-decoration: none;
}

.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
  box-shadow: 0 2px 10px rgba(34,197,94,.28);
}
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); box-shadow: 0 4px 14px rgba(34,197,94,.38); }

.btn-blue {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
  box-shadow: 0 2px 10px rgba(27,68,200,.25);
}
.btn-blue:hover { background: var(--blue-dark); border-color: var(--blue-dark); }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-dark);
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }

.btn-teal {
  background: var(--teal);
  color: var(--blue-dark);
  border-color: var(--teal);
  font-weight: 800;
}
.btn-teal:hover { background: var(--teal-dark); border-color: var(--teal-dark); }

.btn-danger {
  background: var(--red-light);
  color: var(--red-dark);
  border-color: var(--red);
}
.btn-danger:hover { background: var(--red); color: var(--white); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-block { width: 100%; }
.btn-sm    { padding: 7px 16px; font-size: 0.78rem; }
.btn-lg    { padding: 14px 28px; font-size: 1rem; }
.btn-icon  { padding: 0; width: 40px; height: 40px; border-radius: 50%; font-size: 1rem; }

/* ================================================================
   11. FORMS
   ================================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group:last-child { margin-bottom: 0; }

.form-group > label {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-field {
  width: 100%;
  padding: 12px 14px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--dur) var(--ease),
              box-shadow   var(--dur) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.input-field::placeholder { color: var(--text-xlight); }
.input-field:focus {
  border-color: var(--teal-dark);
  box-shadow: 0 0 0 3px rgba(77,217,192,.18);
}
.input-field:disabled { background: var(--bg); color: var(--text-muted); cursor: not-allowed; }
.input-field.is-error { border-color: var(--red); }
.input-field.is-error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,.15); }
.input-field.is-valid { border-color: var(--green); }

/* Input with icon */
.input-with-icon { position: relative; display: flex; align-items: center; }

.input-with-icon > i:first-child {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 1;
}

.input-with-icon > .input-field { padding-left: 40px; }

.input-trail-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 0.9rem;
  transition: color var(--dur) var(--ease);
}

.input-trail-btn:hover { color: var(--blue); }

textarea.input-field { resize: vertical; min-height: 88px; line-height: 1.55; }

select.input-field {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%2364748B' d='M5.5 7.5l4.5 4.5 4.5-4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
  padding-right: 36px;
  cursor: pointer;
}

.field-error-msg { font-size: 0.75rem; color: var(--red); margin-top: 3px; }
.password-hint   { font-size: 0.75rem; color: var(--text-muted); }

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border-dark);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform var(--dur) var(--ease-spring);
}

.toggle input:checked + .toggle-track { background: var(--green); }
.toggle input:checked + .toggle-track::after { transform: translateX(20px); }

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  cursor: pointer;
}

/* ================================================================
   12. AUTH PAGES
   ================================================================ */
.auth-page {
  width: 100%;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 390px;
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  box-shadow: var(--shadow-xl);
  animation: authCardIn .35s var(--ease-out) both;
}

@keyframes authCardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  text-align: center;
}

.auth-logo svg  { width: 68px; height: 68px; }

.auth-logo h1 {
  font-family: var(--font-head);
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--blue);
  letter-spacing: -0.5px;
  line-height: 1;
}

.auth-logo p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--text-light);
  font-size: 0.78rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.social-row { display: flex; gap: 8px; }

.social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--white);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease),
              background   var(--dur) var(--ease);
}

.social-btn:hover { border-color: var(--blue); background: var(--blue-light); }

.auth-footer-link {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 16px;
}

.auth-footer-link a { color: var(--blue); font-weight: 700; }
.auth-footer-link a:hover { color: var(--blue-dark); }

.auth-note {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-light);
  margin-top: 10px;
  line-height: 1.5;
}

.auth-note a { color: var(--blue); }

/* OTP boxes */
.otp-row { display: flex; gap: 8px; justify-content: center; margin: 8px 0; }

.otp-box {
  width: 48px;
  height: 54px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--blue);
  outline: none;
  transition: border-color var(--dur) var(--ease);
}

.otp-box:focus {
  border-color: var(--teal-dark);
  box-shadow: 0 0 0 3px rgba(77,217,192,.2);
}

/* Alert messages */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.45;
  animation: alertIn .2s var(--ease-out);
}

@keyframes alertIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert-error   { background: var(--red-light);    color: #B91C1C; border-left: 3px solid var(--red); }
.alert-success { background: var(--green-light);  color: #166534; border-left: 3px solid var(--green); }
.alert-info    { background: var(--blue-light);   color: var(--blue-dark); border-left: 3px solid var(--blue); }
.alert-warning { background: var(--yellow-light); color: #92400E; border-left: 3px solid var(--yellow); }

/* ================================================================
   13. PRODUCT DETAIL PAGE
   ================================================================ */
.product-detail-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--teal-light);
  overflow: hidden;
  position: relative;
}

.product-detail-img > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .3s var(--ease);
}

.img-count-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,.52);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(4px);
  letter-spacing: 0.3px;
}

.img-thumbnails {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.img-thumbnails::-webkit-scrollbar { display: none; }

.img-thumb {
  width: 62px;
  height: 62px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
  cursor: pointer;
  opacity: .75;
  transition: border-color var(--dur) var(--ease),
              opacity      var(--dur) var(--ease);
}

.img-thumb.active { border-color: var(--teal-dark); opacity: 1; }
.img-thumb:hover  { opacity: 1; border-color: var(--teal); }

.product-detail-body {
  padding: 16px 16px 110px;
  background: var(--bg);
}

.detail-price {
  font-family: var(--font-head);
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--orange);
  line-height: 1;
}

.detail-title {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin: 6px 0 8px;
  line-height: 1.3;
}

.detail-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }

.detail-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
}

.detail-tag i { color: var(--teal-dark); font-size: 0.72rem; }

.seller-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--teal-light);
  border-radius: var(--radius);
  margin-bottom: 14px;
  border: 1px solid var(--teal-mid);
}

.seller-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--blue);
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--blue-mid);
}

.seller-avatar img { width: 100%; height: 100%; object-fit: cover; }

.seller-info .seller-name   { font-weight: 700; font-size: 0.92rem; }
.seller-info .seller-rating { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }

.detail-description {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
}

.detail-cta-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  z-index: 150;
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
}

/* ================================================================
   14. MY LISTINGS PAGE
   ================================================================ */
.listing-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px;
  margin: 0 10px 10px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow var(--dur) var(--ease),
              transform  var(--dur) var(--ease);
}

.listing-item:hover  { box-shadow: var(--shadow); }
.listing-item:active { transform: scale(.98); }

.listing-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  background: var(--teal-light);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border);
}

.listing-thumb img { width: 100%; height: 100%; object-fit: cover; }
.listing-icon { font-size: 1.8rem; color: var(--orange); opacity: .7; }

.listing-info { flex: 1; min-width: 0; }

.listing-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-price {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1rem;
  color: var(--text);
}

.listing-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* Badges */
.badge-sold {
  display: inline-flex;
  align-items: center;
  background: var(--green);
  color: var(--white);
  font-family: var(--font-head);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.6px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}

.badge-edit {
  display: inline-flex;
  align-items: center;
  background: var(--orange);
  color: var(--white);
  font-family: var(--font-head);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.badge-edit:hover { background: #E06210; }

/* Condition badges */
.condition-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.condition-new          { background: var(--green-light);  color: #166534; }
.condition-like-new     { background: var(--blue-light);   color: var(--blue-dark); }
.condition-fair         { background: var(--yellow-light); color: #92400E; }
.condition-needs-repair { background: var(--red-light);    color: #991B1B; }

/* Stats strip */
.stats-strip { display: flex; gap: 1px; background: var(--border); }

.stat-cell { flex: 1; background: var(--white); padding: 10px 8px; text-align: center; }

.stat-cell .stat-value {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.15rem;
  line-height: 1.2;
}

.stat-cell .stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ================================================================
   15. ADD LISTING PAGE
   ================================================================ */
.image-upload-zone {
  border: 2.5px dashed var(--border-dark);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 20px;
  cursor: pointer;
  background: var(--white);
  text-align: center;
  min-height: 110px;
  transition: border-color var(--dur) var(--ease),
              background   var(--dur) var(--ease);
}

.image-upload-zone:hover,
.image-upload-zone.dragover {
  border-color: var(--teal-dark);
  background: var(--teal-light);
}

.upload-icon {
  width: 52px;
  height: 52px;
  background: var(--teal-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--teal-dark);
  margin-bottom: 4px;
  transition: background var(--dur) var(--ease);
}

.image-upload-zone:hover .upload-icon { background: var(--teal-mid); }

.image-upload-zone p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }
.image-upload-zone p strong { color: var(--text); }

.upload-preview-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.preview-thumb-wrap { position: relative; width: 72px; height: 72px; flex-shrink: 0; }

.preview-thumb-wrap img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid var(--border);
}

.remove-thumb {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: var(--red);
  color: var(--white);
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1.5px solid var(--white);
  transition: background var(--dur) var(--ease);
  line-height: 1;
}

.remove-thumb:hover { background: var(--red-dark); }

.cover-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(27,68,200,.75);
  color: var(--white);
  font-family: var(--font-head);
  font-size: 0.5rem;
  font-weight: 900;
  text-align: center;
  padding: 2px 0;
  border-radius: 0 0 var(--radius-xs) var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ================================================================
   16. MESSAGING — CONVERSATION LIST
   ================================================================ */
.convo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.convo-item:active { background: var(--teal-light); }
.convo-item.unread { background: var(--blue-light); }
.convo-item.unread .convo-name { font-weight: 800; }

.convo-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--blue-light);
  border: 2px solid var(--blue-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1rem;
  color: var(--blue);
  overflow: hidden;
  flex-shrink: 0;
}

.convo-avatar img { width: 100%; height: 100%; object-fit: cover; }

.convo-info { flex: 1; min-width: 0; }

.convo-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 1px;
}

.convo-product {
  font-size: 0.76rem;
  color: var(--blue);
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.convo-last {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.convo-meta {
  flex-shrink: 0;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.convo-time { font-size: 0.7rem; color: var(--text-light); }

.unread-bubble {
  min-width: 18px;
  height: 18px;
  background: var(--green);
  color: var(--white);
  border-radius: var(--radius-pill);
  font-family: var(--font-head);
  font-size: 0.62rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ================================================================
   17. MESSAGING — CHAT WINDOW
   ================================================================ */
.chat-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  height: var(--nav-height);
  background: var(--teal);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
  z-index: 200;
  border-bottom: 1px solid var(--teal-mid);
  box-shadow: 0 2px 10px rgba(77,217,192,.22);
}

.chat-header .back-btn {
  color: var(--blue);
  font-size: 1.1rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background var(--dur) var(--ease);
}

.chat-header .back-btn:hover { background: rgba(0,0,0,.07); }

.chat-header-info { flex: 1; min-width: 0; }

.chat-header-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Product strip */
.chat-product-strip {
  position: sticky;
  top: var(--nav-height);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.chat-product-thumb {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--teal-light);
  overflow: hidden;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}

.chat-product-thumb img { width: 100%; height: 100%; object-fit: cover; }

.chat-product-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-product-price {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--green);
  margin-top: 1px;
}

/* Messages area */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 12px 90px;
  background: var(--bg);
  min-height: calc(100dvh - var(--nav-height) - 64px - 80px);
}

/* Date label */
.chat-date-label {
  align-self: center;
  font-size: 0.7rem;
  color: var(--text-light);
  background: var(--bg-alt);
  border-radius: var(--radius-pill);
  padding: 3px 12px;
  margin: 4px 0;
  font-weight: 600;
}

/* Message row */
.message-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  animation: msgIn .18s var(--ease-out) both;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message-row.sent     { flex-direction: row-reverse; }
.message-row.received { flex-direction: row; }

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--blue);
  flex-shrink: 0;
  overflow: hidden;
}

.msg-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Bubble */
.bubble {
  max-width: 74%;
  padding: 9px 13px;
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
}

.bubble.sent {
  background: var(--bubble-out);
  border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
}

.bubble.received {
  background: var(--bubble-in);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px;
  box-shadow: var(--shadow-xs);
}

.bubble.system {
  background: var(--bubble-system);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 12px;
  align-self: center;
  max-width: 90%;
  border: 1px solid var(--border);
}

.bubble-time {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  font-size: 0.62rem;
  color: var(--text-light);
  justify-content: flex-end;
}

.bubble.received .bubble-time { justify-content: flex-start; }

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 13px;
  background: var(--bubble-in);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px;
  width: fit-content;
  box-shadow: var(--shadow-xs);
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-light);
  animation: typingBounce 1.2s infinite;
}

.typing-dot:nth-child(2) { animation-delay: .18s; }
.typing-dot:nth-child(3) { animation-delay: .36s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30%            { transform: translateY(-7px); opacity: 1; }
}

/* Chat input bar */
.chat-input-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 8px 10px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  z-index: 150;
  box-shadow: 0 -2px 12px rgba(0,0,0,.07);
}

.chat-input-wrap {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px 12px;
  transition: border-color var(--dur) var(--ease);
}

.chat-input-wrap:focus-within { border-color: var(--teal-dark); }

.chat-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  background: transparent;
  resize: none;
  max-height: 88px;
  line-height: 1.45;
  min-height: 22px;
  overflow-y: auto;
}

.chat-input-icon {
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
  transition: color var(--dur) var(--ease);
  line-height: 1;
  margin-bottom: 1px;
}

.chat-input-icon:hover { color: var(--teal-dark); }

.chat-send-btn {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: var(--green);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: background var(--dur) var(--ease),
              transform  var(--dur-fast) var(--ease-spring);
  box-shadow: 0 2px 8px rgba(34,197,94,.3);
}

.chat-send-btn:hover  { background: var(--green-dark); }
.chat-send-btn:active { transform: scale(.88); }

.chat-voice-btn {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: var(--blue);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: background var(--dur) var(--ease);
  box-shadow: 0 2px 8px rgba(27,68,200,.25);
}

.chat-voice-btn:hover    { background: var(--blue-dark); }
.chat-voice-btn.recording {
  background: var(--red);
  animation: voicePulse 1s infinite;
}

@keyframes voicePulse {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,.45); }
  70%  { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

.sold-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--green);
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 10px;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.sold-banner:hover { background: var(--green-dark); }

/* ================================================================
   18. PROFILE PAGE
   ================================================================ */
.profile-cover {
  height: 110px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--blue) 100%);
}

.profile-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-top: -44px;
  position: relative;
  z-index: 2;
}

.profile-avatar-lg {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--blue-light);
  border: 4px solid var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.9rem;
  color: var(--blue);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

.profile-camera-btn {
  position: absolute;
  bottom: 2px;
  right: calc(50% - 54px);
  width: 28px;
  height: 28px;
  background: var(--teal-dark);
  border-radius: 50%;
  border: 2.5px solid var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--white);
  cursor: pointer;
  z-index: 3;
  transition: background var(--dur) var(--ease);
}

.profile-camera-btn:hover { background: var(--blue); }

.profile-name  { text-align: center; margin: 10px 0 3px; font-family: var(--font-head); font-size: 1.2rem; font-weight: 800; color: var(--text); }
.profile-email { text-align: center; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 4px; }

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 12px 16px;
  background: var(--white);
  border-radius: var(--radius);
  margin: 12px;
  box-shadow: var(--shadow-sm);
}

.profile-stat          { text-align: center; }
.profile-stat-value    { font-family: var(--font-head); font-weight: 900; font-size: 1.2rem; line-height: 1.2; }
.profile-stat-label    { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

.profile-section {
  background: var(--white);
  border-radius: var(--radius);
  margin: 0 12px 10px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.profile-section-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.profile-detail-row:last-child { border-bottom: none; padding-bottom: 0; }
.profile-detail-row i          { color: var(--teal-dark); width: 18px; text-align: center; flex-shrink: 0; margin-top: 2px; font-size: 0.9rem; }
.profile-detail-row span       { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; }

/* ================================================================
   19. MENU PAGE
   ================================================================ */
.menu-page-header {
  background: var(--teal-light);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--teal-mid);
}

.menu-user-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--blue-light);
  border: 2.5px solid var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--blue);
  overflow: hidden;
  flex-shrink: 0;
}

.menu-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.menu-user-name  { font-family: var(--font-head); font-weight: 800; font-size: 1rem; }
.menu-user-email { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.menu-items { background: var(--white); }

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.menu-item:hover  { background: var(--teal-light); }
.menu-item:active { background: var(--teal-mid); }

.menu-item-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--teal-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--blue);
  flex-shrink: 0;
  transition: background var(--dur) var(--ease);
}

.menu-item:hover .menu-item-icon { background: var(--teal-mid); }

.menu-item-text         { flex: 1; min-width: 0; }
.menu-item-text .menu-title { font-family: var(--font-head); font-weight: 700; font-size: 0.95rem; }
.menu-item-text .menu-sub   { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.menu-item-arrow            { color: var(--text-xlight); font-size: 0.85rem; }

.menu-about-banner {
  margin: 16px 12px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--teal) 0%, var(--blue) 100%);
  padding: 20px;
  text-align: center;
  color: var(--white);
  box-shadow: var(--shadow);
}

.menu-about-banner h3 { font-family: var(--font-head); font-size: 1rem; font-weight: 800; margin-bottom: 4px; }
.menu-about-banner p  { font-size: 0.8rem; opacity: .85; }

/* ================================================================
   20. NOTIFICATIONS PAGE
   ================================================================ */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.notif-item:hover  { background: var(--teal-light); }
.notif-item.unread { background: var(--blue-light); }

.notif-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  overflow: hidden;
}

.notif-icon img { width: 100%; height: 100%; object-fit: cover; }

.notif-body { flex: 1; min-width: 0; }
.notif-text { font-size: 0.85rem; color: var(--text); line-height: 1.5; }
.notif-text strong { font-weight: 700; }
.notif-time { font-size: 0.7rem; color: var(--text-light); margin-top: 3px; }

.notif-unread-dot {
  width: 9px;
  height: 9px;
  background: var(--blue);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

/* ================================================================
   21. SETTINGS PAGE
   ================================================================ */
.settings-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--white);
  margin: 10px 12px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.settings-logout-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--red);
  border: 1.5px solid var(--red);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  background: var(--red-light);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.settings-logout-btn:hover { background: var(--red); color: var(--white); }

.settings-section-label {
  padding: 10px 16px 4px;
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.settings-group {
  background: var(--white);
  border-radius: var(--radius);
  margin: 0 12px 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.settings-row:last-child { border-bottom: none; }
.settings-row:hover      { background: var(--teal-light); }

.settings-row-left { display: flex; align-items: center; gap: 12px; }

.settings-row-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--teal-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--blue);
  flex-shrink: 0;
}

.settings-row-text .row-title { font-weight: 600; font-size: 0.9rem; }
.settings-row-text .row-sub   { font-size: 0.74rem; color: var(--text-muted); margin-top: 1px; }
.settings-row-right           { display: flex; align-items: center; gap: 8px; }
.settings-chevron             { color: var(--text-xlight); font-size: 0.82rem; }

/* ================================================================
   22. MODALS & BOTTOM SHEETS
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.48);
  backdrop-filter: blur(2px);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease);
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal-sheet {
  width: 100%;
  max-width: var(--max-w);
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 6px 20px 32px;
  transform: translateY(100%);
  transition: transform var(--dur-slow) var(--ease-out);
}

.modal-overlay.open .modal-sheet { transform: translateY(0); }

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--border-dark);
  border-radius: var(--radius-pill);
  margin: 10px auto 16px;
}

.modal-logo { text-align: center; margin-bottom: 20px; }
.modal-logo svg { width: 52px; height: 52px; margin: 0 auto 6px; }

.modal-logo h2 {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--blue);
  margin-bottom: 4px;
}

.modal-logo p { font-size: 0.85rem; color: var(--text-muted); }

.sale-confirmed-icon {
  width: 68px;
  height: 68px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  color: var(--white);
  margin: 0 auto 16px;
  box-shadow: 0 6px 20px rgba(34,197,94,.4);
  animation: saleIconPop .4s var(--ease-spring);
}

@keyframes saleIconPop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.sale-confirmed-title {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.35rem;
  text-align: center;
  margin-bottom: 8px;
}

/* ================================================================
   23. SKELETON LOADING
   ================================================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--border) 25%,
    var(--bg-alt) 50%,
    var(--border) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ================================================================
   24. EMPTY STATE
   ================================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state > i    { font-size: 3.2rem; color: var(--border-dark); margin-bottom: 14px; line-height: 1; }
.empty-state h3     { font-family: var(--font-head); font-size: 1.1rem; font-weight: 800; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p      { font-size: 0.88rem; line-height: 1.55; max-width: 260px; }

.divider      { height: 8px; background: var(--bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.divider-line { height: 1px; background: var(--border); margin: 12px 0; }

/* ================================================================
   25. UTILITIES
   ================================================================ */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.flex-1        { flex: 1; }
.shrink-0      { flex-shrink: 0; }
.gap-4  { gap: 4px; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.text-center   { text-align: center; }
.text-right    { text-align: right; }
.text-muted    { color: var(--text-muted); }
.text-light    { color: var(--text-light); }
.text-blue     { color: var(--blue); }
.text-green    { color: var(--green); }
.text-orange   { color: var(--orange); }
.text-red      { color: var(--red); }
.text-teal     { color: var(--teal-dark); }
.font-bold     { font-weight: 700; }
.font-black    { font-weight: 900; }
.font-head     { font-family: var(--font-head); }
.text-xs       { font-size: 0.72rem; }
.text-sm       { font-size: 0.82rem; }
.text-base     { font-size: 0.95rem; }
.text-lg       { font-size: 1.1rem; }
.text-xl       { font-size: 1.3rem; }
.truncate      { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uppercase     { text-transform: uppercase; letter-spacing: 0.5px; }
.line-clamp-2  { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-clamp: 2; }

.p-8    { padding: 8px; }
.p-12   { padding: 12px; }
.p-16   { padding: 16px; }
.px-12  { padding-left: 12px; padding-right: 12px; }
.py-8   { padding-top: 8px; padding-bottom: 8px; }
.mt-4   { margin-top: 4px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mb-4   { margin-bottom: 4px; }
.mb-8   { margin-bottom: 8px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }

.w-full    { width: 100%; }
.h-full    { height: 100%; }
.min-w-0   { min-width: 0; }
.rounded   { border-radius: var(--radius); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-full { border-radius: 50%; }
.shadow    { box-shadow: var(--shadow); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.overflow-hidden { overflow: hidden; }
.relative  { position: relative; }
.hidden    { display: none !important; }

/* ── Custom scrollbar ── */
::-webkit-scrollbar              { width: 3px; height: 3px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: var(--border-dark); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover  { background: var(--text-muted); }

/* ── Selection ── */
::selection { background: rgba(77,217,192,.28); color: var(--text); }

/* ── Focus ring ── */
:focus-visible { outline: 2px solid var(--teal-dark); outline-offset: 2px; }

/* ── Lazy-load fade ── */
/* Pure CSS fade-in — no JS class toggling needed.
   The animation fires when the browser renders the image,
   giving a smooth appearance without hiding images permanently. */
img[loading="lazy"] {
  animation: imgFadeIn .35s var(--ease) both;
}
@keyframes imgFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ================================================================
   26. RESPONSIVE
   ================================================================ */

/* ── 26a. Small tablet: keep phone frame, add depth ─────────── */
@media (min-width: 500px) and (max-width: 767px) {
  body { background: #CDD3DE; }
  .app-shell {
    min-height: 100dvh;
    box-shadow: 0 0 0 1px rgba(0,0,0,.07), 0 24px 64px rgba(0,0,0,.22);
  }
  .top-nav, .chat-header, .chat-input-bar,
  .detail-cta-bar, .modal-overlay .modal-sheet {
    max-width: var(--max-w);
  }
}

/* ── 26b. Desktop (≥768px) — sidebar + full-width layout ─────── */
@media (min-width: 768px) {
  body {
    background: #E8ECF3;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
  }

  /* ── Sidebar (injected by navigation.js) ── */
  .sidebar-nav {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0;
    width: var(--sidebar-w);
    height: 100dvh;
    background: var(--blue);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 300;
    padding: 0 0 16px;
    scrollbar-width: none;
  }
  .sidebar-nav::-webkit-scrollbar { display: none; }

  .sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    font-family: var(--font-head);
    font-weight: 900;
    font-size: 1.3rem;
    color: var(--teal);
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 8px;
    flex-shrink: 0;
  }
  .sidebar-logo-text { color: var(--white); }

  .sidebar-search {
    position: relative;
    padding: 8px 16px 12px;
    flex-shrink: 0;
  }
  .sidebar-search-icon {
    position: absolute;
    left: 28px; top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,.4);
    font-size: 0.82rem;
    pointer-events: none;
  }
  .sidebar-search-input {
    width: 100%;
    padding: 9px 12px 9px 34px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--radius-pill);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    transition: background var(--dur) var(--ease);
  }
  .sidebar-search-input::placeholder { color: rgba(255,255,255,.4); }
  .sidebar-search-input:focus { background: rgba(255,255,255,.18); }

  .sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 10px;
    flex: 1;
  }
  .sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,.75);
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
    white-space: nowrap;
  }
  .sidebar-link i { width: 18px; text-align: center; font-size: 1rem; flex-shrink: 0; }
  .sidebar-link:hover  { background: rgba(255,255,255,.1);  color: var(--white); }
  .sidebar-link.active { background: rgba(255,255,255,.15); color: var(--white); }
  .sidebar-link-sell {
    background: var(--green);
    color: var(--white) !important;
    margin: 4px 0;
    justify-content: center;
    font-weight: 700;
  }
  .sidebar-link-sell:hover { background: var(--green-dark); }

  .sidebar-badge {
    margin-left: auto;
    background: var(--red);
    color: var(--white);
    font-family: var(--font-head);
    font-size: 0.58rem;
    font-weight: 800;
    min-width: 18px; height: 18px;
    border-radius: var(--radius-pill);
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
  }

  .sidebar-footer {
    padding: 12px 16px 0;
    border-top: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
  }
  .sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 6px 0;
    border-radius: var(--radius-sm);
    transition: background var(--dur) var(--ease);
  }
  .sidebar-user:hover { background: rgba(255,255,255,.08); }
  .sidebar-user-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-head);
    font-weight: 800; font-size: 0.8rem;
    color: var(--white);
    overflow: hidden; flex-shrink: 0;
  }
  .sidebar-user-name { font-family: var(--font-head); font-weight: 700; font-size: 0.85rem; color: var(--white); }
  .sidebar-user-sub  { font-size: 0.7rem; color: rgba(255,255,255,.5); margin-top: 1px; }
  .sidebar-icon-btn {
    width: 34px; height: 34px;
    background: rgba(255,255,255,.1);
    border: none; border-radius: var(--radius-sm);
    color: rgba(255,255,255,.7);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.88rem; cursor: pointer; text-decoration: none;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  }
  .sidebar-icon-btn:hover { background: rgba(255,255,255,.2); color: var(--white); }

  /* ── App shell: offset for sidebar ── */
  .app-shell {
    max-width: 100%;
    margin-left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
    box-shadow: none;
    overflow-x: visible;
    min-height: 100dvh;
  }

  /* ── Hide mobile top nav ── */
  .top-nav { display: none !important; }

  /* ── No margin-top needed: no fixed nav on desktop ── */
  .search-bar-wrap { margin-top: 0; padding-top: 16px; }

  /* ── Fixed elements: span full content width ── */
  .chat-header,
  .chat-input-bar,
  .detail-cta-bar {
    left: var(--sidebar-w) !important;
    right: 0 !important;
    max-width: none !important;
    width: auto !important;
    transform: none !important;
  }

  /* ── Modal: offset for sidebar ── */
  .modal-overlay { left: var(--sidebar-w); }

  /* ── FAB: bottom-right corner ── */
  .fab {
    left: auto !important;
    right: 32px;
    bottom: 32px;
    transform: none !important;
    margin-left: 0;
  }

  /* ── Product grid: 3 columns ── */
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px 20px 4px;
  }

  /* ── Auth pages: centred, no sidebar offset ── */
  .auth-page {
    min-height: 100dvh;
    width: 100%;
    padding: 40px 20px;
  }

  /* ── Breathing room ── */
  .listing-item { margin: 0 20px 12px; }
  .profile-cover { height: 160px; }
  .page-title-bar { padding: 14px 24px 10px; }
  .page-title-bar h1 { font-size: 1.55rem; }
}

/* ── 26c. Large desktop (≥1200px) ──────────────────────────────── */
@media (min-width: 1200px) {
  :root { --sidebar-w: 280px; }
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 24px 24px 4px;
  }
  .listing-item { margin: 0 24px 14px; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Logo Icon Styles*/

    .logo-icon {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        overflow: hidden;          /* ← this is what was missing */
        flex-shrink: 0;
        border: 1px solid var(--border);
        background-image: url('../Worker/icons\ \(192×192\ and\ 512×512\)/Metups_logo-192.png ');
        background-size: cover;
        background-position: center;
      }
      .logo-icon-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
      }
      .brand {
        display: flex;
        align-items: center;
        gap: 12px;
      }
      .nav-logo {
      display: flex;
      align-items: center;
      gap: 20px; /* space between logo and text */
      }

      .logo-lockup {
        display: flex;
        align-items: center;
        gap: 3px;
      }

      .logo-text { 
        font-family: 'Syne', sans-serif; 
        font-size: 30px; 
        font-weight: 600; 
        letter-spacing: -0.5px; 
      }
      .logo-text span { 
        color: var(--mint);
      }
          .menu-about-banner {
      padding: 40px 20px;
      text-align: center; /* centers h3, p, version text */
      background-color: #f9f9f9; /* optional banner background */
    }

    .logo-center {
      display: flex;
      flex-direction: column;  /* stack logo, heading, paragraph vertically */
      align-items: center;     /* center horizontally */
      gap: 12px;               /* spacing between elements */
    }
    .version-info {
      margin-top: 14px;
      font-size: 0.72rem;
      opacity: 0.65;
    }