/* =============================================================================
   Rinnai Global Region Widget
   Globe icon → floating dropdown (desktop) / slide panel with accordion (mobile)
   ============================================================================= */

/* ── BASE ────────────────────────────────────────────────── */

.rgr {
	position: relative;
	display: inline-flex;
	align-items: center;
}

/* ── GLOBE BUTTON ────────────────────────────────────────── */

.rgr__globe-btn {
	background: none;
	border: none;
	cursor: pointer;
	color: #3e3a39; /* fallback; overridden by Elementor color control */
	padding: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s ease;
	line-height: 1;
	position: relative;
}

/* ── GLOBE ↔ X ICON SWAP ─────────────────────────────── */

.rgr__globe-icon {
	display: flex;
	align-items: center;
	transition: opacity 0.2s ease;
}

.rgr.is-open .rgr__globe-icon {
	opacity: 0;
}

.rgr__close-icon {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.rgr.is-open .rgr__close-icon {
	opacity: 1;
}

.rgr__close-svg {
	width: 24px; /* default; overridden by Elementor icon_size control */
	height: 24px;
	display: block;
	flex-shrink: 0;
	pointer-events: none;
}

.rgr__globe-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.rgr__globe-svg {
	width: 24px; /* default; overridden by Elementor size control */
	height: 24px;
	display: block;
	flex-shrink: 0;
	pointer-events: none;
}

/* ── DESKTOP DROPDOWN ────────────────────────────────────── */

.rgr__dropdown {
	position: absolute;
	top: calc(100% + 4px);
	right: 0;
	width: 300px; /* default; overridden by Elementor width control */
	background-color: #fff; /* overridden by Elementor control */
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
	z-index: 9991;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition:
		opacity 0.2s ease,
		visibility 0.2s ease,
		transform 0.2s ease;
}

.rgr.is-open .rgr__dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.rgr__dropdown-inner {
	padding: 20px 20px 24px;
	max-height: 80vh;
	overflow-y: auto;
	scrollbar-gutter: stable;
}

/* ── DESKTOP OVERLAY ─────────────────────────────────────── */

.rgr__overlay {
	position: fixed;
	top: var(--rgr-panel-top, 0px);
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9990;
	pointer-events: none;
	background-color: rgba(0, 0, 0, 0.25);
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0.2s ease,
		visibility 0.2s ease;
}

.rgr__overlay.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* ── SECTION HEADER (Region title + red rule) ────────────── */

.rgr__section-header {
	display: flex;
	align-items: center;
	margin-bottom: 12px;
}

.rgr__section-rule {
	display: block;
	flex-shrink: 0;
	width: 4px;  /* overridden by Elementor rule-width control */
	height: 32px; /* overridden by Elementor rule-height control */
	background-color: #e2001a; /* overridden by Elementor rule-color control */
}

.rgr__section-title {
	font-weight: 600;
	color: #3e3a39; /* overridden by Elementor control */
	padding-left: 12px; /* overridden by Elementor rule-gap control */
	line-height: 1.3;
}

/* ── GLOBAL LINK AREA ────────────────────────────────────── */

.rgr__global-link {
	margin-bottom: 10px;
	padding-left: 14px;
}

/* ── GROUP ───────────────────────────────────────────────── */

.rgr__group {
	margin-top: 14px;
}

.rgr__group-header {
	display: flex;
	align-items: center;
	margin-bottom: 6px;
}

.rgr__group-rule {
	display: block;
	flex-shrink: 0;
	width: 4px;  /* overridden by Elementor group-rule-width control */
	height: 24px; /* overridden by Elementor group-rule-height control */
	background-color: #777473; /* overridden by Elementor group-rule-color control */
}

.rgr__group-name {
	font-size: 14px;
	font-weight: 500;
	color: #3e3a39; /* overridden by Elementor control */
	padding-left: 10px; /* overridden by Elementor group-rule-gap control */
	line-height: 1.3;
}

/* ── LINK LIST ───────────────────────────────────────────── */

.rgr__link-list {
	list-style: none;
	margin: 0;
	padding: 0;
	padding-left: 14px;
}

.rgr__link-list li {
	padding: 0;
	margin: 0;
}

/* ── LINK (matches rinnai-hyperlink-button visual style) ──── */

.rgr__link {
	display: inline-flex;
	align-items: flex-start;
	text-decoration: none;
	color: #1a1a1a; /* overridden by Elementor control */
	cursor: pointer;
	line-height: 1.2;
	transition: color 0.2s ease;
	padding: 5px 0;
	width: 100%;
}

.rgr__link:hover {
	text-decoration: none;
	color: #e2001a; /* overridden by Elementor control */
}

/* Chevron — flex-shrink so it never squishes, top-padded to sit on first text line */
.rgr__link-chevron {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	margin-right: 6px;
	padding-top: 0.4em;
}

.rgr__link-chevron-svg {
	width: 10px; /* overridden by Elementor control */
	height: 10px;
	display: block;
	overflow: visible;
}

/* Content + text */
.rgr__link-content {
	display: block;
	min-width: 0;
}

.rgr__link-text {
	white-space: normal;
	word-break: break-word;
}

/* External icon flows inline right after the label text */
.rgr__link-ext {
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	flex-shrink: 0;
	margin-left: 5px;
	position: relative;
	top: -1px;
}

.rgr__link-ext-svg {
	width: 12px; /* overridden by Elementor control */
	height: auto;
	display: block;
	overflow: visible; /* prevent sub-pixel clipping at the viewBox boundary */
}

/* ── BODY SCROLL LOCK ────────────────────────────────────── */

body.rgr-lock {
	overflow: hidden;
}

/* ── MOBILE / TABLET PANEL ───────────────────────────────── */

.rgr__mobile-panel {
	position: fixed;
	left: 0;
	right: 0;
	top: var(--rgr-panel-top, 0px);
	z-index: 9995;
	background-color: #fff; /* overridden by Elementor dropdown-bg control */
	display: none;
	height: 0;
	overflow: hidden;
}

.rgr__mobile-panel-inner {
	padding: 24px 20px 48px;
	display: flex;
	flex-direction: column;
}

/* ── ACCORDION (mobile groups) ───────────────────────────── */

.rgr__accordion {
	margin-top: 8px;
}

.rgr__accordion-item {
	/* container for each accordion group */
}

.rgr__accordion-header {
	display: flex;
	align-items: center;
	padding: 5px 0;
	cursor: default;
	min-height: 44px;
}

/* Plus icon hidden — groups are always expanded, no toggle needed */
.rgr__accordion-plus {
	display: none;
}

/* Always show all group bodies — panel scrolls if content overflows */
.rgr__accordion-body {
	max-height: none;
	overflow: visible;
	padding-left: 14px;
}

/* ── BOTTOM CLOSE BUTTON ─────────────────────────────────── */

.rgr__panel-close-bottom {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin-top: 30px;
	margin-left: calc(100% - 40px);
	background: none;
	border: none;
	cursor: pointer;
	color: inherit;
	padding: 0;
	transition: opacity 0.3s;
	flex-shrink: 0;
}

.rgr__panel-close-bottom:hover {
	opacity: 0.7;
}

.rgr__panel-close-bottom .rgr__close-svg {
	width: 14px;
	height: 14px;
}

/* ── RESPONSIVE BREAKPOINTS ──────────────────────────────── */

/* Desktop (≥1245px): show floating dropdown, hide mobile panel + overlay suppressed */
@media (min-width: 1245px) {
	.rgr__mobile-panel {
		display: none !important;
	}
}

/* Mobile / Tablet (≤1244px): hide floating dropdown, show slide panel; overlay stays active */
@media (max-width: 1244px) {
	.rgr__dropdown {
		display: none !important;
	}

	.rgr__mobile-panel {
		display: block;
	}
}
