.ad-dealers-map-wrap {
  position: relative;
  width: 100%;
  min-height: var(--ad-map-height, 720px);
  background: #fff;
  overflow: hidden;
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  box-sizing: border-box;
}

.ad-dealers-map-wrap *,
.ad-dealers-map-wrap *::before,
.ad-dealers-map-wrap *::after {
  box-sizing: border-box;
  font-family: 'Inter', Arial, Helvetica, sans-serif;
}

.ad-dealers-layout {
  position: relative;
  height: var(--ad-map-height, 720px);
  min-height: 560px;
  overflow: hidden;
  background: #fbfdfe;
}

.ad-dealers-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #fbfdfe;
  overflow: hidden;
}

/* === Estilo acuarela real, sin proveedor externo ni API key ===
   El mar es papel (textura) y la tierra se pinta con GeoJSON vectorial
   al que se aplican filtros SVG (turbulencia, desplazamiento, granulado). */
.ad-dealers-layout[data-map-style="watercolor"] .ad-dealers-map,
.ad-dealers-layout[data-map-style="watercolor"] .leaflet-container {
  background-color: #f3efe4 !important;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, .6), transparent 55%),
    radial-gradient(circle at 82% 78%, rgba(229, 221, 201, .5), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E") !important;
  background-size: auto, auto, 220px 220px !important;
}

.ad-dealers-layout[data-map-style="watercolor"] .leaflet-tile-pane {
  display: none !important;
}

/* Cada capa GeoJSON recibe su filtro acuarela. Los paths heredan la clase
   vía className en el JS; el filtro va sobre el <path> de Leaflet. */
.ad-dealers-layout[data-map-style="watercolor"] .ad-wc-wash {
  filter: url(#ad-wc-wash-f);
}

.ad-dealers-layout[data-map-style="watercolor"] .ad-wc-edge {
  filter: url(#ad-wc-edge-f);
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* Mientras el mapa se mueve o hace zoom, quitamos los filtros SVG:
   se ve el color plano (instantáneo) y la textura vuelve al soltar. */
.ad-dealers-layout[data-map-style="watercolor"].ad-wc-moving .ad-wc-wash,
.ad-dealers-layout[data-map-style="watercolor"].ad-wc-moving .ad-wc-edge {
  filter: none !important;
}

/* Velo de grano de pigmento sobre el conjunto (manchas suaves) */
.ad-dealers-layout[data-map-style="watercolor"] .ad-dealers-map::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 410;
  opacity: .22;
  background:
    radial-gradient(circle at 33% 28%, rgba(15, 110, 134, .26), transparent 18%),
    radial-gradient(circle at 55% 40%, rgba(20, 130, 155, .18), transparent 22%),
    radial-gradient(circle at 64% 60%, rgba(10, 95, 118, .18), transparent 22%),
    radial-gradient(circle at 74% 44%, rgba(40, 170, 190, .16), transparent 24%);
  mix-blend-mode: multiply;
}

.ad-dealers-map .leaflet-control-attribution {
  font-size: 9px;
  opacity: .42;
}

.ad-dealers-sidebar {
  position: absolute;
  z-index: 30;
  top: 34px;
  left: 8.5%;
  width: 335px;
  max-width: calc(100vw - 40px);
  height: calc(var(--ad-map-height, 720px) - 68px);
  min-height: 500px;
  padding: 18px 24px 18px;
  background: rgba(255, 255, 255, .94);
  border-left: 1px solid rgba(0, 0, 0, .08);
  border-right: 1px solid rgba(0, 0, 0, .08);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .16);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #111A3A;
  font-family: 'Inter', Arial, Helvetica, sans-serif;
}

.ad-dealers-search-row,
.ad-dealers-filter-row {
  width: 100%;
  max-width: 100%;
  margin-bottom: 10px;
  overflow: hidden;
}

.ad-dealers-search-row {
  position: relative;
}

.ad-dealers-search-row::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  z-index: 2;
  pointer-events: none;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.05 12.7a5.65 5.65 0 1 1 0-11.3 5.65 5.65 0 0 1 0 11.3Zm0-1.35a4.3 4.3 0 1 0 0-8.6 4.3 4.3 0 0 0 0 8.6Zm4.02.65.98-.98 3.05 3.05-.98.98-3.05-3.05Z' fill='%23111A3A'/%3E%3C/svg%3E");
}

.ad-dealers-search,
.ad-dealers-country,
.ad-dealers-country option {
  font-family: 'Inter', Arial, Helvetica, sans-serif !important;
  font-size: 14px;
  line-height: 1.2;
}

.ad-dealers-search,
.ad-dealers-country {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 38px !important;
  border: 1px solid rgba(17, 26, 58, .25) !important;
  border-radius: 6px !important;
  background-color: #fff !important;
  color: #111A3A !important;
  outline: none !important;
  box-shadow: none !important;
  appearance: none;
}

.ad-dealers-search {
  padding: 0 14px 0 42px !important;
  text-indent: 0 !important;
  background-image: none !important;
}

.ad-dealers-search::-webkit-search-decoration,
.ad-dealers-search::-webkit-search-cancel-button,
.ad-dealers-search::-webkit-search-results-button,
.ad-dealers-search::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

.ad-dealers-search::placeholder {
  color: rgba(17, 26, 58, .72);
  opacity: 1;
}

.ad-dealers-country {
  padding: 0 14px;
  white-space: normal;
}

.ad-dealers-list {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scrollbar-color: rgba(17, 26, 58, .24) transparent;
  scrollbar-width: thin;
}

.ad-dealers-list::-webkit-scrollbar {
  width: 5px;
  height: 0;
}

.ad-dealers-list::-webkit-scrollbar-thumb {
  background: rgba(17, 26, 58, .24);
  border-radius: 5px;
}

.ad-dealers-country-group {
  width: 100%;
  min-width: 0;
  padding: 17px 0 18px;
  border-bottom: 1px solid rgba(17, 26, 58, .28);
  overflow: hidden;
}

.ad-dealers-country-group:last-child {
  border-bottom: none;
}

.ad-dealers-country-group h3 {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #111;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ad-dealer-item {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  display: block !important;
  margin: 0 0 10px !important;
  padding: 10px 12px !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: transparent !important;
  text-align: left !important;
  cursor: pointer;
  color: #111 !important;
  user-select: none;
  white-space: normal !important;
  overflow: hidden !important;
  box-shadow: none !important;
  appearance: none;
}

.ad-dealer-item:last-child {
  margin-bottom: 0 !important;
}

.ad-dealer-item:hover,
.ad-dealer-item:focus,
.ad-dealer-item.is-active {
  background: #f2f2f2 !important;
  color: #111 !important;
  outline: none !important;
}

.ad-dealer-item:hover .ad-dealer-name,
.ad-dealer-item.is-active .ad-dealer-name,
.ad-dealer-item:hover .ad-dealer-address,
.ad-dealer-item:hover .ad-dealer-phone,
.ad-dealer-item.is-active .ad-dealer-address,
.ad-dealer-item.is-active .ad-dealer-phone {
  color: #111 !important;
  text-decoration: none !important;
}

.ad-dealer-name,
.ad-dealer-address,
.ad-dealer-phone {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.ad-dealer-name {
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.32;
  font-weight: 700;
}

.ad-dealer-address,
.ad-dealer-phone {
  font-size: 13px;
  line-height: 1.42;
  font-weight: 400;
}

.ad-dealers-empty {
  margin: 18px 0 0;
  font-size: 14px;
  line-height: 1.45;
}

.ad-dealers-popup {
  max-width: 260px;
  font-family: 'Inter', Arial, Helvetica, sans-serif;
}

.ad-dealers-popup strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.25;
  color: #111A3A;
}

.ad-dealers-popup p {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ad-dealers-popup a {
  font-size: 13px;
  color: #111A3A;
  text-decoration: none;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .ad-dealers-sidebar {
    top: 24px;
    left: 16px;
    width: 320px;
    height: calc(var(--ad-map-height, 720px) - 48px);
  }
}

@media (max-width: 640px) {
  .ad-dealers-layout {
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .ad-dealers-sidebar {
    position: relative;
    top: auto;
    left: auto;
    width: calc(100% - 24px);
    max-width: none;
    height: 360px;
    min-height: 360px;
    margin: 0 12px 12px;
    order: 1;
  }

  .ad-dealers-map {
    position: relative;
    height: 460px;
    order: 2;
  }
}
