/* Leon Locations Archive layout: map left, list right */
.leon-locator {
  display: flex;
  min-height: calc(100vh - 140px);
  /* Full-bleed across viewport even if parent is boxed */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.leon-locator__map-container {
  flex: 1;
  min-width: 0;
}

.leon-locator__panel-container {
  width: 480px;
  display: flex;
}

.leon-locator__map {
  width: 100%;
  height: 100%;
  min-height: 560px;
}

.leon-locator__panel {
  border-left: 1px solid #e6e6e6;
  background: #fff;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.leon-locator__search {
  padding: 40px 22px;
  background: #f8f8f8;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#leon-locator-search {
  height: 50px;
  border: 1px solid #dcdcdc;
  border-radius: 6px;
  padding: 0 12px;
  /* Prevent iOS Safari zoom on focus */
  font-size: 16px;
  grid-column: 1 / -1; /* input full width, buttons split */
}

.leon-locator__use-location,
.leon-locator__nearest {
  height: 50px;
  border-radius: 6px;
  border: 1px solid #dcdcdc;
  background: #f8f8f8;
  cursor: pointer;
}

/* Updated nearest button styles */
.leon-locator__nearest {
  border-radius: 90px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  grid-column: 1 / -1;
  justify-content: center;
}

.leon-locator__nearest img,
.leon-locator__nearest svg {
  width: 16px;
  height: 16px;
  display: inline-block;
}

/* Make inline SVG follow text color, so :hover turns it white */
.leon-locator__nearest svg { fill: currentColor; }

.leon-locator__use-location:hover,
.leon-locator__nearest:hover {
  background: #003366;
  color: #fff;
}

.leon-locator__list {
  overflow-y: auto;
  padding: 10px 12px 24px;
  /* Reserve scrollbar space to avoid layout shift while filtering */
  scrollbar-gutter: stable;
}

@media (min-width: 1025px) {
  .leon-locator__list {
    max-height: 700px;
  }
}

.leon-locator__header {
  margin-top:20px;
  padding: 22px 40px 22px 22px;
  border-bottom: 1px solid #e6e6e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.leon-locator__title {
  margin: 0;
  flex: 0 0 60%;
  font-size: 1.85rem;
}

.leon-locator__filter {
  flex: 0 0 40%;
  display: flex;
  justify-content: end;
  align-items: center;
  margin-right: 0;
}

.leon-locator__country-select {
  min-width: 140px;
  height: 40px;
  padding: 8px 12px;
  border: 1px solid #dcdcdc;
  border-radius: 6px;
  background: #fff;
  color: #333;
  font-size: 14px;
  cursor: pointer;
  background-image: url('../images/worldwide.svg');
  background-repeat: no-repeat;
  background-position: 8px center;
  background-size: 16px 16px;
  padding-left: 32px;
}

.leon-locator__country-select:focus {
  outline: none;
  border-color: #003366;
  box-shadow: 0 0 0 2px rgba(0, 51, 102, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .leon-locator {
    flex-direction: column;
    height: auto;
    min-height: auto;
  }

  .leon-locator__map-container {
    order: 1;
    height: 50vh;
    min-height: 300px;
  }

  .leon-locator__panel-container {
    order: 2;
    width: 100%;
    max-height: none;
    overflow-y: visible;
  }

  .leon-locator__header {
    flex-direction: row;
    align-items: center;
    gap: 15px;
    justify-content: space-between;
    padding: 40px 15px 15px 15px;
  }

  .leon-locator__title {
    flex: 1;
    text-align: left;
  }

  .leon-locator__filter {
    flex: 0 0 auto;
    justify-content: flex-end;
    margin-right: 0;
  }

  .leon-locator__country-select {
    min-width: 140px;
    font-size: 14px;
    padding-left: 32px;
  }

  .leon-locator__search {
    padding: 20px 15px;
  }

  .leon-locator__list {
    padding: 10px 15px 24px;
    min-height: auto;
    max-height: none;
    overflow-y: visible;
    scrollbar-gutter: auto;
  }
}

/* Additional adjustments for very small devices */
@media (max-width: 480px) {
  .leon-locator__header {
    padding: 15px 10px 10px 10px;
    margin-top:40px;
  }


  .leon-locator__country-select {
    min-width: 120px;
    font-size: 13px;
    padding: 6px 8px 6px 28px;
    height: 36px;
    background-size: 14px 14px;
    background-position: 6px center;
  }

  .leon-locator__search {
    padding: 15px 10px;
  }

  .leon-locator__list {
    padding: 8px 10px 20px;
  }
}

.leon-locator__notice {
  margin: 12px;
  padding: 12px;
  background: #fff8e1;
  border: 1px solid #ffe0a3;
  border-radius: 6px;
  color: #6b5200;
}

.leon-card {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #efefef;
  cursor: pointer;
}

.leon-card:hover { background: #fafafa; }

.card__thumb { width: 130px; height: 100px; object-fit: cover; border-radius: 8px; }
.card__title { font-size: 16px; margin: 0 0 6px; }
.card__meta { font-size: 13px; color: #666; margin: 4px 0; }
.card__contact { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #333; margin: 4px 0; }
.card__contact img { width: 14px; height: 14px; display: inline-block; }
.card__reviews { font-size: 13px; color: #333; margin-top: 2px; }
.card__actions { display: flex; gap: 10px; margin-top: 20px; }
.card__link, .card__dir {
  text-decoration: none;
  font-size: 13px;
  border: 1px solid #eaeaea;
  border-radius: 90px;
  padding: 5px 10px;
}
.card__link:hover, .card__dir:hover {
  text-decoration: none;
  background: #003366;
  border-color: #003366;
  color: #fff;
}
.card__distance { font-size: 12px; color: #666; margin-top: 4px; }

/* InfoWindow quick styling */
.leon-infowindow strong { display: block; margin-bottom: 2px; }
.leon-infowindow a { color: inherit; text-decoration: none; font-size: 11px; }
.leon-infowindow a:hover { text-decoration: underline; }
.leon-infowindow .iw-thumb { width: 120px; height: 80px; border-radius: 6px; display: block; object-fit: cover; }

/* Custom AdvancedMarkerElement <img> size */
.leon-marker-img {
  width: 38px;
  height: 48px;
  display: block;
  pointer-events: none; /* let marker capture clicks */
}

.leon-infowindow .iw-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.leon-infowindow .iw-icon { width: 12px; height: 12px; display: inline-block; }


  .leon-infowindow .iw-address {
    margin-bottom: 10px;
    border-bottom: 1px solid #eaeaea;
    padding-bottom:10px;
  }

  .leon-infowindow .iw-row {
    margin-top: 5px;
    gap: 10px;
  }


/* Larger screens only - increase infowindow size and fonts */
@media (min-width: 1025px) {
  .leon-infowindow {
    min-width: 220px;
    padding: 12px;
    font-size: 15px;
    line-height: 1.6;
  }

  .leon-infowindow strong {
    font-size: 18px;
    margin-bottom: 6px;
  }

  .leon-infowindow a {
    font-size: 15px;
  }

  .leon-infowindow .iw-thumb {
    width: 200px;
    height: 140px;
    margin-bottom: 2px;
  }


  .leon-infowindow .iw-icon {
    width: 16px;
    height: 16px;
  }

  /* Increase marker size on larger screens too */
  .leon-marker-img {
    width: 52px;
    height: 65px;
  }
}

@media (max-width: 1024px) {
  .leon-locator { grid-template-columns: 1fr 420px; }
}

@media (max-width: 820px) {
  .leon-locator { grid-template-columns: 1fr; width: 100%; margin-left: 0; margin-right: 0; }
  .leon-locator__search { grid-template-columns: 1fr; }
  .leon-locator__map { min-height: 480px; height: 480px; }
  .leon-locator__panel { border-left: 0; border-top: 1px solid #e6e6e6; min-height: 360px; }
}

/* Remove default site padding on the locations archive only */
.post-type-archive-lokacija #primary {
  padding: 0 !important;
}
