/**
 * Currency switcher (header). Neutral styling that adapts to the theme.
 */
.rbbe-currency {
	position: relative;
	display: inline-flex;
	font-size: 14px;
	line-height: 1.2;
}

.rbbe-currency[hidden] {
	display: none;
}

.rbbe-currency__toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 14px;
	min-height: 44px;
	box-sizing: border-box;
	background: linear-gradient(
		135deg,
		rgba(255, 255, 255, 0.97) 0%,
		color-mix(in srgb, var(--ramaya-sea-soft, #e9f4f6) 88%, #ffffff) 100%
	);
	border: 1px solid color-mix(in srgb, var(--ramaya-sea, #52a9b8) 32%, rgba(255, 255, 255, 0.7));
	border-radius: 999px;
	color: var(--ramaya-sea-deep, #2c5f6b);
	font: inherit;
	font-size: 0.875rem;
	font-weight: 700;
	cursor: pointer;
	box-shadow:
		0 4px 14px rgba(14, 31, 41, 0.14),
		inset 0 1px 0 rgba(255, 255, 255, 0.9);
	transition: background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.rbbe-currency__toggle:hover,
.rbbe-currency.is-open .rbbe-currency__toggle {
	background: #fff;
	border-color: color-mix(in srgb, var(--ramaya-sea, #52a9b8) 48%, white);
	box-shadow:
		0 6px 18px rgba(14, 31, 41, 0.18),
		0 0 0 3px color-mix(in srgb, var(--ramaya-sea, #52a9b8) 16%, transparent);
	transform: translateY(-1px);
}

.rbbe-currency__toggle:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.9);
	outline-offset: 2px;
}

.rbbe-currency__code {
	letter-spacing: 0.02em;
}

.rbbe-currency__caret {
	transition: transform 0.15s ease;
}

.rbbe-currency.is-open .rbbe-currency__caret {
	transform: rotate(180deg);
}

.rbbe-currency__panel {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 1000;
	width: 260px;
	max-width: calc(100vw - 32px);
	padding: 10px;
	background: #fff;
	color: #1a1a1a;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}

.rbbe-currency__panel[hidden] {
	display: none;
}

.rbbe-currency__backdrop {
	display: none;
}

.rbbe-currency__panel-head {
	display: none;
}

.rbbe-currency__panel-body {
	display: block;
}

.rbbe-currency__panel-title {
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
}

.rbbe-currency__panel-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.06);
	color: inherit;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.rbbe-currency__panel-close:hover {
	background: rgba(15, 23, 42, 0.1);
}

.rbbe-currency__search {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	margin-bottom: 8px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 8px;
	font: inherit;
	font-size: 14px;
}

.rbbe-currency__search:focus {
	outline: 2px solid rgba(0, 0, 0, 0.35);
	outline-offset: 1px;
}

.rbbe-currency__list {
	max-height: 300px;
	overflow-y: auto;
}

.rbbe-currency__group {
	padding: 8px 8px 4px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: rgba(0, 0, 0, 0.5);
}

.rbbe-currency__option {
	display: flex;
	align-items: baseline;
	gap: 10px;
	width: 100%;
	padding: 8px;
	background: transparent;
	border: 0;
	border-radius: 8px;
	text-align: left;
	font: inherit;
	color: inherit;
	cursor: pointer;
}

.rbbe-currency__option:hover {
	background: rgba(0, 0, 0, 0.06);
}

.rbbe-currency__option.is-active {
	background: rgba(0, 0, 0, 0.08);
	font-weight: 600;
}

.rbbe-currency__option-code {
	flex: 0 0 auto;
	min-width: 38px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.rbbe-currency__option-name {
	flex: 1 1 auto;
	font-size: 13px;
	color: rgba(0, 0, 0, 0.65);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rbbe-currency__empty {
	padding: 12px 8px;
	font-size: 13px;
	color: rgba(0, 0, 0, 0.55);
	text-align: center;
}

/* Mobile header bar: icon trigger (left of hamburger). */
.rbbe-currency__bar-trigger {
	display: none;
}

@media (max-width: 991.98px) {
	.site-header__bar-end {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		flex-shrink: 0;
	}

	/* Selaras dengan .site-header__toggle (ghost, transparan). */
	.rbbe-currency__bar-trigger {
		display: inline-flex;
		flex-shrink: 0;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin: 0;
		padding: 0;
		box-sizing: border-box;
		border: 1px solid color-mix(in srgb, var(--ramaya-sea, #52a9b8) 40%, rgba(255, 255, 255, 0.35));
		border-radius: 12px;
		background: linear-gradient(
			145deg,
			rgba(255, 255, 255, 0.18) 0%,
			rgba(82, 169, 184, 0.22) 100%
		);
		color: var(--ramaya-header-text, #fff);
		font: inherit;
		font-size: 0.6875rem;
		font-weight: 700;
		line-height: 1;
		letter-spacing: 0.05em;
		cursor: pointer;
		box-shadow: 0 4px 14px rgba(14, 31, 41, 0.16);
		transition:
			background-color var(--ramaya-duration, 0.32s) var(--ramaya-ease-out, ease),
			transform var(--ramaya-duration, 0.32s) var(--ramaya-ease-out, ease),
			box-shadow var(--ramaya-duration, 0.32s) var(--ramaya-ease-out, ease);
		-webkit-tap-highlight-color: transparent;
	}

	.rbbe-currency__bar-trigger:hover,
	.rbbe-currency__bar-trigger:focus-visible,
	.rbbe-currency__bar-trigger[aria-expanded="true"] {
		background: linear-gradient(
			145deg,
			rgba(255, 255, 255, 0.28) 0%,
			rgba(82, 169, 184, 0.34) 100%
		);
		box-shadow: 0 6px 18px rgba(14, 31, 41, 0.2);
		outline: 2px solid var(--ramaya-toggle-outline, rgba(255, 255, 255, 0.55));
		outline-offset: 2px;
	}

	.rbbe-currency__bar-code {
		font-size: inherit;
		font-weight: inherit;
		line-height: inherit;
		letter-spacing: inherit;
	}

	/* Hide duplicate switcher inside the hamburger drawer. */
	.site-header__actions .rbbe-currency {
		display: none !important;
	}
}

/* Mobile: full-screen sheet (avoids clipping inside the nav drawer). */
@media (max-width: 991.98px) {
	body.rbbe-currency-panel-open {
		overflow: hidden;
	}

	.rbbe-currency__backdrop {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 100001;
		background: rgba(15, 23, 42, 0.55);
		-webkit-backdrop-filter: blur(2px);
		backdrop-filter: blur(2px);
	}

	.rbbe-currency__backdrop[hidden] {
		display: none;
	}

	.rbbe-currency__panel {
		position: fixed;
		inset: 0;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		max-width: none;
		height: 100%;
		height: 100dvh;
		z-index: 100002;
		display: flex;
		flex-direction: column;
		padding: 0;
		border: 0;
		border-radius: 0;
		box-shadow: none;
	}

	.rbbe-currency__panel-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		flex-shrink: 0;
		padding: max(12px, env(safe-area-inset-top, 0px)) 16px 12px;
		border-bottom: 1px solid rgba(15, 23, 42, 0.08);
		background: #fff;
	}

	.rbbe-currency__panel-body {
		flex: 1 1 auto;
		min-height: 0;
		display: flex;
		flex-direction: column;
		padding: 12px 16px max(16px, env(safe-area-inset-bottom, 0px));
		background: #fff;
	}

	.rbbe-currency__search {
		flex-shrink: 0;
		margin-bottom: 12px;
		padding: 12px 14px;
		font-size: 16px;
		border-radius: 10px;
	}

	.rbbe-currency__list {
		flex: 1 1 auto;
		max-height: none;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.rbbe-currency__option {
		padding: 12px 10px;
		font-size: 15px;
	}

	.rbbe-currency__option-name {
		font-size: 14px;
	}
}
