/* ============================================================
   VirtualRealityMap.ch — Main Stylesheet  v2.0
   Alpine palette · Space Grotesk + JetBrains Mono
   ============================================================ */

/* ---------- Design tokens ---------------------------------- */
:root {
  /* Brand */
  --vrm-red:        #E30613;
  --vrm-red-hover:  #B80510;
  --vrm-void:       #0B0D12;
  --vrm-snow:       #F6F4EF;
  --vrm-granite:    #D9D5CB;
  --vrm-glass:      #5BE9F0;

  /* Semantic – light */
  --color-bg:           var(--vrm-snow);
  --color-surface:      #FFFFFF;
  --color-surface-alt:  #ECE9DF;
  --color-border:       rgba(11,13,18,0.12);
  --color-border-soft:  rgba(11,13,18,0.06);
  --color-text:         var(--vrm-void);
  --color-text-muted:   rgba(11,13,18,0.55);
  --color-text-dim:     rgba(11,13,18,0.40);
  --color-primary:      var(--vrm-red);
  --color-primary-fg:   #FFFFFF;
  --color-focus-ring:   rgba(227,6,19,0.35);

  /* Type */
  --font-display: 'Space Grotesk', system-ui, -apple-system, Segoe UI, Helvetica, Arial, sans-serif;
  --font-body:    'Space Grotesk', system-ui, -apple-system, Segoe UI, Helvetica, Arial, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Scale */
  --fs-hero:    4.75rem;
  --fs-display: 3rem;
  --fs-h1:      2.25rem;
  --fs-h2:      1.75rem;
  --fs-h3:      1.25rem;
  --fs-body:    1rem;
  --fs-small:   0.875rem;
  --fs-micro:   0.6875rem;

  /* Line heights */
  --lh-display: 0.96;
  --lh-heading: 1.1;
  --lh-body:    1.5;

  /* Letter-spacing */
  --ls-display: -0.035em;
  --ls-heading: -0.02em;
  --ls-mono:    0.16em;

  /* Spacing (4px grid) */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.5rem;
  --sp-6:  2rem;
  --sp-7:  3rem;
  --sp-8:  4rem;
  --sp-9:  6rem;

  /* Radius */
  --r-sm:   4px;
  --r-md:   8px;
  --r-lg:   14px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm:  0 1px 2px rgba(11,13,18,0.06);
  --shadow-md:  0 4px 12px rgba(11,13,18,0.08);
  --shadow-lg:  0 12px 32px rgba(11,13,18,0.12);
  --shadow-pin: 0 6px 14px rgba(227,6,19,0.25);

  /* Motion */
  --ease:      cubic-bezier(0.2,0.7,0.2,1);
  --dur-fast:  140ms;
  --dur-base:  220ms;
  --dur-slow:  420ms;

  /* Layout */
  --container-max: 1280px;
  --nav-h:         64px;
}

/* ---------- Dark override ---------------------------------- */
[data-theme="dark"] {
  --color-bg:          var(--vrm-void);
  --color-surface:     #161821;
  --color-surface-alt: #1F2230;
  --color-border:      rgba(246,244,239,0.12);
  --color-border-soft: rgba(246,244,239,0.06);
  --color-text:        var(--vrm-snow);
  --color-text-muted:  rgba(246,244,239,0.55);
  --color-text-dim:    rgba(246,244,239,0.40);
}

/* ---------- Reset ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: var(--ls-heading);
  line-height: var(--lh-heading);
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ---------- Layout ----------------------------------------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

/* ---------- NAV -------------------------------------------- */
.site-header {
  background: var(--vrm-void);
  height: var(--nav-h);
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid rgba(246,244,239,0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: var(--sp-5);
}

/* Wordmark */
.logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo__pin { display: block; height: 34px; width: auto; }
.logo__text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--vrm-snow);
  letter-spacing: -0.01em;
  line-height: 1;
}
.logo__text .accent { color: var(--vrm-red); }
/* Hide text wordmark on small mobile */
@media (max-width: 480px) { .logo__text { display: none; } }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(246,244,239,0.2);
  color: rgba(246,244,239,0.8);
  border-radius: var(--r-sm);
  padding: 0.3rem 0.55rem;
  font-size: 1.1rem;
  margin-left: auto;
}
@media (max-width: 768px) { .nav-toggle { display: block; } }

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  margin-left: auto;
}
@media (max-width: 768px) {
  .main-nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--vrm-void);
    border-top: 1px solid rgba(246,244,239,0.08);
    padding: var(--sp-3) var(--sp-4);
    gap: 0.125rem;
    z-index: 199;
  }
  .main-nav.open { display: flex; }
  .main-nav .btn-nav-cta { margin-left: 0; margin-top: var(--sp-2); }
}

