/* ===================================================================
   Trova il Rivenditore — map.css v1.1.9
   Font: Montserrat  |  Accent: var(--e-global-color-accent, #c8a96e)
=================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

.rmap-widget {
  --rmap-accent:  var(--e-global-color-accent, #c8a96e);
  --rmap-dark:    #000;
  --rmap-text:    #1a1a1a;
  --rmap-muted:   #888;
  --rmap-border:  #ebebeb;
  --rmap-bg:      #f7f7f7;
  --rmap-card-bg: #fff;
  --rmap-radius:  12px;

  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: var(--rmap-text);
  border-radius: var(--rmap-radius);
  overflow: hidden;
  background: var(--rmap-card-bg);
  width: 100%;
  box-shadow: 0 4px 32px rgba(0,0,0,.10), 0 1px 4px rgba(0,0,0,.06);
}

.rmap-widget *, .rmap-widget *::before, .rmap-widget *::after {
  box-sizing: border-box; margin: 0; padding: 0;
}

/* ── Header ──────────────────────────────────────────────────────── */
.rmap-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 20px;
  background: var(--rmap-dark);
}
.rmap-header-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.rmap-logo-icon   { width: 24px; height: 24px; color: var(--rmap-accent); flex-shrink: 0; }
.rmap-title       { font-size: 14px; font-weight: 700; color: #fff; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rmap-header-right{ display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── Search ──────────────────────────────────────────────────────── */
.rmap-search-wrap { position: relative; display: flex; align-items: center; }
.rmap-search-icon {
  position: absolute; left: 12px; width: 13px; height: 13px;
  color: rgba(255,255,255,.5); pointer-events: none; flex-shrink: 0;
  z-index: 1;
}
.rmap-city-search {
  appearance: none;
  background: rgba(255,255,255,.10);
  border: 1.5px solid rgba(255,255,255,.18);
  border-radius: 20px;
  color: #fff;
  font-family: inherit; font-size: 12px; font-weight: 500;
  padding: 7px 30px 7px 34px;
  width: 170px; outline: none;
  transition: width .28s ease, background .2s, border-color .2s;
  letter-spacing: .2px;
}
.rmap-city-search::placeholder { color: rgba(255,255,255,.4); }
.rmap-city-search:focus {
  width: 210px;
  background: rgba(255,255,255,.15);
  border-color: var(--rmap-accent);
  box-shadow: 0 0 0 3px rgba(200,169,110,.18);
}
.rmap-search-clear {
  position: absolute; right: 10px; background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.5); padding: 0; display: none; align-items: center; justify-content: center;
  width: 14px; height: 14px; transition: color .15s;
}
.rmap-search-clear svg { width: 10px; height: 10px; }
.rmap-search-clear:hover { color: #fff; }
.rmap-search-clear-visible { display: flex; }

/* ── Country select ───────────────────────────────────────────────── */
.rmap-select-wrap { position: relative; display: flex; align-items: center; }
.rmap-select-icon { position: absolute; left: 11px; width: 13px; height: 13px; color: rgba(255,255,255,.5); pointer-events: none; }
.rmap-country-select {
  appearance: none;
  background: rgba(255,255,255,.10);
  border: 1.5px solid rgba(255,255,255,.18);
  border-radius: 20px;
  color: #fff; font-family: inherit; font-size: 12px; font-weight: 500;
  padding: 7px 28px 7px 30px;
  cursor: pointer; outline: none;
  transition: background .2s, border-color .2s;
}
.rmap-country-select option { color: #1a1a1a; background: #fff; }
.rmap-country-select:focus,
.rmap-country-select:hover {
  background: rgba(255,255,255,.15);
  border-color: var(--rmap-accent);
}
.rmap-chevron-select { position: absolute; right: 10px; width: 12px; height: 12px; color: rgba(255,255,255,.45); pointer-events: none; }

/* ── Body ────────────────────────────────────────────────────────── */
.rmap-body { display: flex; overflow: hidden; }

/* ── Sidebar ─────────────────────────────────────────────────────── */
.rmap-sidebar {
  width: 340px; min-width: 280px; flex-shrink: 0;
  background: var(--rmap-bg);
  border-right: 1px solid var(--rmap-border);
  display: flex; flex-direction: column; overflow: hidden;
}
.rmap-sidebar-inner {
  overflow-y: auto; flex: 1; padding-bottom: 16px;
  scrollbar-width: thin; scrollbar-color: #ddd transparent;
}
.rmap-sidebar-inner::-webkit-scrollbar { width: 3px; }
.rmap-sidebar-inner::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* ── Continent / Country labels ──────────────────────────────────── */
.rmap-continent-label {
  font-size: 9px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--rmap-muted); padding: 18px 18px 6px;
  border-top: 1px solid var(--rmap-border); margin-top: 4px;
}
.rmap-continent-group:first-child .rmap-continent-label { border-top: none; margin-top: 0; padding-top: 14px; }

.rmap-country-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 18px 4px;
  font-size: 11px; font-weight: 600; color: #aaa; text-transform: uppercase; letter-spacing: .8px;
}
.rmap-country-count {
  background: #e8e8e8; color: #888; font-size: 10px; font-weight: 700;
  border-radius: 20px; padding: 1px 7px; line-height: 16px;
}

