html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Segoe UI', sans-serif;
  overflow: hidden;
}

/* Utility: hide elements */
.is-hidden {
  display: none !important;
}
/* Map behind UI */
#map {
  position: fixed;
  inset: 0;
  z-index: 1;
}

/* Hamburger */
.hamburger {
  position: fixed;
  top: 16px;
  left: 16px;
  font-size: 28px;
  background: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  border: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 10000;
}

.hamburger.is-hidden { display: none; }

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: -320px;
  width: 290px;
  height: 100%;
  background: linear-gradient(180deg, #2e7d32, #1b5e20);
  color: #fff;
  padding: 25px;
  box-sizing: border-box;
  overflow-y: auto;
  transition: left 0.28s ease;
  z-index: 9999;
}

.sidebar.active { left: 0; }

.subtitle {
  opacity: 0.85;
  margin-bottom: 14px;
}

/* Close X inside sidebar */
.sidebar-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-size: 24px;
  line-height: 44px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  -webkit-tap-highlight-color: transparent;
}

.sidebar-close:active { transform: scale(0.97); }

/* Sidebar radius (slider in menu) */
.sidebar-radius {
  margin: 0 0 18px 0;
  padding: 0 0 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.22);
}

.sidebar-radius .radius-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.sidebar-radius #radiusSlider {
  width: 100%;
  accent-color: #ffffff;
}

.sidebar-radius .radius-value {
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.9;
}

/* Farm items */
.farm-item {
  background: rgba(255,255,255,0.12);
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: 0.2s;
}

.farm-item:hover {
  background: rgba(255,255,255,0.25);
  transform: translateX(5px);
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: 0.28s ease;
  z-index: 9998;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Bottom sheet (Apple Maps-style) */
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 75vh;
  background: rgba(255,255,255,0.96);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  box-shadow: 0 -12px 30px rgba(0,0,0,0.18);
  z-index: 9000;
  overflow: hidden;
  transform: translateY(55%);
  will-change: transform;
}

.sheet.anim {
  transition: transform 260ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.sheet-header {
  padding: 10px 16px 10px 16px;
  touch-action: pan-y;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  background: rgba(255,255,255,0.96);
}

.sheet-handle {
  width: 44px;
  height: 5px;
  background: rgba(0,0,0,0.25);
  border-radius: 999px;
  margin: 6px auto 10px auto;
}

.sheet-title {
  margin: 0 0 4px 0;
  font-size: 18px;
}

.sheet-subtitle {
  margin: 0;
  color: rgba(0,0,0,0.65);
  font-size: 14px;
}

.sheet-content {
  height: calc(100% - 84px);
  overflow-y: auto;
  padding: 0 16px 16px 16px;
  box-sizing: border-box;
  overscroll-behavior: contain;
}

/* --------------------------- */
/* Apple-ish cards + hours      */
/* --------------------------- */

.sheet-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px 14px;
  margin-top: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.10);
  border: 1px solid rgba(0,0,0,0.06);
  transition: transform 140ms ease, box-shadow 140ms ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sheet-card:hover {
  box-shadow: 0 14px 30px rgba(0,0,0,0.12);
}

.sheet-card:active {
  transform: scale(0.992);
}

/* Header row inside card (name + chevron) */
.sheet-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sheet-card-title {
  font-weight: 700;
  font-size: 15px;
  color: rgba(0,0,0,0.92);
  line-height: 1.2;
}

/* Chevron indicator (rotates when expanded) */
.sheet-chevron {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.06);
  flex: 0 0 auto;
  transition: transform 160ms ease, background 160ms ease;
}

.sheet-chevron::before {
  content: "›";
  font-size: 26px;
  line-height: 1;
  transform: rotate(90deg);
  display: inline-block;
  color: rgba(0,0,0,0.55);
}

.sheet-card.expanded .sheet-chevron {
  transform: rotate(180deg);
  background: rgba(0,0,0,0.06);
}

/* Summary line under title */
.sheet-hours {
  font-size: 13px;
  margin-top: 8px;
  color: rgba(0,0,0,0.72);
}

/* "Open/Closed" chip */
.hours-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-right: 8px;
  border: 1px solid transparent;
}

.hours-chip.open {
  background: rgba(46, 125, 50, 0.12);
  color: #1b5e20;
  border-color: rgba(46, 125, 50, 0.25);
}

.hours-chip.closed {
  background: rgba(183, 28, 28, 0.10);
  color: #8e1111;
  border-color: rgba(183, 28, 28, 0.20);
}

/* Expandable details */
.sheet-card .hours-details {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.08);
  font-size: 13px;
  color: rgba(0,0,0,0.82);
}

.sheet-card.expanded .hours-details {
  display: block;
}

.hours-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
}

.hours-row .day {
  font-weight: 700;
  color: rgba(0,0,0,0.65);
}

.hours-row.today .day {
  color: rgba(0,0,0,0.92);
}

.hours-row .val {
  color: rgba(0,0,0,0.72);
}

/* Mobile tweaks */
@media (max-width: 768px) {
  .hamburger {
    font-size: 28px;
    padding: 14px 18px;
    border-radius: 14px;
  }

  .sidebar {
    width: 86vw;
    max-width: 320px;
  }

  #radiusSlider {
    height: 28px;
  }
}
/* Sidebar footer pinned to bottom */
.sidebar {
  display: flex;
  flex-direction: column;
}

#farmList {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-bottom: 12px;
}

/* Farmer account block */
.sidebar-footer {
  flex: 0 0 auto;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.22);
}

.footer-title {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.95;
  margin-bottom: 8px;
}

.auth-status {
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 10px;
  word-break: break-word;
}

.footer-actions {
  display: flex;
  gap: 10px;
}

.auth-btn {
  flex: 1;
  border: none;
  cursor: pointer;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  background: rgba(255,255,255,0.18);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
  -webkit-tap-highlight-color: transparent;
}

.auth-btn:active { transform: scale(0.98); }

.auth-btn.secondary {
  background: rgba(0,0,0,0.18);
}

.auth-btn.is-hidden { display: none; }

.auth-small {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.85;
}

/* Modal basics (if you don't already have these in CSS) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 20000;
}

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 28px));
  background: rgba(255,255,255,0.98);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.28);
  z-index: 20001;
  overflow: hidden;
}

.modal.is-hidden,
.modal-backdrop.is-hidden {
  display: none;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.modal-title {
  font-weight: 800;
}

.modal-x {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: rgba(0,0,0,0.06);
}

.modal-body {
  padding: 14px;
}

.field { display: block; margin-bottom: 12px; }
.label { font-size: 12px; font-weight: 700; margin-bottom: 6px; color: rgba(0,0,0,0.7); }

.input {
  width: 100%;
  border: 1px solid rgba(0,0,0,0.14);
  border-radius: 12px;
  padding: 12px 12px;
  font-size: 14px;
  outline: none;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.modal-btn {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 12px 12px;
  font-weight: 800;
  cursor: pointer;
  background: #2e7d32;
  color: white;
}

.modal-btn.secondary {
  background: rgba(0,0,0,0.08);
  color: rgba(0,0,0,0.85);
}

.modal-note {
  margin-top: 10px;
  font-size: 13px;
  min-height: 18px;
  color: rgba(0,0,0,0.7);
}

.modal-note.err { color: #8e1111; }
.modal-note.ok { color: #1b5e20; }