.nav-link {
  color: rgba(246,244,239,0.75);
  padding: 0.4rem 0.7rem;
  border-radius: var(--r-sm);
  font-size: var(--fs-small);
  font-weight: 500;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.nav-link:hover { color: var(--vrm-snow); background: rgba(246,244,239,0.08); text-decoration: none; }
.nav-link--admin { color: #fbbf24; }
.nav-link--admin:hover { color: #fde68a; }

.btn-nav-cta {
  background: var(--vrm-red);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-small);
  border: 0;
  border-radius: var(--r-md);
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
  white-space: nowrap;
  margin-left: var(--sp-2);
  display: inline-block;
  line-height: 1.5;
  text-decoration: none;
}
.btn-nav-cta:hover { background: var(--vrm-red-hover); color: #fff; text-decoration: none; }
.btn-nav-cta:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }

/* User dropdown */
.nav-user {
  position: relative;
  cursor: pointer;
  margin-left: var(--sp-2);
}
.nav-user__name {
  color: rgba(246,244,239,0.85);
  font-size: var(--fs-small);
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: var(--r-sm);
  border: 1px solid rgba(246,244,239,0.15);
  display: flex; align-items: center; gap: 0.4rem;
}
.nav-user:hover .nav-user__menu { display: flex; }
.nav-user__menu {
  display: none;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 300;
}
.nav-user__menu a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--color-text);
  font-size: var(--fs-small);
  transition: background var(--dur-fast);
}
.nav-user__menu a:hover { background: var(--color-surface-alt); text-decoration: none; }

/* ---------- BUTTONS ---------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-weight: 600;
  border: 0;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 2px; }

.btn--primary {
  background: var(--vrm-red);
  color: #fff;
  padding: 0.65rem 1.5rem;
  font-size: var(--fs-body);
}
.btn--primary:hover { background: var(--vrm-red-hover); color: #fff; }

.btn--void {
  background: var(--vrm-void);
  color: var(--vrm-snow);
  padding: 0.65rem 1.5rem;
  font-size: var(--fs-body);
}
.btn--void:hover { background: #1a1d27; color: var(--vrm-snow); }

.btn--outline {
  background: transparent;
  color: var(--vrm-snow);
  border: 1.5px solid rgba(246,244,239,0.3);
  padding: 0.625rem 1.5rem;
  font-size: var(--fs-body);
}
.btn--outline:hover { border-color: rgba(246,244,239,0.7); color: var(--vrm-snow); }

.btn--outline-dark {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  padding: 0.625rem 1.5rem;
  font-size: var(--fs-body);
}
.btn--outline-dark:hover { border-color: var(--color-text); }

.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  padding: 0.4rem 0.75rem;
  font-size: var(--fs-small);
}
.btn--ghost:hover { color: var(--color-text); background: var(--color-surface-alt); }

.btn--sm { padding: 0.4rem 0.9rem; font-size: var(--fs-small); }
.btn--lg { padding: 0.85rem 2rem; font-size: 1.0625rem; }
.btn--full { width: 100%; justify-content: center; }

/* ---------- HOMEPAGE HERO ---------------------------------- */
.hero {
  background: var(--vrm-void);
  color: var(--vrm-snow);
  overflow: hidden;
  position: relative;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-8);
  align-items: center;
  min-height: 560px;
  padding: var(--sp-9) 0 var(--sp-8);
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; min-height: auto; padding: var(--sp-7) 0; }
  .hero-map-panel { display: none; }
}

.hero-copy { max-width: 600px; }

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: rgba(246,244,239,0.45);
  margin-bottom: var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: rgba(246,244,239,0.3);
  flex-shrink: 0;
}

