/* ============================================================
   BROWSE.CSS — Browse Listings Page
   Phase 3: Search & Discovery — split-view, carousels, sliders
   ============================================================ */

/* ── Page transition ── */
body { opacity: 0; }
body.page-loaded { opacity: 1; transition: opacity 0.3s ease; }
body.page-exiting { opacity: 0; transition: opacity 0.2s ease; }

/* ── Nav ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 52px;
  background: rgba(247,242,234,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(196,98,45,0.08);
  position: sticky;
  top: 0;
  z-index: 200;
  transition: box-shadow 0.3s;
}
.nav-logo { font-family: var(--serif); font-size: 24px; color: var(--clay); font-weight: 700; text-decoration: none; letter-spacing: -0.04em; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { text-decoration: none; color: var(--ink); font-size: 13.5px; font-weight: 500; opacity: 0.65; transition: all 0.2s; }
.nav-links a:hover { opacity: 1; }
.nav-links a.active { opacity: 1; color: var(--clay); font-weight: 600; }
.nav-login { color: var(--clay) !important; opacity: 1 !important; padding: 8px 18px; border: 1.5px solid var(--clay); border-radius: 10px; font-weight: 600 !important; transition: all 0.2s !important; }
.nav-login:hover { background: var(--clay) !important; color: white !important; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; z-index: 210; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: all 0.3s cubic-bezier(0.16,1,0.3,1); }
nav.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
nav.nav-open .nav-toggle span:nth-child(2) { opacity: 0; transform: scaleX(0); }
nav.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
nav.nav-open .nav-links { display: flex !important; }


/* ================================================================
   PAGE HEADER
   ================================================================ */
.page-header { padding: 40px 52px 0; max-width: 1440px; margin: 0 auto; }
.page-header h1 { font-family: var(--serif); font-size: clamp(28px, 4vw, 40px); font-weight: 700; line-height: 1.08; letter-spacing: -0.03em; margin-bottom: 6px; }
.page-header h1 em { font-style: italic; color: var(--clay); }
.page-header p { font-size: 15px; color: var(--warm-grey); line-height: 1.5; }


/* ================================================================
   CAMPUS PICKER
   ================================================================ */
.campus-banner { max-width: 1440px; margin: 12px auto 0; padding: 0 52px; display: flex; align-items: center; gap: 10px; }
.campus-banner-pill { display: inline-flex; align-items: center; gap: 8px; background: white; border: 1.5px solid var(--sand); border-radius: 100px; padding: 7px 14px; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; transition: all 0.2s; font-family: var(--sans); }
.campus-banner-pill:hover { border-color: var(--clay); }
.campus-banner-pill .campus-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--clay); flex-shrink: 0; }
.campus-banner-change { font-size: 12px; color: var(--clay); font-weight: 600; background: none; border: none; cursor: pointer; font-family: var(--sans); padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.campus-banner-change:hover { opacity: 0.75; }

.card-distance { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--clay); background: rgba(196,98,45,0.08); border-radius: 6px; padding: 3px 8px; margin-left: 4px; }

