/* Full viewport width + height on trang có shortcode */
body.dl-locator-page .wp-site-blocks,
body.dl-locator-page .entry-content,
body.dl-locator-page .wp-block-post-content,
body.dl-locator-page main,
body.dl-locator-page .alignwide,
body.dl-locator-page .alignfull,
body.dl-locator-page article,
body.dl-locator-page .post-inner,
body.dl-locator-page .content-area,
body.dl-locator-page #primary,
body.dl-locator-page #content,
body.dl-locator-page .site-content,
body.dl-locator-page .site-main,
body.dl-locator-page .container,
body.dl-locator-page .wrap {
	max-width: none !important;
	width: 100% !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

body.dl-locator-page .entry-header,
body.dl-locator-page .wp-block-post-title,
body.dl-locator-page .page-header {
	display: none;
}

body.dl-locator-page {
	overflow-x: hidden;
}

/* Fallback: ẩn header/footer theme (Flatsome & tương tự) khi template blank chưa áp dụng */
body.dl-locator-page #header,
body.dl-locator-page .header-wrapper,
body.dl-locator-page #top-bar,
body.dl-locator-page .page-title,
body.dl-locator-page #footer,
body.dl-locator-page .footer-wrapper {
	display: none !important;
}

body.dl-locator-page #wrapper,
body.dl-locator-page #main,
body.dl-locator-page .content-area {
	padding-top: 0 !important;
	margin-top: 0 !important;
}

/* Ẩn GTranslate (lá cờ eng/vi) trên trang tra cứu */
body.dl-locator-page .gt_switcher_wrapper,
body.dl-locator-page .gtranslate_wrapper,
body.dl-locator-page .gt_container {
	display: none !important;
}

/* Ẩn nút liên hệ nổi (Zalo / gọi / Messenger) trên trang tra cứu */
body.dl-locator-page #main-div,
body.dl-locator-page #main-button,
body.dl-locator-page .call-custom,
body.dl-locator-page .zalo-custom,
body.dl-locator-page .fb-custom {
	display: none !important;
}

.dl-locator-fullscreen {
	position: relative;
	left: 50%;
	right: 50%;
	width: 100vw;
	max-width: 100vw;
	margin-left: -50vw;
	margin-right: -50vw;
	height: 100vh;
	min-height: 320px;
	overflow: hidden;
	font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
	box-sizing: border-box;
}

/* Trang tra cứu: cố định full width viewport (không bị theme co ngang). */
body.dl-locator-page .dl-locator-fullscreen {
	position: fixed;
	left: 0;
	right: 0;
	width: 100%;
	max-width: none;
	margin-left: 0;
	margin-right: 0;
	transform: none;
	z-index: 5;
	top: 0;
}

body.admin-bar.dl-locator-page .dl-locator-fullscreen {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar.dl-locator-page .dl-locator-fullscreen {
		top: 46px;
	}
}

body.admin-bar .dl-locator-fullscreen {
	height: calc(100vh - 32px);
}

body.dl-locator-page .dl-locator-fullscreen {
	height: 100vh;
}

body.admin-bar.dl-locator-page .dl-locator-fullscreen {
	height: calc(100vh - 32px);
}

@media screen and (max-width: 782px) {
	body.admin-bar .dl-locator-fullscreen {
		height: calc(100vh - 46px);
	}

	body.admin-bar.dl-locator-page .dl-locator-fullscreen {
		height: calc(100vh - 46px);
	}
}

.dl-locator-fullscreen .dl-map-wrap {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.dl-locator-fullscreen .dl-map {
	width: 100%;
	height: 100%;
	min-height: 100%;
	background: #e2e8f0;
}

.dl-locator-fullscreen .dl-map-wrap .leaflet-container {
	width: 100% !important;
	height: 100% !important;
	min-height: 100%;
	font-family: inherit;
}

/* Thanh tìm kiếm — một hàng, bên phải nút zoom Leaflet (+/-) */
.dl-locator-fullscreen .dl-locator-toolbar {
	--dl-toolbar-control-height: 48px;
	--dl-toolbar-gap: 0.5rem;
	--dl-toolbar-radius: 6px;

	position: absolute;
	top: 10px;
	left: calc(10px + 34px + 10px);
	right: 420px;
	z-index: 1001;
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--dl-toolbar-gap);
	margin: 0;
	padding: 0.5rem;
	background: rgba(255, 255, 255, 0.96);
	border-radius: var(--dl-toolbar-radius);
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
	max-width: 50vw;
	box-sizing: border-box;
}

.dl-locator-fullscreen .dl-locator-toolbar .dl-btn,
.dl-locator-fullscreen .dl-locator-toolbar .dl-address-input {
	box-sizing: border-box;
	height: var(--dl-toolbar-control-height);
	min-height: var(--dl-toolbar-control-height);
	margin: 0;
	padding: 0 1rem;
	border-radius: var(--dl-toolbar-radius);
	font-size: 0.92rem;
	line-height: 1.2;
	font-family: inherit;
	vertical-align: middle;
}

.dl-locator-fullscreen .dl-locator-toolbar .dl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
	flex-shrink: 0;
	text-transform: none;
	letter-spacing: normal;
}

