/* Esplora — mockup Dashboard - Esplora.html */

#explore-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
}

#explore-wrap .mt-tile { display: flex; flex-direction: column; height: 100%; }

#explore-wrap .mt-dash-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

#explore-wrap .mt-span-1 { grid-column: span 1; }
#explore-wrap .mt-span-3 { grid-column: span 3; }

#explore-wrap .mt-hero {
  padding: 26px 28px 24px;
  overflow: hidden;
  position: relative;
}

#explore-wrap .mt-hero-wave {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 360px;
  height: 360px;
  z-index: 0;
  pointer-events: none;
}

#explore-wrap .mt-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  z-index: 1;
  gap: 12px;
}

#explore-wrap .mt-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mt-text-tertiary);
  margin-bottom: 4px;
}

#explore-wrap .mt-hero-name {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--mt-text-primary);
}

#explore-wrap .mt-hero-insight {
  font-size: 13.5px;
  color: var(--mt-text-secondary);
  margin-top: 9px;
  line-height: 1.45;
}

#explore-wrap .mt-hero-insight b {
  color: var(--mt-text-primary);
  font-weight: 600;
}

#explore-wrap .mt-scope-tag {
  font-size: 12px;
  color: var(--mt-text-tertiary);
  font-weight: 600;
  white-space: nowrap;
}

.mt-explore-rail { padding: 20px 18px; }

.mt-explore-rail-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mt-text-tertiary);
  margin-bottom: 12px;
}

.mt-explore-view-toggle {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mt-explore-view-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--mt-divider);
  background: rgba(255, 255, 255, 0.5);
  color: var(--mt-text-secondary);
  font-family: inherit;
  text-align: left;
}

.mt-explore-view-btn.active {
  border-color: var(--mt-purple);
  background: linear-gradient(135deg, rgba(124, 92, 246, 0.13), rgba(124, 92, 246, 0.04));
  color: var(--mt-purple-deep);
}

.mt-explore-body,
#explore-iframe-wrap {
  margin: 0;
  border: none;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  background: transparent;
}

#explore-iframe-wrap iframe {
  width: 100%;
  border: none;
  display: block;
  min-height: 400px;
}

#view-explore {
  padding: 0 !important;
  overflow-y: auto !important;
  position: static !important;
}

#view-explore #explore-hero { display: none !important; }

@media (max-width: 1080px) {
  #explore-wrap .mt-dash-grid { grid-template-columns: repeat(2, 1fr); }
  #explore-wrap .mt-span-3 { grid-column: span 2; }
}

@media (max-width: 900px) {
  #explore-wrap .mt-explore-hero-grid { display: none !important; }
}

/* ── Embed explore.php (shell) ── */
.mt-explore-embed .mt-glass {
  background: var(--mt-glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--mt-glass-border);
  border-radius: var(--mt-radius-lg);
  box-shadow: var(--mt-glass-shadow);
  position: relative;
}

.mt-explore-embed .mt-glass::after {
  content: "";
  position: absolute;
  top: 0;
  left: 6%;
  right: 6%;
  height: 1px;
  z-index: 2;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
  pointer-events: none;
}

.mt-explore-embed {
  --mt-bg: #F1F1F4;
  --mt-glass-bg: rgba(255, 255, 255, 0.58);
  --mt-glass-bg-strong: rgba(255, 255, 255, 0.78);
  --mt-glass-border: rgba(255, 255, 255, 0.65);
  --mt-glass-shadow: 0 18px 50px rgba(31, 38, 68, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -16px 30px rgba(124, 92, 246, 0.05);
  --mt-text-primary: #1D1D1F;
  --mt-text-secondary: #6E6E73;
  --mt-text-tertiary: #9B9BA1;
  --mt-divider: rgba(0, 0, 0, 0.07);
  --mt-purple: #7C5CFF;
  --mt-purple-soft: #A78BFA;
  --mt-purple-deep: #6647E0;
  --mt-radius-lg: 26px;
  margin: 0;
  padding: 0;
  background: transparent !important;
  color: var(--mt-text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.mt-explore-embed .app-shell,
.mt-explore-embed .main-area {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  height: auto !important;
  overflow: visible !important;
  display: block !important;
}

.mt-explore-embed .bg-scene,
.mt-explore-embed .sidebar { display: none !important; }

.mt-explore-embed .explore-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.mt-explore-embed .mt-explore-search {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--mt-glass-bg);
  border: 1px solid var(--mt-glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 999px;
  padding: 10px 16px;
  min-width: 260px;
  color: var(--mt-text-tertiary);
  flex: 1;
  max-width: 380px;
}

.mt-explore-embed .mt-explore-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  color: var(--mt-text-primary);
  width: 100%;
  font-family: inherit;
}

.mt-explore-embed .mt-explore-search input::placeholder { color: var(--mt-text-tertiary); }

.mt-explore-embed .filter-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 !important;
  flex-wrap: wrap;
  margin: 0;
}

.mt-explore-embed .filter-select {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 30px 8px 13px;
  border-radius: 999px;
  color: var(--mt-text-secondary);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--mt-divider);
  cursor: pointer;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%236E6E73' stroke-width='2.4'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  font-family: inherit;
}