/* Campus modal */
.campus-modal-overlay { position: fixed; inset: 0; background: rgba(26,22,18,0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 500; display: none; align-items: center; justify-content: center; padding: 24px; }
.campus-modal-overlay.open { display: flex; }
.campus-modal { background: white; border-radius: 20px; padding: 28px; width: 100%; max-width: 480px; max-height: 80vh; display: flex; flex-direction: column; gap: 16px; animation: slideUp 0.3s var(--ease-spring) both; }
.campus-modal-title { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.campus-search-input { width: 100%; padding: 11px 14px; border: 1.5px solid var(--sand); border-radius: 12px; font-size: 14px; font-family: var(--sans); background: var(--cream); color: var(--ink); outline: none; transition: border-color 0.2s; }
.campus-search-input:focus { border-color: var(--clay); background: white; }
.campus-list { overflow-y: auto; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.campus-option { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 10px; cursor: pointer; transition: background 0.15s; border: 1.5px solid transparent; font-family: var(--sans); background: none; width: 100%; text-align: left; }
.campus-option:hover { background: var(--cream); }
.campus-option.selected { border-color: var(--clay); background: rgba(196,98,45,0.05); }
.campus-option-name { font-size: 14px; font-weight: 500; color: var(--ink); }
.campus-option-city { font-size: 12px; color: var(--warm-grey); }
.campus-option-short { font-size: 11px; font-weight: 700; color: var(--clay); background: rgba(196,98,45,0.08); padding: 2px 8px; border-radius: 100px; }
.campus-modal-footer { display: flex; gap: 10px; padding-top: 4px; border-top: 1px solid var(--sand); }
.campus-clear-btn { flex: 1; padding: 10px; background: none; border: 1px solid var(--sand); border-radius: 10px; font-size: 13px; color: var(--warm-grey); cursor: pointer; font-family: var(--sans); transition: all 0.15s; }
.campus-clear-btn:hover { border-color: var(--warm-grey); color: var(--ink); }


/* ================================================================
   SEARCH + FILTERS
   ================================================================ */
.search-section { padding: 20px 52px 0; max-width: 1440px; margin: 0 auto; position: relative; }

.search-bar { display: flex; align-items: center; gap: 10px; background: white; border: 1.5px solid var(--sand); border-radius: 14px; padding: 11px 18px; transition: border-color 0.2s, box-shadow 0.2s; }
.search-bar:focus-within { border-color: var(--clay); box-shadow: 0 0 0 3px rgba(196,98,45,0.1); }
.search-bar input { flex: 1; border: none; outline: none; font-family: var(--sans); font-size: 15px; color: var(--ink); background: transparent; }
.search-bar input::placeholder { color: var(--warm-grey); }
.search-icon { font-size: 16px; flex-shrink: 0; }
.search-clear { background: none; border: none; cursor: pointer; font-size: 14px; color: var(--warm-grey); padding: 4px 6px; border-radius: 50%; transition: all 0.2s; display: none; }
.search-clear:hover { background: var(--sand); color: var(--ink); }

.filter-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.filter-select, .filter-btn {
  font-family: var(--sans); font-size: 13px; padding: 8px 14px; border: 1.5px solid var(--sand); border-radius: 10px;
  background: white; color: var(--ink); cursor: pointer; outline: none; transition: border-color 0.2s;
  -webkit-appearance: none; appearance: none;
}
.filter-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238C8278' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px;
}
.filter-btn { display: inline-flex; align-items: center; gap: 6px; }
.filter-btn svg { flex-shrink: 0; }
.filter-select:focus, .filter-btn:focus { border-color: var(--clay); }
.filter-select.has-value, .filter-btn.has-value { border-color: var(--clay); color: var(--clay); font-weight: 500; }


/* ── Filter Panels (dropdowns) ── */
.filter-panel {
  position: absolute; top: 100%; left: 52px; z-index: 100;
  background: white; border: 1.5px solid var(--sand); border-radius: 16px;
  padding: 20px; box-shadow: 0 12px 40px rgba(26,22,18,0.12);
  width: 320px; margin-top: 8px;
}
.filter-panel-actions { display: flex; justify-content: space-between; margin-top: 16px; }
.filter-panel-clear { background: none; border: none; color: var(--warm-grey); font-size: 13px; cursor: pointer; font-family: var(--sans); }
.filter-panel-clear:hover { color: var(--ink); }
.filter-panel-apply { background: var(--clay); color: white; border: none; padding: 8px 20px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--sans); }
.filter-panel-apply:hover { background: var(--clay-light); }


/* ── Price Histogram ── */
.price-histogram { display: flex; align-items: flex-end; gap: 2px; height: 44px; margin-bottom: 12px; }
.histo-bar { flex: 1; background: var(--sand); border-radius: 2px 2px 0 0; transition: background 0.2s; min-height: 2px; }


/* ── Dual Range Slider ── */
.range-slider-wrap { position: relative; height: 24px; margin: 8px 0; }
.range-slider-wrap input[type="range"] {
  position: absolute; top: 0; left: 0; width: 100%; height: 24px;
  -webkit-appearance: none; appearance: none; background: transparent;
  pointer-events: none; margin: 0;
}
.range-slider-wrap input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; background: var(--sand); border-radius: 2px;
}
.range-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--clay); border: 3px solid white; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  margin-top: -8px; pointer-events: auto; cursor: grab;
}
.range-slider-wrap input[type="range"]::-moz-range-track {
  height: 4px; background: var(--sand); border-radius: 2px; border: none;
}
.range-slider-wrap input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--clay); border: 3px solid white; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  cursor: grab;
}
.range-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--warm-grey); }


