/**
 * Filmabonito Map Block Styles
 * Product list left, Google map right
 */

.map-section {
	background: #1a1a1a;
	padding: 80px 0;
}

.map-main-card {
	background: #2b2b2b;
	border-radius: 12px;
	overflow: hidden;
	margin-top: 48px;
}

.map-content-area {
	display: grid;
	grid-template-columns: 1fr 1.9fr;
	gap: 18px;
	min-height: 500px;
	padding: 24px;
}

@media (max-width: 991px) {
	.map-content-area {
		grid-template-columns: 1fr;
	}
}

.map-list-panel {
	overflow-y: auto;
	max-height: 500px;
}

.map-list-panel::-webkit-scrollbar {
	width: 4px;
}

.map-list-panel::-webkit-scrollbar-thumb {
	background: #555;
	border-radius: 2px;
}

.map_ul_style {
	list-style: none;
	margin: 0;
	padding: 0;
}

.map_li_style {
	margin-bottom: 0;
}

.map_li_style a {
	display: block;
	color: inherit;
}

.map-list-item {
	display: flex;
	gap: 16px;
	padding: 12px 0;
	border-bottom: 1px solid #444;
	align-items: center;
}

.map-list-item:hover {
	background: rgba(255, 255, 255, 0.05);
}

.map-thumb-placeholder {
	width: 80px;
	height: 60px;
	border-radius: 6px;
	overflow: hidden;
	flex-shrink: 0;
	background: #444;
}

.map-thumb-placeholder img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.map-item-info {
	flex: 1;
	min-width: 0;
}

.map-title {
	font-size: 1rem;
	margin-bottom: 12px;
	color: #fff;
}

.map-badge {
	font-size: 11px;
	padding: 2px 6px;
	border-radius: 2px;
	text-transform: uppercase;
	margin-bottom: 4px;
	display: inline-block;
}

.map-badge-video {
	background: #ff8d63;
	color: #fff;
}

.map-item-title {
	font-size: 0.95rem;
	font-weight: 600;
	color: #fff;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.map-item-meta {
	font-size: 0.85rem;
	color: #afaba6;
	margin-top: 4px;
}

.map-map-panel {
	height: 520px;
	position: relative;
	display: flex;
	flex-direction: column;
}

/* List panel should not stretch to fill the row — only the map panel should */
.map-list-panel {
	align-self: start;
}

.filmabonito-google-map,
.filmabonito-map-container {
	border-radius: 8px;
}
/* Leaflet map fills container when using Free (OpenStreetMap) provider */
.filmabonito-map-container.leaflet-container {
	width: 100%;
	height: 100%;
	min-height: 0;
}

/* Map container inside the Product Map block panel grows to fill remaining panel height */
.map-map-panel .map-format-bar {
	flex-shrink: 0;
	position: relative;
	z-index: 800; /* above Leaflet popup layer (600) so filter chips stay accessible */
}
.map-map-panel .filmabonito-map-container {
	flex: 1;
	min-height: 0;
	height: auto;
}

/* Search page: map fills the right column, taller height */
#ser-map .filmabonito-map-container {
	width: 100%;
	height: 100%;
	min-height: 520px;
	flex: 1;
}
@media (max-width: 900px) {
	#ser-map .filmabonito-map-container {
		min-height: 380px;
	}
}
@media (max-width: 767px) {
	#ser-map .filmabonito-map-container {
		min-height: 340px;
	}
}

/* Theme-styled Leaflet: match dark card and primary accent */
.filmabonito-map-container.leaflet-container {
	background: #1a1a1a;
	font-family: var(--font-family, inherit);
}
.filmabonito-map-container .leaflet-control-zoom {
	border: none !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.filmabonito-map-container .leaflet-control-zoom a {
	background: #2b2b2b !important;
	color: #afaba6 !important;
	border: 1px solid #444 !important;
	width: 32px !important;
	height: 32px !important;
	line-height: 32px !important;
	font-size: 18px !important;
}
.filmabonito-map-container .leaflet-control-zoom a:hover {
	background: #3b3b3b !important;
	color: #fd0 !important;
	border-color: #fd0 !important;
}
.filmabonito-map-container .leaflet-control-attribution {
	background: rgba(43, 43, 43, 0.9) !important;
	color: #8d9199 !important;
	font-size: 11px;
	padding: 2px 6px;
	border-radius: 4px;
}
.filmabonito-map-container .leaflet-control-attribution a {
	color: #afaba6;
}
.filmabonito-map-container .leaflet-popup-content-wrapper {
	background: #2b2b2b;
	color: #fff;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
	border: 1px solid rgba(255, 255, 255, 0.1);
}
.filmabonito-map-container .leaflet-popup-tip {
	background: #2b2b2b;
}
.filmabonito-map-container .leaflet-container a.leaflet-popup-close-button {
	color: #afaba6;
	top: 6px;
	right: 8px;
	font-size: 18px;
}
.filmabonito-map-container .leaflet-container a.leaflet-popup-close-button:hover {
	color: #ffd700;
}

.map-loading,
.map-error,
.map-empty {
	padding: 24px;
	color: #afaba6;
}

.map-list-filter-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding: 10px 0 12px;
	border-bottom: 1px solid #444;
	margin-bottom: 8px;
}
.map-list-filter-label {
	font-size: 0.85rem;
	color: #afaba6;
}
.map-show-latest-btn {
	background: transparent;
	border: 1px solid #666;
	color: #ccc;
	padding: 6px 12px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.85rem;
}
.map-show-latest-btn:hover {
	border-color: #e8c700;
	color: #e8c700;
}