.mt-explore-embed .filter-select option { background: #fff; color: #1D1D1F; }

.mt-explore-embed .filter-reset-btn {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 999px;
  color: #D9425A;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.mt-explore-embed .results-info {
  font-size: 12.5px;
  color: var(--mt-text-tertiary);
  margin-bottom: 14px;
  padding: 0 !important;
}

.mt-explore-embed .explore-content {
  position: static !important;
  height: auto !important;
  overflow: visible !important;
  min-height: 0 !important;
}

.mt-explore-embed .grid-view,
.mt-explore-embed .grid-view.active {
  position: static !important;
  height: auto !important;
  overflow: visible !important;
  padding: 0 !important;
  display: none;
}

.mt-explore-embed .grid-view.active { display: block; }

.mt-explore-embed .profiles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.mt-explore-embed .mt-explore-card {
  overflow: visible;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  padding: 0;
  border: 1px solid rgba(124, 92, 246, 0.16) !important;
  box-shadow:
    0 8px 22px rgba(31, 38, 68, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

.mt-explore-embed .mt-explore-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 28px rgba(31, 38, 68, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

.mt-explore-embed .biz-card-inner { overflow: hidden; border-radius: inherit; }

.mt-explore-embed .biz-banner {
  position: relative;
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}

.mt-explore-embed .biz-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 9px 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--mt-text-primary);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.mt-explore-embed .biz-logo {
  position: absolute;
  bottom: -16px;
  left: 14px;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: white;
  border: 2px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--mt-purple-deep);
  box-shadow: 0 4px 10px rgba(31, 38, 68, 0.12);
  overflow: hidden;
  z-index: 2;
}

.mt-explore-embed .biz-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9px;
}

.mt-explore-embed .biz-body { padding: 24px 16px 14px; }

.mt-explore-embed .biz-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--mt-text-primary);
}

.mt-explore-embed .biz-loc {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--mt-text-tertiary);
  margin-top: 2px;
}

.mt-explore-embed .biz-desc {
  font-size: 12px;
  color: var(--mt-text-secondary);
  margin-top: 8px;
  line-height: 1.4;
  min-height: 32px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mt-explore-embed .biz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 8px;
}

.mt-explore-embed .biz-social { display: flex; gap: 5px; }

.mt-explore-embed .biz-social a {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.045);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mt-text-secondary);
  text-decoration: none;
}

.mt-explore-embed .btn-details {
  font-size: 12px;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(124, 92, 246, 0.09);
  color: var(--mt-purple-deep);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  margin-left: auto;
  font-family: inherit;
}

.mt-explore-embed .pc-expanded { display: none !important; }

.mt-explore-embed .map-view {
  display: none;
}

.mt-explore-embed .map-view.active {
  display: block;
  width: 100%;
}

.mt-explore-embed .mt-explore-map-card {
  padding: 0;
  height: 560px;
  overflow: hidden;
  border-radius: var(--mt-radius-lg);
}

.mt-explore-embed #leaflet-map {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.mt-explore-embed .cluster-pin {
  background-color: #7C5CFF;
  background-image: linear-gradient(135deg, #A78BFA, #6647E0);
  color: #fff;
  opacity: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(31, 38, 68, 0.35);
  border: 2px solid #fff;
  text-shadow: 0 1px 2px rgba(31, 38, 68, 0.35);
  -webkit-font-smoothing: antialiased;
}

.mt-explore-embed .leaflet-marker-icon {
  background: transparent !important;
  border: none !important;
  opacity: 1 !important;
}

.mt-explore-embed .biz-pin {
  background: white;
  border: 2px solid var(--mt-purple);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mt-purple-deep);
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(31, 38, 68, 0.18);
  font-size: 13px;
  overflow: hidden;
}

.mt-explore-embed .biz-pin img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.mt-explore-embed .leaflet-popup-content-wrapper {
  border-radius: 20px !important;
  padding: 0 !important;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(31, 38, 68, 0.18) !important;
  background: #fff !important;
}

.mt-explore-embed .leaflet-popup-content {
  margin: 0 !important;
  width: 300px !important;
  line-height: 1.4;
}

.mt-explore-embed .leaflet-popup-tip-container { margin-top: -1px; }

.mt-explore-embed .leaflet-popup-tip {
  background: #fff !important;
  box-shadow: none !important;
}

.mt-explore-embed .leaflet-popup-close-button {
  color: var(--mt-text-secondary) !important;
  font-size: 20px !important;
  padding: 8px 10px 0 0 !important;
  z-index: 5;
}

/* Mappa — popup marker (secondo mockup) */
.mt-explore-embed .mt-map-popup {
  font-family: inherit;
  background: #fff;
}

