/**
 * Geolocation Country Selector Styles
 * Conflict-safe with high z-index and isolated styling
 */

/* Main wrapper - isolated to prevent conflicts */
#fdm-country-selector-wrapper {
	position: relative !important;
	display: inline-flex !important;
	align-items: center !important;
	vertical-align: middle !important;
	z-index: 999 !important;
	isolation: isolate;
	/* Create new stacking context */
	visibility: visible !important;
	opacity: 1 !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Selector container */
.fdm-country-selector {
	position: relative;
	display: inline-block;
	width: auto;
	min-width: 120px;
}

/* Button styling - clean, minimal design matching header */
.fdm-country-selector-button {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 6px;
	padding: 6px 10px !important;
	background: transparent !important;
	border: none !important;
	border-radius: 0;
	color: #0CBAB4 !important;
	cursor: pointer;
	font-size: 13px;
	font-family: "Galano", Sans-serif;
	font-weight: 400;
	transition: all 0.2s ease;
	white-space: nowrap;
	position: relative;
	box-sizing: border-box;
	min-height: 32px;
	height: auto;
	width: auto;
	margin: 0 !important;
	line-height: 1.2;
	opacity: 1;
}

.fdm-country-selector-button:hover {
	background: transparent !important;
	border: none !important;
	color: #0CBAB4 !important;
	opacity: 1;
}

.fdm-country-selector-button:focus {
	outline: 2px solid #0CBAB4;
	outline-offset: 2px;
}

.fdm-country-selector-button.loading {
	opacity: 0.7;
	cursor: wait;
}

.fdm-country-selector-button:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

.fdm-country-selector.active .fdm-country-selector-button,
#fdm-country-selector-wrapper.active .fdm-country-selector-button {
	background: transparent !important;
	border: none !important;
	color: #0CBAB4 !important;
	opacity: 1;
}

.fdm-country-selector.active .fdm-dropdown-icon,
#fdm-country-selector-wrapper.active .fdm-dropdown-icon {
	transform: rotate(180deg);
}

/* Icon styling - subtle and clean */
.fdm-country-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	line-height: 1;
	font-size: 16px;
}

.fdm-country-icon svg {
	fill: currentColor;
	color: inherit;
	width: 18px;
	height: 18px;
}

.fdm-flag-icon {
	font-size: 18px;
	line-height: 1;
	display: inline-block;
}

.fdm-globe-icon {
	width: 20px;
	height: 20px;
	fill: currentColor;
	display: block;
}

.fdm-country-name {
	font-weight: 400;
	flex: 1;
	text-align: left;
	font-size: 13px;
	letter-spacing: 0.3px;
}

.fdm-dropdown-icon {
	width: 10px;
	height: 10px;
	fill: currentColor;
	transition: transform 0.2s ease;
	flex-shrink: 0;
	margin-left: 4px;
	opacity: 0.8;
	color: #0CBAB4;
}

.fdm-country-selector.active .fdm-dropdown-icon,
#fdm-country-selector-wrapper.active .fdm-dropdown-icon {
	transform: rotate(180deg);
}

/* Dropdown menu - clean, modern design with consistent colors */
.fdm-country-dropdown {
	position: fixed !important;
	/* Use fixed to escape ALL parent containers */
	/* Position will be set by JavaScript - don't set top/left here */
	background: #182A54 !important;
	/* Dark blue background matching site */
	border: none !important;
	/* No border */
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2) !important;
	min-width: 160px;
	max-width: 220px;
	width: 180px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(0) scale(0.95);
	transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	overflow: visible !important;
	box-sizing: border-box;
	margin: 0 !important;
	padding: 0 !important;
	pointer-events: none;
	display: block !important;
	clip: auto !important;
	clip-path: none !important;
}

.fdm-country-selector.active .fdm-country-dropdown,
#fdm-country-selector-wrapper.active .fdm-country-dropdown {
	opacity: 1 !important;
	visibility: visible !important;
	transform: translateY(0) scale(1) !important;
	pointer-events: auto !important;
	display: block !important;
}

