/* ═══════════════════════════════════════════════════════════════
   Marktly – Complete Stylesheet v1.3
   Kleinanzeigen-inspired, CSS3 animated, dark-mode ready
   ═══════════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  --primary:       #4f46e5;
  --primary-dark:  #3730a3;
  --primary-light: #818cf8;
  --accent:        #f59e0b;
  --accent-dark:   #d97706;
  --success:       #10b981;
  --danger:        #ef4444;
  --warning:       #f59e0b;

  --bg:            #f8fafc;
  --bg-card:       #ffffff;
  --bg-alt:        #f1f5f9;
  --bg-input:      #ffffff;
  --border:        #e2e8f0;
  --border-strong: #cbd5e1;

  --text:          #0f172a;
  --text-muted:    #64748b;
  --text-light:    #94a3b8;

  --shadow-xs:  0 1px 2px rgba(0,0,0,.06);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --shadow-xl:  0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
  --shadow-card: 0 2px 8px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.04);

  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-full: 9999px;

  --ease:        cubic-bezier(.4,0,.2,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --dur-fast:   150ms;
  --dur-base:   250ms;
  --dur-slow:   400ms;

  --header-h:  64px;
  --container: 1200px;
  --gap:       24px;
}

[data-theme="dark"] {
  --primary:       #818cf8;
  --primary-dark:  #6366f1;
  --primary-light: #a5b4fc;

  --bg:            #0f172a;
  --bg-card:       #1e293b;
  --bg-alt:        #162032;
  --bg-input:      #1e293b;
  --border:        #334155;
  --border-strong: #475569;

  --text:          #f1f5f9;
  --text-muted:    #94a3b8;
  --text-light:    #64748b;

  --shadow-card: 0 2px 8px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.04);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }
main { flex: 1; }
hr { border: none; border-top: 1px solid var(--border); }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Container ──────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ══════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════ */
#siteHeader {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: background var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease);
}
[data-theme="dark"] #siteHeader {
  background: rgba(15,23,42,.85);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}
.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.03em;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease-spring);
}
.logo:hover { transform: scale(1.05); text-decoration: none; }
.logo span { color: var(--primary); }

/* Nav */
.main-nav { flex: 1; }
.main-nav ul {
  display: flex;
  gap: 4px;
  align-items: center;
}
.main-nav a {
  padding: 6px 14px;
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
  text-decoration: none;
}
.main-nav a:hover {
  color: var(--text);
  background: var(--bg-alt);
  text-decoration: none;
}
.main-nav a.active {
  color: var(--primary);
  background: rgba(79,70,229,.08);
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Lang switch */
.lang-switch {
  display: flex;
  gap: 2px;
  background: var(--bg-alt);
  border-radius: var(--r-sm);
  padding: 3px;
}
.lang-switch a {
  padding: 3px 9px;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--dur-fast) var(--ease);
}
.lang-switch a:hover,
.lang-switch a.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
}

/* Theme toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  transition: all var(--dur-fast) var(--ease);
}
.theme-toggle:hover {
  color: var(--primary);
  background: rgba(79,70,229,.08);
  border-color: var(--primary-light);
  transform: rotate(15deg);
}

/* User menu */
.user-menu-wrap { position: relative; }
.user-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: .875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px transparent;
  transition: box-shadow var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease-spring);
}
.user-avatar-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px rgba(79,70,229,.3);
}
.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  padding: 6px;
  z-index: 200;
  animation: dropIn var(--dur-base) var(--ease-spring);
}
.user-dropdown.open { display: block; }
.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: var(--text);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease);
}
.user-dropdown a:hover { background: var(--bg-alt); text-decoration: none; }
.user-dropdown hr { margin: 4px 0; border-color: var(--border); }
.user-dropdown .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-full);
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
}
.mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--dur-base) var(--ease), opacity var(--dur-fast) var(--ease);
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ══════════════════════════════════════════════════════════════
   HERO SECTION
   ══════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4338ca 70%, #6366f1 100%);
  color: #fff;
  padding: 80px 0 90px;
  overflow: hidden;
  isolation: isolate;
}
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #0a0828 0%, #1e1b4b 40%, #2d2a7a 70%, #3730a3 100%);
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z' fill='none' stroke='rgba(255,255,255,.03)' stroke-width='1'/%3E%3C/svg%3E") repeat;
  z-index: -1;
}

