/*
 * PTGP GeoDirectory Support
 *
 * GD pages are functional interfaces, so they use a wider, lighter layout
 * system than brand/content pages. The goal is maximum usable viewport with
 * a safe gutter, while retaining PTGP colors, typography, panels and buttons.
 *
 * GD architecture:
 * - .pt-gd-section controls vertical rhythm and optional background bands.
 * - .pt-gd-wide controls wide functional width for search, listings, map and GD output.
 * - .pt-gd-content controls readable width for hero text, local context, guidance and CTA.
 * - .pt-gd-panel controls intentional GD widget surfaces such as maps and location sections.
 */

:root {
	--pt-gd-wide: 1360px;
	--pt-gd-content: 980px;
	--pt-gd-gutter: clamp(0.85rem, 0.45rem + 1.5vw, 1.5rem);
	--pt-gd-gap: clamp(1rem, 0.75rem + 1.2vw, 1.75rem);
}

.pt-gd-page-shell,
.pt-gd-page,
body.pt-gd-context {
	box-sizing: border-box;
	width: 100%;
	overflow-x: clip;
}

.pt-gd-section,
.wp-block-group.pt-gd-section {
	box-sizing: border-box;
	width: 100%;
	padding-block: clamp(2rem, 1.35rem + 2.8vw, 4rem);
}

.pt-gd-section-compact,
.wp-block-group.pt-gd-section-compact {
	padding-block: clamp(1.35rem, 0.95rem + 1.7vw, 2.5rem);
}

.pt-gd-section-soft,
.wp-block-group.pt-gd-section-soft {
	background: var(--pt-color-bg-soft);
}

.pt-gd-wide,
.wp-block-group.pt-gd-wide,
.pt-gd-content,
.wp-block-group.pt-gd-content {
	box-sizing: border-box;
	width: 100%;
	margin-inline: auto;
	padding-inline: var(--pt-gd-gutter);
}

.pt-gd-wide,
.wp-block-group.pt-gd-wide {
	max-width: calc(var(--pt-gd-wide) + (var(--pt-gd-gutter) * 2));
}

.pt-gd-content,
.wp-block-group.pt-gd-content {
	max-width: calc(var(--pt-gd-content) + (var(--pt-gd-gutter) * 2));
}

.pt-gd-panel,
.wp-block-group.pt-gd-panel,
.pt-gd-wrapper,
.pt-gd-archive,
.pt-gd-single {
	box-sizing: border-box;
	width: 100%;
	border: 1px solid var(--pt-color-border);
	border-radius: var(--pt-radius-lg);
	background: #fff;
	box-shadow: var(--pt-shadow-card);
	padding: clamp(1rem, 0.8rem + 0.85vw, 1.65rem);
}

.pt-gd-panel > :first-child,
.pt-gd-wrapper > :first-child {
	margin-top: 0;
}

.pt-gd-panel > :last-child,
.pt-gd-wrapper > :last-child {
	margin-bottom: 0;
}

.pt-gd-section-head,
.pt-gd-section-head-inline {
	max-width: 760px;
	margin-bottom: var(--pt-space-md);
}

.pt-gd-section-head > :first-child,
.pt-gd-section-head-inline > :first-child {
	margin-top: 0;
}

.pt-gd-section-head > :last-child,
.pt-gd-section-head-inline > :last-child {
	margin-bottom: 0;
}

.pt-gd-section-head-inline {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	justify-content: space-between;
	gap: 0.75rem 1.25rem;
	max-width: none;
}

.pt-gd-section-head-inline .pt-muted {
	max-width: 520px;
}