/* Country options - consistent colors with site design, icon left center, text center, checkmark right center */
.fdm-country-option {
	display: flex !important;
	align-items: center !important;
	/* Vertically center all items in the middle */
	justify-content: space-between !important;
	gap: 12px;
	width: 100% !important;
	padding: 12px 14px;
	background: transparent;
	border: none !important;
	border-bottom: 1px solid rgba(12, 186, 180, 0.2);
	color: #fff !important;
	/* White text on dark blue background */
	cursor: pointer;
	font-size: 13px;
	font-family: "Galano", Sans-serif;
	font-weight: 400;
	text-align: center;
	transition: all 0.15s ease;
	box-sizing: border-box;
	position: relative;
	min-height: 44px;
	/* Ensure consistent height for proper centering */
	flex-direction: row !important;
	/* Ensure horizontal layout */
}

.fdm-country-option:last-child {
	border-bottom: none;
}

.fdm-country-option:hover {
	background: rgba(12, 186, 180, 0.2) !important;
	/* Teal hover on dark blue */
	color: #fff !important;
}

.fdm-country-option:focus {
	outline: 2px solid #0CBAB4;
	outline-offset: -2px;
}

.fdm-country-option.active {
	background: rgba(12, 186, 180, 0.3) !important;
	/* Teal background for active */
	color: #0CBAB4 !important;
	/* Teal text for active */
	font-weight: 500;
	border: none !important;
	/* No border on active state */
}

.fdm-country-option-icon {
	display: flex !important;
	align-items: center !important;
	/* Vertically center icon */
	justify-content: center;
	width: 20px;
	height: 20px;
	flex-shrink: 0 !important;
	margin: 0 !important;
	order: 1 !important;
	/* Icon on the left center */
	line-height: 1;
	position: relative;
}

.fdm-country-option-icon .fdm-flag-icon {
	display: inline-flex;
	align-items: center;
	line-height: 1;
	font-size: 18px;
}

.fdm-country-option-icon svg {
	display: block;
	width: 20px;
	height: 20px;
}

.fdm-country-option-icon svg {
	fill: currentColor;
	color: inherit;
}

.fdm-country-option.active .fdm-country-option-icon svg {
	fill: #0CBAB4;
}

.fdm-country-option-name {
	flex: 1 !important;
	text-align: center !important;
	color: inherit;
	margin: 0 auto !important;
	order: 2 !important;
	/* Text in the center */
	display: flex;
	align-items: center !important;
	/* Vertically center text */
	justify-content: center;
	line-height: 1.4;
	position: relative;
}

.fdm-check-icon {
	width: 16px !important;
	height: 16px !important;
	fill: none;
	stroke: #0CBAB4 !important;
	/* Teal checkmark */
	stroke-width: 2;
	flex-shrink: 0 !important;
	margin: 0 !important;
	order: 3 !important;
	/* Checkmark on the right center */
	display: flex !important;
	align-items: center !important;
	/* Vertically center checkmark */
	justify-content: center;
	position: relative;
}

/* Ensure checkmark container takes space even when hidden for perfect centering */
.fdm-country-option .fdm-check-icon {
	visibility: visible;
}

.fdm-country-option:not(.active) .fdm-check-icon {
	visibility: hidden !important;
	display: flex !important;
	/* Keep display:flex so it takes up space */
}

/* Dark header variant */
#fdm-country-selector-wrapper.dark .fdm-country-selector-button {
	border-color: rgba(24, 42, 84, 0.3);
	color: #182A54;
}

#fdm-country-selector-wrapper.dark .fdm-country-selector-button:hover {
	background: rgba(24, 42, 84, 0.1);
	border-color: rgba(24, 42, 84, 0.5);
}

#fdm-country-selector-wrapper.dark .fdm-country-selector.active .fdm-country-selector-button,
#fdm-country-selector-wrapper.dark.active .fdm-country-selector-button {
	background: rgba(24, 42, 84, 0.15);
	border-color: rgba(24, 42, 84, 0.6);
}

