/*
 * Product Map – Styles
 * Desktop: legend sidebar + map, tabbed product sections aligned to map.
 * Mobile:  no map/legend, horizontal scrollable tabs, stacked products.
 */

/* ── Block Container ──────────────────────────────────────────────────────── */

.wdm-pm {
	width: 100%;
	position: relative;
}

/* ── Map Area (legend left, map right) ────────────────────────────────────── */

.wdm-pm__map-area {
	display: flex;
	gap: 24px;
	margin-bottom: 32px;
}

.wdm-pm__legend {
	flex: 0 0 292px;
	align-self: flex-start;
	background: #f6f6f6;
	border-radius: 8px;
	padding: 16px;
}

.wdm-pm__legend-title {
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	margin: 0 0 14px;
	color: var(--wp--preset--color--heading-navy, #003057);
}

.wdm-pm__legend-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.wdm-pm__legend-item {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 16px;
	color: #4C4C4D;
}

.wdm-pm__legend-icon {
	width: 36px;
	height: 36px;
	object-fit: contain;
	flex-shrink: 0;
}

.wdm-pm__map {
	flex: 1 1 0%;
	min-width: 0;
	border-radius: 8px;
	overflow: hidden;
}

.wdm-pm__map img {
	display: block;
	width: 100%;
	height: auto;
}

/* ── Tabs (aligned to map column) ─────────────────────────────────────────── */

.wdm-pm__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 24px;
	position: relative;
}

.wdm-pm__tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	font-size: 16px;
	font-weight: 700;
	color: #878484;
	background: #fff;
	border: 1px solid #d0d0d0;
	border-radius: 8px;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.2s ease, border-color 0.2s ease;
	line-height: 1.4;
}

.wdm-pm__tab:hover {
	border-color: #999;
}

.wdm-pm__tab--active {
	background: #f6f6f6;
	border-color: #005197;
	border-width: 2px;
	font-weight: 700;
	color: #323232;
	/* Compensate 1px extra border so size doesn't jump */
	padding: 7px 15px;
}

.wdm-pm__tab-icon {
	width: 44px;
	height: 44px;
	object-fit: contain;
	flex-shrink: 0;
	border-radius: 50%;
}

/* ── Section Panels (aligned to map column) ───────────────────────────────── */

.wdm-pm__panel {
	display: none;
}

.wdm-pm__panel--active {
	display: block;
}

.wdm-pm__tabs-heading {
	font-size: 20px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #323232;
	margin: 0 0 12px;
}

.wdm-pm__section-title {
	font-size: 20px;
	font-weight: 700;
	text-transform: uppercase;
	color: #323232;
	margin: 0 0 12px;
}

.wdm-pm__section-text {
	font-size: 14px;
	line-height: 1.65;
	color: var(--wp--preset--color--dark-gray, #4C4C4D);
	margin: 0 0 24px;
}

/* ── Product Cards ────────────────────────────────────────────────────────── */

.wdm-pm__products {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px 24px;
}

.wdm-pm__product-card {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	text-decoration: none;
	color: inherit;
	transition: opacity 0.2s ease;
}

a.wdm-pm__product-card:hover {
	opacity: 0.75;
}

.wdm-pm__product-img {
	width: 80px;
	height: 80px;
	object-fit: cover;
	border-radius: 6px;
	flex-shrink: 0;
	background: #f6f6f6;
}

.wdm-pm__product-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.wdm-pm__product-name {
	font-size: 16px;
	font-weight: 600;
	line-height: 24px;
	color: #323232;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wdm-pm__product-sub {
	font-size: 13px;
	color: var(--wp--preset--color--dark-gray, #4C4C4D);
}

.wdm-pm__product-price {
	font-size: 13px;
	font-weight: 600;
	color: var(--wp--preset--color--primary-blue, #005CA9);
}

/* ── Mobile (≤ 781px) ─────────────────────────────────────────────────────── */

@media (max-width: 781px) {
	/* Hide map + legend */
	.wdm-pm__map-area {
		display: none;
	}

	/* Reset left offset on mobile */
	.wdm-pm__tabs,
	.wdm-pm__panel {
		margin-left: 0;
	}

	/* Tabs: single-line horizontal scroll with fade */
	.wdm-pm__tabs {
		flex-wrap: nowrap;
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		-ms-overflow-style: none;
		gap: 8px;
		padding-bottom: 4px;
	}

	.wdm-pm__tabs::-webkit-scrollbar {
		display: none;
	}

	/* Products: single column */
	.wdm-pm__products {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.wdm-pm__product-img {
		width: 64px;
		height: 64px;
	}
}

/* ── Tab Fade Overlays (JS-inserted, mobile only) ─────────────────────────── */

.wdm-pm__fade {
	position: absolute;
	width: 2.5rem;
	pointer-events: none;
	z-index: 2;
	opacity: 0;
	transition: opacity 0.2s;
	display: none;
}

.wdm-pm__fade--left {
	left: 0;
	background: linear-gradient(to right, #fff, transparent);
}

.wdm-pm__fade--right {
	right: 0;
	background: linear-gradient(to left, #fff, transparent);
}