.hero-h1 {
  font-size: clamp(3rem, 6vw, var(--fs-hero));
  font-weight: 600;
  letter-spacing: var(--ls-display);
  line-height: var(--lh-display);
  color: var(--vrm-snow);
  margin-bottom: var(--sp-5);
  text-wrap: balance;
}
.hero-h1 .accent { color: var(--vrm-red); }

.hero-sub {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: rgba(246,244,239,0.55);
  max-width: 480px;
  margin-bottom: var(--sp-6);
}

/* Search bar */
.hero-search {
  background: rgba(246,244,239,0.06);
  border: 1px solid rgba(246,244,239,0.14);
  border-radius: var(--r-lg);
  padding: var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: 520px;
  margin-bottom: var(--sp-5);
  transition: border-color var(--dur-fast);
}
.hero-search:focus-within {
  border-color: var(--vrm-red);
  box-shadow: 0 0 0 3px rgba(227,6,19,0.2);
}
.hero-search__icon {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: rgba(246,244,239,0.35);
  padding: 0 var(--sp-3);
  flex-shrink: 0;
  user-select: none;
}
.hero-search__input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--vrm-snow);
  font-family: var(--font-body);
  font-size: var(--fs-small);
  outline: none;
  padding: var(--sp-3) 0;
}
.hero-search__input::placeholder { color: rgba(246,244,239,0.3); }
.hero-search__btn {
  background: var(--vrm-red);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  border: 0;
  border-radius: var(--r-md);
  padding: 0.65rem 1.25rem;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
  flex-shrink: 0;
}
.hero-search__btn:hover { background: var(--vrm-red-hover); }

/* Pill row */
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.hero-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(246,244,239,0.6);
  border: 1px solid rgba(246,244,239,0.18);
  border-radius: var(--r-pill);
  padding: 0.35rem 0.85rem;
  text-decoration: none;
  transition: border-color var(--dur-fast), color var(--dur-fast);
  white-space: nowrap;
}
.hero-pill:hover { border-color: var(--vrm-red); color: var(--vrm-red); text-decoration: none; }

/* Right: decorative map panel */
.hero-map-panel {
  position: relative;
  background: #0d1017;
  border-radius: var(--r-lg);
  border: 1px solid rgba(246,244,239,0.08);
  overflow: hidden;
  height: 400px;
}
.hero-map-panel #hero-map { width: 100%; height: 100%; }

/* ---------- SECTIONS --------------------------------------- */
.section { padding: var(--sp-8) 0; }
.section--alt { background: var(--color-surface-alt); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.section-title {
  font-size: var(--fs-h2);
  font-weight: 600;
  letter-spacing: var(--ls-heading);
}

/* ---------- CATEGORY CARDS --------------------------------- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--sp-4);
}

.category-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text);
  transition: box-shadow var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.category-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; }

.category-card__img {
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: var(--color-surface-alt);
  position: relative;
  overflow: hidden;
}

.category-card__body {
  padding: var(--sp-4) var(--sp-5);
}
.category-card__body h3 { font-size: var(--fs-h3); margin-bottom: var(--sp-1); }
.category-card__body p { font-weight: 600; color: var(--vrm-red); font-size: var(--fs-small); margin-bottom: var(--sp-1); }
.category-card__sub { font-size: var(--fs-small); color: var(--color-text-muted); }

/* ---------- LISTING CARDS ---------------------------------- */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
}
.listings-grid--wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.listing-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text);
  transition: box-shadow var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.listing-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; color: var(--color-text); }

.listing-card__img {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: var(--color-surface-alt);
}
.listing-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease);
}
.listing-card:hover .listing-card__img img { transform: scale(1.04); }

.listing-card__img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-surface-alt) 0%, var(--vrm-granite) 100%);
}
.listing-card__img-placeholder::after {
  content: '';
  display: block;
  width: 36px;
  height: 46px;
  background-color: rgba(11,13,18,0.12);
  -webkit-mask-image: url('/assets/logo-pin-primary.svg');
  mask-image: url('/assets/logo-pin-primary.svg');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.listing-card__badges {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  display: flex;
  gap: var(--sp-1);
}

.listing-card__body {
  padding: var(--sp-4) var(--sp-5);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.listing-card__body h3 { font-size: var(--fs-h3); font-weight: 600; line-height: 1.2; }
.listing-card__city { font-size: var(--fs-small); color: var(--color-text-muted); }
.listing-card__meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); font-size: var(--fs-small); color: var(--color-text-muted); margin-top: auto; }
.listing-card__price { font-weight: 600; color: var(--color-text); }
.listing-card__system { font-family: var(--font-mono); font-size: 0.725rem; letter-spacing: var(--ls-mono); text-transform: uppercase; color: var(--color-text-dim); }
.listing-card__tags { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-top: var(--sp-1); }