/* ── Commute Filter ── */
.commute-modes { display: flex; gap: 8px; margin-bottom: 12px; }
.commute-mode {
  flex: 1; padding: 8px; border: 1.5px solid var(--sand); border-radius: 8px;
  background: white; font-size: 13px; font-weight: 500; text-align: center;
  cursor: pointer; font-family: var(--sans); transition: all 0.2s;
}
.commute-mode:hover { border-color: var(--clay); }
.commute-mode.active { background: var(--clay); color: white; border-color: var(--clay); }

/* Commute range slider styling */
#commute-max, #drawer-commute-max {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 100px;
  background: linear-gradient(to right, var(--clay) 50%, var(--sand) 50%);
  outline: none; cursor: pointer;
}
#commute-max::-webkit-slider-thumb, #drawer-commute-max::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: white; border: 3px solid var(--clay);
  box-shadow: 0 2px 8px rgba(196,98,45,0.3);
  cursor: grab; transition: transform 0.15s var(--ease-spring);
}
#commute-max::-webkit-slider-thumb:hover, #drawer-commute-max::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
#commute-max::-webkit-slider-thumb:active, #drawer-commute-max::-webkit-slider-thumb:active {
  cursor: grabbing; transform: scale(1.1);
}
#commute-max::-moz-range-thumb, #drawer-commute-max::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: white; border: 3px solid var(--clay);
  box-shadow: 0 2px 8px rgba(196,98,45,0.3);
  cursor: grab;
}
#commute-max::-moz-range-track, #drawer-commute-max::-moz-range-track {
  height: 6px; background: var(--sand); border-radius: 100px; border: none;
}
#commute-max::-moz-range-progress, #drawer-commute-max::-moz-range-progress {
  height: 6px; background: var(--clay); border-radius: 100px;
}
.commute-label { text-align: center; font-size: 13px; color: var(--warm-grey); margin-top: 4px; }


/* ── Chips ── */
.chip-row { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 7px 14px; border-radius: 100px; font-size: 13px; font-weight: 500;
  color: var(--ink); background: white; border: 1.5px solid var(--sand);
  cursor: pointer; transition: all 0.2s; white-space: nowrap; font-family: var(--sans);
}
.chip:hover { border-color: var(--clay); color: var(--clay); }
.chip.active { background: var(--clay); color: white; border-color: var(--clay); }


/* ── Results Meta ── */
.results-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 13px; color: var(--warm-grey); }
.results-meta-right { display: flex; align-items: center; gap: 10px; }
.reset-btn { background: none; border: none; color: var(--clay); font-size: 13px; font-weight: 500; cursor: pointer; padding: 0; display: none; font-family: var(--sans); }
.reset-btn:hover { text-decoration: underline; }
.save-search-btn {
  background: none; border: 1.5px solid var(--sand); border-radius: 8px;
  padding: 6px 14px; font-size: 12px; font-weight: 600; color: var(--clay);
  cursor: pointer; font-family: var(--sans); transition: all 0.2s;
}
.save-search-btn:hover { border-color: var(--clay); background: var(--clay-pale); }
.mobile-map-btn { display: none; } /* shown at mobile breakpoint */


/* ================================================================
   BUILDINGS ROW
   ================================================================ */