/* Animated blobs */
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
  z-index: -1;
  animation: blobFloat 8s ease-in-out infinite;
}
.hero-blob-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #7c3aed, transparent);
  top: -150px;
  right: -100px;
  animation-delay: 0s;
}
.hero-blob-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #2563eb, transparent);
  bottom: -100px;
  left: -80px;
  animation-delay: -3s;
}
.hero-blob-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #db2777, transparent);
  top: 30%;
  left: 40%;
  animation-delay: -6s;
}
@keyframes blobFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  33%       { transform: translateY(-20px) scale(1.05); }
  66%       { transform: translateY(10px) scale(.95); }
}

.hero-content { position: relative; text-align: center; }
.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.1;
  margin-bottom: 16px;
  text-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.hero-sub {
  font-size: clamp(.9rem, 2vw, 1.15rem);
  color: rgba(255,255,255,.8);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* Hero search bar */
.hero-search {
  display: flex;
  gap: 8px;
  max-width: 700px;
  margin: 0 auto 40px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--r-xl);
  padding: 8px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.hero-search input,
.hero-search select {
  flex: 1;
  min-width: 0;
  padding: 12px 18px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--r-lg);
  color: #fff;
  font-size: .95rem;
  font-weight: 500;
  outline: none;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.hero-search input::placeholder { color: rgba(255,255,255,.55); }
.hero-search input:focus,
.hero-search select:focus {
  background: rgba(255,255,255,.25);
  border-color: rgba(255,255,255,.4);
}
.hero-search select {
  flex: 0 0 200px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='rgba(255,255,255,.7)' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
.hero-search select option { background: #1e1b4b; color: #fff; }
.hero-search button[type=submit] {
  padding: 12px 28px;
  background: #fff;
  color: var(--primary);
  border-radius: var(--r-lg);
  font-weight: 700;
  font-size: .95rem;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur-fast) var(--ease);
  flex-shrink: 0;
  border: none;
  cursor: pointer;
}
.hero-search button[type=submit]:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}

/* Hero stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
}
.hero-stats .stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: rgba(255,255,255,.75);
  font-size: .85rem;
}
.hero-stats .stat strong {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -.03em;
}

/* ══════════════════════════════════════════════════════════════
   SECTIONS
   ══════════════════════════════════════════════════════════════ */
.section { padding: 60px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: 32px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.section-header .section-title { margin-bottom: 0; }

/* ══════════════════════════════════════════════════════════════
   CATEGORY CARDS
   ══════════════════════════════════════════════════════════════ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: var(--text);
  transition: transform var(--dur-base) var(--ease-spring),
              box-shadow var(--dur-base) var(--ease),
              border-color var(--dur-base) var(--ease);
  position: relative;
  overflow: hidden;
}
.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease);
}
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  border-color: transparent;
}
.category-card:hover::before { opacity: 1; }
.category-card:hover .cat-icon { transform: rotate(-8deg) scale(1.15); }

.cat-icon {
  font-size: 2.2rem;
  line-height: 1;
  transition: transform var(--dur-base) var(--ease-spring);
}
.category-card h3 {
  font-size: .85rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
}
.category-card span {
  font-size: .75rem;
  color: var(--text-muted);
}

/* Category color variants */
.cat-elektronik { border-top: 3px solid #6366f1; }
.cat-elektronik::before { background: linear-gradient(135deg, rgba(99,102,241,.06), rgba(139,92,246,.06)); }
.cat-moebel { border-top: 3px solid #f59e0b; }
.cat-moebel::before { background: linear-gradient(135deg, rgba(245,158,11,.06), rgba(251,191,36,.06)); }
.cat-kleidung { border-top: 3px solid #ec4899; }
.cat-kleidung::before { background: linear-gradient(135deg, rgba(236,72,153,.06), rgba(249,168,212,.06)); }
.cat-fahrzeuge { border-top: 3px solid #3b82f6; }
.cat-fahrzeuge::before { background: linear-gradient(135deg, rgba(59,130,246,.06), rgba(147,197,253,.06)); }
.cat-immobilien { border-top: 3px solid #10b981; }
.cat-immobilien::before { background: linear-gradient(135deg, rgba(16,185,129,.06), rgba(110,231,183,.06)); }
.cat-jobs { border-top: 3px solid #8b5cf6; }
.cat-jobs::before { background: linear-gradient(135deg, rgba(139,92,246,.06), rgba(196,181,253,.06)); }
.cat-sport { border-top: 3px solid #ef4444; }
.cat-sport::before { background: linear-gradient(135deg, rgba(239,68,68,.06), rgba(252,165,165,.06)); }
.cat-haushalt { border-top: 3px solid #14b8a6; }
.cat-haushalt::before { background: linear-gradient(135deg, rgba(20,184,166,.06), rgba(153,246,228,.06)); }

/* ══════════════════════════════════════════════════════════════
   LISTING CARDS (GRID)
   ══════════════════════════════════════════════════════════════ */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.listing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-base) var(--ease-spring),
              box-shadow var(--dur-base) var(--ease),
              border-color var(--dur-base) var(--ease);
}
.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(79,70,229,.2);
}

/* Card image */
.card-image-link {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--bg-alt);
}
.card-image-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease);
  display: block;
}
.listing-card:hover .card-image-link img { transform: scale(1.06); }
.no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  color: var(--text-light);
  font-size: 2.5rem;
}

/* Badges on card */
.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  z-index: 2;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--r-full);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1;
}
.badge-new { background: #dcfce7; color: #15803d; }
.badge-top { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; }
.badge-sold { background: #fee2e2; color: #b91c1c; }
.badge-reserved { background: #fef3c7; color: #92400e; }
.badge-featured { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }

/* Fav button on card */
.fav-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: all var(--dur-fast) var(--ease-spring);
  z-index: 2;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: var(--shadow-sm);
}
.fav-btn:hover,
.fav-btn.active { color: #e11d48; transform: scale(1.15); }
.fav-btn.active { background: #fff0f3; }

/* Card body */
.card-body { padding: 14px 16px 16px; }
.card-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -.02em;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.card-price small { font-size: .75rem; font-weight: 500; color: var(--text-muted); }
.price-free { color: var(--success); font-size: 1rem; font-weight: 700; }
.card-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--primary); }
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.meta-location, .meta-cat, .meta-date {
  font-size: .75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}
.meta-cat {
  background: var(--bg-alt);
  padding: 2px 8px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════════════════
   HOW IT WORKS
   ══════════════════════════════════════════════════════════════ */
.hiw-section { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%); }
.hiw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
  margin-bottom: 48px;
}
.hiw-step {
  text-align: center;
  padding: 36px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.hiw-step:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.hiw-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: block;
  animation: iconPulse 3s ease-in-out infinite;
}
.hiw-step:nth-child(2) .hiw-icon { animation-delay: .5s; }
.hiw-step:nth-child(3) .hiw-icon { animation-delay: 1s; }
.hiw-step:nth-child(4) .hiw-icon { animation-delay: 1.5s; }
@keyframes iconPulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%       { transform: scale(1.12) rotate(4deg); }
}
.hiw-step h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.hiw-step p { font-size: .875rem; color: var(--text-muted); line-height: 1.6; }

/* ══════════════════════════════════════════════════════════════
   LISTING DETAIL PAGE
   ══════════════════════════════════════════════════════════════ */
.listing-detail-wrap { padding: 32px 0 60px; }
.listing-detail-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

/* Gallery */
.listing-gallery { position: sticky; top: calc(var(--header-h) + 16px); }
.gallery-main {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--bg-alt);
  margin-bottom: 12px;
  cursor: zoom-in;
  box-shadow: var(--shadow-md);
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease);
}
.gallery-main:hover img { transform: scale(1.03); }
.fav-btn-large {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
  background: rgba(255,255,255,.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  box-shadow: var(--shadow-md);
  border: 2px solid rgba(0,0,0,.06);
  transition: all var(--dur-fast) var(--ease-spring);
  z-index: 5;
  cursor: pointer;
}
.fav-btn-large:hover,
.fav-btn-large.active { color: #e11d48; transform: scale(1.12); }
.gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.gallery-thumbs::-webkit-scrollbar { height: 4px; }
.gallery-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease),
              opacity var(--dur-fast) var(--ease);
  opacity: .7;
  display: block;
}
.gallery-thumb:hover { opacity: 1; transform: scale(1.05); }
.gallery-thumb.active {
  border-color: var(--primary);
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(79,70,229,.3);
}