/* ---------- BADGES / TAGS / PILLS -------------------------- */
.badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: var(--r-pill);
  font-weight: 500;
  white-space: nowrap;
}
.badge--cat { background: var(--vrm-void); color: var(--vrm-snow); }
.badge--approved { background: #d1fae5; color: #065f46; }
.badge--pending  { background: #fef3c7; color: #92400e; }
.badge--rejected { background: #fee2e2; color: #991b1b; }
.badge--inactive { background: #e2e8f0; color: #475569; }

.tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  background: var(--color-surface-alt);
  border-radius: var(--r-pill);
  padding: 0.2rem 0.6rem;
  white-space: nowrap;
}

.pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--r-pill);
  padding: 0.35rem 0.85rem;
  background: transparent;
  cursor: pointer;
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
  text-decoration: none;
  white-space: nowrap;
  display: inline-block;
}
.pill:hover, .pill.active {
  border-color: var(--vrm-red);
  color: var(--vrm-red);
  background: rgba(227,6,19,0.04);
  text-decoration: none;
}

/* ---------- PAGE HERO (interior pages) --------------------- */
.page-hero {
  background: var(--vrm-void);
  color: var(--vrm-snow);
  padding: var(--sp-7) 0 var(--sp-6);
}
.page-hero h1 {
  font-size: var(--fs-h1);
  font-weight: 600;
  color: var(--vrm-snow);
  margin-bottom: var(--sp-2);
}
.page-hero p { color: rgba(246,244,239,0.55); font-size: var(--fs-small); max-width: 520px; }
.page-hero--sm { padding: var(--sp-6) 0 var(--sp-5); }

/* ---------- ARCADES PAGE ----------------------------------- */
.arcades-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--sp-6);
  padding-top: var(--sp-6);
  padding-bottom: var(--sp-8);
  align-items: start;
}
@media (max-width: 900px) {
  .arcades-layout { grid-template-columns: 1fr; }
  .filters-sidebar { display: none; }
}

.filters-sidebar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
}

.filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}
.filters-header h3 { font-size: var(--fs-h3); font-weight: 600; }
.filters-clear { font-size: var(--fs-small); color: var(--color-text-muted); }
.filters-clear:hover { color: var(--vrm-red); text-decoration: none; }

.filter-group {
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--color-border-soft);
}
.filter-group:last-of-type { border-bottom: 0; margin-bottom: var(--sp-3); padding-bottom: 0; }

.filter-group__label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin-bottom: var(--sp-2);
}

.filter-option { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; cursor: pointer; }
.filter-option input { accent-color: var(--vrm-red); }
.filter-option span { font-size: var(--fs-small); color: var(--color-text); }

.filter-input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: 0.5rem 0.75rem;
  font-family: var(--font-body);
  font-size: var(--fs-small);
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--dur-fast);
}
.filter-input:focus {
  border-color: var(--vrm-red);
  box-shadow: 0 0 0 3px rgba(227,6,19,0.18);
}

.listings-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}
.listings-count { font-size: var(--fs-small); color: var(--color-text-muted); }

/* ---------- LISTING DETAIL --------------------------------- */
.listing-detail {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--sp-6);
  padding: var(--sp-6) 0 var(--sp-8);
  align-items: start;
}
@media (max-width: 900px) {
  .listing-detail { grid-template-columns: 1fr; }
}

.listing-detail__cover {
  width: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--color-surface-alt);
  aspect-ratio: 16/9;
}
.listing-detail__cover img { width: 100%; height: 100%; object-fit: cover; }

.listing-detail__meta-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
}

.meta-row { display: flex; gap: var(--sp-3); }
.meta-row dt {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--color-text-dim);
  min-width: 90px;
  padding-top: 2px;
  flex-shrink: 0;
}
.meta-row dd { font-size: var(--fs-small); color: var(--color-text); }

