/*!
 * Store Locator - foglio di stile
 * Tutte le classi sono prefissate .sl- per non entrare in conflitto con il tema.
 * Grafica flat: nessun arrotondamento, nessuna ombra, nessun bordo esterno.
 * Personalizzabile tramite le variabili CSS qui sotto.
 */

.sl-root {
  --sl-primary: #b5884b;
  --sl-primary-dark: #9a713b;
  --sl-text: #4e4e56;
  --sl-muted: #8a8a92;
  --sl-line: #e3e1dd;          /* separatori interni (elenco, campi) */
  --sl-bg: #ffffff;
  --sl-bg-soft: #f4f3f1;
  --sl-height: 620px;
  --sl-panel-width: 380px;
  --sl-font: inherit;

  font-family: var(--sl-font);
  color: var(--sl-text);
  box-sizing: border-box;
}

.sl-root *,
.sl-root *::before,
.sl-root *::after { box-sizing: border-box; }

/* Blindatura contro i temi che stilizzano TUTTE le <svg> della pagina
   (quiin21.it ha una regola globale svg{fill:#23232c;stroke-width:0;width:20px}
   che senza queste righe annerisce e deforma le icone del locator).
   Gli attributi fill/stroke scritti nel markup perdono contro il CSS del tema:
   vanno quindi riaffermati qui. */
.sl-root svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  width: 18px;
  height: 18px;
  max-width: none;
  display: inline-block;
  vertical-align: middle;
  transition: none;
}

.sl-root .sl-btn--ghost svg { width: 16px; height: 16px; }
.sl-root .sl-link svg,
.sl-root .sl-card__dist svg { width: 15px; height: 15px; }
.sl-root .sl-social__link svg { stroke-width: 1.8; }

/* ------------------------------------------------------------ layout */
.sl-layout {
  display: flex;
  gap: 0;
  height: var(--sl-height);
  min-height: 420px;
  background: var(--sl-bg);
  border: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}

.sl-panel {
  width: var(--sl-panel-width);
  flex: 0 0 var(--sl-panel-width);
  display: flex;
  flex-direction: column;
  background: var(--sl-bg);
  min-width: 0;
}

.sl-mapwrap { flex: 1 1 auto; position: relative; min-width: 0; }
.sl-map { position: absolute; inset: 0; }

/* ------------------------------------------------------------ ricerca */
.sl-search {
  padding: 0 16px 16px 0;
  background: var(--sl-bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sl-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--sl-bg-soft);
  border: 0;
  border-bottom: 2px solid var(--sl-line);
  border-radius: 0;
  padding: 0 0 0 12px;
  transition: border-color .15s;
}

.sl-field:focus-within { border-bottom-color: var(--sl-primary); }

.sl-field__icon { display: flex; color: var(--sl-primary); flex: 0 0 auto; }

.sl-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: inherit;
  padding: 12px 0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

.sl-input::-webkit-search-cancel-button { display: none; }

.sl-input__clear {
  border: 0;
  background: transparent;
  color: var(--sl-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}

/* ------------------------------------------------------------ bottoni */
.sl-btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 20px;
  white-space: nowrap;
  letter-spacing: .02em;
  transition: background-color .15s, color .15s;
}