/* GD location hero */
.pt-gd-hero,
.wp-block-group.pt-gd-hero {
	background:
		radial-gradient(circle at top right, rgba(201, 151, 47, 0.16), transparent 34rem),
		linear-gradient(180deg, #fff 0%, var(--pt-color-bg-soft) 100%);
	padding-block: clamp(3rem, 2.1rem + 4vw, 6rem);
}

.pt-gd-location-summary {
	max-width: 820px;
	color: var(--pt-color-muted);
	font-size: clamp(1.05rem, 1rem + 0.24vw, 1.2rem);
	line-height: 1.72;
}

.pt-gd-location-summary :where(p, div) {
	margin-bottom: 0;
}

.pt-gd-feature-strip,
.wp-block-group.pt-gd-feature-strip {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: stretch;
	gap: 0.85rem;
	margin-top: var(--pt-space-md);
}

/* GD custom layout containers own gap; reset WordPress flow margins on direct children. */
.pt-gd-feature-strip > *,
.pt-gd-decision-grid > *,
.pt-theme .pt-gd-feature-strip > *,
.pt-theme .pt-gd-decision-grid > * {
	margin-block-start: 0;
	margin-block-end: 0;
	align-self: stretch;
	min-width: 0;
}

.pt-gd-feature,
.wp-block-group.pt-gd-feature {
	display: flex;
	align-items: center;
	height: 100%;
	min-height: 74px;
	border: 1px solid rgba(15, 81, 50, 0.12);
	border-radius: var(--pt-radius);
	background: rgba(255, 255, 255, 0.78);
	padding: 0.8rem 0.95rem;
	box-shadow: 0 8px 22px rgba(23, 33, 29, 0.055);
}

.pt-gd-feature-label {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	width: 100%;
	margin: 0;
	color: var(--pt-color-text);
	font-size: 0.98rem;
	font-weight: 800;
	line-height: 1.25;
	white-space: nowrap;
}

.pt-gd-feature-label i {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 2rem;
	width: 2rem;
	height: 2rem;
	border-radius: 999px;
	background: rgba(15, 81, 50, 0.09);
	color: var(--pt-color-primary);
	font-size: 0.95rem;
}

/* Search, listings and map presentation */
.pt-gd-search-panel {
	border-color: rgba(15, 81, 50, 0.18);
	box-shadow: var(--pt-shadow-soft);
}

body.pt-gd-context .geodir-search,
body.pt-gd-context .gd-search-bar,
.pt-gd-wrapper .geodir-search,
.pt-gd-wrapper .gd-search-bar,
.pt-gd-panel .geodir-search,
.pt-gd-panel .gd-search-bar {
	border-radius: var(--pt-radius);
	border: 1px solid var(--pt-color-border);
	background: #fff;
	box-shadow: none;
	padding: clamp(0.8rem, 0.65rem + 0.65vw, 1.25rem);
}

body.pt-gd-context .geodir-search label,
body.pt-gd-context .gd-search-bar label {
	color: var(--pt-color-text);
	font-weight: 700;
}

body.pt-gd-context .geodir-search input,
body.pt-gd-context .geodir-search select,
body.pt-gd-context .gd-search-bar input,
body.pt-gd-context .gd-search-bar select {
	border-radius: var(--pt-radius-sm);
	border-color: var(--pt-color-border);
}

body.pt-gd-context .geodir-search button,
body.pt-gd-context .gd-search-bar button,
body.pt-gd-context .geodir_submit_search {
	border-radius: 999px;
	background: var(--pt-color-primary);
	color: #fff;
	font-weight: 700;
}

.pt-gd-categories-panel,
.pt-gd-listings-zone,
.pt-gd-locations-wrapper {
	padding: clamp(0.85rem, 0.72rem + 0.65vw, 1.3rem);
}

.pt-gd-listings-zone {
	background: var(--pt-color-bg-soft);
}

/* GeoDirectory listing wrappers/rows keep their native Bootstrap spacing.
 * Do not add flex/grid gap here: GD renders listing grids as Bootstrap rows,
 * and horizontal gap breaks row-cols calculations.
 */

/* GeoDirectory listing rows and columns are layout structures.
 * Visual card treatment belongs to the actual card wrapper only.
 */
body.pt-gd-context .geodir-post > .card,
.pt-gd-card {
	border-radius: var(--pt-radius);
	border: 1px solid var(--pt-color-border);
	background: #fff;
	box-shadow: 0 8px 22px rgba(23, 33, 29, 0.055);
	overflow: hidden;
}

body.pt-gd-context .geodir-post .geodir-post-content,
.pt-gd-card-body {
	padding: 1rem;
}

body.pt-gd-context .geodir-post img {
	max-width: 100%;
	height: auto;
}

.pt-gd-card-media img,
body.pt-gd-context .geodir-post > .card img.card-img-top,
body.pt-gd-context .geodir-post > .card .geodir-post-image img,
body.pt-gd-context .geodir-post > .card .geodir-images img {
	object-fit: cover;
}

body.pt-gd-context .geodir-entry-title,
body.pt-gd-context .geodir-post-title,
.pt-gd-card h3 {
	margin-top: 0;
	font-size: 1.08rem;
	line-height: 1.25;
}

body.pt-gd-context .geodir-post .geodir-post-title a,
body.pt-gd-context .geodir-entry-title a,
.pt-gd-card h3 a {
	color: var(--pt-color-text);
	text-decoration: none;
}

body.pt-gd-context .geodir-post .geodir-post-title a:hover,
body.pt-gd-context .geodir-entry-title a:hover,
.pt-gd-card h3 a:hover {
	color: var(--pt-color-primary);
}

.pt-gd-card-meta,
body.pt-gd-context .geodir_post_meta,
body.pt-gd-context .geodir-output-location {
	color: var(--pt-color-muted);
	font-size: 0.92rem;
	line-height: 1.55;
}

body.pt-gd-context .geodir-output-location i,
body.pt-gd-context .geodir_post_meta i {
	color: var(--pt-color-primary);
}

body.pt-gd-context .geodir-badge,
body.pt-gd-context .badge,
body.pt-gd-context .gd-badge {
	border-radius: 999px;
	font-weight: 700;
}

.pt-gd-map-frame {
	padding: clamp(0.55rem, 0.45rem + 0.5vw, 0.9rem);
}

.pt-gd-map-frame :where(.geodir-map-wrap, .geodir_map_container, iframe) {
	border-radius: var(--pt-radius);
	overflow: hidden;
}

/* Local context and guidance */
.pt-gd-location-description {
	font-size: 1rem;
	line-height: 1.76;
}

.pt-gd-location-description :where(p, ul, ol) {
	color: var(--pt-color-muted);
}

.pt-gd-decision-grid,
.wp-block-group.pt-gd-decision-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--pt-gd-gap);
}

