/* POI reference badges: shared by point/category pages in every language. */
.widget.box-item.customer-card .label-distanza.poi-distance-badge {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
  box-sizing: border-box;
  width: auto;
  max-width: calc(100% - 20px);
  bottom: 10px;
  left: 10px;
  padding: 8px 11px;
  border: 1px solid rgba(0, 60, 112, .12);
  border-radius: 12px;
  background: rgba(255, 255, 255, .97);
  color: #31516c;
  box-shadow: 0 3px 12px rgba(16, 42, 64, .16);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  text-align: start;
  white-space: normal;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.poi-distance-badge .poi-distance-icon {
  flex: 0 0 15px;
  width: 15px;
  height: 18px;
  color: #003c70;
}

.poi-distance-badge .poi-distance-text {
  min-width: 0;
}

.poi-distance-badge .poi-distance-value {
  color: #003c70;
  font-weight: 750;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .widget.box-item.customer-card .label-distanza.poi-distance-badge {
    font-size: 13px;
    padding: 8px 10px;
  }
}

/* Keep slideshow controls clear of multi-line POI names, even on narrow cards. */
.widget.box-item.customer-card .box-item-content:has(> .poi-distance-badge) .flex-direction-nav a {
  top: 10px;
  transform: none;
}
/* Use uninterrupted, mobile-first columns for grids containing POI badges. */
.customer-grid:has(.poi-distance-badge) > .customer-card-column {
  width: 100%;
}
@media (min-width: 768px) {
  .customer-grid:has(.poi-distance-badge) > .customer-card-column {
    width: 50%;
  }
}
@media (min-width: 1200px) {
  .customer-grid:has(.poi-distance-badge) > .customer-card-column {
    width: 33.33333333% !important;
  }
}

/* Exceptionally long references have their own space on phones. The original
   server control and the photo slider keep their existing DOM ownership. */
@media (max-width: 767.98px) {
  .widget.box-item.customer-card .box-item-content:has(> .poi-distance-badge-long) {
    display: flex;
    flex-direction: column;
    aspect-ratio: auto;
  }
  .widget.box-item.customer-card .label-distanza.poi-distance-badge-long {
    position: static;
    order: 1;
    align-self: flex-start;
    margin: 10px;
  }
  .widget.box-item.customer-card .box-item-content:has(> .poi-distance-badge-long) > .flex-viewport {
    width: 100%;
    flex: 0 0 auto;
  }
  .widget.box-item.customer-card .box-item-content:has(> .poi-distance-badge-long) > .flex-direction-nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    margin: 0;
  }
}