/* Responsive styles - Mobile and Tablet */
@media (max-width: 1024px) {
	#fdm-country-selector-wrapper {
		display: block !important;
		visibility: visible !important;
		opacity: 1 !important;
		position: relative !important;
		display: inline-flex !important;
		align-items: center;
		margin-right: 15px;
		/* Add spacing between selector and hamburger */
		width: auto !important;
		height: auto !important;
		max-width: none !important;
		max-height: none !important;
		clip: auto !important;
		clip-path: none !important;
		transform: none !important;
		pointer-events: auto !important;
	}

	/* Reset positioning when inside the mobile popup menu */
	/* Reset positioning when inside the mobile popup menu */
	.app-popup-mobile-nav #fdm-country-selector-wrapper,
	.app-popup-nav-mobile #fdm-country-selector-wrapper,
	.elementor-nav-menu--dropdown #fdm-country-selector-wrapper {
		position: relative !important;
		top: auto !important;
		right: auto !important;
		display: flex !important;
		/* Use flex to allow centering */
		justify-content: center !important;
		margin: 20px auto 10px auto !important;
		/* Center and add space */
		z-index: 100 !important;
		width: 100% !important;
		/* Full width wrapper for centering */
	}

	/* Specific design for the button inside popup */
	.app-popup-mobile-nav .fdm-country-selector-button,
	.app-popup-nav-mobile .fdm-country-selector-button {
		background: rgba(255, 255, 255, 0.08) !important;
		border: 1px solid rgba(255, 255, 255, 0.2) !important;
		border-radius: 50px !important;
		padding: 10px 24px !important;
		color: #ffffff !important;
		min-width: 160px;
		justify-content: center;
		transition: all 0.3s ease;
	}

	.app-popup-mobile-nav .fdm-country-selector-button:hover,
	.app-popup-nav-mobile .fdm-country-selector-button:hover {
		background: rgba(255, 255, 255, 0.15) !important;
		border-color: #ffffff !important;
	}

	/* Force show text inside popup */
	.app-popup-mobile-nav .fdm-country-name,
	.app-popup-nav-mobile .fdm-country-name {
		display: inline-block !important;
		margin: 0 10px !important;
		font-size: 14px !important;
		font-weight: 500 !important;
		text-transform: uppercase;
		letter-spacing: 0.5px;
	}

	/* Adjust icon colors */
	.app-popup-mobile-nav .fdm-globe-icon,
	.app-popup-nav-mobile .fdm-globe-icon,
	.app-popup-mobile-nav .fdm-dropdown-icon,
	.app-popup-nav-mobile .fdm-dropdown-icon {
		color: #ffffff !important;
	}


	.fdm-country-selector {
		min-width: auto;
		display: block !important;
		visibility: visible !important;
		opacity: 1 !important;
	}

	.fdm-country-selector-button {
		padding: 8px 12px !important;
		font-size: 14px !important;
		margin: 0 !important;
		min-height: 40px !important;
		display: flex !important;
		visibility: visible !important;
		opacity: 1 !important;
	}

	.fdm-country-name {
		display: none;
	}

	.fdm-country-dropdown {
		right: 0 !important;
		left: auto !important;
		min-width: 160px !important;
	}

	/* Dropdown specific styles for mobile popup */
	.app-popup-mobile-nav .fdm-country-dropdown,
	.app-popup-nav-mobile .fdm-country-dropdown,
	.elementor-nav-menu--dropdown .fdm-country-dropdown {
		position: absolute !important;
		/* Use absolute relative to the selector wrapper */
		top: 100% !important;
		/* Position right below */
		left: 0 !important;
		right: 0 !important;
		width: 100% !important;
		max-width: none !important;
		margin-top: 8px !important;
		background: #182A54 !important;
		border: 1px solid rgba(255, 255, 255, 0.1) !important;
	}

	.fdm-country-icon {
		width: 20px;
		height: 20px;
	}
}

/* Ensure it aligns with other header buttons */
.elementor-location-header .elementor-widget-shortcode #fdm-country-selector-wrapper {
	display: inline-flex !important;
	vertical-align: middle !important;
	width: auto !important;
}

/* Match spacing with other header elements - position near social icons */
.elementor-location-header #fdm-country-selector-wrapper {
	margin-left: 0 !important;
	margin-right: 16px !important;
	/* Space after country selector, before social icons */
}

/* Add spacing between country selector and social icons */
.elementor-location-header #fdm-country-selector-wrapper+.elementor-widget,
.elementor-location-header #fdm-country-selector-wrapper~.elementor-widget {
	margin-left: 0;
	/* Social icons will have their own spacing */
}

