/**
 * CHG-001 — EV Charging Map Styles
 */

/* ── Page Wrap ─────────────────────────────────────────── */
.chg-page-wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 32px 20px 60px;
}

/* ── Map Container ─────────────────────────────────────── */
/* Map + Filters side by side */
.chg-map-filters-wrap {
	display: flex;
	gap: 20px;
	align-items: flex-start;
	margin-bottom: 30px;
}
#driveev-map {
	width: 60%;
	aspect-ratio: 16 / 10;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	flex-shrink: 0;
}
.chg-filters-panel {
	width: 40%;
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 20px;
	background: #f8f9fa;
	border-radius: 12px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}
.chg-filters-panel .chg-filter-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.chg-filters-panel .chg-filter-label {
	font-family: 'Barlow Condensed', sans-serif;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #00337a;
}
.chg-filter-select {
	width: 100%;
	padding: 10px 12px;
	font-family: 'DM Sans', sans-serif;
	font-size: 14px;
	color: #333;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 6px;
	cursor: pointer;
	appearance: auto;
}
.chg-filter-select:focus {
	outline: none;
	border-color: #00337a;
}
.chg-panel-count {
	font-family: 'DM Sans', sans-serif;
	font-size: 14px;
	color: #555;
	padding-top: 8px;
	border-top: 1px solid #e0e0e0;
}
.chg-panel-search {
	margin-top: 4px;
}
.chg-panel-search .chg-search {
	width: 100%;
	padding: 10px 12px;
	font-family: 'DM Sans', sans-serif;
	font-size: 14px;
	border: 1px solid #ddd;
	border-radius: 6px;
	box-sizing: border-box;
}
.chg-panel-search .chg-search:focus {
	outline: none;
	border-color: #00337a;
}
/* Fix WP theme breaking map tiles */
#driveev-map img,
#driveev-map .maplibregl-map img,
#driveev-map .maplibregl-tile img,
.maplibregl-map img { max-width: none !important; max-height: none !important; }
#driveev-map .maplibregl-canvas { outline: none; }
#driveev-map .maplibregl-canvas-container { height: 100%; }
#driveev-map .maplibregl-map { width: 100%; height: 100%; }

