/* GeoLang – Frontend Styles */

.geolang-switcher {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	flex-wrap: wrap;
}

/* Flags — just the images, side by side, no frame.
   !important + doubled class beat theme / Elementor kit styles for links
   and buttons (borders, padding, backgrounds, hover colours, shadows). */
.geolang-switcher.geolang-switcher .geolang-flag {
	display: inline-flex !important;
	align-items: center;
	gap: 4px;
	background: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none;
	padding: 0 !important;
	margin: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	width: auto !important;
	height: auto !important;
	color: inherit !important;
	text-decoration: none !important;
	line-height: 1;
	vertical-align: middle;
	cursor: pointer;
	opacity: 1 !important;
	transform: none !important;
	transition: none !important;
}

.geolang-switcher.geolang-switcher .geolang-flag:hover,
.geolang-switcher.geolang-switcher .geolang-flag:focus,
.geolang-switcher.geolang-switcher .geolang-flag:active {
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
	color: inherit !important;
}

/* Keyboard users still see where they are. */
.geolang-switcher .geolang-flag:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.geolang-switcher .geolang-flag img {
	display: block;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	max-width: none;
}

.geolang-switcher { gap: 8px; }

/* Size variants (height follows the image's own proportions) */
.geolang-switcher--sm .geolang-flag img { width: 24px; height: auto; }
.geolang-switcher--md .geolang-flag img { width: 32px; height: auto; }
.geolang-switcher--lg .geolang-flag img { width: 40px; height: auto; }

/* Label */
.geolang-lang-label {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

/* Fade transition overlay — applied on body during reload */
.geolang-fading {
	opacity: 0;
	transition: opacity 0.2s ease;
}

/* Admin bar integration */
#wpadminbar .geolang-switcher {
	padding: 4px 0;
}

/* ==========================================================================
   Language-specific visibility — .geolang-only-pt / -en / -es
   ==========================================================================
   Add one of these CSS classes to any Elementor section, column or widget
   via the "Advanced → CSS Classes" field to make it visible only when that
   language is active.  All other matching sections are hidden via display:none.

   The <html data-geolang="en"> attribute is set by an inline <script> in
   <head> (before body renders), so there is zero flash of wrong content
   even on cached pages.
   ========================================================================== */

/* Default state: hide lang-specific elements for all non-active languages.
   We only apply display:none to the INACTIVE languages — never forcing a
   display value on the visible one, so Elementor's own flex/grid/block
   layout is fully preserved. */

/* PT active (default — also covers when data-geolang is absent) */
:root:not([data-geolang]) .geolang-only-en,
:root:not([data-geolang]) .geolang-only-es,
[data-geolang="pt"] .geolang-only-en,
[data-geolang="pt"] .geolang-only-es { display: none !important; }

/* EN active */
[data-geolang="en"] .geolang-only-pt,
[data-geolang="en"] .geolang-only-es { display: none !important; }

/* ES active */
[data-geolang="es"] .geolang-only-pt,
[data-geolang="es"] .geolang-only-en { display: none !important; }

/* Editor / preview: always show all (so the designer sees every section) */
.elementor-editor-active .geolang-only-pt,
.elementor-editor-active .geolang-only-en,
.elementor-editor-active .geolang-only-es { display: revert !important; }

/* In editor, add a subtle label so the designer knows which language each section belongs to */
.elementor-editor-active .geolang-only-pt::before,
.elementor-editor-active .geolang-only-en::before,
.elementor-editor-active .geolang-only-es::before {
	content: attr(data-geolang-label);
	display: block;
	background: #2271b1;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .05em;
	text-transform: uppercase;
	padding: 2px 8px;
	pointer-events: none;
}

/* Elementor widget placeholder */
.geolang-widget-placeholder {
	background: #f0f6ff;
	border: 1px dashed #2271b1;
	border-radius: 4px;
	padding: 12px 16px;
	color: #2271b1;
	font-size: 13px;
	text-align: center;
}