#buildings-row-wrap { padding: 20px 52px 0; max-width: 1440px; margin: 0 auto; }
.buildings-row-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.buildings-row-label { font-size: 11px; font-weight: 700; color: var(--clay); letter-spacing: 0.1em; text-transform: uppercase; }
.buildings-row-seeall { font-size: 13px; font-weight: 600; color: var(--clay); text-decoration: none; }
.buildings-row-seeall:hover { text-decoration: underline; }
.buildings-row-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.buildings-row-scroll::-webkit-scrollbar { display: none; }
.brow-card { flex-shrink: 0; width: 200px; background: white; border: 1.5px solid var(--sand); border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: all 0.3s var(--ease-out); cursor: pointer; box-shadow: 0 2px 8px rgba(26,22,18,0.04); }
.brow-card:hover { border-color: transparent; box-shadow: 0 12px 36px rgba(26,22,18,0.1); transform: translateY(-4px); }
.brow-card-photo { width: 100%; height: 110px; background: var(--sand); overflow: hidden; flex-shrink: 0; }
.brow-card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.brow-card-name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow-card-addr { font-size: 11px; color: var(--warm-grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow-card-walk { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: #166534; background: #F0FDF4; border-radius: 100px; padding: 3px 8px; margin-top: 4px; width: fit-content; }
.brow-card-types { font-size: 11px; color: var(--warm-grey); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


/* ================================================================
   SPLIT VIEW LAYOUT
   ================================================================ */
.browse-split {
  display: flex;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 52px 80px;
  gap: 24px;
}

.browse-list {
  flex: 1;
  min-width: 0;
}

.browse-map {
  width: 42%;
  min-width: 360px;
  position: sticky;
  top: 80px;
  height: calc(100vh - 100px); height: calc(100dvh - 100px);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--sand);
  flex-shrink: 0;
}

.map-container {
  width: 100%;
  height: 100%;
}

.mobile-map-close { display: none; }


/* ── Search This Area ── */
.search-area-btn {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  background: white;
  border: 1.5px solid var(--sand);
  border-radius: 100px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--clay);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(26,22,18,0.12);
  font-family: var(--sans);
  transition: all 0.2s;
}
.search-area-btn:hover { border-color: var(--clay); background: var(--clay-pale); }


/* ── Listings Grid (inside split-view list panel) ── */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}


/* ================================================================
   LISTING CARD
   ================================================================ */
.listing-card {
  background: white;
  border: 1px solid var(--sand);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.3s;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: 0 2px 8px rgba(26,22,18,0.04);
}
.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(26,22,18,0.1), 0 4px 12px rgba(26,22,18,0.06);
  border-color: transparent;
}

.card-img-section { position: relative; }
.card-img-wrap { position: relative; height: 200px; overflow: hidden; background: var(--sand); }
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94); }
.listing-card:hover .card-img-wrap img { transform: scale(1.04); }
.card-img-wrap::after, .card-carousel::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.35), transparent); pointer-events: none; z-index: 1;
}