.dl-locator-fullscreen .dl-locator-toolbar .dl-btn-primary {
	border: none;
}

.dl-locator-fullscreen .dl-locator-toolbar .dl-btn-secondary {
	border: 1px solid #cbd5e1;
}

.dl-locator-fullscreen .dl-locator-toolbar .dl-address-search {
	display: flex;
	flex: 1 1 auto;
	flex-wrap: nowrap;
	align-items: center;
	gap: var(--dl-toolbar-gap);
	min-width: 0;
	margin: 0;
	padding: 0;
}

.dl-locator-fullscreen .dl-locator-toolbar .dl-address-input {
	flex: 3 1 0;
	min-width: 0;
	max-width: none;
	display: block;
	width: auto;
	font-size: 1.15rem;
	font-weight: 400;
	border: 1px solid #cbd5e1;
	background: #fff;
	color: #0f172a;
}

.dl-locator-fullscreen .dl-locator-toolbar .dl-address-input::placeholder {
	color: #94a3b8;
	opacity: 1;
}

.dl-address-input-wrap {
	position: relative;
	flex: 3 1 0;
	min-width: 0;
}

.dl-locator-fullscreen .dl-locator-toolbar .dl-address-input-wrap #dl-address-input,
.dl-locator-frame .dl-locator-toolbar .dl-address-input-wrap #dl-address-input {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	flex: none;
}

.dl-locator-fullscreen .dl-locator-toolbar .dl-address-input-wrap,
.dl-locator-frame .dl-locator-toolbar .dl-address-input-wrap {
	flex: 1 1 0 !important;
	width: auto;
	min-width: 0;
	max-width: none;
}

.dl-locator-fullscreen .dl-locator-toolbar .dl-address-search,
.dl-locator-frame .dl-locator-toolbar .dl-address-search {
	width: 100%;
}

.dl-address-placeholder {
	max-width: calc(100% - 2rem);
	overflow: hidden;
	text-overflow: ellipsis;
}

.dl-locator-fullscreen .dl-locator-toolbar #dl-address-search-btn,
.dl-locator-frame .dl-locator-toolbar #dl-address-search-btn {
	flex: 0 0 28% !important;
	max-width: 28%;
}

.dl-address-placeholder {
	position: absolute;
	top: 50%;
	left: 1rem;
	transform: translateY(-50%);
	z-index: 1;
	display: block;
	width: calc(100% - 2rem);
	max-width: calc(100% - 2rem);
	color: #94a3b8;
	font-size: 1rem;
	line-height: 1.2;
	pointer-events: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.dl-address-placeholder small {
	font-size: 0.7em;
}

.dl-address-placeholder[hidden] {
	display: none;
}

/* Nút Tìm đại lý — làm dài ra ngang */
.dl-locator-toolbar #dl-address-search-btn {
	flex: 1 1 0;
	min-width: 0;
	padding-left: 1rem;
	padding-right: 1rem;
	white-space: nowrap;
}

.dl-btn-secondary {
	background: #f1f5f9;
	color: #0f172a;
	border: 1px solid #cbd5e1;
	white-space: nowrap;
}

