/* Seaman Distributor Map — estilos del frontend
   Paleta del sitio: cian #00bcd4, texto #333, apagado #747474, oscuro #32383c */

.sdm-wrap {
	--sdm-cyan: #00bcd4;
	--sdm-cyan-dark: #00a5bb;
	--sdm-text: #333;
	--sdm-muted: #747474;
	--sdm-dark: #32383c;
	--sdm-border: #e4e7e9;
	--sdm-list-width: 35%;
	--sdm-map-height: 620px;
	color: var(--sdm-text);
	font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- Barra de título estilo sitio --- */
.sdm-titlebar {
	background: #e2e2e2;
	padding: 24px clamp(16px, 5vw, 60px);
}
.sdm-title {
	margin: 0;
	font-size: 22px;
	font-weight: 400;
	color: #414141;
	line-height: 1.2;
}
.sdm-intro {
	max-width: 900px;
	margin: 28px auto 22px;
	padding: 0 20px;
	text-align: center;
	font-size: 17px;
	color: var(--sdm-text);
}

/* --- Contenedor de dos columnas --- */
.sdm-widget {
	display: grid;
	grid-template-columns: var(--sdm-list-width) 1fr;
	gap: 0;
	border-top: 1px solid var(--sdm-border);
	position: relative;
}

/* --- Columna de listado --- */
.sdm-list {
	max-height: var(--sdm-map-height);
	overflow-y: auto;
	background: #fff;
	border-right: 1px solid var(--sdm-border);
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: #c8ccce transparent;
}
.sdm-list::-webkit-scrollbar { width: 8px; }
.sdm-list::-webkit-scrollbar-thumb { background: #c8ccce; border-radius: 4px; }

/* --- Buscador de la lista --- */
.sdm-search {
	position: sticky;
	top: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px clamp(14px, 2vw, 20px);
	background: #fff;
	border-bottom: 1px solid var(--sdm-border);
}
.sdm-search-ico {
	flex: 0 0 16px;
	width: 16px; height: 16px;
	background: var(--sdm-muted);
	-webkit-mask: no-repeat center / contain;
	mask: no-repeat center / contain;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M15.5 14h-.8l-.3-.3a6.5 6.5 0 1 0-.7.7l.3.3v.8l5 5 1.5-1.5-5-5zm-6 0A4.5 4.5 0 1 1 14 9.5 4.5 4.5 0 0 1 9.5 14z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M15.5 14h-.8l-.3-.3a6.5 6.5 0 1 0-.7.7l.3.3v.8l5 5 1.5-1.5-5-5zm-6 0A4.5 4.5 0 1 1 14 9.5 4.5 4.5 0 0 1 9.5 14z'/%3E%3C/svg%3E");
}
.sdm-search-input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: 14px;
	color: var(--sdm-text);
	padding: 4px 0;
}
.sdm-search-input:focus { outline: none; }
.sdm-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.sdm-search-clear {
	flex: 0 0 auto;
	border: 0;
	background: #eceff1;
	color: #607d8b;
	width: 22px; height: 22px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
}
.sdm-search-clear:hover { background: #cfd8dc; }
.sdm-search-empty {
	margin: 0;
	padding: 18px 20px;
	color: var(--sdm-muted);
	font-size: 14px;
	text-align: center;
}

.sdm-area { padding: 0; }
.sdm-area[hidden] { display: none; }
.sdm-area-list li[hidden] { display: none; }
.sdm-area-title {
	margin: 0;
	padding: 12px clamp(14px, 2vw, 24px) 8px;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .5px;
	color: var(--sdm-cyan);
	text-transform: uppercase;
	position: sticky;
	top: 0;
	background: #fff;
	z-index: 2;
	border-bottom: 1px solid var(--sdm-border);
}
.sdm-has-search .sdm-area-title { top: 49px; }
.sdm-area-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.sdm-area-list li { margin: 0; }

.sdm-item {
	display: block;
	width: 100%;
	text-align: left;
	background: none;
	border: 0;
	border-bottom: 1px solid #f0f2f3;
	border-left: 3px solid transparent;
	padding: 12px clamp(14px, 2vw, 24px);
	box-sizing: border-box;
	cursor: pointer;
	font-family: inherit;
	transition: background .15s ease, border-color .15s ease;
}
.sdm-item:hover { background: #f6fcfd; border-left-color: var(--sdm-cyan); }
.sdm-item:focus-visible { outline: 2px solid var(--sdm-cyan); outline-offset: -2px; }
.sdm-item.is-active {
	background: #e9f9fc;
	border-left-color: var(--sdm-cyan);
}
.sdm-item-name {
	display: block;
	font-size: 15px;
	font-weight: 600;
	color: var(--sdm-text);
	line-height: 1.25;
}
.sdm-item.is-active .sdm-item-name { color: var(--sdm-cyan-dark); }
.sdm-item-addr {
	display: block;
	margin-top: 3px;
	font-size: 13px;
	color: var(--sdm-muted);
	line-height: 1.35;
}

/* --- Columna del mapa --- */
.sdm-map-col { position: relative; }
.sdm-map {
	width: 100%;
	height: var(--sdm-map-height);
	background: #aadaff;
	z-index: 1;
}
.sdm-map .leaflet-container { font-family: inherit; }

/* Botón "ver mapa completo": abajo al centro. Arriba a la derecha quedaba
   debajo de la lupa del mapa (en Safari/Mac la lupa lo tapaba). */
.sdm-reset {
	position: absolute;
	bottom: 18px;
	left: 50%;
	transform: translateX(-50%);
	white-space: nowrap;
	z-index: 1001;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: var(--sdm-cyan);
	color: #fff;
	border: 0;
	border-radius: 24px;
	padding: 9px 16px 9px 14px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 3px 10px rgba(0,0,0,.22);
	transition: background .15s ease, transform .15s ease;
}
.sdm-reset:hover { background: var(--sdm-cyan-dark); transform: translate(-50%, -1px); }
.sdm-reset[hidden] { display: none; }
.sdm-reset-icon {
	width: 15px; height: 15px;
	background: currentColor;
	-webkit-mask: no-repeat center / contain;
	mask: no-repeat center / contain;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 5h18v14H3z' fill='none' stroke='white' stroke-width='2'/%3E%3Cpath d='M3 5l9 7 9-7' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 3L3 6v15l6-3 6 3 6-3V3l-6 3-6-3z' fill='white'/%3E%3C/svg%3E");
}

/* --- Tarjeta (popup Leaflet) --- */
.leaflet-popup.sdm-popup .leaflet-popup-content-wrapper {
	border-radius: 10px;
	box-shadow: 0 8px 26px rgba(0,0,0,.25);
	padding: 0;
	overflow: hidden;
}
.leaflet-popup.sdm-popup .leaflet-popup-content {
	margin: 0;
	width: 270px !important;
	line-height: 1.4;
}
.leaflet-popup.sdm-popup .leaflet-popup-tip { box-shadow: 0 8px 26px rgba(0,0,0,.25); }

.sdm-card { font-family: "Source Sans Pro", sans-serif; }
.sdm-card-head {
	background: var(--sdm-dark);
	padding: 14px 16px;
}
.sdm-card-logo {
	display: block;
	max-height: 40px;
	max-width: 150px;
	width: auto;
	margin-bottom: 8px;
	background: #fff;
	padding: 4px 6px;
	border-radius: 4px;
}
.sdm-card-area {
	display: block;
	font-size: 11px;
	letter-spacing: .6px;
	text-transform: uppercase;
	color: var(--sdm-cyan);
	font-weight: 600;
}
.sdm-card-name {
	display: block;
	margin-top: 2px;
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	line-height: 1.2;
}
.sdm-card-body { padding: 12px 16px 14px; }
.sdm-card-row {
	display: flex;
	gap: 8px;
	font-size: 13px;
	color: var(--sdm-text);
	margin: 0 0 8px;
}
.sdm-card-row:last-child { margin-bottom: 0; }
.sdm-card-row .sdm-ico {
	flex: 0 0 15px;
	width: 15px; height: 15px;
	margin-top: 2px;
	fill: var(--sdm-cyan);
}
.sdm-card-row a { color: var(--sdm-cyan-dark); text-decoration: none; word-break: break-word; }
.sdm-card-row a:hover { text-decoration: underline; }
.sdm-card-row .sdm-card-emails a { display: block; }

/* Popups largos: cabecera fija visualmente + cuerpo con scroll */
.leaflet-popup.sdm-popup .leaflet-popup-scrolled {
	scrollbar-width: thin;
}

/* --- Punto pequeño (marcador estándar) --- */
.sdm-dot-icon { background: none; border: 0; }
.sdm-dot {
	display: block;
	width: 14px;
	height: 14px;
	margin: 2px;
	background: var(--sdm-cyan);
	border: 2px solid #fff;
	border-radius: 50%;
	box-shadow: 0 1px 4px rgba(0,0,0,.4);
	transition: transform .12s ease;
}
.sdm-dot-icon:hover .sdm-dot { transform: scale(1.25); }

/* --- Cluster (globo general de un área) --- */
.sdm-cluster {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--sdm-cyan);
	color: #fff;
	font-family: "Source Sans Pro", sans-serif;
	font-weight: 700;
	font-size: 14px;
	border-radius: 50%;
	border: 3px solid #fff;
	box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.sdm-cluster span { line-height: 1; }
.sdm-cluster:hover { background: var(--sdm-cyan-dark); }

/* --- Marcador badge (logo/tridente, p. ej. sede) --- */
.sdm-badge-icon { background: none; border: 0; }
.sdm-badge {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: #fff;
	border: 3px solid var(--sdm-cyan);
	border-radius: 50%;
	box-shadow: 0 3px 8px rgba(0,0,0,.3);
	position: relative;
}
.sdm-badge::after {
	content: "";
	position: absolute;
	bottom: -8px;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: var(--sdm-cyan);
}
.sdm-badge img {
	width: 26px;
	height: 26px;
	object-fit: contain;
	display: block;
}

/* --- Lupa de búsqueda sobre el mapa --- */
.sdm-mapsearch {
	background: #fff;
	border-radius: 22px !important;
	box-shadow: 0 2px 8px rgba(0,0,0,.22);
	display: flex;
	align-items: center;
	overflow: visible;
	border: 0 !important;
}
.sdm-mapsearch-btn {
	width: 40px; height: 40px;
	border: 0;
	background: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 22px;
	flex: 0 0 auto;
}
.sdm-wrap .sdm-mapsearch-btn { padding: 0; margin: 0; min-width: 0; box-shadow: none; }
.sdm-mapsearch-btn svg { flex: 0 0 20px; width: 20px; height: 20px; fill: var(--sdm-dark); }
.sdm-mapsearch.is-open .sdm-mapsearch-btn svg { fill: var(--sdm-cyan); }
.sdm-mapsearch-box {
	position: relative;
	width: 0;
	overflow: hidden;
	transition: width .22s ease;
}
.sdm-mapsearch.is-open .sdm-mapsearch-box { width: 210px; overflow: visible; }
.sdm-mapsearch-input {
	width: 100%;
	border: 0;
	background: none;
	font-family: "Source Sans Pro", sans-serif;
	font-size: 14px;
	color: var(--sdm-text);
	padding: 0 12px 0 2px;
	height: 40px;
	opacity: 0;
	transition: opacity .2s ease;
}
.sdm-mapsearch.is-open .sdm-mapsearch-input { opacity: 1; }
.sdm-mapsearch-input:focus { outline: none; }
.sdm-wrap input.sdm-mapsearch-input,
.sdm-wrap input.sdm-mapsearch-input:focus {
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: none;
	min-height: 0;
	margin: 0;
	padding: 0 12px 0 2px;
}
.sdm-wrap .sdm-mapsearch-input::placeholder,
.sdm-wrap .sdm-search-input::placeholder { color: #9aa3a8; opacity: 1; }
.sdm-mapsearch-results {
	position: absolute;
	top: 46px;
	right: 0;
	width: 250px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 6px 18px rgba(0,0,0,.22);
	overflow: hidden;
}
.sdm-mapsearch-results[hidden] { display: none; }
.sdm-mapsearch-item {
	display: block;
	width: 100%;
	text-align: left;
	border: 0;
	border-bottom: 1px solid #eee;
	background: #fff;
	padding: 9px 12px;
	cursor: pointer;
	font-family: "Source Sans Pro", sans-serif;
}
.sdm-mapsearch-item:hover { background: #f0fbfd; }
.sdm-mapsearch-item strong { display: block; font-size: 13px; color: var(--sdm-text); }
.sdm-mapsearch-item span { display: block; font-size: 11px; color: var(--sdm-cyan); text-transform: uppercase; letter-spacing: .4px; }
.sdm-mapsearch-none { padding: 12px; font-size: 13px; color: var(--sdm-muted); text-align: center; }

/* Atribución oculta a petición (el control ya está desactivado en JS). */
.sdm-map .leaflet-control-attribution { display: none; }

/* --- Listado en escritorio: ventana sin barra + flechas (alto = mapa) --- */
.sdm-scroll-btn { display: none; }
@media (min-width: 861px) {
	.sdm-widget { --sdm-h: clamp(380px, calc(100vh - 130px), var(--sdm-map-height)); }
	.sdm-map { height: var(--sdm-h); }
	.sdm-list.sdm-has-scroller {
		display: flex;
		flex-direction: column;
		height: var(--sdm-h);
		max-height: none;
		overflow: hidden;
	}
	.sdm-has-scroller .sdm-scroll {
		position: relative;
		flex: 1 1 auto;
		min-height: 0;
	}
	.sdm-has-scroller .sdm-viewport {
		height: 100%;
		overflow-y: auto;
		scrollbar-width: none;
		overscroll-behavior: contain;
	}
	.sdm-has-scroller .sdm-viewport::-webkit-scrollbar { display: none; }
	.sdm-has-scroller .sdm-area-list > li > .sdm-item { min-height: inherit; }
	.sdm-has-scroller .sdm-area-title { top: 0; }
	.sdm-wrap .sdm-has-scroller .sdm-scroll-btn {
		display: block;
		position: absolute;
		right: 8px;
		z-index: 4;
		width: 28px;
		height: 28px;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: rgba(255,255,255,.92);
		box-shadow: 0 1px 4px rgba(0,0,0,.18);
		cursor: pointer;
		transition: opacity .2s ease, background .2s ease;
	}
	.sdm-wrap .sdm-scroll-btn::before {
		content: "";
		position: absolute;
		left: 50%;
		top: 50%;
		width: 8px;
		height: 8px;
		border-left: 1.5px solid #7d7d7d;
		border-top: 1.5px solid #7d7d7d;
		transition: border-color .2s ease;
	}
	.sdm-wrap .sdm-scroll-up { top: 6px; }
	.sdm-wrap .sdm-scroll-up::before { transform: translate(-50%, -25%) rotate(45deg); }
	.sdm-wrap .sdm-scroll-down { bottom: 8px; }
	.sdm-wrap .sdm-scroll-down::before { transform: translate(-50%, -75%) rotate(-135deg); }
	.sdm-wrap .sdm-scroll-btn:hover,
	.sdm-wrap .sdm-scroll-btn:focus-visible { background: #e9f9fc; outline: none; }
	.sdm-wrap .sdm-scroll-btn:hover::before,
	.sdm-wrap .sdm-scroll-btn:focus-visible::before { border-color: var(--sdm-cyan); }
	.sdm-wrap .sdm-scroll-btn.is-off { opacity: 0; pointer-events: none; }
}

/* Pantallas con escala (125 %, 150 %…): el navegador agranda cada tile y su
   borde se mezcla con transparente → líneas finas. 1px de solape las tapa. */
@media (min-resolution: 1.01dppx) {
	.sdm-map img.leaflet-tile {
		width: 257px !important;
		height: 257px !important;
		/* Leaflet 1.9 usa plus-lighter (suma brillo): con solape daría líneas blancas. */
		mix-blend-mode: normal !important;
	}
}

/* --- Toggle de lista (solo móvil) --- */
.sdm-list-toggle {
	display: none;
	width: 100%;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: var(--sdm-dark);
	color: #fff;
	border: 0;
	padding: 14px 16px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}
.sdm-list-toggle-icon {
	width: 18px; height: 12px;
	background:
		linear-gradient(currentColor,currentColor) top/100% 2px no-repeat,
		linear-gradient(currentColor,currentColor) center/100% 2px no-repeat,
		linear-gradient(currentColor,currentColor) bottom/100% 2px no-repeat;
}
.sdm-list-toggle[aria-expanded="true"] .sdm-list-toggle-icon {
	background: linear-gradient(currentColor,currentColor) center/100% 2px no-repeat;
}

/* --- Responsive --- */
@media (max-width: 860px) {
	.sdm-widget { grid-template-columns: 1fr; }
	.sdm-list-toggle { display: flex; order: 1; }
	.sdm-list {
		order: 2;
		max-height: 0;
		overflow: hidden;
		border-right: 0;
		border-bottom: 1px solid var(--sdm-border);
		transition: max-height .3s ease;
	}
	.sdm-widget.sdm-list-open .sdm-list {
		max-height: 60vh;
		overflow-y: auto;
	}
	.sdm-map-col { order: 3; }
	.sdm-map { height: min(var(--sdm-map-height), 70vh); }
	.sdm-intro { font-size: 15px; }
}