/* Badges */
.card-badges { position: absolute; top: 10px; left: 10px; z-index: 2; display: flex; flex-direction: column; gap: 4px; }
.card-badge {
  display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 10px; font-weight: 600;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); white-space: nowrap;
}
.badge-verified { background: rgba(255,255,255,0.92); color: var(--green); }
.badge-sublet { background: rgba(196,98,45,0.9); color: white; }
.badge-reviewed { background: rgba(255,251,235,0.95); color: #92400E; }
.badge-rented { background: rgba(0,0,0,0.7); color: #fff; font-weight: 600; }
.badge-yours { background: rgba(196,98,45,0.9); color: #fff; font-weight: 600; }
.badge-sample { background: rgba(255,255,255,0.8); color: #706760; border: 1px dashed #E8DDD0; }

/* Rented listing cards — greyed out overlay */
.listing-card.is-rented { opacity: 0.7; pointer-events: auto; }
.listing-card.is-rented .card-img-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.15);
  border-radius: inherit;
}

/* Review score in card footer */
.card-review-score { font-size: 12px; font-weight: 600; color: var(--clay); }
.card-review-count { font-weight: 400; color: var(--warm-grey); }

/* Save heart */
.card-save {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(255,255,255,0.85); border: none; width: 34px; height: 34px;
  border-radius: 50%; font-size: 18px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: all 0.2s;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.card-save:hover { background: white; transform: scale(1.12); }
.card-save.saved { color: var(--clay); }

/* Price badge */
.card-price-badge {
  position: absolute; bottom: 12px; left: 12px; z-index: 2;
  font-family: var(--serif); font-size: 17px; font-weight: 700;
  color: white; text-shadow: 0 1px 4px rgba(0,0,0,0.3); letter-spacing: -0.02em;
}
.card-price-badge small { font-family: var(--sans); font-weight: 400; font-size: 11px; opacity: 0.85; }

/* Card body */
.card-body { padding: 14px 16px 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 3px; color: var(--ink); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-loc { font-size: 12px; color: var(--warm-grey); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-proof { font-size: 11px; color: var(--clay); font-weight: 500; margin-bottom: 6px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.card-tag { font-size: 10px; padding: 3px 8px; border-radius: 100px; background: var(--cream); color: var(--warm-grey); white-space: nowrap; }
.card-footer { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--warm-grey); padding-top: 10px; border-top: 1px solid var(--sand); }
.card-cta { color: var(--clay); font-weight: 600; font-size: 12px; }


/* ================================================================
   CARD CAROUSEL (in-card photo swipe)
   ================================================================ */
.card-carousel {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: var(--sand);
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  height: 100%;
  -webkit-overflow-scrolling: touch;
}
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-slide {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 3;
}
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: all 0.2s;
}
.carousel-dot.active {
  background: white;
  transform: scale(1.2);
}

.carousel-prev, .carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  color: var(--ink);
  line-height: 1;
}
.listing-card:hover .carousel-prev,
.listing-card:hover .carousel-next { opacity: 1; }
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
.carousel-prev:hover, .carousel-next:hover { background: white; }


/* ================================================================
   MAP STYLES
   ================================================================ */
.map-pin {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  font-family: Inter, sans-serif;
  color: white;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: transform 0.15s, box-shadow 0.15s;
}

.map-cluster {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--clay);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  font-family: Inter, sans-serif;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  border: 3px solid white;
}

/* Map popup */
.map-popup { font-family: Inter, sans-serif; }
.map-popup-img { height: 100px; background-size: cover; background-position: center; border-radius: 8px; margin-bottom: 10px; }
.map-popup-body {}
.map-popup-title { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.map-popup-addr { font-size: 12px; color: var(--warm-grey); margin-bottom: 6px; }
.map-popup-price { font-size: 13px; color: var(--clay); font-weight: 600; margin-bottom: 8px; }
.map-popup-link { display: inline-block; padding: 6px 14px; background: var(--clay); color: white; border-radius: 8px; font-size: 12px; font-weight: 600; text-decoration: none; }
.map-popup-link:hover { background: var(--clay-dark); color: white; }


/* ================================================================
   LOADING SKELETONS
   ================================================================ */
.skeleton-card { background: white; border: 1px solid var(--sand); border-radius: 16px; overflow: hidden; }
.skeleton-img { height: 200px; background: linear-gradient(90deg, var(--sand) 25%, var(--cream) 50%, var(--sand) 75%); background-size: 200% 100%; animation: shimmer 1.5s ease infinite; }
.skeleton-body { padding: 14px 16px; }
.skeleton-line { height: 12px; background: var(--sand); border-radius: 6px; margin-bottom: 8px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.med { width: 80%; }

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }


/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state { text-align: center; padding: 60px 24px; grid-column: 1 / -1; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-title { font-family: var(--serif); font-size: 22px; margin-bottom: 8px; }
.empty-sub { font-size: 14px; color: var(--warm-grey); line-height: 1.6; margin-bottom: 20px; }


/* ================================================================
   MOBILE FILTER DRAWER (3G)
   ================================================================ */
.filter-drawer-overlay {
  position: fixed; inset: 0; background: rgba(26,22,18,0.5); z-index: 600;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.filter-drawer-overlay.open { opacity: 1; pointer-events: auto; }

.filter-drawer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 650;
  background: white; border-radius: 20px 20px 0 0;
  max-height: 85vh; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
  box-shadow: 0 -8px 40px rgba(26,22,18,0.12);
}
.filter-drawer.open { transform: translateY(0); }

.filter-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--sand);
}
.filter-drawer-title { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.filter-drawer-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--warm-grey); padding: 4px; }

.filter-drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-section { margin-bottom: 24px; }
.drawer-label { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 10px; display: block; }
.drawer-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.drawer-pill {
  padding: 8px 16px; border: 1.5px solid var(--sand); border-radius: 8px;
  background: white; font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: var(--sans); transition: all 0.2s;
}
.drawer-pill:hover { border-color: var(--clay); }
.drawer-pill.active { background: var(--clay); color: white; border-color: var(--clay); }
.drawer-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.filter-drawer-footer {
  display: flex; gap: 12px; padding: 16px 20px;
  border-top: 1px solid var(--sand); background: white;
}
.filter-drawer-clear {
  flex: 1; padding: 12px; background: none; border: 1.5px solid var(--sand);
  border-radius: 10px; font-size: 14px; cursor: pointer; font-family: var(--sans); color: var(--warm-grey);
}
.filter-drawer-apply {
  flex: 2; padding: 12px; background: var(--clay); color: white; border: none;
  border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: var(--sans);
}
.filter-drawer-apply:hover { background: var(--clay-light); }


/* ── Mobile Sticky Filter Bar ── */
.mobile-filter-bar {
  display: none; /* shown at mobile breakpoint */
  position: sticky; top: 56px; z-index: 150;
  background: rgba(247,242,234,0.95); backdrop-filter: blur(8px);
  padding: 10px 16px; gap: 10px;
  border-bottom: 1px solid var(--sand);
}
.mobile-filter-trigger {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; border: 1.5px solid var(--sand); border-radius: 10px;
  background: white; font-size: 14px; font-weight: 500; cursor: pointer;
  font-family: var(--sans);
}
.mobile-filter-count {
  background: var(--clay); color: white; font-size: 11px; font-weight: 700;
  width: 20px; height: 20px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
}
.mobile-filter-bar .mobile-map-btn {
  padding: 10px 20px; border: 1.5px solid var(--sand); border-radius: 10px;
  background: white; font-size: 14px; font-weight: 500; cursor: pointer; font-family: var(--sans);
}


/* ================================================================
   FOOTER
   ================================================================ */
footer { background: var(--gradient-dark); border-top: 4px solid var(--clay); color: rgba(255,255,255,0.5); }


/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  .browse-map { width: 38%; min-width: 300px; }
  .listings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  nav { padding: 14px 16px; }
  .nav-links {
    display: none; position: absolute; top: 56px; left: 0; right: 0;
    background: rgba(247,242,234,0.98); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--sand); flex-direction: column; padding: 16px; gap: 12px;
    box-shadow: 0 8px 32px rgba(26,22,18,0.08);
  }
  .nav-toggle { display: flex; }

  .page-header { padding: 24px 16px 0; }
  .page-header h1 { font-size: 24px; }
  .campus-banner { padding: 0 16px; }

  /* Hide desktop search/filters, show mobile bar */
  .search-section { display: none; }
  .mobile-filter-bar { display: flex; }

  /* Split view → stacked, map hidden by default */
  .browse-split { flex-direction: column; height: auto; padding: 0 16px; gap: 0; min-height: auto; }
  .browse-list { overflow: visible; padding-right: 0; }
  .browse-map { display: none; width: 100%; min-width: 0; height: 0; border: none; }
  .browse-map.mobile-fullscreen {
    display: block; position: fixed; inset: 0; z-index: 500;
    width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; border: none;
  }
  .browse-map.mobile-fullscreen .mobile-map-close {
    display: block; position: absolute; top: 16px; left: 16px; z-index: 600;
    background: white; border: 1.5px solid var(--sand); border-radius: 10px;
    padding: 8px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
    font-family: var(--sans); box-shadow: 0 4px 16px rgba(26,22,18,0.12);
  }

  .listings-grid { grid-template-columns: 1fr; gap: 16px; }
  .card-carousel, .card-img-wrap { height: 200px; }

  /* Hide carousel arrows on mobile (touch swipe) */
  .carousel-prev, .carousel-next { display: none; }

  #buildings-row-wrap { padding: 12px 16px 0; }

  /* Filter panel repositioning */
  .filter-panel { left: 16px; right: 16px; width: auto; }
}

@media (max-width: 480px) {
  .page-header h1 { font-size: 22px; }
  .card-carousel, .card-img-wrap { height: 180px; }
  .chip { padding: 6px 12px; font-size: 12px; }
}

/* Universal fixes */
input, textarea, select { -webkit-appearance: none; }
* { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