.dl-btn-secondary:hover {
	background: #e2e8f0;
}

/* Panel danh sách — overlay bên phải */
.dl-locator-fullscreen .dl-dealer-panel {
	position: absolute;
	top: 1rem;
	right: 1rem;
	bottom: 1rem;
	z-index: 500;
	width: min(380px, calc(100% - 2rem));
	display: flex;
	flex-direction: column;
	padding: 1rem 1rem 0.75rem;
	background: rgba(255, 255, 255, 0.96);
	border-radius: 10px;
	box-shadow: 0 4px 24px rgba(15, 23, 42, 0.12);
	box-sizing: border-box;
}

.dl-locator-fullscreen .dl-dealer-panel h3 {
	margin: 0 0 0.75rem;
	font-size: 1.05rem;
}

.dl-locator-fullscreen .dl-dealer-list {
	flex: 1;
	min-height: 0;
	max-height: none;
	overflow: auto;
}

@media (max-width: 768px) {
	.dl-locator-fullscreen .dl-dealer-panel {
		left: 1rem;
		right: 1rem;
		width: auto;
		top: auto;
		max-height: 42vh;
		bottom: calc(0.5rem + var(--dl-mobile-nav-h, 60px));
	}

	.dl-locator-fullscreen .dl-locator-toolbar {
		left: calc(10px + 34px + 8px);
		right: 1rem;
		top: 10px;
		width: auto;
		max-width: none;
		flex-wrap: nowrap;
	}

	.dl-locator-fullscreen .dl-locator-toolbar .dl-address-search {
		flex: 1 1 auto;
		min-width: 0;
	}

	.dl-address-input {
		flex: 1 1 auto;
		max-width: none;
	}

	.dl-locator-toolbar #dl-address-search-btn {
		flex: 0 0 auto;
		padding-left: 0.6rem;
		padding-right: 0.6rem;
	}
}

.dl-btn {
	cursor: pointer;
	border: none;
	border-radius: 6px;
	padding: 0.65rem 1.25rem;
	font-size: 1rem;
}

.dl-btn-primary {
	background: #16a34a;
	color: #fff;
}

.dl-btn-primary:hover {
	background: #15803d;
}

.dl-status {
	color: #64748b;
	font-size: 0.8rem;
	flex-shrink: 1;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 10rem;
}

.dl-locator-fullscreen .dl-locator-toolbar .dl-status:empty {
	display: none;
}

/* Note gợi ý mờ — nằm ngay dưới thanh tìm kiếm, tách riêng khỏi khối trắng */
.dl-search-hint {
	position: absolute;
	top: 90px;
	left: calc(10px + 34px + 10px + 8px);
	z-index: 900;
	max-width: min(560px, calc(100% - 24px));
	padding: 0;
	margin: 0;
	color: #15803d;
	font-size: 0.98rem;
	font-style: italic;
	line-height: 1.4;
	text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

/* Hai ghi chú dùng hai dòng riêng, tránh chồng chữ trên bản đồ. */
.dl-search-hint + .dl-search-hint {
	top: 118px;
	font-size: 0.82rem;
}

.dl-search-hint:first-of-type {
	font-size: 0.82rem;
}

.dl-dealer-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.dl-dealer-list li {
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	padding: 0.75rem;
	margin-bottom: 0.5rem;
}

.dl-dealer-list .dl-dist {
	float: right;
	color: #16a34a;
	font-size: 0.85rem;
}

.dl-dealer-list .dl-addr {
	color: #64748b;
	font-size: 0.9rem;
}

.dl-modal[hidden] {
	display: none !important;
}

.dl-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.dl-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
}

