/* =========================================================================
   Garment District Interactive Map — prototype styles
   Brand palette sampled from garmentdistrict.nyc
   ========================================================================= */
:root {
  --gda-ink:      #232323;
  --gda-ink-soft: #555555;
  --gda-paper:    #ffffff;
  --gda-paper-2:  #f7f4f2;
  --gda-line:     #e3ddd8;

  --gda-orange:   #e87722;
  --gda-magenta:  #e31c79;
  --gda-green:    #84bd00;

  --gda-accent:   var(--gda-magenta);
  --panel-w:      364px;
  --radius:       12px;
  --shadow:       0 2px 14px rgba(35, 35, 35, .12);
  --focus:        #1158d4;

  --font-sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font-sans);
  color: var(--gda-ink);
  background: var(--gda-paper-2);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Skip link --------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 2000;
  background: var(--gda-ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* Global focus visibility ------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* =========================== Layout ====================================== */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.panel {
  flex: 0 0 var(--panel-w);
  width: var(--panel-w);
  height: 100vh;
  background: var(--gda-paper);
  border-right: 1px solid var(--gda-line);
  display: flex;
  flex-direction: column;
  z-index: 1100;
}
.panel__inner {
  overflow-y: auto;
  flex: 1 1 auto;
  padding: 0 20px 20px;
}

.map-wrap {
  position: relative;
  flex: 1 1 auto;
  height: 100vh;
}
#map {
  position: absolute;
  inset: 0;
  background: #eae6e1;
}

.map-loading {
  position: absolute;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  background: rgba(35,35,35,.9);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: .85rem;
}

/* =========================== Panel header ================================ */
.panel__header {
  position: sticky;
  top: 0;
  background: var(--gda-paper);
  padding: 18px 0 14px;
  border-bottom: 2px solid var(--gda-ink);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  z-index: 2;
}
.brandmark { margin: 0; line-height: 1.1; }
.brandmark__name {
  display: block;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -.01em;
  text-transform: uppercase;
}
.brandmark__sub {
  display: block;
  font-size: .82rem;
  color: var(--gda-ink-soft);
  margin-top: 3px;
}
.prototype-badge {
  margin: 0;
  flex: none;
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #fff;
  background: var(--gda-magenta);
  padding: 4px 8px;
  border-radius: 6px;
}

/* =========================== Sections =================================== */
.panel__section { padding: 16px 0; border-bottom: 1px solid var(--gda-line); }
.panel__heading {
  margin: 0 0 10px;
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gda-ink-soft);
}

/* Search ------------------------------------------------------------------ */
.search { position: relative; display: flex; }
.search__input {
  width: 100%;
  padding: 10px 34px 10px 12px;
  font-size: .95rem;
  border: 1.5px solid var(--gda-line);
  border-radius: 8px;
  background: var(--gda-paper-2);
  color: var(--gda-ink);
}
.search__input:focus {
  border-color: var(--gda-accent);
  background: #fff;
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}
.search__clear {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  border: 0; background: transparent;
  font-size: 1.4rem; line-height: 1;
  color: var(--gda-ink-soft);
  cursor: pointer;
  padding: 0 8px;
  border-radius: 6px;
}
.search__status {
  margin: 8px 2px 0;
  font-size: .8rem;
  color: var(--gda-ink-soft);
  min-height: 1.1em;
}

