/* ==========================================================================
   CoolHub Lang — Architectural Dark Studio Switcher (CoolToYou Design System)
   ========================================================================== */

.chl-switcher {
	position: relative;
	display: inline-flex;
	align-items: center;
	font-family: var(--cty-font-body, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
	line-height: 1;
	z-index: 75;
}

.chl-globe-icon,
.chl-check-icon,
.chl-chevron {
	flex-shrink: 0;
}

/* ==========================================================================
   1. Header / Dark Studio Dropdown Trigger & Popover
   Matches `.cty-account-btn` (height 38px, radius 8px) & `.cty-mega-menu` 1:1
   ========================================================================== */

.chl-dropdown-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 38px;
	padding: 0 12px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(148, 163, 184, 0.18);
	color: #f1f5f9;
	font-family: var(--cty-font-body, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.03em;
	cursor: pointer;
	white-space: nowrap;
	transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.chl-dropdown-btn:hover,
.chl-switcher--dropdown:hover .chl-dropdown-btn,
.chl-switcher--dropdown.is-open .chl-dropdown-btn {
	background: rgba(34, 211, 238, 0.1);
	border-color: rgba(34, 211, 238, 0.42);
	color: #22d3ee;
}

.chl-trigger-code {
	line-height: 1;
}

.chl-chevron {
	opacity: 0.72;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.chl-switcher--dropdown:hover .chl-chevron,
.chl-switcher--dropdown.is-open .chl-chevron {
	transform: rotate(180deg);
	opacity: 1;
}

/* Architectural Popover Card */
.chl-dropdown-popover {
	position: absolute;
	top: calc(100% + 12px);
	right: 0;
	width: 212px;
	background: #0e172a;
	border: 1px solid rgba(148, 163, 184, 0.18);
	border-radius: 12px;
	box-shadow: 0 28px 64px rgba(2, 6, 18, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(8px);
	transition: opacity 0.18s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.18s ease;
	z-index: 95;
}

/* Invisible hover bridge matching `.cty-mega-menu::before` */
.chl-dropdown-popover::before {
	content: "";
	position: absolute;
	top: -14px;
	left: 0;
	right: 0;
	height: 14px;
}

@media (hover: hover) and (pointer: fine) {
	.chl-switcher--dropdown.is-ctx-header:hover .chl-dropdown-popover,
	.chl-switcher--dropdown.is-ctx-nav:hover .chl-dropdown-popover,
	.chl-switcher--dropdown.is-ctx-portal:hover .chl-dropdown-popover {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: translateY(0);
	}
}

.chl-switcher--dropdown.is-open .chl-dropdown-popover {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

.chl-popover-head {
	padding: 9px 13px 7px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: #64748b;
	border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.chl-dropdown-list {
	margin: 0;
	padding: 6px;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.chl-dropdown-list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.chl-dropdown-link {
	display: flex !important;
	align-items: center;
	gap: 10px;
	padding: 8.5px 10px !important;
	border-radius: 8px;
	color: #cbd5e1 !important;
	text-decoration: none !important;
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.25;
	transition: background-color 0.16s ease, color 0.16s ease;
}

.chl-dropdown-link:hover {
	background: rgba(255, 255, 255, 0.06) !important;
	color: #ffffff !important;
}

.chl-dropdown-link.is-active {
	background: rgba(34, 211, 238, 0.1) !important;
	color: #ffffff !important;
	font-weight: 600;
}

.chl-dropdown-name {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.chl-active-mark {
	display: inline-flex;
	align-items: center;
	color: #22d3ee;
}

.chl-code-hint {
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: #64748b;
	padding: 2px 5px;
	border-radius: 4px;
	background: rgba(148, 163, 184, 0.09);
}

/* ==========================================================================
   2. Light Financial Portal Variant (`/account/` & `/checkout/` Topbars)
      + Light Widget / Shortcode Variant
   ========================================================================== */

.chl-switcher.is-ctx-portal .chl-dropdown-btn {
	height: 34px;
	padding: 0 11px;
	border-radius: 8px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	color: #334155;
	font-size: 12.5px;
	font-weight: 600;
}

.chl-switcher.is-ctx-portal .chl-dropdown-btn:hover,
.chl-switcher.is-ctx-portal:hover .chl-dropdown-btn,
.chl-switcher.is-ctx-portal.is-open .chl-dropdown-btn {
	background: #eef2ff;
	border-color: #c7d2fe;
	color: #4f46e5;
}

.chl-switcher.is-ctx-portal .chl-dropdown-popover {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	box-shadow: 0 20px 44px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.04);
}

.chl-switcher.is-ctx-portal .chl-popover-head {
	color: #64748b;
	border-bottom: 1px solid #f1f5f9;
}

.chl-switcher.is-ctx-portal .chl-dropdown-link {
	color: #334155 !important;
}

.chl-switcher.is-ctx-portal .chl-dropdown-link:hover {
	background: #f8fafc !important;
	color: #0f172a !important;
}

.chl-switcher.is-ctx-portal .chl-dropdown-link.is-active {
	background: #eef2ff !important;
	color: #4f46e5 !important;
	font-weight: 600;
}

.chl-switcher.is-ctx-portal .chl-active-mark {
	color: #4f46e5;
}

.chl-switcher.is-ctx-portal .chl-code-hint {
	background: #f1f5f9;
	color: #64748b;
}

.chl-switcher.is-ctx-widget .chl-dropdown-btn,
.chl-switcher.is-ctx-shortcode .chl-dropdown-btn,
.chl-switcher.is-ctx-standalone .chl-dropdown-btn {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	color: #0a1426;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.chl-switcher.is-ctx-widget .chl-dropdown-btn:hover,
.chl-switcher.is-ctx-shortcode .chl-dropdown-btn:hover,
.chl-switcher.is-ctx-standalone .chl-dropdown-btn:hover {
	border-color: #38bdf8;
	color: #0284c7;
	background: #f8fafc;
}

/* ==========================================================================
   3. Inline / Segmented Grid Cards (Mobile Drawer & Inline Mode)
   ========================================================================== */

.chl-switcher--inline {
	display: inline-flex;
	gap: 8px;
	flex-wrap: wrap;
}

.chl-switcher--inline.is-ctx-drawer {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	width: 100%;
}

.chl-lang-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 12px;
	border-radius: 8px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	color: #0a1426;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.chl-lang-pill:hover {
	border-color: #38bdf8;
	color: #0284c7;
}

.chl-lang-pill.is-active {
	background: #f0f9ff;
	border-color: #38bdf8;
	color: #0369a1;
}

.chl-lang-pill .chl-lang-label {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.chl-code-tag {
	font-size: 10px;
	font-weight: 700;
	color: #64748b;
	opacity: 0.8;
}

/* Dark Drawer Overrides matching `.cty-drawer-prod-link` */
.chl-switcher--inline.is-ctx-drawer .chl-lang-pill {
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(148, 163, 184, 0.1);
	border-radius: 9px;
	color: #cbd5e1;
	padding: 10px 11px;
}

.chl-switcher--inline.is-ctx-drawer .chl-lang-pill:hover {
	background: rgba(255, 255, 255, 0.07);
	border-color: rgba(34, 211, 238, 0.28);
	color: #ffffff;
}

.chl-switcher--inline.is-ctx-drawer .chl-lang-pill.is-active {
	background: rgba(34, 211, 238, 0.09);
	border-color: rgba(34, 211, 238, 0.38);
	color: #ffffff;
}

.chl-switcher--inline.is-ctx-drawer .chl-lang-pill.is-active .chl-check-icon {
	color: #22d3ee;
}

/* Mobile Header Compaction (`<= 520px`): hide chevron so button stays sleek next to Sign In & Burger */
@media (max-width: 520px) {
	.chl-switcher.is-ctx-header .chl-dropdown-btn {
		padding: 0 9px;
		height: 36px;
		gap: 5px;
	}
	.chl-switcher.is-ctx-header .chl-chevron {
		display: none;
	}
}

/* Optional Floating Dock */
.chl-floating-dock {
	position: fixed;
	left: 18px;
	bottom: 18px;
	z-index: 90;
}

.chl-floating-dock .chl-dropdown-btn {
	background: rgba(12, 19, 34, 0.92);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	box-shadow: 0 12px 32px rgba(2, 6, 18, 0.45);
}

.chl-floating-dock .chl-dropdown-popover {
	top: auto;
	bottom: calc(100% + 12px);
	left: 0;
	right: auto;
}

.chl-floating-dock .chl-dropdown-popover::before {
	top: auto;
	bottom: -14px;
}