.listing-detail__price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
}
.listing-detail__price sup { font-size: 0.75em; vertical-align: top; margin-top: 0.2em; }

.listing-map {
  border-radius: var(--r-lg);
  overflow: hidden;
  height: 200px;
  background: var(--color-surface-alt);
}

/* ---------- MAP (Leaflet overrides) ------------------------ */
.leaflet-container { font-family: var(--font-body); }
.leaflet-popup-content-wrapper {
  border-radius: var(--r-lg) !important;
  box-shadow: var(--shadow-lg) !important;
}

/* ---------- FORM STYLES ------------------------------------ */
.form-page {
  max-width: 720px;
  margin: var(--sp-7) auto var(--sp-9);
  padding: 0 clamp(1.25rem, 4vw, 2rem);
}
.form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--sp-6) var(--sp-7);
}
@media (max-width: 600px) { .form-card { padding: var(--sp-5); } }

.form-title { font-size: var(--fs-h2); font-weight: 600; margin-bottom: var(--sp-5); }

.form-group { margin-bottom: var(--sp-5); }
.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin-bottom: var(--sp-2);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: 0.65rem 1rem;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--vrm-red);
  box-shadow: 0 0 0 3px rgba(227,6,19,0.18);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: var(--fs-small); color: var(--color-text-dim); margin-top: var(--sp-1); }

.checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-2);
}
.checkbox-item { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.checkbox-item input { accent-color: var(--vrm-red); }
.checkbox-item span { font-size: var(--fs-small); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ---------- ALERT / FLASH ---------------------------------- */
.alert {
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
  font-size: var(--fs-small);
  border: 1px solid transparent;
}
.alert--success { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.alert--error   { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.alert--info    { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.alert--warning { background: #fef3c7; color: #92400e; border-color: #fcd34d; }

/* ---------- ADMIN ------------------------------------------ */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - var(--nav-h));
}
@media (max-width: 768px) { .admin-layout { grid-template-columns: 1fr; } }

.admin-sidebar {
  background: var(--vrm-void);
  color: var(--vrm-snow);
  padding: var(--sp-5);
  border-right: 1px solid rgba(246,244,239,0.06);
}
.admin-sidebar h4 {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: rgba(246,244,239,0.35);
  margin-bottom: var(--sp-3);
  padding: 0 0.75rem;
}
.admin-nav-link {
  display: block;
  color: rgba(246,244,239,0.7);
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-sm);
  font-size: var(--fs-small);
  font-weight: 500;
  margin-bottom: var(--sp-1);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.admin-nav-link:hover, .admin-nav-link.active {
  background: rgba(246,244,239,0.08);
  color: var(--vrm-snow);
  text-decoration: none;
}

.admin-main { padding: var(--sp-6); background: var(--color-bg); }
.admin-main > h1 { font-size: var(--fs-h2); font-weight: 600; margin-bottom: var(--sp-5); }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.admin-table th {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--color-text-dim);
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  background: var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border);
}
.admin-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--color-border-soft);
  font-size: var(--fs-small);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover td { background: rgba(11,13,18,0.02); }

.admin-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* Stat cards */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}
.stat-card__num { font-size: 2rem; font-weight: 700; color: var(--color-text); line-height: 1; }
.stat-card__label {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin-top: var(--sp-1);
}

/* ---------- COMPANIES PAGE --------------------------------- */
.companies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-4);
  padding: var(--sp-6) 0 var(--sp-8);
}
.company-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.company-card h3 { font-size: var(--fs-h3); font-weight: 600; }
.company-card p { font-size: var(--fs-small); color: var(--color-text-muted); }
.company-card__meta {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin-top: auto;
}

/* ---------- CTA SECTION ------------------------------------ */
.cta-section {
  background: var(--vrm-void);
  color: var(--vrm-snow);
  padding: var(--sp-8) 0;
}
.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
}
.cta-inner h2 { font-size: var(--fs-h2); color: var(--vrm-snow); margin-bottom: var(--sp-2); }
.cta-inner p { color: rgba(246,244,239,0.55); max-width: 480px; font-size: var(--fs-small); }
@media (max-width: 700px) { .cta-inner { flex-direction: column; align-items: flex-start; } }