/* ── Custom map pin (DivIcon) ────────────────────────────────────────────── */
.fb-map-pin {
	width: 32px;
	height: 42px;
	cursor: pointer;
	filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
	transition: transform 0.15s ease, filter 0.15s ease;
	display: flex;
	align-items: flex-end;
}
.fb-map-pin svg {
	width: 32px;
	height: 42px;
}
.fb-map-pin:hover {
	transform: translateY(-4px) scale(1.08);
	filter: drop-shadow(0 7px 12px rgba(0, 0, 0, 0.55));
}

/* ── Premium popup card ──────────────────────────────────────────────────── */
.filmabonito-map-container .leaflet-popup-content-wrapper {
	padding: 0;
	overflow: hidden;
	min-width: 230px;
	max-width: 260px;
	border-radius: 12px !important;
}
.filmabonito-map-container .leaflet-popup-content {
	margin: 0 !important;
	width: auto !important;
}

.filmabonito-map-popup {
	font-family: var(--font-family, 'Instrument Sans', sans-serif);
	color: #fff;
}

/* Thumbnail */
.fb-popup-thumb-wrap {
	display: block;
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: #333;
	text-decoration: none;
}
.fb-popup-thumb-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}
.fb-popup-thumb-wrap:hover img {
	transform: scale(1.06);
}

/* Type badge overlaid on thumbnail */
.fb-popup-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 3px 8px;
	border-radius: 4px;
	color: #fff;
	pointer-events: none;
}
.fb-badge--video  { background: #ff8d63; }
.fb-badge--photo  { background: #4a9eff; }
.fb-badge--rental { background: #a855f7; }

/* Body */
.fb-popup-body {
	padding: 13px 14px 14px;
}

.fb-popup-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 13px;
	font-weight: 600;
	color: #fff;
	text-decoration: none;
	line-height: 1.4;
	margin-bottom: 8px;
	transition: color 0.18s;
}
.fb-popup-title:hover {
	color: #ffd700;
}

.fb-popup-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 11px;
}
.fb-popup-location {
	display: flex;
	align-items: center;
	gap: 3px;
	font-size: 11px;
	color: #afaba6;
}
.fb-popup-location svg {
	flex-shrink: 0;
	opacity: 0.7;
}
.fb-popup-price {
	margin-left: auto;
	font-size: 13px;
	font-weight: 700;
	color: #ffd700;
}

/* CTA button */
.fb-popup-btn {
	display: block;
	background: #ffd700;
	color: #1a1a1a;
	text-align: center;
	padding: 9px 14px;
	border-radius: 7px;
	font-size: 12px;
	font-weight: 700;
	text-decoration: none;
	letter-spacing: 0.3px;
	transition: background 0.18s, transform 0.15s;
}
.fb-popup-btn:hover {
	background: #e6c200;
	color: #1a1a1a;
	transform: translateY(-1px);
}

/* Map placeholder when no API key */
.map-no-api-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #222;
	border: 1px dashed #555;
}
.map-placeholder-text {
	margin: 0;
	padding: 24px;
	color: #afaba6;
	text-align: center;
	font-size: 0.95rem;
}

/* ── Format filter bar (Product Map block) ──────────────────────────────── */
.map-format-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	padding: 12px 16px;
	background: #232323;
	border-radius: 8px 8px 0 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.map-format-chip {
	background: rgba(255, 255, 255, 0.07);
	color: #afaba6;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 20px;
	padding: 5px 16px;
	font-size: 13px;
	font-family: var(--font-family, 'Instrument Sans', sans-serif);
	font-weight: 500;
	line-height: 1.3;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.map-format-chip:hover {
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	border-color: rgba(255, 255, 255, 0.25);
}

.map-format-chip.active {
	background: var(--primary, #ffd700);
	color: #1a1a1a;
	border-color: var(--primary, #ffd700);
	font-weight: 700;
}


@media (max-width: 600px) {
	.map-format-bar {
		gap: 6px;
		padding: 10px 12px;
	}
	.map-format-chip {
		padding: 4px 12px;
		font-size: 12px;
	}
}

/* List-only mode (map disabled) */
.map-content-area--list-only {
	grid-template-columns: 1fr;
	max-width: 800px;
	margin-left: auto;
	margin-right: auto;
}
.map-content-area--list-only .map-list-panel {
	max-height: none;
}

/* Pagination */
.map-pagination {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid #444;
}
.map-pagination-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 16px;
}
.map-pagination-btn {
	background: #2b2b2b;
	border: 1px solid #555;
	color: #fff;
	padding: 10px 18px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.9rem;
	transition: border-color 0.2s, color 0.2s;
}
.map-pagination-btn:hover:not(:disabled) {
	border-color: #fd0;
	color: #fd0;
}
.map-pagination-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
.map-pagination-info {
	font-size: 0.9rem;
	color: #afaba6;
}

/* Hide on Mobile option */
@media (max-width: 767px) {
	.map-section--hide-mobile {
		display: none !important;
	}
}
