/* ==========================================================
   Merkiplatz — Warm boutique salon marketplace
   ========================================================== */

:root {
  /* Cream/parchment surface system */
  --bg: #faf6ee;
  --bg-elev: #ffffff;
  --bg-soft: #f3ecdd;
  --bg-warm: #efe7d4;
  --line: #e6dcc6;
  --line-soft: #efe7d3;

  /* Espresso ink scale */
  --ink-1: #1a120b;
  --ink-2: #3a2a1f;
  --ink-3: #5b4636;
  --ink-4: #856e58;
  --ink-5: #a89379;
  --ink-6: #c7b598;

  /* Accent (espresso default) */
  --accent: #3a2a1f;
  --accent-hover: #4d3829;
  --accent-soft: #efe7d3;
  --accent-ink: #faf6ee;

  --highlight: #c8612b;       /* terracotta — for ratings, availability dots */
  --highlight-soft: #f7e6d6;
  --gold: #b8893a;            /* star color */
  --success: #6b8a4d;
  --map-ratio: 42%;
  --list-ratio: 58%;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(58, 42, 31, 0.04), 0 1px 1px rgba(58, 42, 31, 0.02);
  --shadow-md: 0 4px 12px rgba(58, 42, 31, 0.06), 0 1px 3px rgba(58, 42, 31, 0.04);
  --shadow-lg: 0 12px 32px rgba(58, 42, 31, 0.10), 0 4px 8px rgba(58, 42, 31, 0.05);
  --shadow-pop: 0 18px 40px rgba(58, 42, 31, 0.14), 0 6px 14px rgba(58, 42, 31, 0.08);

  --serif: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --sans: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SF Mono, monospace;

  --header-h: 68px;
}

[data-accent="terracotta"] {
  --accent: #b65a2e;
  --accent-hover: #a04d24;
  --accent-soft: #f6e3d2;
}
[data-accent="olive"] {
  --accent: #5a6b3f;
  --accent-hover: #4a5934;
  --accent-soft: #e8e9d4;
}
[data-accent="ink"] {
  --accent: #1a120b;
  --accent-hover: #2a1e14;
}

/* ==========================================================
   Base
   ========================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink-1);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font: inherit; color: inherit; }
input::placeholder { color: var(--ink-5); }
a { color: inherit; text-decoration: none; }

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================
   Header
   ========================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  height: var(--header-h);
}
.header-inner {
  max-width: 1480px;
  margin: 0 auto;
  height: 100%;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 48px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  height: 44px;
  width: 44px;
  display: block;
  border-radius: 8px;
  pointer-events: none;
}
.nav-primary {
  display: flex;
  gap: 28px;
  flex: 1;
}
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
  padding: 6px 0;
  position: relative;
  transition: color 0.15s ease;
}
.nav-link:hover { color: var(--ink-1); }
.nav-link.active { color: var(--ink-1); }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1.5px;
  background: var(--accent);
}
.nav-secondary {
  display: flex;
  align-items: center;
  gap: 18px;
}
.lang-pill {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  padding: 6px 10px;
  border-radius: 20px;
  border: 1px solid var(--line);
  letter-spacing: 0.04em;
}
.lang-pill:hover { background: var(--bg-soft); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-secondary {
  background: var(--bg-elev);
  color: var(--ink-1);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: var(--bg-soft); }

/* ==========================================================
   Search hero
   ========================================================== */
.search-hero {
  background: var(--bg);
  padding: 36px 32px 24px;
}
.search-bar {
  max-width: 1480px;
  margin: 0 auto;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  align-items: center;
  padding: 8px 8px 8px 4px;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.search-bar:focus-within {
  box-shadow: var(--shadow-lg);
  border-color: var(--ink-5);
}
.search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 22px;
  color: var(--ink-4);
}
.search-field input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--ink-1);
  padding: 6px 0;
}
.search-divider {
  width: 1px;
  height: 28px;
  background: var(--line);
}
.search-submit {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
  flex-shrink: 0;
}
.search-submit:hover { background: var(--accent-hover); }

