:root {
  --brand-dark: #204f13;
  --brand: #2c6917;
  --brand-light: #00a651;
  --brand-sage: #527b53;
  --bg: #f5f6f4;
  --card: #ffffff;
  --text: #3a3f3a;
  --muted: #757f75;
  --border: #e4e7e2;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 12px 34px rgba(20, 40, 15, 0.16);
  --topbar-h: 68px;

  --embalaza: #8a5a00;
  --embalaza-bg: #fff3d9;
  --komunalni: #155c30;
  --komunalni-bg: #e6f5ea;
  --accent-blue: #2f6fb0;
  --accent-blue-bg: #e9f1fa;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: "Open Sans", "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--text);
  line-height: 1.45;
}

/* ---------- full-screen map ---------- */

#map-canvas {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  background: #e9efe6;
}

.hisa-marker {
  background: transparent;
  border: none;
}

/* ---------- top bar ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--topbar-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--brand-light), var(--accent-blue)) 1;
  box-shadow: 0 2px 12px rgba(20, 40, 15, 0.08);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 1;
}

.topbar__logo {
  height: 42px;
  width: auto;
  max-width: 120px;
  flex-shrink: 0;
}

.topbar__title {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--brand-dark);
  white-space: nowrap;
  flex-shrink: 0;
}

.search-field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 460px;
  margin-left: auto;
}

.search-field input {
  width: 100%;
  font-size: 0.96rem;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--accent-blue);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-field input:focus {
  border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.18);
}

.autocomplete-list {
  position: absolute;
  z-index: 1001;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-height: 280px;
  overflow-y: auto;
  display: none;
  list-style: none;
  margin: 0;
  padding: 6px;
}

.autocomplete-list.is-open {
  display: block;
}

.autocomplete-list li {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.94rem;
}

.autocomplete-list li:hover,
.autocomplete-list li.is-active {
  background: var(--komunalni-bg);
  color: var(--komunalni);
}

/* ---------- floating result panel ---------- */

.result-panel {
  position: fixed;
  z-index: 900;
  top: calc(var(--topbar-h) + 16px);
  left: 16px;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - var(--topbar-h) - 32px);
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 24px 26px;
  transform: translateX(calc(-100% - 32px));
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.result-panel.is-visible {
  transform: translateX(0);
  opacity: 1;
}

.result-panel__close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
}

.today-line {
  margin: 0 26px 6px 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.result-panel__address {
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0 26px 18px 0;
  color: var(--brand-dark);
}

.card__label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 4px;
}

#pickupNext .card__label {
  color: var(--accent-blue);
}

.pickup-row {
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
}

.pickup-row:first-of-type {
  margin-top: 0;
}

.pickup-row .pickup-date {
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: capitalize;
}

.pickup-row .pickup-day {
  color: var(--muted);
  font-size: 0.95rem;
  text-transform: capitalize;
}

.bin-badge {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--card);
}

.bin-badge__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.bin-badge__icon img {
  width: 100%;
  height: auto;
}

.bin-badge span {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.bin-badge small {
  display: block;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text);
}

.bin-badge__examples {
  font-weight: 400 !important;
  font-size: 0.76rem !important;
  color: var(--muted) !important;
  margin-top: 1px;
}

.bin-badge.embalaza .bin-badge__icon {
  background: var(--embalaza-bg);
}

.bin-badge.embalaza span {
  color: var(--embalaza);
}

.bin-badge.komunalni .bin-badge__icon {
  background: var(--komunalni-bg);
}

.bin-badge.komunalni span {
  color: var(--komunalni);
}

.vehicle-row {
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.vehicle-row img {
  width: 110px;
  height: auto;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.vehicle-row .card__label {
  font-size: 0.8rem;
  margin: 0;
}

.panel-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.panel-action {
  flex: 1 1 0;
  min-width: 0;
  display: block;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.panel-action:hover {
  color: var(--brand);
  border-color: var(--brand-light);
}

@media print {
  html,
  body {
    height: auto;
    overflow: visible;
  }

  .topbar,
  #map-canvas,
  .map-hint,
  .autocomplete-list,
  .result-panel__close,
  .panel-actions {
    display: none !important;
  }

  .result-panel {
    position: static;
    transform: none;
    opacity: 1;
    box-shadow: none;
    border: none;
    width: auto;
    max-width: none;
    max-height: none;
    overflow: visible;
  }
}

/* ---------- mobile: bottom sheet instead of side card ---------- */

@media (max-width: 720px) {
  .topbar {
    gap: 8px;
    padding: 0 10px;
  }

  .topbar__brand {
    gap: 6px;
  }

  .topbar__logo {
    height: 32px;
    max-width: 80px;
  }

  .topbar__title {
    display: none;
  }

  .search-field {
    max-width: none;
  }

  .result-panel {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 10px;
    width: auto;
    max-width: none;
    max-height: 42vh;
    border-radius: var(--radius);
    padding: 14px 18px;
    transform: translateY(calc(100% + 20px));
  }

  .result-panel.is-visible {
    transform: translateY(0);
  }

  .today-line {
    font-size: 0.7rem;
    margin-bottom: 4px;
  }

  .result-panel__address {
    font-size: 1.02rem;
    margin-bottom: 8px;
  }

  .pickup-row {
    padding: 10px;
    margin-top: 8px;
  }

  .pickup-row .pickup-date {
    font-size: 1.1rem;
  }

  .bin-badge {
    margin-top: 8px;
    padding: 8px 10px;
    gap: 10px;
  }

  .bin-badge__icon {
    width: 34px;
    height: 34px;
  }

  .vehicle-row {
    margin-top: 10px;
    padding-top: 10px;
    padding: 10px;
  }

  .vehicle-row img {
    width: 76px;
  }

  .panel-actions {
    margin-top: 8px;
  }

  .panel-action {
    font-size: 0.76rem;
    padding: 8px 6px;
  }
}