.dl-modal-dialog {
	position: relative;
	background: #ecfdf5;
	border-radius: 14px;
	padding: 1.6rem 1.6rem 1.4rem;
	width: 50%;
	max-width: 720px;
	max-height: 88vh;
	overflow-y: auto;
	box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
	border: 1px solid #bbf7d0;
	border-top: 5px solid #22c55e;
	/* Ẩn thanh cuộn nhưng vẫn cuộn được */
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.dl-modal-dialog::-webkit-scrollbar {
	display: none;
}

.dl-modal-close {
	position: absolute;
	top: 0.6rem;
	right: 0.8rem;
	width: 30px;
	height: 30px;
	background: #f0fdf4;
	border: none;
	border-radius: 50%;
	font-size: 1.15rem;
	line-height: 1;
	color: #16a34a;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.dl-modal-close:hover {
	background: #dcfce7;
}

.dl-modal-dialog h2 {
	margin: 0 0 0.5rem;
	font-size: 1.35rem;
	color: #14532d;
}

.dl-contact-intro {
	margin: 0 0 1.25rem;
	color: #64748b;
	font-size: 0.9rem;
}

.dl-modal-dialog form p {
	margin: 0 0 0.75rem;
}

.dl-modal-dialog label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.35rem;
	font-size: 0.85rem;
	color: #0f172a;
}

.dl-required {
	color: #dc2626;
	font-weight: 700;
}

.dl-modal-dialog input[type='text'],
.dl-modal-dialog input[type='tel'],
.dl-modal-dialog input[type='email'],
.dl-modal-dialog input[type='number'],
.dl-modal-dialog select,
.dl-modal-dialog textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 0.55rem 0.75rem;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 0.95rem;
	font-family: inherit;
	background: #fff;
	color: #0f172a;
	margin-bottom: 0.5rem;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dl-modal-dialog input[type='text']:focus,
