/* DHL DDP — Country Switcher (shortcode / menu item) */

.dhl-ddp-switcher {
	position: relative;
	display: inline-block;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.4;
}

/* ── Toggle button ──────────────────────────────────────────────────────── */
.dhl-ddp-switcher__toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: transparent;
	cursor: pointer;
	font-size: inherit;
	font-family: inherit;
	white-space: nowrap;ß
	transition: background 0.15s;
	border: 1px solid #DEDAD3AB!important;
	color: #fff!important;
	letter-spacing: .5px!important;
	padding: 10px!important;
}

.dhl-ddp-switcher__toggle:hover {
	background: rgba(0, 0, 0, 0.06);
}

.dhl-ddp-switcher__label {
	font-weight: 400;
	opacity: 0.7;
}

.dhl-ddp-switcher__flag {
	width: 20px;
	height: 15px;
	object-fit: cover;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.dhl-ddp-switcher__name {
	font-weight: 500;
}

.dhl-ddp-switcher__arrow {
	transition: transform 0.2s;
}

.dhl-ddp-switcher__toggle[aria-expanded="true"] .dhl-ddp-switcher__arrow {
	transform: rotate(180deg);
}

body .dhl-ddp-switcher button:hover, body .dhl-ddp-switcher button:focus {
	background: inherit!important;
}

/* ── Dropdown ───────────────────────────────────────────────────────────── */
.dhl-ddp-switcher__dropdown {
	position: absolute;
	top: 100%;
	right: 0;
	z-index: 99999;
	width: 280px;
	margin-top: 6px;
	background: #1a1a2e;
	color: #fff;
	border-radius: 10px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
	overflow: hidden;
}

.dhl-ddp-switcher__dropdown::before {
	content: '';
	position: absolute;
	top: -6px;
	right: 16px;
	width: 12px;
	height: 12px;
	background: #1a1a2e;
	transform: rotate(45deg);
}

/* ── Search ─────────────────────────────────────────────────────────────── */
.dhl-ddp-switcher__search {
	display: block;
	width: 100%;
	padding: 10px 14px;
	font-size: 13px;
	color: #fff;
	background: #2a2a4a;
	border: none;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	outline: none;
	box-sizing: border-box;
}

.dhl-ddp-switcher__search::placeholder {
	color: rgba(255, 255, 255, 0.4);
}

/* ── Country list ───────────────────────────────────────────────────────── */
.dhl-ddp-switcher__list {
	list-style: none !important;
	margin: 0 !important;
	padding: 4px 0 !important;
	max-height: 300px;
	overflow-y: auto;
	overscroll-behavior: contain;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	height: auto !important;
	width: auto !important;
	position: static !important;
	background: none !important;
	border: none !important;
	box-shadow: none !important;
}

.dhl-ddp-switcher__list li {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	height: auto !important;
	width: auto !important;
	position: static !important;
	float: none !important;
	background: none !important;
	border: none !important;
}

.dhl-ddp-switcher__list li.dhl-ddp-hidden {
	display: none !important;
}

.dhl-ddp-switcher__item,
.dhl-ddp-switcher__item:link,
.dhl-ddp-switcher__item:visited {
	display: flex !important;
	align-items: center;
	gap: 10px;
	padding: 8px 14px !important;
	color: rgba(255, 255, 255, 0.85) !important;
	text-decoration: none !important;
	font-size: 13px !important;
	cursor: pointer;
	transition: background 0.1s;
	background: none !important;
	border: none !important;
	line-height: 1.4 !important;
	height: auto !important;
	width: auto !important;
	position: static !important;
}

.dhl-ddp-switcher__item:hover {
	background: rgba(255, 255, 255, 0.08) !important;
	color: #fff !important;
}

.dhl-ddp-switcher__item--active,
.dhl-ddp-switcher__item--active:link,
.dhl-ddp-switcher__item--active:visited {
	background: rgba(255, 255, 255, 0.12) !important;
	color: #fff !important;
	font-weight: 600;
}

.dhl-ddp-switcher__item-flag {
	width: 18px !important;
	height: 13px !important;
	object-fit: cover;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
	flex-shrink: 0;
	max-width: none !important;
}

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
.dhl-ddp-switcher__list::-webkit-scrollbar {
	width: 6px;
}

.dhl-ddp-switcher__list::-webkit-scrollbar-track {
	background: transparent;
}

.dhl-ddp-switcher__list::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.15);
	border-radius: 3px;
}

.dhl-ddp-switcher__list::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.3);
}

/* ── Loading spinner ────────────────────────────────────────────────────── */
.dhl-ddp-switcher__loading {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 30px 0;
}

.dhl-ddp-switcher__spinner {
	width: 24px;
	height: 24px;
	border: 3px solid rgba(255, 255, 255, 0.15);
	border-top-color: #fff;
	border-radius: 50%;
	animation: dhlSwitcherSpin 0.6s linear infinite;
}

@keyframes dhlSwitcherSpin {
	to { transform: rotate(360deg); }
}

/* ── Nav menu integration ───────────────────────────────────────────────── */
.dhl-ddp-menu-country-switcher > a {
	display: contents !important;
	pointer-events: none !important;
}

.dhl-ddp-menu-country-switcher .dhl-ddp-switcher,
.dhl-ddp-menu-country-switcher .dhl-ddp-switcher * {
	pointer-events: all !important;
}

/* Prevent theme sub-menu styles from affecting our dropdown */
.dhl-ddp-menu-country-switcher .dhl-ddp-switcher__dropdown {
	position: absolute !important;
	display: none;
}

.dhl-ddp-menu-country-switcher .sub-menu,
.dhl-ddp-menu-country-switcher > .sub-menu {
	display: none !important;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
	.dhl-ddp-switcher__dropdown {
		position: fixed;
		top: auto;
		bottom: 0;
		left: 0;
		right: 0;
		margin: 0;
		border-radius: 16px 16px 0 0;
		width: 100%;
	}

	.dhl-ddp-switcher__dropdown::before {
		display: none;
	}

	.dhl-ddp-switcher__list {
		max-height: 50vh;
	}
}
