#prodajna-mesta {
  --branch-controls-top: calc(var(--site-message-top, var(--fixed-top, 126px)) + var(--site-message-height, 0px) + 12px);
  scroll-margin-top: 12px;
}

#prodajna-mesta .search-row {
  position: sticky;
  top: var(--branch-controls-top);
  z-index: 2;
  background: #fff;
}

@media (min-width: 741px) {
  #prodajna-mesta .network-aside {
    position: sticky;
    top: var(--branch-controls-top);
    align-self: start;
  }

  #prodajna-mesta #branches {
    max-block-size: clamp(15rem, calc(100dvh - var(--branch-controls-top) - var(--fixed-bottom, 54px) - 14rem), 40rem);
    overflow-y: auto;
    scrollbar-gutter: stable;
    align-content: start;
    padding: 2px 6px 4px 2px;
  }
}

@media (max-width: 520px) {
  #prodajna-mesta #branches {
    grid-template-columns: minmax(0, 1fr);
  }
}

#prodajna-mesta #branches:focus-visible {
  outline: 2px solid #39794d;
  outline-offset: 2px;
}

#branches .branch-card {
  border-color: #bccdbb;
}

#branches .branch-card:has(.branch-detail-trigger) {
  cursor: pointer;
}

#branches .branch-detail-trigger {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

#branches .branch-card:hover .branch-detail-trigger,
#branches .branch-detail-trigger:focus-visible {
  text-decoration: underline;
}

#branches .branch-card > a {
  margin-top: auto;
}

#branches .branch-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .85fr);
  align-items: start;
  gap: 8px;
  margin-bottom: 4px;
}

#branches .branch-card-heading {
  overflow-wrap: anywhere;
}

#branches .branch-photo {
  block-size: 62px;
  overflow: hidden;
  border-radius: 6px;
  background: #e9f2e6;
}

:is(#branches, #branch-detail) .branch-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

:is(#branches, #branch-detail) .branch-photo .branch-logo {
  box-sizing: border-box;
  padding: 6px;
  object-fit: contain;
  opacity: .52;
}

:is(#branches, #branch-detail) .branch-card .branch-contact {
  display: grid;
  gap: 3px;
  margin: 3px 0 10px;
  color: #314f3b;
  font-size: .82rem;
  line-height: 1.35;
}

:is(#branches, #branch-detail) .branch-card .branch-contact p {
  margin: 0;
}

:is(#branches, #branch-detail) .branch-card .branch-contact-phone a {
  display: inline-block;
  width: auto;
  min-height: 24px;
  margin: 0;
  padding: 2px 7px;
  background: #39794d;
  color: #fff;
  box-shadow: none;
  border: 0;
  border-radius: 4px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

:is(#branches, #branch-detail) .branch-card .branch-contact-phone a:hover,
:is(#branches, #branch-detail) .branch-card .branch-contact-phone a:focus-visible {
  text-decoration: underline;
}

:is(#branches, #branch-detail) .branch-card .branch-contact-weekend {
  display: flex;
  flex-wrap: wrap;
  column-gap: .75em;
}

:is(#branches, #branch-detail) .branch-contact-weekend span {
  white-space: nowrap;
}

#branch-detail {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(54rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid #bccdbb;
  border-radius: 12px;
  background: #fff;
  color: #172d22;
}

#branch-detail::backdrop {
  background: rgb(23 45 34 / .68);
}

#branch-detail .branch-detail-close {
  display: block;
  margin: 0 0 .75rem auto;
  padding: .45rem .75rem;
  border: 1px solid #bccdbb;
  border-radius: 6px;
  background: #eef5eb;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

#branch-detail .branch-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#branch-detail .branch-card-header {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-items: start;
  gap: 1rem;
}

#branch-detail-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

#branch-detail .branch-photo {
  height: clamp(9rem, 44dvh, 22rem);
  border-radius: 6px;
  background: #e9f2e6;
}

#branch-detail .branch-photo img {
  object-fit: contain;
}

#branch-detail .branch-photo .branch-logo {
  padding: 1rem;
  max-width: 12rem;
  margin-inline: auto;
}

#branch-detail .branch-contact {
  margin-block: 1rem;
  font-size: 1rem;
}

#branch-detail .branch-card > a {
  margin-top: 1rem;
}

@media (max-width: 520px) {
  #branch-detail .branch-card-header {
    grid-template-columns: minmax(0, 1fr);
  }
}
