/* ── Blocco esterno ──────────────────────────── */
.smp-block {
	display: flex;
	flex-direction: column;
	gap: 0;
	width: 100%;
}

/* ── Wrapper ─────────────────────────────────── */
.smp-wrapper {
	position: relative;
	display: block;
	width: 100%;
	border-radius: 8px;
	background: transparent;
}

/* ── Viewport ────────────────────────────────── */
.smp-map-viewport {
	position: relative;
	width: 100%;
	overflow: hidden;
	cursor: grab;
}
.smp-map-viewport:active { cursor: grabbing; }

/* ── Container SVG ───────────────────────────── */
.smp-svg-container {
	display: block;
	width: 100%;
	line-height: 0;
	transform-origin: 0 0;
}

/* SVG sempre visibile anche senza JS */
.smp-svg-container svg {
	display: block !important;
	width: 100% !important;
	height: auto !important;
	max-width: 100%;
	pointer-events: all;
}

/* ── Controlli zoom ──────────────────────────── */
.smp-zoom-controls {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 50;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.smp-zoom-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
	font-size: 18px;
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
	color: #333;
	box-shadow: 0 2px 8px rgba(0,0,0,0.12);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
	user-select: none;
}

.smp-zoom-btn:hover {
	background: #fff;
	box-shadow: 0 4px 14px rgba(0,0,0,0.18);
	transform: scale(1.08);
}

.smp-zoom-btn:active {
	transform: scale(0.95);
}

/* ── Pin ─────────────────────────────────────── */
/* La scala hover è gestita via SVG transform in JS (non CSS),
   così il counter-zoom funziona correttamente */
.smp-pin {
	cursor: pointer;
}

/* ── Hover card ──────────────────────────────── */
.smp-hover-card {
	display: none;
	position: absolute;
	z-index: 100;
	padding: 14px 16px;
	min-width: 160px;
	pointer-events: auto;
	animation: smp-card-in 0.18s ease;
}