/* Listing info panel */
.listing-info { display: flex; flex-direction: column; gap: 20px; }
.listing-detail-title {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.25;
  color: var(--text);
}
.listing-price-box {
  background: linear-gradient(135deg, rgba(79,70,229,.05), rgba(99,102,241,.08));
  border: 1px solid rgba(79,70,229,.15);
  border-radius: var(--r-lg);
  padding: 20px 24px;
}
.price-hero {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -.04em;
  line-height: 1;
  margin-bottom: 6px;
  display: block;
}
.price-type-label {
  font-size: .8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Listing tags */
.listing-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  padding: 5px 12px;
  border-radius: var(--r-full);
  font-size: .78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.tag-condition { background: #ede9fe; color: #5b21b6; }
.tag-category  { background: #dbeafe; color: #1d4ed8; }
.tag-shipping  { background: #dcfce7; color: #15803d; }
.tag-pickup    { background: #fef3c7; color: #92400e; }
.tag-views     { background: var(--bg-alt); color: var(--text-muted); }

/* Meta list */
.listing-meta-list { display: flex; flex-direction: column; gap: 0; }
.listing-meta-list li {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
  gap: 12px;
}
.listing-meta-list li:last-child { border-bottom: none; }
.meta-label {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 100px;
  flex-shrink: 0;
}
.meta-value { color: var(--text); }

/* QR mini */
#qrcode-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .75rem;
  color: var(--text-muted);
}
#qrcode-mini canvas,
#qrcode-mini img {
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

/* Action row */
.listing-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Contact box */
.contact-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.contact-box h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}

/* Seller card */
.seller-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.seller-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.seller-details strong { display: block; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.seller-details span { font-size: .8rem; color: var(--text-muted); }

/* Description */
.listing-description {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
  margin-top: 32px;
}
.listing-description h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
.listing-description-text {
  color: var(--text-muted);
  line-height: 1.8;
  white-space: pre-line;
}

/* Similar listings */
.similar-section { margin-top: 48px; }
.similar-section h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 24px; }

/* ══════════════════════════════════════════════════════════════
   LISTINGS PAGE (BROWSE)
   ══════════════════════════════════════════════════════════════ */
.listings-wrap { padding: 32px 0 60px; }
.listings-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: start;
}

/* Sidebar filters */
.filters-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
  box-shadow: var(--shadow-sm);
}
.filters-sidebar h3 {
  font-size: .875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.filter-group { margin-bottom: 24px; }
.filter-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.filter-row { display: flex; gap: 8px; }
.filter-row .form-control { flex: 1; }

/* Listings top bar */
.listings-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.listings-count {
  font-size: .875rem;
  color: var(--text-muted);
  font-weight: 500;
}
.listings-count strong { color: var(--text); }

/* ══════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-input);
  color: var(--text);
  font-size: .9rem;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.form-control::placeholder { color: var(--text-light); }
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,.15); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: 5px; }
.invalid-feedback { font-size: .78rem; color: var(--danger); margin-top: 5px; display: block; }
.form-check { display: flex; align-items: center; gap: 10px; }
.form-check input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.form-check label { font-size: .875rem; color: var(--text); cursor: pointer; }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--dur-base) var(--ease);
  background: var(--bg-alt);
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--primary);
  background: rgba(79,70,229,.04);
}
.upload-zone-icon { font-size: 2.5rem; margin-bottom: 10px; }
.upload-zone p { font-size: .875rem; color: var(--text-muted); }
.upload-zone strong { color: var(--primary); }
.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.upload-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 2px solid var(--border);
}
.upload-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview-item .remove-img {
  position: absolute;
  top: 2px; right: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: .7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--r-md);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none;
  transition: all var(--dur-fast) var(--ease);
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(79,70,229,.3);
}
.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(79,70,229,.4);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: rgba(79,70,229,.08); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-alt); color: var(--text); }
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
}
.btn-danger:hover { background: #dc2626; }
.btn-white {
  background: #fff;
  color: var(--primary);
  border-color: var(--border);
}
.btn-white:hover { background: var(--bg-alt); }
.btn-success {
  background: var(--success);
  color: #fff;
  border-color: transparent;
}
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-xl { padding: 16px 40px; font-size: 1.1rem; border-radius: var(--r-lg); }
.w-full { width: 100%; }

/* ══════════════════════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════════════════════ */
.alert {
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.alert-error   { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.alert-info    { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }

/* ══════════════════════════════════════════════════════════════
   AUTH PAGES
   ══════════════════════════════════════════════════════════════ */
.auth-wrap {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(160deg, var(--bg) 60%, rgba(79,70,229,.05) 100%);
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
}
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-header .logo { display: inline-block; font-size: 1.8rem; margin-bottom: 8px; }
.auth-title { font-size: 1.5rem; font-weight: 800; color: var(--text); letter-spacing: -.03em; }
.auth-sub { font-size: .875rem; color: var(--text-muted); margin-top: 4px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: .875rem; color: var(--text-muted); }
.auth-footer a { color: var(--primary); font-weight: 600; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-light);
  font-size: .8rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ══════════════════════════════════════════════════════════════
   MESSAGES
   ══════════════════════════════════════════════════════════════ */
.messages-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  min-height: 600px;
}
.messages-list { border-right: 1px solid var(--border); overflow-y: auto; }
.messages-list-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: .95rem;
  background: var(--bg-alt);
}
.message-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
  text-decoration: none;
}
.message-item:hover { background: var(--bg-alt); text-decoration: none; }
.message-item.active { background: rgba(79,70,229,.06); border-left: 3px solid var(--primary); }
.message-item.unread .msg-subject { font-weight: 700; }
.msg-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.msg-content { flex: 1; min-width: 0; }
.msg-subject {
  font-size: .875rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.msg-preview {
  font-size: .78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-meta { display: flex; align-items: center; justify-content: space-between; }
.msg-date { font-size: .72rem; color: var(--text-light); }
.msg-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

/* Chat / conversation */
.chat-wrap { display: flex; flex-direction: column; height: 100%; }
.chat-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-bubble {
  max-width: 70%;
  padding: 10px 16px;
  border-radius: 18px;
  font-size: .875rem;
  line-height: 1.5;
}
.chat-bubble-sent {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble-recv {
  align-self: flex-start;
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-input-row {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.chat-input-row .form-control { resize: none; min-height: 44px; max-height: 120px; }

/* ══════════════════════════════════════════════════════════════
   PROFILE PAGE
   ══════════════════════════════════════════════════════════════ */
.profile-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 48px 0;
}
.profile-header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}
.profile-avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255,255,255,.4);
  flex-shrink: 0;
}
.profile-name { font-size: 1.5rem; font-weight: 800; }
.profile-meta { font-size: .875rem; opacity: .8; margin-top: 4px; }
.profile-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  overflow-x: auto;
}
.profile-tab {
  padding: 14px 22px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.profile-tab:hover { color: var(--text); text-decoration: none; }
.profile-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ══════════════════════════════════════════════════════════════
   CREATE / EDIT LISTING
   ══════════════════════════════════════════════════════════════ */
.create-listing-wrap { padding: 32px 0 60px; }
.create-listing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 36px 40px;
  box-shadow: var(--shadow-sm);
  max-width: 800px;
  margin: 0 auto;
}
.create-listing-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ══════════════════════════════════════════════════════════════
   ADMIN
   ══════════════════════════════════════════════════════════════ */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  min-height: calc(100vh - var(--header-h));
}
.admin-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px 0;
}
.admin-sidebar h3 {
  padding: 0 20px 16px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
}
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: .875rem;
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
  transition: all var(--dur-fast) var(--ease);
  border-left: 3px solid transparent;
}
.admin-nav a:hover { color: var(--text); background: var(--bg-alt); text-decoration: none; }
.admin-nav a.active {
  color: var(--primary);
  background: rgba(79,70,229,.06);
  border-left-color: var(--primary);
}
.admin-content { padding: 32px; }
.admin-page-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 28px;
  letter-spacing: -.03em;
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}
.stat-card-value {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -.04em;
  color: var(--text);
  display: block;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-card-label {
  font-size: .8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  background: var(--bg-alt);
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-alt); }
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* Status badges in table */
.status-badge {
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: .72rem;
  font-weight: 700;
  display: inline-block;
}
.status-active   { background: #dcfce7; color: #15803d; }
.status-inactive { background: var(--bg-alt); color: var(--text-muted); }
.status-pending  { background: #fef3c7; color: #92400e; }
.status-sold     { background: #fee2e2; color: #b91c1c; }

/* ══════════════════════════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════════════════════════ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  font-size: .875rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  background: var(--bg-card);
  text-decoration: none;
  transition: all var(--dur-fast) var(--ease);
}
.pagination a:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(79,70,229,.06);
  text-decoration: none;
}
.pagination span.current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.pagination span.dots { border: none; background: none; }

/* ══════════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  display: block;
  animation: iconPulse 3s ease-in-out infinite;
}
.empty-state h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.empty-state p {
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ══════════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════════ */
#toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}
.toast-item {
  background: var(--text);
  color: var(--bg-card);
  padding: 12px 20px;
  border-radius: var(--r-lg);
  font-size: .875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn var(--dur-base) var(--ease-spring),
             toastOut var(--dur-base) var(--ease) 2.8s forwards;
  pointer-events: auto;
  max-width: 300px;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ══════════════════════════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════════════════════════ */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,.92);
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--dur-base) var(--ease);
}
#lightbox.open { display: flex; }
#lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  animation: scaleIn var(--dur-base) var(--ease-spring);
}
#lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--dur-fast);
}
#lightbox-close:hover { background: rgba(255,255,255,.2); }
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ══════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════ */
.site-footer {
  background: #0f172a;
  color: rgba(255,255,255,.7);
  padding: 56px 0 28px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
.footer-brand .logo {
  color: #fff;
  font-size: 1.4rem;
  margin-bottom: 12px;
  display: inline-block;
}
.footer-brand p {
  font-size: .85rem;
  line-height: 1.7;
  max-width: 280px;
  color: rgba(255,255,255,.55);
}
.footer-col h4 {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #fff;
  margin-bottom: 14px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col a {
  font-size: .85rem;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  transition: color var(--dur-fast);
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
  color: rgba(255,255,255,.4);
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom a { color: rgba(255,255,255,.5); text-decoration: none; }
.footer-bottom a:hover { color: rgba(255,255,255,.8); }

/* ══════════════════════════════════════════════════════════════
   SCROLL REVEAL
   ══════════════════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-slow) var(--ease),
              transform var(--dur-slow) var(--ease);
}
.reveal.visible,
.reveal.revealed { opacity: 1; transform: translateY(0); }

/* ══════════════════════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════════════════════ */
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.text-muted    { color: var(--text-muted); }
.text-primary  { color: var(--primary); }
.text-danger   { color: var(--danger); }
.text-success  { color: var(--success); }
.font-bold     { font-weight: 700; }
.font-semibold { font-weight: 600; }
.d-flex        { display: flex; }
.align-center  { align-items: center; }
.gap-2         { gap: 8px; }
.gap-3         { gap: 12px; }
.gap-4         { gap: 16px; }
.mt-8          { margin-top: 8px; }
.mt-16         { margin-top: 16px; }
.mt-24         { margin-top: 24px; }
.mt-32         { margin-top: 32px; }
.mt-40         { margin-top: 40px; }
.mb-0          { margin-bottom: 0; }
.mb-8          { margin-bottom: 8px; }
.mb-16         { margin-bottom: 16px; }
.mb-24         { margin-bottom: 24px; }
.card-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.page-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.page-breadcrumb a:hover { color: var(--primary); }
.page-wrap { padding: 32px 0 60px; }

/* Print dropdown */
.print-dropdown-wrap { position: relative; display: inline-block; }
.print-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  padding: 6px;
  min-width: 160px;
  z-index: 100;
  animation: dropIn var(--dur-base) var(--ease-spring);
}
.print-dropdown.open { display: block; }
.print-dropdown a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: .875rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: background var(--dur-fast);
}
.print-dropdown a:hover { background: var(--bg-alt); text-decoration: none; }

/* Contact page */
.contact-wrap { max-width: 640px; margin: 0 auto; padding: 40px 0 60px; }
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 36px;
  box-shadow: var(--shadow-sm);
}