.dl-modal-dialog input[type='tel']:focus,
.dl-modal-dialog input[type='email']:focus,
.dl-modal-dialog input[type='number']:focus,
.dl-modal-dialog select:focus,
.dl-modal-dialog textarea:focus {
	outline: none;
	border-color: #22c55e;
	box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.dl-modal-dialog textarea {
	resize: vertical;
}

.dl-form-message.dl-success {
	color: #15803d;
}

.dl-form-message.dl-error {
	color: #b91c1c;
}

.dl-form-actions {
	margin-top: 1rem;
}

.dl-form-actions .dl-btn {
	width: 100%;
	padding: 0.7rem 1.25rem;
	font-size: 1rem;
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

/* Hình thức mua hàng — radio */
.dl-purchase-options {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	margin-bottom: 0.5rem;
}

.dl-purchase-options .dl-radio {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.95rem;
	color: #0f172a;
}

.dl-purchase-options input[type='radio'] {
	width: auto;
	margin: 0;
	accent-color: #16a34a;
}

/* Sản phẩm — tìm kiếm + danh sách nhóm checkbox */
.dl-products-search {
	margin-bottom: 0.5rem;
}

.dl-products-list {
	display: none;
	max-height: 180px;
	overflow-y: auto;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	padding: 0.5rem 0.75rem;
	margin-bottom: 0.5rem;
	background: #fff;
}

.dl-products-list.dl-open {
	display: block;
}

.dl-prod-group + .dl-prod-group {
	margin-top: 0.5rem;
}

.dl-prod-group-title {
	font-weight: 600;
	font-size: 0.85rem;
	color: #374151;
	margin-bottom: 0.25rem;
}

.dl-prod-checkbox {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.92rem;
	color: #0f172a;
	cursor: pointer;
	padding: 0.12rem 0;
}

.dl-prod-checkbox input[type='checkbox'] {
	width: auto;
	margin: 0;
	accent-color: #16a34a;
}

/* Layout form 2 cột — giảm chiều cao popup */
.dl-form-row {
	display: flex;
	gap: 1rem;
}

.dl-form-col {
	flex: 1 1 0;
	min-width: 0;
}

.dl-form-col p {
	margin: 0 0 0.75rem;
}

/* Danh sách sản phẩm đã chọn — mỗi dòng tên + ô số lượng */
.dl-selected-products {
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 0.5rem 0.75rem;
	margin-bottom: 0.5rem;
	background: #f8fafc;
}

.dl-selected-row {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.92rem;
	color: #0f172a;
	padding: 0.3rem 0;
}

.dl-selected-row + .dl-selected-row {
	border-top: 1px dashed #e2e8f0;
}

.dl-selected-name {
	flex: 9 1 0; /* ~90% */
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	display: block;
}

.dl-selected-qty {
	flex: 0 0 10%; /* ~10%, không phình quá */
	max-width: 10%;
	flex-shrink: 0;
	padding: 0.35rem 0.5rem !important;
	margin: 0 !important;
	text-align: center;
	box-sizing: border-box;
	min-width: 44px;
}

@media (max-width: 560px) {
	.dl-form-row {
		flex-direction: column;
	}
}

.dl-btn[disabled] {
	opacity: 0.8;
	cursor: not-allowed;
}

.dl-send-spinner {
	width: 1em;
	height: 1em;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: dl-spin 0.8s linear infinite;
	box-sizing: border-box;
}

.dl-send-spinner[hidden] {
	display: none;
}

/* Loading overlay — spinner ở giữa màn hình khi đang tìm đại lý */
.dl-loading[hidden] {
	display: none !important;
}

.dl-loading {
	position: fixed;
	inset: 0;
	z-index: 2000;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	background: rgba(15, 23, 42, 0.45);
	backdrop-filter: blur(2px);
}

.dl-loading-spinner {
	width: 52px;
	height: 52px;
	border: 5px solid rgba(255, 255, 255, 0.35);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: dl-spin 0.9s linear infinite;
	box-sizing: border-box;
}

.dl-loading-text {
	color: #ffffff;
	font-size: 0.95rem;
	font-weight: 500;
	text-shadow: 0 1px 3px rgba(15, 23, 42, 0.6);
}

@keyframes dl-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Trạng thái gửi form thành công */
.dl-form-success {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 0.85rem;
	padding: 1.75rem 1.25rem;
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 12px;
}

.dl-form-success[hidden] {
	display: none;
}

.dl-form-success-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #22c55e;
	color: #fff;
	font-size: 1.7rem;
	line-height: 1;
	box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}

.dl-form-success-text {
	margin: 0;
	font-size: 0.95rem;
	color: #14532d;
	font-weight: 500;
}

/* Loading trong chế độ frame — phủ chỉ trong khung bản đồ, không phủ cả màn hình */
.dl-locator-frame .dl-loading {
	position: absolute;
	inset: 0;
	border-radius: 10px;
}

/* ===== Chế độ frame — bản đồ nhỏ gọn, đặt trong container bất kỳ ===== */
.dl-locator-frame {
	position: relative;
	width: 100%;
	height: 460px;
	min-height: 320px;
	overflow: hidden;
	font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
	box-sizing: border-box;
}

.dl-locator-frame .dl-map-wrap {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.dl-locator-frame .dl-map {
	width: 100%;
	height: 100%;
	min-height: 100%;
	background: #e2e8f0;
}

.dl-locator-frame .dl-map-wrap .leaflet-container {
	width: 100% !important;
	height: 100% !important;
	min-height: 100%;
	font-family: inherit;
	border-radius: 8px;
}

.dl-locator-frame {
	border-radius: 10px;
	border: 1px solid #d1d5db;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

/* Thanh tìm kiếm — một hàng, bên phải nút zoom Leaflet (+/-) */
.dl-locator-frame .dl-locator-toolbar {
	--dl-toolbar-control-height: 46px;
	--dl-toolbar-gap: 0.5rem;
	--dl-toolbar-radius: 6px;

	position: absolute;
	top: 10px;
	left: calc(10px + 34px + 10px);
	right: 240px;
	z-index: 1001;
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--dl-toolbar-gap);
	margin: 0;
	padding: 0.5rem;
	background: rgba(255, 255, 255, 0.96);
	border-radius: var(--dl-toolbar-radius);
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
	max-width: 50vw;
	box-sizing: border-box;
}

.dl-locator-frame .dl-locator-toolbar .dl-btn,
.dl-locator-frame .dl-locator-toolbar .dl-address-input {
	box-sizing: border-box;
	height: var(--dl-toolbar-control-height);
	min-height: var(--dl-toolbar-control-height);
	margin: 0;
	padding: 0 1rem;
	border-radius: var(--dl-toolbar-radius);
	font-size: 0.92rem;
	line-height: 1.2;
	font-family: inherit;
	vertical-align: middle;
}

.dl-locator-frame .dl-locator-toolbar .dl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
	flex-shrink: 0;
	text-transform: none;
	letter-spacing: normal;
}

.dl-locator-frame .dl-locator-toolbar .dl-address-search {
	display: flex;
	flex: 1 1 auto;
	flex-wrap: nowrap;
	align-items: center;
	gap: var(--dl-toolbar-gap);
	min-width: 0;
	margin: 0;
	padding: 0;
}

.dl-locator-frame .dl-locator-toolbar .dl-address-input {
	flex: 3 1 0;
	min-width: 0;
	max-width: none;
	display: block;
	width: auto;
	font-size: 1.15rem;
	font-weight: 400;
	border: 1px solid #cbd5e1;
	background: #fff;
	color: #0f172a;
}

.dl-locator-frame .dl-locator-toolbar .dl-address-input::placeholder {
	color: #94a3b8;
	opacity: 1;
}

.dl-locator-frame .dl-locator-toolbar .dl-status:empty {
	display: none;
}

/* Panel danh sách — overlay bên phải trong frame */
.dl-locator-frame .dl-dealer-panel {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	bottom: 0.75rem;
	z-index: 500;
	width: min(320px, calc(100% - 1.5rem));
	display: flex;
	flex-direction: column;
	padding: 0.85rem 0.85rem 0.6rem;
	background: rgba(255, 255, 255, 0.96);
	border-radius: 8px;
	box-shadow: 0 4px 24px rgba(15, 23, 42, 0.14);
	box-sizing: border-box;
}

.dl-locator-frame .dl-dealer-panel h3 {
	margin: 0 0 0.6rem;
	font-size: 0.95rem;
}

.dl-locator-frame .dl-dealer-list {
	flex: 1;
	min-height: 0;
	max-height: none;
	overflow: auto;
}

@media (max-width: 768px) {
	.dl-locator-frame .dl-dealer-panel {
		left: 0.75rem;
		right: 0.75rem;
		width: auto;
		top: auto;
		max-height: 40%;
		bottom: 0.75rem;
	}

	/* Mobile: thanh tìm kiếm lấp giữa nút zoom và lề phải; ô nhập (flex 1) dãn,
	   nút "Tìm đại lý" giữ nguyên bản rộng đủ chữ (không bị bóp cắt nửa bên phải). */
	.dl-locator-frame .dl-locator-toolbar {
		left: calc(10px + 34px + 8px);
		right: 0.75rem;
		top: 10px;
		width: auto;
		max-width: none;
		flex-wrap: nowrap;
	}

	.dl-locator-frame .dl-locator-toolbar .dl-address-search {
		flex: 1 1 auto;
		min-width: 0;
	}

	.dl-locator-frame .dl-locator-toolbar .dl-address-input {
		flex: 1 1 auto;
		max-width: none;
	}

	.dl-locator-frame .dl-locator-toolbar #dl-address-search-btn {
		flex: 0 0 auto;
		padding-left: 0.6rem;
		padding-right: 0.6rem;
	}
}