.pt-gd-decision-card,
.wp-block-group.pt-gd-decision-card {
	border: 1px solid var(--pt-color-border);
	border-radius: var(--pt-radius);
	background: #fff;
	padding: clamp(1rem, 0.8rem + 0.8vw, 1.45rem);
	box-shadow: 0 8px 22px rgba(23, 33, 29, 0.055);
}

.pt-gd-decision-card > :first-child {
	margin-top: 0;
}

.pt-gd-decision-card > :last-child {
	margin-bottom: 0;
}

.pt-gd-locations-wrapper :where(.geodir-locations, .geodir-location-grid, .gd-location-grid) {
	margin-top: 0;
}

/* Light support for GD single/detail sections without archive-card side effects. */
.pt-gd-single .pt-gd-section,
body.pt-gd-context.geodir-page-single .geodir-tabs,
body.pt-gd-context.geodir-page-single .geodir-post-meta-container,
body.pt-gd-context.geodir-page-single .geodir-field-group {
	border-radius: var(--pt-radius);
	border: 1px solid var(--pt-color-border);
	background: #fff;
	padding: clamp(1rem, 0.85rem + 0.75vw, 1.5rem);
	box-shadow: var(--pt-shadow-card);
}

body.pt-gd-context .geodir-tabs .nav-link,
body.pt-gd-context .geodir-tabs a {
	font-weight: 700;
}

body.pt-gd-context.geodir-page-single .geodir-field-group + .geodir-field-group,
body.pt-gd-context.geodir-page-single .geodir-post-meta-container + .geodir-post-meta-container {
	margin-top: var(--pt-space-md);
}

@media (max-width: 900px) {
	.pt-gd-decision-grid,
	.wp-block-group.pt-gd-decision-grid {
		grid-template-columns: 1fr;
	}

	.pt-gd-section-head-inline {
		display: block;
	}
}

