/* =========================================================
   Preços Combustíveis Portugal — Public stylesheet
   ========================================================= */

/* ----- Container ----------------------------------------- */
.ppc-container {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
		Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
	font-size: 14px;
	color: #212529;
	max-width: 1200px;
	margin: 0 auto;
	box-sizing: border-box;
}

.ppc-container *,
.ppc-container *::before,
.ppc-container *::after {
	box-sizing: inherit;
}

/* ----- Filters bar --------------------------------------- */
.ppc-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: flex-end;
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 16px;
}

.ppc-filter-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 160px;
}

.ppc-filter-group label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #495057;
	margin: 0;
}

.ppc-filter-group select {
	width: 100%;
	padding: 6px 10px;
	font-size: 13px;
	border: 1px solid #ced4da !important;
	border-radius: 6px;
	background: #ffffff !important;
	background-color: #ffffff !important;
	color: #212529 !important;
	color-scheme: light;
	outline: none;
	transition: border-color 0.2s;
	-webkit-appearance: auto;
	appearance: auto;
}

.ppc-filter-group select option,
.ppc-filter-group select option:checked,
.ppc-filter-group select option:hover {
	background: #ffffff !important;
	background-color: #ffffff !important;
	color: #212529 !important;
	font-weight: normal !important;
}

.ppc-filter-group select:focus {
	border-color: #0056b3;
	box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.15);
}

.ppc-filter-group select:disabled {
	background: #e9ecef;
	color: #6c757d;
	cursor: not-allowed;
}

#ppc-fuel-type {
	height: 80px;
}

/* ----- Filter action buttons ----------------------------- */
.ppc-filter-actions {
	display: flex;
	gap: 8px;
	align-items: flex-end;
	margin-left: auto;
}

.ppc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 18px;
	font-size: 13px;
	font-weight: 600;
	border: 1px solid transparent;
	border-radius: 6px;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
	line-height: 1.4;
}

.ppc-btn:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.2);
}

.ppc-btn-primary {
	background: #0056b3;
	border-color: #0056b3;
	color: #fff;
}

.ppc-btn-primary:hover {
	background: #004494;
	border-color: #004494;
}

.ppc-btn-primary:active {
	background: #003a80;
	border-color: #003a80;
}

.ppc-btn-secondary {
	background: #fff;
	border-color: #0056b3;
	color: #0056b3;
}

.ppc-btn-secondary:hover {
	background: #e8f0fb;
}

.ppc-btn-secondary:active {
	background: #d1e1f8;
}

/* ----- Content layout ------------------------------------ */
.ppc-content {
	display: flex;
	gap: 16px;
	align-items: stretch;
}

/* ----- Map wrapper --------------------------------------- */
.ppc-map-wrapper {
	flex: 1 1 0;
	position: relative;
	min-height: 400px;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

#ppc-map,
#ppc-ev-map {
	width: 100%;
	height: 100%;
	display: block;
}

/* ----- Loading overlay ----------------------------------- */
#ppc-loading,
#ppc-ev-loading {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.82);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	z-index: 10;
	font-size: 13px;
	color: #495057;
}

.ppc-spinner {
	width: 36px;
	height: 36px;
	border: 4px solid #dee2e6;
	border-top-color: #0056b3;
	border-radius: 50%;
	animation: ppcSpin 0.75s linear infinite;
}

@keyframes ppcSpin {
	to { transform: rotate(360deg); }
}

/* ----- Sidebar ------------------------------------------- */
.ppc-sidebar {
	flex: 0 0 300px;
	width: 300px;
	border: 1px solid #dee2e6;
	border-radius: 8px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #fff;
}


.ppc-sidebar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	background: #f8f9fa;
	border-bottom: 1px solid #dee2e6;
	flex-shrink: 0;
}

.ppc-sidebar-header h3 {
	margin: 0;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #495057;
}

#ppc-count,
#ppc-ev-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	padding: 0 7px;
	background: #0056b3;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	border-radius: 999px;
	line-height: 1;
}

/* ----- Station list -------------------------------------- */
#ppc-station-list {
	overflow-y: auto;
	flex: 1 1 0;
	padding: 8px;
}

.ppc-station-item {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 10px 8px;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s;
	border-bottom: 1px solid #f0f0f0;
}

.ppc-station-item:last-child {
	border-bottom: none;
}

.ppc-station-item:hover {
	background: #eef4ff;
}

.ppc-station-item--active {
	background: #dceeff;
	border-left: 3px solid #0056b3;
	padding-left: 5px;
}

.ppc-station-color {
	flex-shrink: 0;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	margin-top: 3px;
}

.ppc-station-info {
	flex: 1 1 0;
	min-width: 0;
}