/* ==========================================================
   Category chips
   ========================================================== */
.cat-rail {
  background: var(--bg);
  padding: 8px 32px 20px;
  border-bottom: 1px solid var(--line);
}
.cat-rail-inner {
  max-width: 1480px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-rail-inner::-webkit-scrollbar { display: none; }
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition: all 0.15s ease;
}
.cat-chip:hover {
  border-color: var(--ink-5);
  transform: translateY(-1px);
}
.cat-chip.is-active {
  background: var(--ink-1);
  color: var(--bg);
  border-color: var(--ink-1);
}
.cat-chip-icon {
  font-size: 13px;
  opacity: 0.7;
}
.cat-chip.is-active .cat-chip-icon { opacity: 1; }

/* ==========================================================
   Layout
   ========================================================== */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: var(--list-ratio) var(--map-ratio);
  max-width: 1480px;
  margin: 0 auto;
  width: 100%;
  padding: 0 32px;
  gap: 0;
  min-height: 0;
}
.list-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-right: 24px;
}
.map-pane {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  padding: 24px 0 32px;
}

/* ==========================================================
   Filter bar
   ========================================================== */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 16px;
  gap: 16px;
  flex-wrap: wrap;
}
.filter-left { display: flex; align-items: center; gap: 16px; }
.result-count {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink-1);
}
.result-count strong {
  font-weight: 600;
  font-style: italic;
}
.filter-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-divider {
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 4px;
}

.fdrop { position: relative; }
.fdrop-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.fdrop-trigger:hover { border-color: var(--ink-5); }
.fdrop.is-open .fdrop-trigger { border-color: var(--ink-3); background: var(--bg-soft); }
.fdrop.is-set .fdrop-trigger { background: var(--ink-1); color: var(--bg); border-color: var(--ink-1); }
.fdrop--bare .fdrop-trigger {
  background: transparent;
  border: none;
  color: var(--ink-3);
  padding: 8px 10px;
}
.fdrop--bare .fdrop-trigger:hover { background: var(--bg-soft); border: none; }
.fdrop--bare.is-open .fdrop-trigger { background: var(--bg-soft); color: var(--ink-1); }

.fdrop-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 180px;
  z-index: 30;
  animation: fdrop-in 0.15s ease;
}
@keyframes fdrop-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.fdrop-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--ink-2);
  text-align: left;
}
.fdrop-opt:hover { background: var(--bg-soft); }
.fdrop-opt.is-selected { color: var(--ink-1); font-weight: 500; }

/* ==========================================================
   Salon cards
   ========================================================== */
.list-scroll {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 48px;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-6) transparent;
}
.list-scroll::-webkit-scrollbar { width: 8px; }
.list-scroll::-webkit-scrollbar-thumb { background: var(--ink-6); border-radius: 4px; }
.list-scroll::-webkit-scrollbar-track { background: transparent; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

[data-density="compact"] .card-grid { gap: 16px; }

.salon-card {
  background: var(--bg-elev);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.salon-card:hover, .salon-card.is-hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-pop);
  border-color: var(--ink-5);
}
.salon-card.is-focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-pop);
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.card-img {
  width: 100%;
  height: 100%;
  display: block;
}
.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--bg);
  color: var(--ink-1);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 5px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}
.card-fav {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  transition: all 0.15s ease;
}
.card-fav:hover { background: rgba(255, 255, 255, 1); transform: scale(1.06); }
.card-fav.is-on { color: #c8612b; }

.card-media-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}
.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
}
.dot.is-on { background: #fff; width: 16px; border-radius: 3px; }

.card-body {
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
[data-density="compact"] .card-body { padding: 14px 14px 12px; gap: 6px; }

.card-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-cat {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.card-rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-1);
}
.card-reviews { color: var(--ink-4); font-weight: 400; }

.star-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--gold);
  font-size: 13.5px;
}
.star-row strong { color: var(--ink-1); font-weight: 600; }

.card-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 2px 0;
  color: var(--ink-1);
  line-height: 1.15;
}
[data-density="compact"] .card-title { font-size: 18px; }