@media (max-width: 600px) {
	:root {
		--pt-gd-gutter: 0.9rem;
	}

	.pt-gd-section,
	.wp-block-group.pt-gd-section {
		padding-block: 1.75rem;
	}

	.pt-gd-hero,
	.wp-block-group.pt-gd-hero {
		padding-block: 2.5rem;
	}

	.pt-gd-panel,
	.wp-block-group.pt-gd-panel,
	.pt-gd-wrapper,
	.pt-gd-archive,
	.pt-gd-single {
		border-radius: var(--pt-radius);
		padding: 1rem;
	}

	.pt-gd-feature-strip,
	.wp-block-group.pt-gd-feature-strip {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		align-items: stretch;
		gap: 0.45rem;
	}

	.pt-gd-feature,
	.wp-block-group.pt-gd-feature {
		justify-content: center;
		min-height: 64px;
		padding: 0.65rem 0.45rem;
	}

	.pt-gd-feature-label {
		flex-direction: column;
		justify-content: center;
		gap: 0.35rem;
		text-align: center;
		font-size: 0.76rem;
		line-height: 1.15;
		white-space: normal;
	}

	.pt-gd-feature-label i {
		flex-basis: 1.85rem;
		width: 1.85rem;
		height: 1.85rem;
		font-size: 0.82rem;
	}

}

/* ==========================================================================
 * GD Search Page
 *
 * Layout architecture:
 * - .pt-gd-search-page is the page-level wrapper. Three variants:
 *   .pt-gd-search-page-split  - listings on left, sticky map on right
 *   .pt-gd-search-page-float  - listings first, FAB opens full-screen map overlay
 *   .pt-gd-search-page-tabs   - Listings / Map tabs with native GD lazy map
 * - .pt-gd-search-bar-section is the sticky Search Command Area.
 *   It hosts the GD title, GD search block and GD loop/search utility actions
 *   as one connected workflow.
 * - The title uses GD output when a search has term/near context, with a
 *   PT fallback of "Property Search" on direct empty search-page visits.
 * - .pt-gd-search-layout owns the split grid; collapses to single column on tablets.
 * - .pt-gd-map-sticky pins the map within its column on desktop.
 * - .pt-gd-search-command-row contains gd_loop_actions inside the search command area; GeoDirectory may suppress sort on search pages.
 *
 * WIDTH BREAKOUT:
 * On the search page, we override GeneratePress' .grid-container max-width
 * so .pt-gd-wide can actually reach 1480px. Without this, GP clamps content
 * to its Customizer container width (~1200px default), which restricts the
 * effective width regardless of the value of --pt-gd-wide.
 * ========================================================================== */

body.geodir-page-search .grid-container,
body.geodir-page-search .inside-article,
body.geodir-page-search .site-content,
body.geodir-page-search .content-area,
body.geodir-page-search .inside-content,
.pt-gd-search-page,
.pt-gd-search-page .grid-container,
.pt-gd-search-page .inside-article,
.pt-gd-search-page .inside-content {
	max-width: 100%;
	padding-left: 0;
	padding-right: 0;
}

body.geodir-page-search .entry-content,
.pt-gd-search-page .entry-content {
	margin-top: 0;
}

/* Bump wide width specifically for the search page so it can breathe */
.pt-gd-search-page {
	--pt-gd-wide: 1480px;
}

/* Search Command Area header */
.pt-gd-search-command-header,
.wp-block-group.pt-gd-search-command-header {
	margin-bottom: clamp(0.65rem, 0.45rem + 0.7vw, 1rem);
}

.pt-gd-search-page .pt-gd-search-title,
.pt-gd-search-page .geodir-page-title-container,
.pt-gd-search-page .geodir-page-title-container h1,
.pt-gd-search-page h1.pt-gd-search-title {
	margin: 0;
	color: var(--pt-color-text);
	font-weight: 720;
	letter-spacing: -0.02em;
	line-height: 1.18;
	font-size: clamp(1.35rem, 1.05rem + 1.1vw, 1.9rem);
}

/* Sticky Search Command Area */
.pt-gd-search-page .pt-gd-search-bar-section {
	position: sticky;
	top: 0;
	z-index: 25;
	background: var(--pt-color-bg-soft);
	padding-block: clamp(0.85rem, 0.6rem + 1vw, 1.35rem);
	border-bottom: 1px solid var(--pt-color-border);
}