/* ── Office item ─────────────────────────────────────────────────── */
.rmap-office-item {
  margin: 3px 10px;
  border-radius: 10px;
  background: var(--rmap-card-bg);
  border: 1px solid transparent;
  transition: border-color .15s, box-shadow .15s;
  cursor: pointer;
}
.rmap-office-item:hover { border-color: #e0e0e0; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.rmap-office-item.rmap-active {
  border-color: var(--rmap-accent);
  box-shadow: 0 2px 16px rgba(0,0,0,.08);
  background: var(--rmap-card-bg);
}

/* Header riga */
.rmap-office-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; gap: 8px; user-select: none;
}
.rmap-office-header-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.rmap-office-titles { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow: hidden; }
.rmap-office-name {
  font-size: 12px; font-weight: 600; color: var(--rmap-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rmap-office-city {
  font-size: 10px; font-weight: 500; color: var(--rmap-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-transform: uppercase; letter-spacing: .5px;
}
.rmap-active .rmap-office-name { color: var(--rmap-accent); }
.rmap-active .rmap-office-city { color: var(--rmap-accent); opacity: .7; }
.rmap-no-coords .rmap-office-titles { opacity: .55; }

.rmap-chevron {
  width: 15px; height: 15px; color: #ccc; flex-shrink: 0;
  transition: transform .25s cubic-bezier(.4,0,.2,1), color .15s;
}
.rmap-active .rmap-chevron { transform: rotate(180deg); color: var(--rmap-accent); }

/* ── Detail accordion ────────────────────────────────────────────── */
.rmap-office-detail {
  max-height: 0; overflow: hidden;
  transition: max-height .32s cubic-bezier(.4,0,.2,1), opacity .25s;
  opacity: 0; padding: 0 14px;
}
.rmap-active .rmap-office-detail { max-height: 500px; opacity: 1; padding: 0 14px 14px; }

/* Logo dentro l'accordion */
.rmap-detail-logo {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rmap-border);
}
.rmap-detail-logo img {
  width: 150px; max-height: 72px; object-fit: contain;
  display: block; border-radius: 6px; background: #fafafa;
}

/* Righe dati */
.rmap-detail-row {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 4px 0; font-size: 12px; color: #555; line-height: 1.5;
}
.rmap-detail-row:first-child { padding-top: 0; }
.rmap-icon { width: 14px; height: 14px; flex-shrink: 0; color: var(--rmap-accent); margin-top: 1px; }
.rmap-detail-row a { color: var(--rmap-accent); text-decoration: none; }
.rmap-detail-row a:hover { text-decoration: underline; }
.rmap-directions-row { margin-top: 6px; }
.rmap-directions-row a { font-weight: 700; font-size: 11px; letter-spacing: .3px; text-transform: uppercase; }

/* Social icons — neutral modern */
.rmap-socials-row { gap: 6px; flex-wrap: wrap; padding: 4px 0 2px; }
.rmap-social-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px;
  background: #f0f0f0; color: #555;
  transition: background .15s, color .15s; flex-shrink: 0;
}
.rmap-social-icon:hover { background: #e0e0e0; color: #111; }
.rmap-social-icon svg { width: 13px; height: 13px; }

/* ── Map panel ───────────────────────────────────────────────────── */
.rmap-map-panel  { flex: 1; position: relative; background: #e8e8e8; }
.rmap-map        { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .4s; }
.rmap-map.rmap-map-ready { opacity: 1; }
.rmap-map-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; pointer-events: none; transition: opacity .3s;
}
.rmap-map-placeholder svg { width: 48px; height: 48px; opacity: .25; }
.rmap-map-placeholder p   { font-size: 12px; color: #aaa; font-weight: 500; }

/* ── No results ───────────────────────────────────────────────────── */
.rmap-no-results { display: none; padding: 32px 20px; text-align: center; color: #aaa; }
.rmap-no-results.rmap-visible { display: block; }
.rmap-no-results p { font-size: 12px; font-weight: 500; }

/* ── Leaflet popup ────────────────────────────────────────────────── */
.rmap-leaflet-popup .leaflet-popup-content-wrapper {
  padding: 0 !important; border-radius: 10px !important;
  overflow: hidden !important; box-shadow: 0 8px 32px rgba(0,0,0,.18) !important;
}
.rmap-leaflet-popup .leaflet-popup-content { margin: 0 !important; }

/* ── Popup card ───────────────────────────────────────────────────── */
.rmap-popup { font-family: 'Montserrat', -apple-system, sans-serif; min-width: 200px; max-width: 260px; }
.rmap-popup-header { padding: 12px 14px 10px; background: var(--rmap-dark); color: #fff; }
.rmap-popup-tipo   { font-size: 9px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; opacity: .6; display: block; margin-bottom: 2px; }
.rmap-popup-nome   { font-size: 14px; font-weight: 700; display: block; line-height: 1.3; }
.rmap-popup-body   { padding: 10px 14px 12px; background: #fff; }
.rmap-popup-body p { margin: 0 0 4px; color: #555; line-height: 1.5; font-size: 12px; }
.rmap-popup-body a { color: var(--rmap-accent); text-decoration: none; font-size: 12px; font-weight: 600; }
.rmap-popup-body a:hover { text-decoration: underline; }

/* ── Pin markers ─────────────────────────────────────────────────── */
.rmap-pin-dot {
  width: 13px; height: 13px;
  background: var(--rmap-accent);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,.28);
}
.rmap-pin-logo {
  width: 30px; height: 30px; border-radius: 50%;
  overflow: hidden; border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.22); background: #fff;
}
.rmap-pin-logo img { width: 100%; height: 100%; object-fit: contain; }

/* ── Cluster ─────────────────────────────────────────────────────── */
.rmap-cluster-icon {
  background: var(--rmap-dark); border-radius: 50%; color: #fff;
  font-family: 'Montserrat', -apple-system, sans-serif;
  font-size: 12px; font-weight: 700; text-align: center;
  border: 2px solid rgba(255,255,255,.3);
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .rmap-body       { flex-direction: column; height: auto !important; }
  .rmap-sidebar    { width: 100%; min-width: 0; border-right: none; border-bottom: 1px solid var(--rmap-border); max-height: 340px; }
  .rmap-map-panel  { height: 300px; flex: none; }
  .rmap-header     { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 16px; }
  .rmap-header-right { flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; }
  .rmap-city-search,
  .rmap-city-search:focus { width: 100%; }
  .rmap-select-wrap,
  .rmap-country-select { width: 100%; }
}