/* ===== Toast thông báo — hiện nổi giữa frame, dùng chung (thành công / lỗi) ===== */
.dl-toast {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 1500;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	max-width: min(400px, calc(100% - 2rem));
	width: fit-content;
	padding: 0.85rem 1.1rem;
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1.4;
	text-align: left;
	color: #0f172a;
	background: #ffffff;
	border: 1px solid #d1d5db;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.dl-toast.dl-toast-success {
	background: #f0fdf4;
	border-color: #bbf7d0;
}

.dl-toast.dl-toast-error {
	background: #fef2f2;
	border-color: #fecaca;
}

.dl-toast.dl-toast-visible {
	opacity: 1;
}

.dl-toast-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	font-size: 1rem;
	line-height: 1;
	background: #16a34a;
	color: #fff;
}

.dl-toast-error .dl-toast-icon {
	background: #dc2626;
}

/* ===== Nút nổi (floating) + popup tra cứu đại lý ===== */
/* Vị trí nút (khi popup đóng): bên phải màn hình, đáy cách 400px.
   Neo bottom nên không cần margin-top căn giữa như trước. */
.dl-fab {
	--dl-fab-right: 22px;
	position: fixed;
	right: var(--dl-fab-right);
	top: auto;
	left: auto;
	bottom: 410px;
	z-index: 9999;
	width: 58px;
	height: 58px;
	min-width: 0;
	margin: 0;
	padding: 5px 1px 7px;
	-webkit-appearance: none;
	appearance: none;
	-webkit-text-size-adjust: none;
	text-size-adjust: none;
	border: 2px solid #fff;
	border-radius: 50%;
	background: linear-gradient(160deg, #0aa33c 0%, #009b35 55%, #00852e 100%);
	color: #fff;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	gap: 2px;
	align-items: center;
	justify-content: center;
	box-shadow: 0 0 0 2px #c8edc9, 0 5px 18px rgba(0, 151, 48, 0.35);
	text-transform: none;
	letter-spacing: normal;
	line-height: 1;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
	box-sizing: border-box;
}

.dl-fab:hover {
	background: #15803d;
	color: #fff;
	transform: translateY(-2px) scale(1.04);
	box-shadow: 0 10px 26px rgba(22, 163, 74, 0.5);
}

/* Mobile: nút map đang neo cách đáy 400px nên chồng lên nút khác (vd stack
   Zalo/Call) ở cột phải. Trên màn hình ≤768px nhích nút lên cao hơn (tăng
   bottom) để không che nút nào. Tăng/giảm con số ở `bottom` nếu cần. */
@media (max-width: 768px) {
	.dl-fab {
		--dl-fab-right: 22px;
		bottom: 450px;
	}
}

/* Nút FAB luôn giữ vị trí cố định (bottom 400px), không dịch vào popup.
   Là nút toggle mở/đóng bình thường. */
/* Khi popup mở, nút map nằm dưới popup (đã có nút X trong popup đóng rồi). */
body.dl-fab-open .dl-fab {
	z-index: 1;
}

.dl-fab:focus-visible {
	outline: 3px solid #005c24;
	outline-offset: 5px;
}

#dl-fab > .dl-fab-icon {
	display: block;
	position: static;
	width: 24px;
	height: 24px;
	max-width: 24px;
	max-height: 24px;
	margin: 0;
	flex-shrink: 0;
}