/* Frosted-glass effect only on viewports with the GPU headroom for it
 * (desktop/tablet). Mobile keeps the solid background above for smooth
 * scrolling and battery. The semi-transparent bg + blur are applied
 * together so content scrolling behind reads as layered. */
@media (min-width: 768px) {
	@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
		.pt-gd-search-page .pt-gd-search-bar-section {
			background: rgba(247, 245, 239, 0.82);
			-webkit-backdrop-filter: blur(12px);
			backdrop-filter: blur(12px);
		}
	}
}

.pt-gd-search-command-row,
.wp-block-group.pt-gd-search-command-row {
	margin-top: clamp(0.65rem, 0.45rem + 0.7vw, 1rem);
}

/* Results section gets its own padding now that there's no .pt-gd-section wrapper */
.pt-gd-search-page .pt-gd-results-section {
	padding-block: clamp(1rem, 0.7rem + 1.2vw, 1.75rem);
}

/* Split layout: listings + sticky map column */
.pt-gd-search-layout,
.wp-block-group.pt-gd-search-layout {
	box-sizing: border-box;
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
	gap: var(--pt-gd-gap);
}

.pt-gd-search-layout > *,
.pt-theme .pt-gd-search-layout > * {
	margin-block-start: 0;
	margin-block-end: 0;
	min-width: 0;
}

.pt-gd-results-column {
	display: flex;
	flex-direction: column;
	gap: var(--pt-gd-gap);
}

.pt-gd-map-column {
	position: relative;
}

.pt-gd-map-sticky {
	position: sticky;
	top: calc(var(--pt-search-bar-offset, 5rem));
}

.pt-gd-map-sticky .pt-gd-map-frame {
	padding: clamp(0.45rem, 0.35rem + 0.4vw, 0.75rem);
}

.pt-gd-map-sticky .pt-gd-map-frame :where(.geodir-map-wrap, .geodir_map_container, iframe) {
	border-radius: var(--pt-radius);
	overflow: hidden;
}

/* Results list and pagination */
.pt-gd-results-list,
.pt-gd-results-paging {
	box-sizing: border-box;
}

.pt-gd-results-paging,
.wp-block-group.pt-gd-results-paging {
	margin-top: 0.5rem;
}

.pt-gd-search-page .pt-gd-results-paging .pagination,
.pt-gd-search-page .pt-gd-results-paging .page-numbers {
	justify-content: center;
}

/* Help CTA at end of results */
.pt-gd-help-section .pt-cta-band {
	background: linear-gradient(135deg, var(--pt-color-primary) 0%, var(--pt-color-primary-dark) 100%);
	color: #fff;
	padding: clamp(1.5rem, 1.1rem + 2vw, 2.5rem);
	border-radius: var(--pt-radius-lg);
}

.pt-gd-help-section .pt-cta-band .pt-eyebrow,
.pt-gd-help-section .pt-cta-band .pt-subheading,
.pt-gd-help-section .pt-cta-band p {
	color: #fff;
}

.pt-gd-help-section .pt-cta-band .pt-eyebrow {
	color: rgba(255, 255, 255, 0.78);
}

.pt-gd-help-section .pt-cta-band p {
	color: rgba(255, 255, 255, 0.92);
	max-width: 620px;
}

.pt-gd-help-section .pt-cta-band .wp-block-button:not(.is-style-outline) .wp-block-button__link {
	background: var(--pt-color-accent);
	border-color: var(--pt-color-accent);
	color: #17211d;
}

.pt-gd-help-section .pt-cta-band .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
	background: #d9aa44;
	border-color: #d9aa44;
}

.pt-gd-help-section .pt-cta-band .wp-block-button.is-style-outline .wp-block-button__link {
	border-color: rgba(255, 255, 255, 0.55);
	color: #fff;
}

.pt-gd-help-section .pt-cta-band .wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: rgba(255, 255, 255, 0.12);
	border-color: #fff;
}