.sl-btn--primary { background: var(--sl-primary); color: #fff; align-self: stretch; }
.sl-btn--primary:hover { background: var(--sl-primary-dark); }

.sl-btn--ghost {
  background: var(--sl-bg-soft);
  color: var(--sl-text);
  padding: 11px 14px;
}
.sl-btn--ghost:hover { background: var(--sl-primary); color: #fff; }
.sl-btn--ghost svg { color: var(--sl-primary); }
.sl-btn--ghost:hover svg { color: #fff; }

.sl-tools { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }

.sl-select {
  font: inherit;
  font-size: 14px;
  padding: 11px 12px;
  border: 0;
  border-radius: 0;
  background: var(--sl-bg-soft);
  color: inherit;
  cursor: pointer;
  flex: 1 1 auto;
  min-width: 0;
}

/* ------------------------------------------------------- suggerimenti */
.sl-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1200;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--sl-bg);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  max-height: 260px;
  overflow-y: auto;
}

.sl-suggest li {
  padding: 10px 12px;
  border-radius: 0;
  border-bottom: 1px solid var(--sl-line);
  font-size: 13.5px;
  line-height: 1.35;
  cursor: pointer;
  color: var(--sl-text);
  background: var(--sl-bg-soft);
}
.sl-suggest li:hover { background: var(--sl-primary); color: #fff; }

/* ------------------------------------------------------------- stato */
.sl-status {
  margin: 0;
  padding: 10px 16px 10px 0;
  font-size: 13px;
  color: var(--sl-muted);
  border-bottom: 1px solid var(--sl-line);
  background: var(--sl-bg);
}
.sl-status:empty { display: none; }
.sl-status--error { color: #fff; background: var(--sl-text); padding-left: 12px; }

/* ------------------------------------------------------------- lista */
.sl-list {
  list-style: none;
  /* rientro negativo: la barra gold della scheda attiva sta nel margine e non
     copre l'icona, ma il testo resta comunque allineato al resto del pannello */
  margin: 0 0 0 -8px;
  padding: 0;
  overflow-y: auto;
  flex: 1 1 auto;
  scrollbar-width: thin;
}

.sl-card {
  display: flex;
  gap: 12px;
  padding: 14px 16px 14px 8px;
  border-bottom: 1px solid var(--sl-line);
  cursor: pointer;
  transition: background-color .15s;
  outline: none;
}

.sl-card:hover { background: var(--sl-bg-soft); }
.sl-card:focus-visible { background: var(--sl-bg-soft); box-shadow: inset 4px 0 0 var(--sl-primary); }
.sl-card.is-active { background: var(--sl-bg-soft); box-shadow: inset 4px 0 0 var(--sl-primary); }

/* icona del punto vendita (immagine icona-store.png o pin di ripiego) */
.sl-card__icon {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1px 0 0;
  border-radius: 0;
  overflow: hidden;
}

.sl-card__icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sl-card__icon--pin {
  background: var(--sl-primary);
  color: #fff;
}
.sl-card__icon--pin svg { width: 18px; height: 18px; }

.sl-card__body { min-width: 0; flex: 1 1 auto; }

.sl-card__title {
  margin: 0 0 4px;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--sl-text);
}

.sl-card__addr {
  margin: 4px 0 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--sl-muted);
}
.sl-card__addr:empty { display: none; }

.sl-card__dist {
  margin: 7px 0 0;
  font-size: 13px;
  color: var(--sl-text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.sl-card__dist svg { color: var(--sl-primary); flex: 0 0 auto; }
.sl-card__dist strong { font-weight: 700; }

.sl-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 0;
  background: var(--sl-bg-soft);
  border: 0;
  color: var(--sl-muted);
  margin: 0 4px 2px 0;
}

.sl-badge--open { background: var(--sl-primary); color: #fff; }
.sl-badge--closed { background: var(--sl-text); color: #fff; }

.sl-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
}

.sl-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sl-muted);
  text-decoration: none;
}
.sl-link:hover { color: var(--sl-primary); text-decoration: underline; }
.sl-link--primary { color: var(--sl-primary); }

/* -------------------------------------------------------------- social */
.sl-social { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sl-social:empty { display: none; }

.sl-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 0;
  background: var(--sl-bg-soft);
  color: var(--sl-text);
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.sl-social__link:hover { background: var(--sl-primary); color: #fff; }

/* fila compatta dentro la scheda del punto vendita */
.sl-social--card { margin-top: 10px; gap: 6px; }
.sl-social--card .sl-social__link { width: 28px; height: 28px; }
.sl-social--card .sl-social__link svg { width: 15px; height: 15px; }

/* barra social del brand, in fondo al pannello */
.sl-socialbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 16px 16px 0;
  border-top: 1px solid var(--sl-line);
  flex: 0 0 auto;
}

.sl-socialbar__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sl-muted);
}

.sl-hours { margin-top: 10px; font-size: 13px; }
.sl-hours summary { cursor: pointer; color: var(--sl-primary); font-weight: 600; }
.sl-hours__table { width: 100%; margin-top: 6px; border-collapse: collapse; }
.sl-hours__table th {
  text-align: left;
  font-weight: 500;
  color: var(--sl-muted);
  padding: 2px 8px 2px 0;
  width: 46px;
}
.sl-hours__table td { padding: 2px 0; color: var(--sl-text); }
.sl-hours__table tr.is-today th,
.sl-hours__table tr.is-today td { font-weight: 700; color: var(--sl-primary); }