@keyframes smp-card-in {
	from { opacity: 0; transform: translateY(4px) scale(0.97); }
	to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.smp-hc-title {
	font-size: 15px;
	font-weight: 700;
	color: #1a1a2e;
	margin-bottom: 6px;
	line-height: 1.3;
}

/* Divider varianti */
.smp-hc-divider {
	margin: 6px 0 8px;
	height: 1px;
	background: #e8e8e8;
}

.smp-div--none     { display: none; }
.smp-div--line     { height: 1px; background: #e8e8e8; }
.smp-div--dot      { height: 1px; background: repeating-linear-gradient(90deg,#ccc 0,#ccc 4px,transparent 4px,transparent 8px); }
.smp-div--gradient { height: 2px; background: linear-gradient(90deg,#ccc,transparent); }

.smp-hc-desc {
	font-size: 13px;
	color: #555;
	line-height: 16px;
	white-space: pre-wrap;
}

.smp-hc-desc a    { color: #3498db; }
.smp-hc-desc p    { margin: 0 0 4px; }
.smp-hc-desc p:last-child { margin: 0; }

/* ══════════════════════════════════════════════
   SEARCH
══════════════════════════════════════════════ */

/* Contenitore search */
.smp-search-wrap {
	position: relative;
	padding: 14px 0 0;
	max-width: 480px;
	margin-left: auto;
	margin-right: auto;
}

/* Barra di ricerca pill */
.smp-search-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #fff !important;
	border: 1.5px solid #e2e8f0 !important;
	border-radius: 50px !important;
	padding: 0 14px;
	height: 44px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
	transition: border-color 0.2s, box-shadow 0.2s;
	outline: none !important;
}

.smp-search-bar:focus-within {
	border-color: #6366f1 !important;
	box-shadow: 0 0 0 3px rgba(99,102,241,0.13), 0 4px 16px rgba(0,0,0,0.08);
}

.smp-search-icon {
	width: 16px !important;
	height: 16px !important;
	min-width: 16px;
	min-height: 16px;
	color: #94a3b8;
	flex-shrink: 0;
	transition: color 0.2s;
}

.smp-search-bar:focus-within .smp-search-icon {
	color: #6366f1;
}

.smp-search-input {
	flex: 1;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
	font-size: 14px;
	color: #1e293b;
	line-height: 1;
	min-width: 0;
	-webkit-appearance: none;
	appearance: none;
}

.smp-search-input::placeholder {
	color: #94a3b8;
}

/* Reset stile browser per type=search */
.smp-search-input::-webkit-search-decoration,
.smp-search-input::-webkit-search-cancel-button,
.smp-search-input::-webkit-search-results-button,
.smp-search-input::-webkit-search-results-decoration {
	-webkit-appearance: none;
	display: none;
}

/* Pulsante cancella */
.smp-search-clear {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border: none;
	background: #e2e8f0;
	border-radius: 50%;
	cursor: pointer;
	color: #64748b;
	flex-shrink: 0;
	transition: background 0.15s, color 0.15s;
	padding: 0;
}

.smp-search-clear svg {
	width: 10px;
	height: 10px;
}

.smp-search-clear:hover {
	background: #cbd5e1;
	color: #1e293b;
}

/* Dropdown suggerimenti */
.smp-suggestions {
	position: absolute;
	top: calc(100% - 6px);
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	box-shadow: 0 8px 30px rgba(0,0,0,0.12);
	list-style: none;
	margin: 6px 0 0;
	padding: 6px;
	z-index: 200;
	overflow: hidden;
	animation: smp-fade-down 0.15s ease;
}

@keyframes smp-fade-down {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: translateY(0); }
}

.smp-suggestions li {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 14px;
	border-radius: 10px;
	font-size: 14px;
	color: #1e293b;
	cursor: pointer;
	transition: background 0.12s;
}

.smp-suggestions li:hover {
	background: #f1f5f9;
}

.smp-sug-icon {
	font-size: 16px;
	flex-shrink: 0;
}

/* Risultati */
.smp-results {
	margin-top: 16px;
	animation: smp-fade-down 0.18s ease;
}

.smp-results-count {
	font-size: 13px;
	color: #64748b;
	margin: 0 0 12px;
	font-weight: 500;
}

/* Griglia risultati */
.smp-results-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 200px, 1fr ) );
	gap: 10px;
}

/* Scheda singolo risultato */
.smp-result-card {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #fff;
	border: 1.5px solid #e2e8f0;
	border-radius: 14px;
	padding: 12px 14px;
	cursor: pointer;
	text-align: left;
	width: 100%;
	transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
	box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.smp-result-card:hover {
	border-color: #6366f1;
	box-shadow: 0 4px 16px rgba(99,102,241,0.15);
	transform: translateY(-1px);
}

.smp-rc-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	flex-shrink: 0;
	box-shadow: 0 0 0 2px rgba(255,255,255,0.8), 0 0 0 3px currentColor;
}

.smp-rc-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.smp-rc-title {
	font-size: 14px;
	font-weight: 600;
	color: #1e293b;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.smp-rc-loc {
	font-size: 12px;
	color: #64748b;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ── Mobile ──────────────────────────────────── */
@media ( max-width: 600px ) {
	.smp-zoom-controls { top: 8px; right: 8px; }
	.smp-zoom-btn { width: 30px; height: 30px; font-size: 16px; }

	/* Su mobile la hover card diventa fissa in basso */
	.smp-hover-card {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		top: auto;
		max-width: 100% !important;
		border-radius: 14px 14px 0 0 !important;
		padding: 18px 20px 24px;
		animation: smp-card-up 0.22s ease;
	}

	@keyframes smp-card-up {
		from { transform: translateY(100%); }
		to   { transform: translateY(0); }
	}
}

/* ══════════════════════════════════════════════
   DETAIL PANEL
══════════════════════════════════════════════ */

.smp-detail-panel {
    margin-top: 20px;
    animation: smp-panel-in 0.3s cubic-bezier(.22,.68,0,1.1);
}

@keyframes smp-panel-in {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.smp-dp-wrap {
    background: #fff;
    border: 1.5px solid #e8edf5;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
    padding: 28px 32px;
    position: relative;
}

.smp-dp-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    line-height: 1;
    padding: 0;
}

.smp-dp-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Header */
.smp-dp-header {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1.5px solid #f1f5f9;
    padding-right: 40px;
}

.smp-dp-logo {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smp-dp-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.smp-dp-header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.smp-dp-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.smp-dp-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
}

.smp-dp-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

/* Description */
.smp-dp-desc {
    font-size: 14px;
    color: #475569;
    line-height: 1.65;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1.5px solid #f1f5f9;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.smp-dp-desc p    { margin: 0 0 6px; }
.smp-dp-desc p:last-child { margin: 0; }

/* Grid */
.smp-dp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.smp-dp-col-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: #94a3b8;
    margin-bottom: 10px;
}

.smp-dp-info-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: #1e293b;
    padding: 3px 0;
    line-height: 1.4;
}

.smp-dp-ii-icon {
    font-size: 15px;
    flex-shrink: 0;
    line-height: 1.3;
}

.smp-dp-info-item a {
    color: #6366f1;
    text-decoration: none;
    word-break: break-all;
}

.smp-dp-info-item a:hover { text-decoration: underline; }

/* Section */
.smp-dp-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1.5px solid #f1f5f9;
}

.smp-dp-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Online links */
.smp-dp-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.smp-dp-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    color: #475569;
    transition: background .15s, border-color .15s, color .15s;
}

.smp-dp-link:hover {
    background: #f1f5f9;
    border-color: #6366f1;
    color: #6366f1;
}

.smp-dp-link--fb:hover { border-color: #1877f2; color: #1877f2; }
.smp-dp-link--ig:hover { border-color: #e1306c; color: #e1306c; }
.smp-dp-link--tw:hover { border-color: #000; color: #000; }
.smp-dp-link--li:hover { border-color: #0a66c2; color: #0a66c2; }

/* Events content */
.smp-dp-events-content {
    font-size: 14px;
    color: #475569;
    line-height: 1.65;
    margin-top: 4px;
}

/* Footer */
.smp-dp-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1.5px solid #f1f5f9;
}

.smp-dp-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 24px;
    background: var(--smp-cta-bg, #6366f1);
    color: var(--smp-cta-color, #fff) !important;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: filter .15s, transform .1s, box-shadow .15s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.smp-dp-cta:hover {
    filter: brightness(0.88);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.22);
}

.smp-dp-back {
    background: none;
    border: 1.5px solid #e2e8f0;
    color: #64748b;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
    font-family: inherit;
}

.smp-dp-back:hover {
    border-color: #94a3b8;
    color: #1e293b;
    background: #f8fafc;
}

/* Mobile */
@media ( max-width: 600px ) {
    .smp-dp-wrap {
        padding: 20px 16px;
        border-radius: 16px;
    }
    .smp-dp-title { font-size: 18px; }
    .smp-dp-grid { grid-template-columns: 1fr; gap: 16px; }
    .smp-dp-footer { flex-direction: column; align-items: stretch; }
    .smp-dp-cta, .smp-dp-back { text-align: center; justify-content: center; }
}
