:root {
  color-scheme: light;
  --page: #f7f8f5;
  --surface: #ffffff;
  --surface-alt: #eef3f0;
  --ink: #1d2522;
  --muted: #66736e;
  --line: #dbe2dd;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --later: #9a5a13;
  --later-bg: #fff3df;
  --now-bg: #e6f7f2;
  --reserved: #6b4ea2;
  --reserved-bg: #f0ebff;
  --sold: #9b1c1c;
  --sold-bg: #fee2e2;
  --shadow: 0 14px 34px rgba(31, 41, 37, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  background: #23332f;
  color: #fff;
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  margin: 0 0 5px;
  color: #b8d7cf;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.header-note {
  display: grid;
  gap: 6px;
  min-width: 260px;
  color: #dceae6;
  font-size: 0.96rem;
  text-align: right;
  overflow-wrap: anywhere;
}

.header-note a,
.site-footer a,
.pickup-note a {
  color: inherit;
  font-weight: 850;
}

.app-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 24px 30px;
}

.controls-panel {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 248, 245, 0.96);
  padding: 12px 0 16px;
  backdrop-filter: blur(10px);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.summary-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-height: 74px;
}

.summary-box strong {
  display: block;
  font-size: 1.35rem;
}

.summary-box span {
  color: var(--muted);
  font-size: 0.86rem;
}