/* Tablet collapse: stack listings (first) above map */
@media (max-width: 960px) {
	.pt-gd-search-layout,
	.wp-block-group.pt-gd-search-layout {
		grid-template-columns: 1fr;
	}

	.pt-gd-map-sticky {
		position: static;
	}
}

/* Mobile: relax sticky search command area */
@media (max-width: 600px) {
	.pt-gd-search-page .pt-gd-search-bar-section {
		position: static;
		border-bottom: 0;
		padding-block: 0.85rem;
	}

}

/* ==========================================================================
 * Float Search Variant
 *
 * A floating Map button (FAB) opens a full-viewport overlay. The map widget
 * remains in the normal GD/WordPress lifecycle, while GD native Click to Load
 * controls when the map/API payload is requested. JS toggles
 * .pt-gd-overlay-active on <body> and switches `inert` on the overlay so it
 * leaves the accessibility tree / tab order when closed.
 *
 * Map fill: the overlay body is position:relative; the widget inside is
 * position:absolute inset:0 so percentage heights inside GD's nested map
 * markup all resolve against an element with explicit pixel dimensions —
 * sidestepping the well-known flex + percentage-height cascade quirk.
 * ========================================================================== */

/* FAB button - positioned to clear GP's back-to-top (bottom 30 + 40h = 70px) */
.pt-gd-map-fab {
	position: fixed;
	right: clamp(1rem, 1.4vw + 0.5rem, 1.75rem);
	bottom: clamp(5rem, 4.5rem + 1.5vw, 6rem);
	z-index: 90;
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	min-height: 52px;
	padding: 0.85rem 1.4rem;
	border: 0;
	border-radius: 999px;
	background: var(--pt-color-primary);
	color: #fff;
	font-family: inherit;
	font-weight: 700;
	font-size: 0.95rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 12px 28px rgba(15, 81, 50, 0.35);
	transition: transform 0.18s ease, box-shadow 0.18s ease, background var(--pt-transition);
	-webkit-tap-highlight-color: transparent;
}

.pt-gd-map-fab:hover,
.pt-gd-map-fab:focus-visible {
	background: var(--pt-color-primary-dark);
	transform: translateY(-2px);
	box-shadow: 0 16px 36px rgba(15, 81, 50, 0.42);
	outline: none;
}

.pt-gd-map-fab:focus-visible {
	box-shadow: var(--pt-focus-ring), 0 16px 36px rgba(15, 81, 50, 0.42);
}

.pt-gd-map-fab:active {
	transform: translateY(0);
}

.pt-gd-map-fab i {
	font-size: 1.05rem;
}

/* Hide FAB while overlay is open */
body.pt-gd-overlay-active .pt-gd-map-fab {
	display: none;
}

/* Overlay container: always rendered at full size; offscreen via transform.
 * No visibility:hidden — that can cause some map engines to skip tile loads
 * and prevents the map iframe from sizing correctly at boot. */
.pt-gd-map-overlay,
.wp-block-group.pt-gd-map-overlay {
	position: fixed;
	inset: 0;
	z-index: 95;
	display: flex;
	flex-direction: column;
	background: var(--pt-color-bg);
	transform: translateY(100%);
	transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
	pointer-events: none;
	margin-top: 0 !important;
}

body.pt-gd-overlay-active .pt-gd-map-overlay {
	transform: translateY(0);
	pointer-events: auto;
}

/* Body scroll lock while overlay is open */
body.pt-gd-overlay-active {
	overflow: hidden;
}

/* Overlay header */
.pt-gd-map-overlay-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: clamp(0.7rem, 0.5rem + 0.6vw, 1rem) clamp(1rem, 0.7rem + 1vw, 1.5rem);
	background: var(--pt-color-bg);
	border-bottom: 1px solid var(--pt-color-border);
	z-index: 2;
	flex: 0 0 auto;
}

.pt-gd-map-overlay-title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 720;
	letter-spacing: -0.01em;
	color: var(--pt-color-text);
}

.pt-gd-map-overlay-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	background: var(--pt-color-bg-soft);
	color: var(--pt-color-text);
	border: 1px solid var(--pt-color-border);
	border-radius: 999px;
	font-size: 1rem;
	cursor: pointer;
	transition: background var(--pt-transition), color var(--pt-transition), border-color var(--pt-transition);
}