/* How it works standalone page */
.hiw-standalone { padding: 48px 0 80px; }

/* ══════════════════════════════════════════════════════════════
   PRINT
   ══════════════════════════════════════════════════════════════ */
@media print {
  #siteHeader, .site-footer, .fav-btn, .fav-btn-large,
  .listing-actions-row, .contact-box, .similar-section,
  .hero-blob, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .listing-detail-grid { grid-template-columns: 1fr; }
  .listing-gallery { position: static; }
  .gallery-main { aspect-ratio: 4/3; border: 1px solid #ccc; }
  .gallery-thumbs { display: none; }
  a { color: #000; text-decoration: none; }
  .listing-description { border: 1px solid #ccc; box-shadow: none; }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .listing-detail-grid { grid-template-columns: 1fr 340px; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .listings-layout { grid-template-columns: 240px 1fr; }
}

@media (max-width: 900px) {
  .listing-detail-grid { grid-template-columns: 1fr; }
  .listing-gallery { position: static; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { border-right: none; border-bottom: 1px solid var(--border); }
  .messages-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .listings-layout { grid-template-columns: 1fr; }
  .filters-sidebar { position: static; }
}

@media (max-width: 768px) {
  :root { --header-h: 58px; }
  .section { padding: 40px 0; }
  .main-nav {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--header-h);
    background: var(--bg-card);
    padding: 24px 20px;
    z-index: 999;
    border-top: 1px solid var(--border);
    flex-direction: column;
  }
  .main-nav.open { display: flex; }
  .main-nav ul { flex-direction: column; gap: 4px; }
  .main-nav a { padding: 12px 16px; font-size: 1rem; }
  .mobile-menu-btn { display: flex; }
  .hide-mobile { display: none !important; }
  .hero { padding: 50px 0 60px; }
  .hero-search { flex-wrap: wrap; border-radius: var(--r-lg); }
  .hero-search select { flex: 0 0 100%; }
  .hero-stats { gap: 28px; }
  .hero-stats .stat strong { font-size: 1.5rem; }
  .listings-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .categories-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
  .create-listing-card { padding: 24px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .contact-wrap { padding: 20px 0 40px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.7rem; }
  .listing-detail-title { font-size: 1.3rem; }
  .price-hero { font-size: 1.6rem; }
  .listings-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card-body { padding: 10px 12px 12px; }
  .card-price { font-size: 1rem; }
}