/* ── MapTiler Popup ────────────────────────────────────── */
.chg-popup { font-family: 'DM Sans', sans-serif; font-size: 13px; line-height: 1.5; }
.chg-popup__name { font-family: 'Barlow Condensed', sans-serif; font-size: 16px; font-weight: 700; color: #1a1a2e; margin: 0 0 4px; }
.chg-popup__address { color: #666; margin: 0 0 6px; }
.chg-popup__detail { margin: 2px 0; color: #333; }
.chg-popup__detail strong { color: #00337a; }
.chg-popup__status { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; margin-top: 4px; }
.chg-popup__status--operational { background: #dcfce7; color: #166534; }
.chg-popup__status--offline { background: #fef2f2; color: #991b1b; }

/* ── Filter Bar ────────────────────────────────────────── */
.chg-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	padding: 24px 0;
	border-bottom: 1px solid #e5e7eb;
}
.chg-filter-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.chg-filter-label {
	font-family: 'DM Sans', sans-serif;
	font-size: 12px;
	font-weight: 600;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.chg-filter-pills {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}
.chg-pill {
	padding: 6px 14px;
	border: 1.5px solid #d1d5db;
	border-radius: 20px;
	background: #fff;
	color: #374151;
	font-family: 'DM Sans', sans-serif;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
	white-space: nowrap;
}
.chg-pill:hover {
	border-color: #00337a;
	color: #00337a;
}
.chg-pill--active,
.chg-pill--active:hover {
	background: #00337a;
	color: #fff;
	border-color: #00337a;
}

/* ── Results Bar ───────────────────────────────────────── */
.chg-results-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 0;
	font-family: 'DM Sans', sans-serif;
	font-size: 14px;
	color: #6b7280;
	gap: 16px;
}
.chg-search {
	padding: 8px 14px;
	border: 1.5px solid #d1d5db;
	border-radius: 6px;
	font-family: 'DM Sans', sans-serif;
	font-size: 14px;
	color: #1a1a2e;
	outline: none;
	width: 260px;
	transition: border-color 0.2s;
}
.chg-search:focus {
	border-color: #00337a;
	box-shadow: 0 0 0 3px rgba(0, 51, 122, 0.10);
}
.chg-search::placeholder {
	color: #9ca3af;
}

/* ── Card Grid ─────────────────────────────────────────── */
.chg-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

.chg-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 20px;
	transition: box-shadow 0.2s, border-color 0.2s;
	cursor: pointer;
}
.chg-card:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
	border-color: #00337a;
}
.chg-card--highlight {
	border-color: #00337a;
	box-shadow: 0 0 0 2px rgba(0, 51, 122, 0.15);
}
.chg-card__name {
	font-family: 'Barlow Condensed', sans-serif;
	font-size: 16px;
	font-weight: 700;
	color: #1a1a2e;
	margin: 0 0 4px;
}
.chg-card__address {
	font-size: 13px;
	color: #6b7280;
	margin: 0 0 10px;
}
.chg-card__connectors {
	font-size: 13px;
	color: #333;
	margin: 0 0 6px;
}
.chg-card__meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 12px;
	color: #6b7280;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid #f3f4f6;
}
.chg-card__operator {
	font-weight: 600;
	color: #00337a;
}
.chg-card__points {
	font-weight: 500;
}

/* ── Attribution ───────────────────────────────────────── */
.chg-attribution {
	text-align: right;
	padding: 12px 0;
	font-size: 10px;
	color: #c9cdd3;
}
.chg-attribution a {
	color: #b0b5bd;
	text-decoration: none;
}
.chg-attribution a:hover {
	text-decoration: underline;
}

/* ── Loader Overlay ─────────────────────────────────────── */
.chg-loader {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 80px 20px;
}
.chg-loader__spinner {
	width: 40px;
	height: 40px;
	border: 4px solid #e5e7eb;
	border-top-color: #00337a;
	border-radius: 50%;
	animation: chg-spin 0.8s linear infinite;
}
@keyframes chg-spin {
	to { transform: rotate(360deg); }
}
.chg-loader__text {
	font-family: 'DM Sans', sans-serif;
	font-size: 14px;
	color: #6b7280;
	margin-top: 16px;
}
.chg-loader--hidden {
	display: none;
}

/* ── Loading ───────────────────────────────────────────── */
.chg-loading {
	text-align: center;
	padding: 60px 20px;
	font-family: 'DM Sans', sans-serif;
	font-size: 15px;
	color: #6b7280;
}

/* ── No Results ────────────────────────────────────────── */
.chg-no-results {
	text-align: center;
	padding: 40px 20px;
	font-size: 14px;
	color: #9ca3af;
	grid-column: 1 / -1;
}

/* ── Pagination (charging page specific) ───────────────── */
#chgPagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	padding: 24px 0;
}
#chgPagination .driveev-pagination__item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	font-family: 'DM Sans', sans-serif;
	font-size: 14px;
	font-weight: 600;
	border-radius: 6px;
	text-decoration: none;
	color: #00337a;
	background: #f5f5f5;
	border: 1.5px solid #e5e7eb;
	transition: all 0.2s;
	cursor: pointer;
}
#chgPagination .driveev-pagination__item:hover {
	background: #00337a;
	color: #fff;
	border-color: #00337a;
}
#chgPagination .driveev-pagination__item--current {
	background: #00337a;
	color: #fff;
	border-color: #00337a;
	cursor: default;
}
#chgPagination .driveev-pagination__prev,
#chgPagination .driveev-pagination__next {
	padding: 0 16px;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
	.chg-map-filters-wrap { flex-direction: column; }
	#driveev-map { width: 100%; aspect-ratio: 16 / 10; border-radius: 8px; }
	.chg-filters-panel { width: 100%; flex-direction: column; gap: 12px; padding: 16px; box-sizing: border-box; }
	.chg-filters-panel .chg-filter-group { width: 100%; }
	.chg-panel-count { width: 100%; }
	.chg-panel-search { width: 100%; }
	.chg-cards { grid-template-columns: 1fr; }
	.chg-page-wrap { padding: 20px 16px 40px; overflow-x: hidden; }
	.chg-results-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
	.chg-search { width: 100%; }
	.chg-card { padding: 16px; }
	#chgPagination { flex-wrap: wrap; gap: 6px; }
	#chgPagination .driveev-pagination__item { min-width: 36px; height: 36px; font-size: 13px; }
}
@media (max-width: 480px) {
	#driveev-map { aspect-ratio: 16 / 10; }
	.chg-pill { font-size: 12px; padding: 5px 12px; }
	.chg-card__name { font-size: 15px; }
}