.pt-gd-map-overlay-close:hover {
	background: var(--pt-color-text);
	color: #fff;
	border-color: var(--pt-color-text);
}

.pt-gd-map-overlay-close:focus-visible {
	outline: none;
	box-shadow: var(--pt-focus-ring);
}

/* Overlay body: provides a sized, relative-positioned canvas for the map */
.pt-gd-map-overlay-body,
.wp-block-group.pt-gd-map-overlay-body {
	flex: 1 1 auto;
	min-height: 0;
	position: relative;
	overflow: hidden;
}

/* Force the GD map widget and all its nested wrappers to fill the body.
 * Using absolute positioning on the widget means its children's height:100%
 * resolves against a parent with explicit dimensions (regardless of flex
 * cascade quirks). */
.pt-gd-map-overlay-body .wp-block-geodirectory-geodir-widget-map {
	position: absolute;
	inset: 0;
	margin: 0 !important;
}

.pt-gd-map-overlay-body :where(
	.geodir-map-wrap,
	.geodir_map_container,
	.geodir_map,
	.main_map_wrapper,
	.stick_trigger_container
) {
	height: 100% !important;
	width: 100% !important;
	max-height: none !important;
	max-width: none !important;
}

.pt-gd-map-overlay-body [id^="geodir_map_canvas"],
.pt-gd-map-overlay-body [id^="map_canvas"] {
	height: 100% !important;
	width: 100% !important;
}

@media (max-width: 600px) {
	.pt-gd-map-fab {
		padding: 0.8rem 1.15rem;
		font-size: 0.9rem;
		bottom: clamp(4.5rem, 4rem + 2vw, 5.5rem);
	}

	.pt-gd-map-fab i {
		font-size: 1rem;
	}

	.pt-gd-map-overlay-title {
		font-size: 0.98rem;
	}
}

/* ==========================================================================
 * Tabbed Search Variant
 *
 * Listings are visible by default. The Map tab contains the normal GD archive
 * map widget and relies on GD's native Click to Load lazy map mode. The tab JS
 * only reveals the panel and refits the map. The optional auto-load switch in
 * pt-search.js is kept false by default, so Google Maps/API stays unloaded
 * until the visitor explicitly clicks the map placeholder.
 * ========================================================================== */
.pt-gd-search-tabs-nav {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.35rem;
	margin-bottom: 1rem;
	border: 1px solid var(--pt-color-border);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.86);
	box-shadow: var(--pt-shadow-card);
}

.pt-gd-search-tab {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 0.65rem 1.1rem;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--pt-color-muted);
	font-family: inherit;
	font-size: 0.94rem;
	font-weight: 720;
	line-height: 1;
	cursor: pointer;
	transition: background var(--pt-transition), color var(--pt-transition), box-shadow var(--pt-transition);
}

.pt-gd-search-tab:hover,
.pt-gd-search-tab:focus-visible {
	color: var(--pt-color-text);
	outline: none;
}

.pt-gd-search-tab:focus-visible {
	box-shadow: var(--pt-focus-ring);
}

.pt-gd-search-tab.is-active {
	background: var(--pt-color-primary);
	color: #fff;
	box-shadow: 0 8px 20px rgba(15, 81, 50, 0.22);
}

.pt-gd-search-tab-panel[hidden] {
	display: none !important;
}

.pt-gd-search-tab-panel-map .pt-gd-map-frame-wide {
	padding: clamp(0.45rem, 0.35rem + 0.4vw, 0.75rem);
}

.pt-gd-search-tab-panel-map :where(.geodir-map-wrap, .geodir_map_container, iframe) {
	border-radius: var(--pt-radius);
	overflow: hidden;
}

.pt-gd-search-tab-panel-map .geodir-lazyload-div,
.pt-gd-map-overlay-body .geodir-lazyload-div {
	height: 100% !important;
	min-height: 100% !important;
}

@media (max-width: 600px) {
	.pt-gd-search-tabs-nav {
		display: flex;
		width: 100%;
	}

	.pt-gd-search-tab {
		flex: 1 1 0;
		padding-inline: 0.8rem;
	}
}