/* ---------- FOOTER ----------------------------------------- */
.site-footer {
  background: var(--vrm-void);
  color: rgba(246,244,239,0.6);
  margin-top: auto;
  padding-top: var(--sp-8);
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-6);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid rgba(246,244,239,0.08);
}
@media (max-width: 900px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-inner { grid-template-columns: 1fr; } }

.footer-brand .logo { margin-bottom: var(--sp-3); }
.footer-brand p { font-size: var(--fs-small); color: rgba(246,244,239,0.4); max-width: 280px; }

.footer-links h4 {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: rgba(246,244,239,0.3);
  margin-bottom: var(--sp-3);
}
.footer-links a {
  display: block;
  color: rgba(246,244,239,0.55);
  font-size: var(--fs-small);
  margin-bottom: var(--sp-2);
  transition: color var(--dur-fast);
}
.footer-links a:hover { color: var(--vrm-snow); text-decoration: none; }

.footer-bottom { padding: var(--sp-4) 0; }
.footer-bottom p {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-mono);
  color: rgba(246,244,239,0.28);
}

/* ---------- EMPTY STATE ------------------------------------ */
.empty-state {
  text-align: center;
  padding: var(--sp-9) var(--sp-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  color: var(--color-text-muted);
}
.empty-state h3 { font-size: var(--fs-h3); margin-bottom: var(--sp-2); color: var(--color-text); }
.empty-icon { font-size: 2.5rem; margin-bottom: var(--sp-3); display: block; }

/* ---------- AUTH PAGES ------------------------------------- */
.auth-page {
  max-width: 440px;
  margin: var(--sp-9) auto;
  padding: 0 1.25rem;
}
.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--sp-7) var(--sp-6);
}
.auth-title { font-size: var(--fs-h2); font-weight: 600; margin-bottom: var(--sp-5); }
.auth-footer { text-align: center; margin-top: var(--sp-4); font-size: var(--fs-small); color: var(--color-text-muted); }

/* ---------- BREADCRUMB ------------------------------------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: rgba(246,244,239,0.4);
  margin-bottom: var(--sp-3);
}
.breadcrumb a { color: rgba(246,244,239,0.5); }
.breadcrumb a:hover { color: var(--vrm-snow); text-decoration: none; }
.breadcrumb span { color: rgba(246,244,239,0.25); }

/* ---------- DASHBOARD CARDS -------------------------------- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-4); }
.dash-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}
.dash-card h3 { font-size: var(--fs-h3); font-weight: 600; margin-bottom: var(--sp-3); }

/* ---------- PRIVACY / LEGAL -------------------------------- */
.legal-page {
  max-width: 760px;
  margin: var(--sp-8) auto var(--sp-9);
  padding: 0 clamp(1.25rem, 4vw, 2rem);
}
.legal-page h1 { font-size: var(--fs-h2); margin-bottom: var(--sp-5); }
.legal-page h2 { font-size: var(--fs-h3); font-weight: 600; margin: var(--sp-6) 0 var(--sp-3); }
.legal-page p, .legal-page li { font-size: var(--fs-small); line-height: 1.75; color: var(--color-text-muted); margin-bottom: var(--sp-3); }
.legal-page address { font-style: normal; }

/* ---------- ERROR PAGE ------------------------------------- */
.error-page { text-align: center; padding: var(--sp-9) var(--sp-5); max-width: 480px; margin: 0 auto; }
.error-page__code { font-family: var(--font-mono); font-size: 6rem; font-weight: 700; color: var(--vrm-red); line-height: 1; }
.error-page h1 { font-size: var(--fs-h2); margin: var(--sp-3) 0 var(--sp-2); }
.error-page p { color: var(--color-text-muted); margin-bottom: var(--sp-5); }

/* ---------- UTILITIES -------------------------------------- */
.text-red   { color: var(--vrm-red) !important; }
.text-muted { color: var(--color-text-muted) !important; }
.text-mono  { font-family: var(--font-mono); }
.mt-auto    { margin-top: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ---------- IMAGE UPLOAD WIDGET ---------------------------- */
.image-upload-widget { padding: var(--sp-4); background: var(--color-surface-alt); border-radius: var(--r-lg); border: 1px solid var(--color-border); }
.image-upload-widget__preview { width: 120px; height: 120px; object-fit: cover; border-radius: var(--r-md); display: block; border: 2px solid var(--color-border); }
