:root{
  --icon-distance: url('/wp-content/plugins/osm-store-locator/assets/img/icons/distance.svg');
  --icon-phone:    url('/wp-content/plugins/osm-store-locator/assets/img/icons/phone.svg');
  --icon-email:    url('/wp-content/plugins/osm-store-locator/assets/img/icons/email.svg');
  --icon-link:     url('/wp-content/plugins/osm-store-locator/assets/img/icons/link.svg');
  --icon-clock:    url('/wp-content/plugins/osm-store-locator/assets/img/icons/clock.svg');
  --icon-directions: url('/wp-content/plugins/osm-store-locator/assets/img/icons/directions.svg');
}

.osmsl-search-wrap {
    background-color: #f4f3f3;
    padding: 1rem;
    margin-bottom: 1rem;
}
.osmsl-search-wrap form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
form .osmsl-search input[type=text], .osmsl-search select { padding: .4rem .6rem; }

.osmsl-search-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.osmsl-search input[type=text], .osmsl-search select { padding: .4rem .6rem; }
#osmsl-map { flex: 1 1 66%; width: 100%; height: 350px; min-height: 350px; overflow: hidden; }
#osmsl-list { flex: 1 1 44%; max-height: 350px; overflow: auto; padding: .5rem; }
.osmsl-item { border-bottom: 1px solid #eee; padding: .6rem 0; display: flex; column-gap: 1rem; }
.osmsl-item .store-body { flex: 1 1 auto; }
.osmsl-item figure.store-image { flex: 0 0 100px; margin: 0; width: 100px; height: 100px; }
.osmsl-item figure.store-image a { display: block; }
.osmsl-item figure.store-image a img { width: 100%; height: 100%; object-fit: cover; }
.osmsl-item h3 { margin: 0 0 .25rem; font-size: 1rem; }
.osmsl-item small { color: #666; }
.osmsl-item .osmsl-meta > div, .store-directions { display: flex; align-items: center; gap: .4rem; }

/* Base: icone via mask + currentColor (LIST + POPUP) */
.store-distance::before,
.store-phone::before,
.store-email::before,
.store-website::before,
.store-hours::before,
.osmsl-item .osmsl-meta > div::before, .store-directions::before {
  content:"";
  display:inline-block;
  width:1.5rem;
  height:1.5rem;
  margin-right:.4rem;
  background-color: currentColor;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 1.5rem 1.5rem;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: 1.5rem 1.5rem;
}

.store-distance::before { -webkit-mask-image: var(--icon-distance); mask-image: var(--icon-distance); }
.store-phone::before    { -webkit-mask-image: var(--icon-phone);    mask-image: var(--icon-phone); }
.store-email::before    { -webkit-mask-image: var(--icon-email);    mask-image: var(--icon-email); }
.store-website::before  { -webkit-mask-image: var(--icon-link);     mask-image: var(--icon-link); }
.store-hours::before    { -webkit-mask-image: var(--icon-clock);    mask-image: var(--icon-clock); }
.store-directions::before{ -webkit-mask: var(--icon-directions);  mask: var(--icon-directions); }

.store-hours { padding-left:1.5em; text-indent:-1.5em; }

.osmsl-item .osmsl-meta { display: grid; gap: .3rem; margin-top: .35rem; }
.osmsl-item .osmsl-meta > div { display:flex; align-items:center; gap:.4rem; color:#222; }
.store-hours { white-space: pre-line; }
.osmsl-single-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.osmsl-single-thumb { border-radius: 12px; }
.leaflet-touch .leaflet-bar a { text-decoration: none; }

/* Autocomplete */
.osmsl-suggest-wrap { position: relative; display: inline-block; }
.osmsl-suggest {
  position: absolute; top: 100%; left: 0; right: 0;
  z-index: 9999; background: #fff; border: 1px solid #ddd; border-radius: 8px;
  margin-top: 4px; padding: 4px 0; max-height: 260px; overflow: auto;
  box-shadow: 0 6px 24px rgba(0,0,0,.08);
}
.osmsl-suggest-item { padding: 8px 10px; cursor: pointer; line-height: 1.2; }
.osmsl-suggest-item:hover, .osmsl-suggest-item.is-active { background: #f5f7fb; }
.osmsl-suggest-title { display:block; font-weight:600; }
.osmsl-suggest-sub   { display:block; font-size:.85em; color:#666; }

/* Popup Mappa */
.leaflet-popup-content .osmsl-popup {
  min-width: 220px;
  color: #000;
  font: inherit;
  display: flex;
  column-gap: .5rem;
}

.leaflet-popup-content .osmsl-popup a {
  color: #000;
  text-decoration: none;
}

.leaflet-popup-content .osmsl-popup a:hover {
  text-decoration: underline;
}

.leaflet-popup-content .osmsl-content {
    flex: 1 1 auto;
    border-right: 1px solid #e9e9e9;
}

/* Titolo */
.leaflet-popup-content .osmsl-popup__title {
  display:block;
  margin: 0 0 .4rem;
  font-weight: 700;
  line-height: 1.2;
}
.leaflet-popup-content .osmsl-popup__title a {
  color: inherit;
  text-decoration: none;
}
.osmsl-popup .store-phone, .osmsl-popup .store-email, .osmsl-popup .store-website, .osmsl-popup .store-hours {
    display: flex;
    align-items: center;
    margin-top: .5rem;
}

/* Immagine */
.leaflet-popup-content .osmsl-popup__figure {
  margin: 0 0 .5rem;
  width: 80px;
  height: 80px;
  flex: 0 0 80px;
}
.leaflet-popup-content .osmsl-popup__img {
  display:block;
  width: 100%;   
  height: 100%;
  object-fit: cover;        /* cambia se la vuoi più grande */
  max-width: 100%;
  border-radius: 8px;
}

/* Orari */
.leaflet-popup-content .store-hours { padding-left: 0; text-indent: unset; }

@media (min-width: 992px){
    .osmsl-search-wrap form {
        flex-direction: row;
    }
    form .osmsl-search input[type=text], .osmsl-search select { padding: .4rem .6rem; }
    .osmsl-suggest-wrap {
        flex: 1 1 auto;
    }
    #search-radius {
        flex: 0 0 200px;
    }
    #search-button {
        flex: 0 0 100px;
    }
    .osmsl-search-results {
        flex-direction: row;
    }
}