.sl-empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--sl-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ------------------------------------------------------------ marker */
.sl-marker { background: none; border: 0; }
.sl-marker span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 0;
  background: var(--sl-marker-bg, #b5884b);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border: 0;
  box-shadow: none;
}
.sl-marker b { font-style: normal; line-height: 1; }
.sl-marker.is-active span { background: #4e4e56; }

/* cluster (Leaflet.markercluster) intonati al colore principale */
.sl-root .marker-cluster,
.sl-root .marker-cluster div {
  border-radius: 0;
  background-clip: padding-box;
}
.sl-root .marker-cluster { background: rgba(181, 136, 75, .3); }
.sl-root .marker-cluster div {
  background: var(--sl-primary);
  color: #fff;
  font: 700 12px/30px inherit;
}

.sl-origin i {
  display: block;
  width: 16px;
  height: 16px;
  margin: 3px;
  border-radius: 0;
  background: #4e4e56;
  border: 0;
  box-shadow: 0 0 0 4px rgba(78, 78, 86, .25);
}

/* ------------------------------------------------------------- popup */
.sl-root .leaflet-popup-content-wrapper,
.sl-root .leaflet-popup-tip { border-radius: 0; box-shadow: none; }
.sl-root .leaflet-popup-content-wrapper { border: 0; color: var(--sl-text); }

.sl-popup { font-size: 13.5px; line-height: 1.45; display: block; }
.sl-popup__title { display: block; font-size: 15px; margin-bottom: 3px; }
.sl-popup__addr { display: block; color: #8a8a92; margin-bottom: 4px; }
.sl-popup__addr:empty { display: none; }
.sl-popup__dist { display: block; font-weight: 700; margin-bottom: 6px; }
.sl-popup__cta {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 14px;
  border-radius: 0;
  background: var(--sl-primary, #b5884b);
  color: #fff !important;
  font-weight: 600;
  text-decoration: none !important;
}

/* ------------------------------------------- modalita' senza mappa
   Attivata da data-map="false": la mappa non viene nemmeno inizializzata.
   Per rimetterla basta data-map="true", nessuna modifica al codice. */
.sl-root.sl-no-map .sl-mapwrap { display: none; }
.sl-root.sl-no-map .sl-tabs { display: none; }

.sl-root.sl-no-map .sl-layout { display: block; height: auto; min-height: 0; }

.sl-root.sl-no-map .sl-panel {
  width: 100%;
  flex: 1 1 auto;
  max-height: none;
}

.sl-root.sl-no-map .sl-search { max-width: 520px; }

/* a tutta larghezza l'elenco su una sola colonna sarebbe troppo rado */
.sl-root.sl-no-map .sl-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  column-gap: 32px;
  max-height: var(--sl-height);
}

.sl-root.sl-no-map .sl-card { align-content: start; }

/* --------------------------------------------------- tab mobile */
.sl-tabs { display: none; gap: 0; margin-top: 10px; }
.sl-tab {
  flex: 1 1 0;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  border-radius: 0;
  border: 0;
  background: var(--sl-bg-soft);
  color: var(--sl-muted);
  cursor: pointer;
}
.sl-tab.is-active { background: var(--sl-primary); color: #fff; }

/* --------------------------------------------------------- caricamento */
.sl-root.is-loading .sl-field::after {
  content: '';
  position: absolute;
  right: 96px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--sl-line);
  border-top-color: var(--sl-primary);
  border-radius: 50%;
  animation: sl-spin .7s linear infinite;
}

@keyframes sl-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------- responsive */
@media (max-width: 860px) {
  .sl-root { --sl-height: auto; }

  .sl-layout {
    flex-direction: column;
    height: auto;
  }

  .sl-panel {
    width: 100%;
    flex: 1 1 auto;
    max-height: 70vh;
  }

  .sl-list { max-height: 52vh; }

  .sl-mapwrap { display: none; height: 65vh; flex: 0 0 65vh; }

  .sl-tabs { display: flex; }

  .sl-root.sl-view-map .sl-panel .sl-list,
  .sl-root.sl-view-map .sl-panel .sl-status { display: none; }
  .sl-root.sl-view-map .sl-mapwrap { display: block; }

  .sl-btn--primary { padding: 13px 16px; }
}

@media (max-width: 420px) {
  .sl-field { padding-left: 10px; }
  .sl-btn--primary { font-size: 13px; padding: 13px 12px; }
}