.mt-explore-embed .mt-map-popup-header {
  height: 72px;
  position: relative;
  background-size: cover;
  background-position: center;
}

.mt-explore-embed .mt-map-popup-logo {
  position: absolute;
  bottom: -20px;
  left: 16px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: white;
  border: 3px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--mt-purple-deep);
  box-shadow: 0 6px 14px rgba(31, 38, 68, 0.16);
  overflow: hidden;
  z-index: 2;
}

.mt-explore-embed .mt-map-popup-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9px;
}

.mt-explore-embed .mt-map-popup-body {
  padding: 30px 18px 18px;
  background: #fff;
}

.mt-explore-embed .mt-map-popup-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--mt-text-primary);
}

.mt-explore-embed .mt-map-popup-meta {
  font-size: 12px;
  color: var(--mt-text-tertiary);
  margin-top: 3px;
}

.mt-explore-embed .mt-map-popup-desc {
  font-size: 13px;
  color: var(--mt-text-secondary);
  margin-top: 10px;
  line-height: 1.45;
}

.mt-explore-embed .mt-map-popup-contacts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.mt-explore-embed .mt-map-popup-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mt-text-primary);
  background: #fff;
  border: 1px solid var(--mt-divider);
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
}

.mt-explore-embed .mt-map-popup-contact svg {
  color: var(--mt-purple-deep);
  flex-shrink: 0;
}

.mt-explore-embed .mt-map-popup-contact span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.mt-explore-embed .mt-map-popup-pages-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mt-text-tertiary);
  margin: 16px 0 8px;
}

.mt-explore-embed .mt-map-popup-page-link {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mt-purple-deep);
  background: rgba(124, 92, 246, 0.09);
  padding: 11px 13px;
  border-radius: 13px;
  text-decoration: none;
  margin-bottom: 4px;
}

.mt-explore-embed .mt-map-popup-page-link svg {
  color: var(--mt-purple-deep);
  flex-shrink: 0;
}

.mt-explore-embed .mt-map-popup-page-link span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.mt-explore-embed .leaflet-control-zoom a {
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.85) !important;
  color: var(--mt-text-primary) !important;
}

.mt-explore-embed .empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 24px;
  color: var(--mt-text-secondary);
}

.mt-explore-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 30, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  padding: 24px;
  pointer-events: none;
}

.mt-explore-modal-overlay.open {
  display: flex;
  pointer-events: auto;
}

.mt-explore-modal-card {
  background: var(--mt-glass-bg-strong);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--mt-glass-border);
  border-radius: 24px;
  box-shadow: var(--mt-glass-shadow);
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  padding: 0;
}

/* Griglia — popup dettaglio (mockup detail-*) */
.mt-explore-modal-card .detail-banner {
  height: 110px;
  position: relative;
  background-size: cover;
  background-position: center;
}

.mt-explore-modal-card .detail-logo {
  position: absolute;
  bottom: -22px;
  left: 20px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: white;
  border: 3px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 17px;
  color: var(--mt-purple-deep);
  box-shadow: 0 6px 14px rgba(31, 38, 68, 0.18);
  overflow: hidden;
}

.mt-explore-modal-card .detail-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 11px;
}

.mt-explore-modal-card .detail-body {
  padding: 32px 22px 22px;
}

.mt-explore-modal-card .detail-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--mt-text-primary);
}

.mt-explore-modal-card .detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
  color: var(--mt-text-tertiary);
  margin-top: 4px;
}

.mt-explore-modal-card .detail-desc {
  font-size: 13px;
  color: var(--mt-text-secondary);
  margin-top: 12px;
  line-height: 1.5;
}

.mt-explore-modal-card .detail-contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.mt-explore-modal-card .detail-contact a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mt-text-primary);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--mt-divider);
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
}

.mt-explore-modal-card .detail-contact a svg {
  color: var(--mt-purple-deep);
  flex-shrink: 0;
}

.mt-explore-modal-card .detail-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mt-text-tertiary);
  margin: 16px 0 8px;
}

.mt-explore-modal-card .detail-page-link {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mt-purple-deep);
  background: rgba(124, 92, 246, 0.09);
  padding: 11px 13px;
  border-radius: 13px;
  text-decoration: none;
  margin-bottom: 6px;
}

.mt-explore-modal-card .detail-page-link svg {
  color: var(--mt-purple-deep);
  flex-shrink: 0;
}

.mt-explore-modal-close,
.mt-explore-modal-card .modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  color: var(--mt-text-secondary);
  z-index: 5;
}

@media (max-width: 1080px) {
  .mt-explore-embed .profiles-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .mt-explore-embed .profiles-grid { grid-template-columns: 1fr; }
  .mt-explore-embed .mt-explore-map-card { height: 420px; }
  .mt-explore-embed .explore-toolbar { flex-direction: column; align-items: stretch; }
  .mt-explore-embed .mt-explore-search { max-width: none; }
}