/* Position country selector before social icons in flex layout */
.elementor-location-header .elementor-row .elementor-column:first-child #fdm-country-selector-wrapper,
.elementor-location-header .elementor-container>.elementor-row>.elementor-column:first-child #fdm-country-selector-wrapper {
	margin-right: 16px !important;
	margin-left: 0 !important;
}

/* Ensure proper alignment in header row */
.elementor-location-header .elementor-widget-shortcode {
	display: inline-block !important;
	vertical-align: middle !important;
}

/* Position country selector in left section with social icons */
.elementor-location-header .elementor-row,
.elementor-location-header .elementor-container {
	justify-content: space-between !important;
}

/* Left section styling - where social icons and country selector are */
.elementor-location-header .elementor-column:first-child,
.elementor-location-header .elementor-row>.elementor-column:first-child {
	display: flex !important;
	align-items: center !important;
	flex-wrap: wrap !important;
	gap: 12px !important;
}

/* Ensure country selector appears before social icons */
.elementor-location-header .elementor-column:first-child #fdm-country-selector-wrapper {
	order: 1 !important;
	margin-right: 12px !important;
}

/* Social icons should come after country selector */
.elementor-location-header .elementor-column:first-child .elementor-widget:not(:has(#fdm-country-selector-wrapper)) {
	order: 2 !important;
}

/* Integration with Elementor header - position near social icons on left */
.elementor-location-header #fdm-country-selector-wrapper {
	position: relative !important;
	top: auto !important;
	left: auto !important;
	right: auto !important;
	margin-left: 0 !important;
	margin-right: 16px !important;
	display: inline-flex !important;
	align-items: center !important;
	vertical-align: middle !important;
	flex-shrink: 0 !important;
	order: -1;
	/* Place before other elements if in flex container */
}

/* Ensure header has relative positioning for absolute dropdown */
.elementor-location-header {
	position: relative;
}

/* Match header button container styling - align with other header buttons */
.elementor-location-header .elementor-container #fdm-country-selector-wrapper,
.elementor-location-header .elementor-row #fdm-country-selector-wrapper,
.elementor-location-header .elementor-column #fdm-country-selector-wrapper {
	display: inline-flex !important;
	align-items: center !important;
	margin: 0 !important;
	vertical-align: middle !important;
}

/* Align with other header widgets/buttons */
.elementor-location-header .elementor-widget-shortcode #fdm-country-selector-wrapper,
.elementor-location-header .elementor-widget-container #fdm-country-selector-wrapper {
	display: inline-flex !important;
	align-items: center !important;
	width: auto !important;
	margin: 0 !important;
}

/* Ensure it flows with other elements in a flex row */
.elementor-location-header .elementor-row,
.elementor-location-header .elementor-container {
	display: flex !important;
	align-items: center !important;
	flex-wrap: wrap !important;
}

.elementor-location-header .elementor-column {
	display: flex !important;
	align-items: center !important;
}

/* Prevent conflicts with other dropdowns/menus */
#fdm-country-selector-wrapper * {
	box-sizing: border-box;
}

/* Isolate from other styles */
#fdm-country-selector-wrapper,
#fdm-country-selector-wrapper * {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Screen reader text */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
}

/* Prevent text selection on button */
.fdm-country-selector-button,
.fdm-country-option {
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}

/* Ensure dropdown doesn't get cut off - allow it to escape all boundaries */
#fdm-country-selector-wrapper {
	overflow: visible !important;
}

.fdm-country-selector {
	overflow: visible !important;
}

/* Fix for potential overflow issues in parent containers - allow dropdown to escape */
body.elementor-page #fdm-country-selector-wrapper,
.site-header #fdm-country-selector-wrapper,
.elementor-location-header #fdm-country-selector-wrapper,
.elementor-location-header,
.elementor-location-header .elementor-container,
.elementor-location-header .elementor-row,
.elementor-location-header .elementor-column,
.elementor-location-header .elementor-widget,
.elementor-location-header .elementor-widget-container {
	overflow: visible !important;
}