#dl-fab > .dl-fab-label {
	display: block;
	min-width: 0;
	padding: 0;
	margin: 0;
	color: #fff;
	font-family: Arial, sans-serif;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	-webkit-text-size-adjust: none;
	text-size-adjust: none;
	line-height: 1.3;
	white-space: nowrap;
}

/* Luôn chỉ hiện icon bản đồ trên nút FAB — bỏ biến thành nút X khi mở popup. */
.dl-fab-close {
	display: none;
}

/* Popup — tái dùng .dl-modal base (fixed, inset:0, flex center).
   z-index rất cao (200000001) để popup luôn nằm TRÊN các widget nổi khác
   như 2 lá cờ GTranslate (thường dùng z-index ~200000). */
.dl-fab-modal {
	z-index: 200000001;
}

.dl-fab-dialog {
	position: relative;
	background: #ffffff;
	border-radius: 14px;
	width: 90vw;
	height: 95vh;
	height: 95dvh;
	max-width: none;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
	border: 1px solid #e2e8f0;
	box-sizing: border-box;
}

.dl-fab-body {
	flex: 1 1 auto;
	min-height: 0;
	position: relative;
}

/* Nút X đóng popup — nút tròn, nằm sát góc trên phải dialog, trên map. */
/* Nút X đóng popup — là con trực tiếp của modal nên không bị dialog
   overflow:hidden cắt. Dialog cao 95vh/căn giữa => mép trên cách đỉnh
   viewport 2.5vh; top calc(2.5vh - 8px) để nút (cao 16px) nằm ngang mép
   trên popup, chồm lên khỏi mép một nửa (không bị popup che).
   Kích thước nút = 30x16 px (nửa so với 60x32 trước). */