/* Layers / legend --------------------------------------------------------- */
.layers { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.layer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
}
.layer:hover { background: var(--gda-paper-2); }
.layer__input {
  flex: none;
  width: 18px; height: 18px;
  accent-color: var(--gda-accent);
  cursor: pointer;
}
.layer__label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  cursor: pointer;
  font-size: .92rem;
}
.layer__text { flex: 1 1 auto; min-width: 0; }
.layer__tag {
  display: inline-block;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  vertical-align: middle;
  color: var(--gda-ink-soft);
  background: var(--gda-paper-2);
  border: 1px solid var(--gda-line);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 2px;
}
.layer__tag--real { color: #2f6a17; background: #eef6e3; border-color: #cfe6b3; }
.layer__count {
  flex: none;
  min-width: 1.6em;
  text-align: right;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  color: var(--gda-ink-soft);
}
.layers__hint {
  margin: 10px 2px 0;
  font-size: .78rem;
  color: var(--gda-ink-soft);
}

/* About ------------------------------------------------------------------- */
.about__summary {
  cursor: pointer;
  font-weight: 700;
  font-size: .9rem;
  padding: 4px 2px;
  list-style: none;
}
.about__summary::before { content: "ⓘ "; color: var(--gda-magenta); }
.about__summary::-webkit-details-marker { display: none; }
.about__body { font-size: .85rem; color: var(--gda-ink-soft); line-height: 1.5; }
.about__body p { margin: 10px 0; }

/* Footer ------------------------------------------------------------------ */
.panel__footer {
  padding: 14px 0 4px;
  font-size: .75rem;
  color: var(--gda-ink-soft);
}
.panel__footer-data { display: block; margin-top: 4px; opacity: .85; }

/* ====================== Markers & legend swatches ======================= */
.gda-divicon { background: transparent; border: 0; }
.gda-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  background: var(--mk);
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  border: 2px solid #fff;
}
.gda-marker svg { width: 60%; height: 60%; fill: #fff; }

/* Distinct shapes so colour is never the only differentiator */
.gda-marker--circle  { border-radius: 50%; }
.gda-marker--square  { border-radius: 6px; }
.gda-marker--diamond { clip-path: polygon(50% 1%, 99% 50%, 50% 99%, 1% 50%); border: 0; }
.gda-marker--diamond svg { width: 52%; height: 52%; }
.gda-marker--pin     { clip-path: polygon(50% 100%, 6% 56%, 6% 6%, 94% 6%, 94% 56%); border: 0; border-radius: 4px; }
.gda-marker--pin svg { width: 52%; height: 52%; transform: translateY(-2px); }

/* Legend swatches reuse the marker shapes at a smaller size */
.layer__swatch {
  flex: none;
  width: 24px; height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--mk);
  box-shadow: none;
  border: 2px solid #fff;
  outline: 1px solid rgba(0,0,0,.08);
}
.layer__swatch svg { width: 62%; height: 62%; fill: #fff; }
.layer__swatch.gda-marker--diamond,
.layer__swatch.gda-marker--pin { outline: 0; }

/* ============================== Popups =================================== */
.gda-popup .leaflet-popup-content-wrapper {
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.gda-popup .leaflet-popup-content { margin: 12px 14px; }
.popup__title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--gda-ink);
}
.popup__meta { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
.popup__meta dt {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gda-ink-soft);
  padding-top: 2px;
}
.popup__meta dd { margin: 0; font-size: .88rem; color: var(--gda-ink); }
.popup__badge {
  display: inline-block;
  margin-top: 10px;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
}
.popup__badge--sample { color: #8a2b00; background: #fdeede; border: 1px solid #f4cfa6; }
.popup__badge--real   { color: #2f6a17; background: #eef6e3; border: 1px solid #cfe6b3; }

/* ====================== Mobile bottom-sheet handle ====================== */
.sheet-toggle { display: none; }

/* =============================== Mobile ================================= */
@media (max-width: 768px) {
  .app { flex-direction: column; }

  .map-wrap { height: 100vh; }

  .panel {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    width: auto;
    height: auto;
    max-height: 76vh;
    flex: none;
    border-right: 0;
    border-top: 1px solid var(--gda-line);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,.18);
    transition: transform .25s ease;
  }
  .panel--collapsed { transform: translateY(calc(100% - 56px)); }

  .panel__inner { padding: 0 18px 24px; max-height: calc(76vh - 56px); }

  .sheet-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 56px;
    order: -1;
    background: var(--gda-paper);
    border: 0;
    border-radius: 16px 16px 0 0;
    cursor: pointer;
    font-weight: 700;
    font-size: .9rem;
    color: var(--gda-ink);
  }
  .sheet-toggle__grip {
    position: absolute;
    top: 8px; left: 50%;
    transform: translateX(-50%);
    width: 44px; height: 5px;
    border-radius: 3px;
    background: var(--gda-line);
  }
  .panel__header { position: static; padding-top: 6px; }

  .map-loading { top: 12px; }
  .leaflet-bottom.leaflet-right { margin-bottom: 60px; } /* clear the sheet handle */
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .panel, .skip-link { transition: none; }
}