/* Ensure header and all sections don't clip dropdown */
header,
.site-header,
.elementor-location-header,
.elementor-section,
.elementor-container,
.elementor-row,
.elementor-column,
.elementor-widget,
.elementor-widget-container,
nav,
.nav-menu,
.elementor-nav-menu {
	overflow: visible !important;
}

/* Force dropdown to appear above everything including nav menus */
.fdm-country-dropdown {
	position: fixed !important;
}

/* Styles for selector when added to navigation menu */
.menu-item-country-selector,
.fdm-menu-country-selector {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	display: inline-flex !important;
	align-items: center !important;
}

.menu-item-country-selector .fdm-country-selector-wrapper,
.fdm-menu-country-selector .fdm-country-selector-wrapper {
	display: inline-flex !important;
	margin: 0 !important;
}

/* Ensure selector works in standard WordPress menus */
.site-navigation .menu-item-country-selector,
.site-navigation .fdm-menu-country-selector {
	display: inline-block !important;
	vertical-align: middle !important;
}

.fdm-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: 'Outfit', 'Inter', sans-serif;
}

.fdm-modal-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(4px);
}

.fdm-modal-content {
	position: relative;
	background: #fff;
	padding: 50px 40px;
	border-radius: 20px;
	max-width: 550px;
	width: 90%;
	text-align: center;
	box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.fdm-modal-content h2,
.fdm-modal-content h3 {
	margin-top: 0;
	color: #002d62;
	font-size: 48px;
	font-weight: 700;
	margin-bottom: 20px;
}

.fdm-modal-content p {
	font-size: 18px;
	color: #444;
	line-height: 1.5;
}

.fdm-region-options,
.fdm-modal-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	justify-content: center;
	margin-top: 40px;
}

#fdm-warning-modal .fdm-modal-actions {
	flex-direction: column;
	align-items: center;
	flex-wrap: nowrap;
}

.fdm-modal-actions-row {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	justify-content: center;
}

.fdm-modal-actions .fdm-btn-global,
.fdm-modal-actions .fdm-btn-us,
.fdm-modal-actions .fdm-btn-ghost {
	min-width: 0;
	padding: 14px 24px;
	font-size: 16px;
}

#fdm-warning-set-region,
.fdm-warning-set-region-link {
	width: auto;
	padding: 0;
	min-width: 0;
	border: none;
	border-radius: 0;
	outline: none;
	box-shadow: none;
	background: transparent;
	color: #666;
	font-size: 16px;
	font-weight: 400;
	font-style: italic;
	text-decoration: underline;
	cursor: pointer;
	transform: none;
}

#fdm-warning-set-region:hover,
#fdm-warning-set-region:focus,
#fdm-warning-set-region:focus-visible,
.fdm-warning-set-region-link:hover,
.fdm-warning-set-region-link:focus,
.fdm-warning-set-region-link:focus-visible {
	background: transparent;
	border: none;
	outline: none;
	box-shadow: none;
	transform: none;
	color: #333;
	text-decoration: underline;
}

.fdm-btn-global,
.fdm-btn-us,
.fdm-btn-ghost {
	padding: 14px 40px;
	border-radius: 40px;
	border: none;
	font-weight: 600;
	font-size: 18px;
	cursor: pointer;
	transition: all 0.3s ease;
	min-width: 150px;
	text-decoration: none;
	display: inline-block;
}

.fdm-btn-global {
	background: #E62E5F;
	color: #fff;
}

.fdm-btn-global:hover {
	background: #C52551;
	transform: translateY(-2px);
	box-shadow: 0 10px 20px rgba(230, 46, 95, 0.3);
}

.fdm-btn-us {
	background: #00afcc;
	color: #fff;
}

.fdm-btn-us:hover {
	background: #008fa6;
	transform: translateY(-2px);
	box-shadow: 0 10px 20px rgba(0, 175, 204, 0.3);
}

.fdm-btn-ghost {
	background: transparent;
	border: 1px solid #ccc;
	color: #666;
}

.fdm-btn-ghost:hover {
	background: #f5f5f5;
}

.fdm-warning-disclaimer {
	font-size: 11px;
	color: #999;
	margin-top: 20px;
	font-style: italic;
	line-height: 1.4;
}