.dl-fab-modal-close {
	position: absolute;
	top: calc(2.5vh - 16px);
	right: calc(5vw - 36px);
	z-index: 4000;
	width: 40px;
	height: 16px;
	padding: 0;
	border: none;
	border-radius: 50%;
	overflow: hidden;
	background: #16a34a;
	color: #ffffff;
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 3px 12px rgba(15, 23, 42, 0.3);
	font-family: inherit;
	box-sizing: border-box;
	text-align: center;
}

.dl-fab-modal-close:hover {
	background: #15803d;
}

/* Mobile: dialog full màn hình, không có mép popup ở trên để chồm — nút nằm
   trong góc, tránh bị cắt ở mép màn hình. */
@media (max-width: 768px) {
	.dl-fab-modal-close {
		top: 10px;
		right: 10px;
	}
}

/* Nút toàn màn hình — nổi lên trên map, góc trái dưới */
.dl-fab-overlay-fullscreen {
	position: absolute;
	left: 12px;
	bottom: 12px;
	z-index: 3000;
	height: 34px;
	padding: 0 0.9rem;
	border: none;
	border-radius: 8px;
	background: #16a34a;
	color: #ffffff;
	font-size: 0.8rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: inherit;
	box-shadow: 0 2px 10px rgba(15, 23, 42, 0.25);
	box-sizing: border-box;
}

.dl-fab-overlay-fullscreen:hover {
	background: #15803d;
}

/* Locator frame phải lấp đầy khung body popup (bỏ chiều cao 460px mặc định) */
.dl-fab-body .dl-locator-frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	min-height: 0;
}

@media (max-width: 768px) {
	.dl-fab-dialog {
		width: 100vw;
		height: 100vh;
		height: 100dvh;
		border-radius: 0;
		border: none;
		max-width: none;
	}

	/* Mobile: popup FAB đã full màn hình (nằm trong @media trên) nên góc dưới
	   của frame bị danh sách đại lý che. Ẩn nút "Xem toàn màn hình" để không
	   nổi chồng lên danh sách. */
	.dl-fab-overlay-fullscreen {
		display: none;
	}
}

/* Nút "Chỉ đường" trong popup marker Leaflet */
.dl-route-btn {
	margin-top: 6px;
	width: 100%;
}
.leaflet-popup-content button.dl-route-btn {
	font: inherit;
}

/* Nút "Chỉ đường" nhỏ trong danh sách đại lý gần bạn */
.dl-route-btn-sm {
	width: auto;
	margin-top: 4px;
	padding: 0.2rem 0.55rem;
	font-size: 0.72rem;
	border-radius: 5px;
	line-height: 1.3;
}

/* Trình duyệt mobile thật: thanh URL động thu/giãn làm thay đổi chiều cao nhìn thấy.
   100vh không đổi (cao hơn vùng hiện ra) nên phần dưới .dl-locator-fullscreen bị khuất
   sau thanh menu bottom. 100dvh bám theo chiều cao thật lúc hiển thị. */
body.dl-locator-page .dl-locator-fullscreen {
	height: 100vh;
	height: 100dvh;
}
@supports (height: 100dvh) {
	body.admin-bar.dl-locator-page .dl-locator-fullscreen {
		height: calc(100dvh - 32px);
	}
}
@media screen and (max-width: 782px) {
	@supports (height: 100dvh) {
		body.admin-bar.dl-locator-page .dl-locator-fullscreen {
			height: calc(100dvh - 46px);
		}
	}
}

/* Mobile: form liên hệ dàn đủ bề rộng — dialog gần full, hủy bố cục 2 cột chật.
   Giữ giới hạn chiều cao + cuộn bên trong để form dài không bị che trên màn hình nhỏ. */
@media (max-width: 768px) {
	.dl-locator-fullscreen .dl-modal,
	.dl-locator-frame .dl-modal,
	.dl-modal {
		padding: 1rem;
		box-sizing: border-box;
		align-items: stretch;
	}
	.dl-modal-dialog {
		width: 100%;
		max-width: none;
		max-height: 100%;
		align-self: stretch;
		padding: 1.2rem 1.1rem;
		box-sizing: border-box;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}
	.dl-form-row {
		flex-direction: column;
		gap: 0;
	}
}