.controls-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.search-wrap {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.search-wrap input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

.search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.filter-group {
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(74px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.filter-button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.filter-button.active {
  background: var(--accent);
  color: #fff;
}

.sale-info {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(420px, 1.25fr);
  gap: 18px;
  align-items: stretch;
  margin: 2px 0 18px;
  padding: 16px 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.contact-panel,
.pickup-area-copy {
  display: grid;
  align-content: center;
  gap: 8px;
}

.info-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.contact-panel a {
  color: var(--accent-strong);
  font-size: 1.2rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.contact-panel p,
.pickup-area-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.pickup-policy {
  color: #33423d;
  font-weight: 700;
}

.pickup-area-copy strong {
  font-size: 1.15rem;
}

.pickup-area-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(260px, 1.25fr);
  gap: 14px;
  align-items: stretch;
}

.map-frame {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  min-height: 220px;
  border: 0;
  filter: saturate(0.9) contrast(0.98);
}

.map-circle {
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(24%, 110px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(15, 118, 110, 0.82);
  border-radius: 50%;
  background: rgba(15, 118, 110, 0.16);
  box-shadow: 0 0 0 999px rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.map-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  min-height: 28px;
  border-radius: 999px;
  padding: 6px 10px;
  color: #fff;
  background: rgba(35, 51, 47, 0.9);
  font-size: 0.8rem;
  font-weight: 850;
  pointer-events: none;
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(310px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.item-list-panel,
.detail-panel {
  min-width: 0;
}

.item-list-panel {
  position: sticky;
  top: 154px;
  max-height: calc(100vh - 174px);
  overflow: auto;
  padding-right: 2px;
}

.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.list-heading h2 {
  margin: 0;
  font-size: 1rem;
}

#resultCount {
  color: var(--muted);
  font-size: 0.9rem;
}

.item-list {
  display: grid;
  gap: 10px;
}

.list-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface);
  color: inherit;
  text-align: left;
}

.list-item:hover,
.list-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.list-item.sold-item {
  border-color: #efcaca;
  background: #fff8f8;
}

.list-item.sold-item .price,
.detail-card.sold-item .detail-price strong {
  text-decoration: line-through;
  color: var(--muted);
}

.list-thumb-wrap {
  position: relative;
  display: block;
  width: 92px;
  height: 94px;
}

.list-thumb {
  width: 92px;
  height: 94px;
  border-radius: 6px;
  object-fit: contain;
  background: #f1f4f2;
}

.sold-ribbon {
  position: absolute;
  left: 6px;
  top: 6px;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 8px;
  color: #fff;
  background: rgba(155, 28, 28, 0.92);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.list-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
  align-content: start;
}

.list-name {
  font-weight: 850;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.price {
  color: var(--ink);
  font-weight: 900;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
}

.badge.now {
  background: var(--now-bg);
  color: var(--accent-strong);
}

.badge.later {
  background: var(--later-bg);
  color: var(--later);
}

.badge.reserved {
  background: var(--reserved-bg);
  color: var(--reserved);
}

.badge.sold {
  background: var(--sold-bg);
  color: var(--sold);
}

.detail-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.detail-media {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  background: #111816;
}

.main-photo-wrap {
  position: relative;
  min-height: 400px;
  display: grid;
  place-items: center;
  background: #111816;
}

.main-photo {
  width: 100%;
  max-height: min(70vh, 720px);
  object-fit: contain;
  display: block;
  background: #111816;
}

.photo-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  min-height: 30px;
  border-radius: 999px;
  padding: 6px 10px;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  font-size: 0.82rem;
  font-weight: 800;
}

.detail-sold-overlay {
  position: absolute;
  left: 16px;
  top: 16px;
  min-height: 40px;
  border-radius: 999px;
  padding: 10px 16px;
  color: #fff;
  background: rgba(155, 28, 28, 0.94);
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: var(--shadow);
}

.thumb-strip {
  display: flex;
  gap: 8px;
  padding: 10px;
  overflow-x: auto;
  background: #1b2522;
}

.detail-thumb {
  width: 86px;
  height: 64px;
  flex: 0 0 auto;
  border: 2px solid transparent;
  border-radius: 6px;
  object-fit: contain;
  background: #f1f4f2;
}

.detail-thumb-button {
  flex: 0 0 auto;
  width: 86px;
  height: 64px;
  border: 0;
  border-radius: 6px;
  padding: 0;
  background: transparent;
}

.detail-thumb.active {
  border-color: #9be0d1;
}

.detail-body {
  display: grid;
  gap: 22px;
  padding: 22px;
}

.detail-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.detail-title-row h2 {
  margin: 0 0 10px;
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.detail-price {
  min-width: 116px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-alt);
  text-align: right;
}

.detail-price strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1;
}

.detail-price span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.detail-summary {
  margin: 0;
  color: #3c4944;
  font-size: 1.04rem;
  line-height: 1.6;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.fact {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfa;
}

.fact span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.fact strong {
  overflow-wrap: anywhere;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 850;
  text-decoration: none;
}

.action-button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.pickup-note {
  border-left: 4px solid var(--accent);
  padding: 12px 14px;
  background: var(--surface-alt);
  color: #33423d;
  line-height: 1.45;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--surface);
}

.site-footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px 30px;
  color: var(--muted);
  font-size: 0.94rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 100;
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  background: #263531;
  box-shadow: var(--shadow);
}

@media (max-width: 880px) {
  .header-inner,
  .controls-row,
  .sale-info,
  .pickup-area-panel,
  .catalog-layout,
  .detail-title-row,
  .detail-facts {
    grid-template-columns: 1fr;
  }

  .header-inner {
    align-items: start;
    flex-direction: column;
  }

  .header-note {
    min-width: 0;
    width: 100%;
    text-align: left;
  }

  .controls-panel {
    position: static;
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sale-info {
    gap: 14px;
  }

  .item-list-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .detail-price {
    text-align: left;
  }

  .main-photo-wrap {
    min-height: 290px;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .app-shell,
  .site-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .map-frame,
  .map-frame iframe {
    min-height: 210px;
  }

  .filter-group {
    grid-template-columns: 1fr 1fr;
  }

  .list-item {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .list-thumb {
    width: 84px;
    height: 90px;
  }

  .list-thumb-wrap {
    width: 84px;
    height: 90px;
  }

  .detail-body {
    padding: 16px;
  }
}