.card-addr {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--ink-4);
  margin: 0;
}
.card-addr svg { flex-shrink: 0; opacity: 0.7; }
.card-distance { color: var(--ink-5); }

.card-services {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.service-pill {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--bg-soft);
  color: var(--ink-2);
  border-radius: 999px;
  font-weight: 500;
}
[data-density="compact"] .card-services { display: none; }

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.card-avail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
}
.card-avail svg { color: var(--ink-4); }
.avail-text { color: var(--ink-1); }
.avail-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-5);
}
.avail-dot.is-on {
  background: #6b8a4d;
  box-shadow: 0 0 0 3px rgba(107, 138, 77, 0.18);
}
.card-price {
  font-size: 13px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================
   Empty state
   ========================================================== */
.empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--ink-3);
}
.empty-mark {
  font-family: var(--serif);
  font-size: 56px;
  color: var(--ink-6);
  margin-bottom: 8px;
}
.empty h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 8px;
  color: var(--ink-1);
}
.empty p { margin: 0 0 20px; font-size: 14px; }

/* ==========================================================
   Map
   ========================================================== */
.map-wrap {
  position: relative;
  height: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  background: #f3ead9;
}
.map-canvas {
  position: absolute;
  inset: 0;
  transition: transform 0.3s ease;
  transform-origin: center;
}
.map-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  z-index: 5;
  filter: drop-shadow(0 4px 8px rgba(58, 42, 31, 0.18));
  transition: transform 0.18s ease, z-index 0s;
}
.map-pin:hover, .map-pin.is-hover {
  z-index: 8;
  transform: translate(-50%, -100%) scale(1.12);
}
.map-pin.is-focused {
  z-index: 10;
}
.pin-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: var(--bg-elev);
  border: 1.5px solid var(--ink-1);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-1);
  white-space: nowrap;
}
.pin-bubble svg { color: var(--gold); }
.map-pin.is-hover .pin-bubble,
.map-pin.is-focused .pin-bubble {
  background: var(--ink-1);
  color: var(--bg);
}
.map-pin.is-hover .pin-bubble svg,
.map-pin.is-focused .pin-bubble svg { color: var(--gold); }

.pin-tail {
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--ink-1);
  margin-top: -1px;
}

.map-popup {
  position: absolute;
  transform: translate(-50%, calc(-100% - 16px));
  width: 280px;
  background: var(--bg-elev);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  z-index: 12;
  overflow: hidden;
  animation: pop-in 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes pop-in {
  from { opacity: 0; transform: translate(-50%, calc(-100% - 8px)); }
  to { opacity: 1; transform: translate(-50%, calc(-100% - 16px)); }
}
.map-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 2;
  color: var(--ink-2);
}
.map-popup-close:hover { background: #fff; }
.map-popup-img {
  height: 130px;
  overflow: hidden;
}
.map-popup-body {
  padding: 12px 14px 14px;
}
.map-popup-cat {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 4px;
}
.map-popup-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink-1);
  margin-bottom: 4px;
}
.map-popup-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.map-popup-reviews { color: var(--ink-4); }
.map-popup-sep { color: var(--ink-5); }
.map-popup-cta {
  width: 100%;
  background: var(--ink-1);
  color: var(--bg);
  padding: 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease;
}
.map-popup-cta:hover { background: var(--ink-2); }

.map-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
  z-index: 3;
}
.map-controls button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.map-controls button:last-child { border-bottom: none; }
.map-controls button:hover { background: var(--bg-soft); color: var(--ink-1); }

.map-overlay-tag {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-md);
  z-index: 3;
}
.map-overlay-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6b8a4d;
  box-shadow: 0 0 0 3px rgba(107, 138, 77, 0.2);
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1100px) {
  .card-grid { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; }
  .map-pane { display: none; }
  .list-pane { padding-right: 0; }
  .nav-primary { display: none; }
}

/* Tweaks panel default chrome (when our custom panel doesn't override) */
.tweaks-fab { background: var(--accent) !important; color: var(--accent-ink) !important; }
