body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: #f8f9fa;
}

/* FULL-WIDTH layout */
#container {
  display: grid;
  grid-template-columns: 380px 1fr; /* sidebar + map */
  gap: 16px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
}

/* Sidebar */
#stockist-list {
  width: 100%;
  /* was clamp(560px, 70vh, 900px) — felt too short on large screens */
  height: clamp(680px, 78vh, 1100px);
  background-color: #ffffff;
  box-shadow: 2px 0 6px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid #eee;
}

#stockist-list h2 {
  margin-top: 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

#stockist-list input,
#stockist-list select {
  margin-bottom: 10px;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  background: white;
  appearance: none;
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 15px;
}

#use-location,
#clear-filters {
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}

:root { --brand: #CDEB25; }

#use-location {
  background-color: var(--brand);
  color: #000;
}

#use-location:hover { background-color: #b5d81f; }

#clear-filters {
  background-color: #e9eef3;
  color: #222;
}

#clear-filters:hover { background-color: #d6dde4; }

#stockist-entries {
  overflow-y: auto;
  flex-grow: 1;
}

#stockist-entries .stockist {
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid #eee;
  background-color: #fafafa;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}

#stockist-entries .stockist:hover { background-color: #f1f1f1; }

/* Map + sidebar should both fill the available height */
#map {
  width: 100%;
  /* was clamp(560px, 70vh, 900px) */
  height: clamp(680px, 78vh, 1100px);
  border-radius: 12px;
  background: #f4f6f8;
  overflow: hidden;
}

/* ========= Responsive ========= */

/* Tablet and down */
@media (max-width: 1024px) {
  #container {
    grid-template-columns: 1fr; /* stack */
    gap: 12px;
    padding: 16px;
  }

  #stockist-list {
    height: auto;          /* let content size it */
    max-height: none;
  }

  #map {
    /* rely on aspect ratio for a clean, predictable height on tablets */
    aspect-ratio: 16 / 9;
    min-height: 420px;
    height: auto;
  }
}

/* Small phones */
@media (max-width: 600px) {
  #stockist-list { padding: 16px; }
  #stockist-list h2 { font-size: 18px; }

  #stockist-list input,
  #stockist-list select {
    font-size: 16px;
    padding: 12px 14px;
  }

  .btn-row { grid-template-columns: 1fr; }

  #use-location,
  #clear-filters {
    font-size: 16px;
    padding: 12px 14px;
  }

  #map {
    aspect-ratio: 3 / 4;
    min-height: 360px;
  }
}

/* Put map first when stacked */
@media (max-width: 1024px) {
  #map { order: -1; }
}

/* Cap list height on mobile so it never pushes the map off-screen */
@media (max-width: 1024px) {
  #stockist-entries {
    max-height: 45vh;
    overflow: auto;
  }
}

/* "Show more" button inside the list */
#show-more {
  width: 100%;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  background: #e9eef3;
  color: #222;
}

/* ... keep everything you already have above ... */

/* ===== Desktop: fill the iframe (viewport) ===== */
@media (min-width: 1200px) {
  html, body { height: 100%; }
  /* make the app's outer container consume the iframe height */
  #container {
    min-height: 100vh;
    /* 20px top + 20px bottom padding on #container */
  }
  /* subtract the container's vertical padding so map/list align flush */
  #map,
  #stockist-list {
    height: calc(100vh - 40px); /* fills the viewport inside the section */
  }
}

/* ===== Tablet (unchanged from your current rules) ===== */
@media (max-width: 1024px) {
  /* your existing tablet/mobile styles remain as-is */
}