.ppc-station-name {
	font-size: 13px;
	font-weight: 700;
	color: #212529;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ppc-station-address {
	font-size: 11px;
	color: #6c757d;
	margin-top: 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ppc-station-dist {
	font-size: 11px;
	color: #0056b3;
	font-weight: 600;
	margin-top: 2px;
}

.ppc-station-meta {
	flex-shrink: 0;
	text-align: right;
}

.ppc-price {
	font-size: 14px;
	font-weight: 700;
	color: #198754;
	white-space: nowrap;
}

.ppc-price-na {
	font-size: 11px;
	color: #adb5bd;
	white-space: nowrap;
}

/* ----- InfoWindow ---------------------------------------- */
.ppc-infowindow {
	max-width: 280px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 13px;
	color: #212529;
	line-height: 1.5;
}

.ppc-iw-name {
	display: block;
	font-size: 14px;
	font-weight: 700;
	margin-bottom: 4px;
	color: #0056b3;
}

.ppc-iw-address {
	margin: 0 0 10px;
	font-size: 12px;
	color: #6c757d;
}

.ppc-iw-prices {
	width: 100%;
	border-collapse: collapse;
}

.ppc-iw-prices tr:not(:last-child) td {
	border-bottom: 1px solid #f0f0f0;
}

.ppc-iw-prices td {
	padding: 4px 0;
}

.ppc-iw-fuel {
	font-size: 12px;
	color: #495057;
	padding-right: 12px;
}

.ppc-iw-price {
	font-size: 13px;
	font-weight: 700;
	color: #198754;
	text-align: right;
	white-space: nowrap;
}

/* ----- Responsive ---------------------------------------- */
@media (max-width: 768px) {
	.ppc-filters {
		flex-direction: column;
		align-items: stretch;
	}

	.ppc-filter-group {
		min-width: 0;
		width: 100%;
	}

	.ppc-filter-actions {
		margin-left: 0;
		flex-direction: column;
	}

	.ppc-btn {
		width: 100%;
	}

	.ppc-content {
		flex-direction: column;
	}

	.ppc-map-wrapper {
		width: 100%;
	}

	.ppc-sidebar {
		flex: none;
		width: 100%;
		max-height: 360px;
	}
}

/* ----- Credits ------------------------------------------- */
.ppc-credits {
	margin-top: 8px;
	font-size: 9px;
	color: #adb5bd;
	text-align: right;
}

.ppc-credits a {
	color: #adb5bd;
	text-decoration: none;
}

.ppc-credits a:hover {
	color: #6c757d;
	text-decoration: underline;
}

/* =========================================================
   Leaflet — Pins com preço
   ========================================================= */

.ppc-marker-icon {
	background: transparent !important;
	border: none !important;
}

.ppc-pin-badge {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--ppc-color, #e74c3c);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	line-height: 1;
	padding: 5px 8px;
	border-radius: 4px;
	white-space: nowrap;
	box-shadow: 0 2px 6px rgba(0,0,0,0.35);
	min-width: 52px;
	text-align: center;
}

.ppc-pin-badge::after {
	content: '';
	position: absolute;
	bottom: -6px;
	left: 50%;
	transform: translateX(-50%);
	border-width: 6px 5px 0;
	border-style: solid;
	border-color: var(--ppc-color, #e74c3c) transparent transparent;
}

/* =========================================================
   Leaflet — Popup
   ========================================================= */

.ppc-leaflet-popup .leaflet-popup-content-wrapper {
	border-radius: 8px;
	padding: 0;
	box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.ppc-leaflet-popup .leaflet-popup-content {
	margin: 0;
	min-width: 220px;
}

.ppc-popup {
	padding: 14px 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 13px;
}

.ppc-popup-name {
	font-size: 14px;
	font-weight: 700;
	color: #212529;
	margin-bottom: 4px;
}

.ppc-popup-address {
	font-size: 12px;
	color: #6c757d;
	margin-bottom: 10px;
}

.ppc-popup-prices {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 8px;
}

.ppc-popup-prices tr + tr {
	border-top: 1px solid #f1f3f5;
}

.ppc-fuel-name {
	padding: 5px 8px 5px 0;
	color: #495057;
}

.ppc-fuel-price {
	padding: 5px 0 5px 8px;
	text-align: right;
	font-weight: 700;
	color: #198754;
	white-space: nowrap;
}

.ppc-popup-updated {
	font-size: 11px;
	color: #adb5bd;
	margin-top: 4px;
	margin-bottom: 8px;
}

.ppc-popup-nav {
	display: flex;
	gap: 6px;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid #f1f3f5;
}

.ppc-nav-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	flex: 1;
	justify-content: center;
	padding: 6px 8px;
	font-size: 11px;
	font-weight: 600;
	border-radius: 5px;
	text-decoration: none !important;
	transition: opacity 0.15s;
}

.ppc-nav-btn:hover { opacity: 0.85; }

.ppc-nav-gmaps {
	background: #4285F4;
	color: #fff !important;
}

.ppc-nav-waze {
	background: #33CCFF;
	color: #000 !important;
}

/* =========================================================
   Carregamento Elétrico — overrides específicos
   ========================================================= */

.ppc-ev-pin .ppc-pin-badge {
	letter-spacing: -0.02em;
}

.ppc-ev-status {
	font-size: 11px;
	font-weight: 600;
	margin-bottom: 8px;
}

.ppc-ev-status--ok  { color: #198754; }
.ppc-ev-status--nok { color: #dc3545; }

.ppc-ev-kw {
	color: #0056b3 !important;
}

.ppc-station-operator {
	font-size: 11px;
	color: #0056b3;
	font-weight: 600;
	margin-top: 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
