/* Edit Location Modal – standalone block; also included by top-menu-v2 */

/* Stack above mobile menu drawer (drawer uses z-index: 99999). Radar autocomplete in modal stacks above modal. */
.dp-edit-location-modal {
	z-index: 100000;
}

/* Hide live chat when edit location modal is open (z-index unreliable with widget, same as mobile drawer) */
body:has(#dp-edit-location-modal.is-open) #cxone-guide-container {
	opacity: 0 !important;
	pointer-events: none !important;
}
.dp-ui-autocomplete-in-modal.ui-autocomplete.ui-menu {
	z-index: 100001 !important;
}

/* "City ZIP" – hidden until userAddress has zip; JS adds .has-zip when set */
.dp-edit-location-zip-wrap {
	opacity: 0;
}
.dp-edit-location-zip-wrap.has-zip {
	opacity: 1;
}

/* City truncates with ellipsis when long (e.g. "Fort Laud... 33340") */
.dp-edit-location-city-display {
	display: inline-block;
	max-width: 15ch;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	vertical-align: bottom;
}

.dp-edit-location-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.dp-edit-location-modal.is-open {
	display: block;
	pointer-events: auto;
}

.dp-edit-location-modal .dp-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	transition: opacity 0.3s;
}

.dp-edit-location-modal.is-open .dp-modal-overlay {
	opacity: 1;
}

.dp-edit-location-modal .dp-modal-content {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.95);
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
	width: 90%;
	max-width: 400px;
	max-height: 90vh;
	overflow-y: auto;
	transition: transform 0.3s;
	padding: 0;
}

.dp-edit-location-modal.is-open .dp-modal-content {
	transform: translate(-50%, -50%) scale(1);
}

/* Drag handle: visible only on mobile (bottom sheet) */
.dp-edit-location-modal .dp-modal-drag-handle {
	display: none;
}

/* Close button: top-right of modal content (desktop) */
.dp-edit-location-modal .dp-modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	color: #070808;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	z-index: 1;
}

.dp-edit-location-modal .dp-modal-close:hover {
	color: #2445EA;
}

/* ----- Mobile: bottom sheet (aligns to bottom, stays when keyboard open) ----- */
@media (max-width: 767px) {
	.dp-edit-location-modal .dp-modal-content {
		top: auto;
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		max-width: none;
		max-height: 90vh;
		max-height: calc(100dvh - env(safe-area-inset-top, 0));
		transform: translateY(0);
		border-radius: 16px 16px 0 0;
		box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
		padding-bottom: env(safe-area-inset-bottom, 0);
		transition: transform 0.3s ease-out;
		display: flex;
		flex-direction: column;
		overflow: hidden;
	}

	.dp-edit-location-modal.is-open .dp-modal-content {
		transform: translateY(0);
	}

	.dp-edit-location-modal .dp-modal-content.is-dragging {
		transition: none;
	}

	/* Drag handle: pill at top of sheet; min-height + full width for easier touch */
	.dp-edit-location-modal .dp-modal-drag-handle {
		display: flex;
		align-items: center;
		justify-content: center;
		flex-shrink: 0;
		width: 100%;
		min-height: 48px;
		padding: 0;
		cursor: grab;
		touch-action: none;
	}
	.dp-edit-location-modal .dp-modal-drag-handle::before {
		content: '';
		display: block;
		width: 40px;
		height: 4px;
		margin: 0 auto;
		background: #d0d0d0;
		border-radius: 2px;
	}
	.dp-edit-location-modal .dp-modal-drag-handle:active {
		cursor: grabbing;
	}

	/* Hide X on mobile; close via drag or overlay */
	.dp-edit-location-modal .dp-modal-close {
		display: none;
	}
}

.dp-edit-location-modal .dp-modal-body {
	padding: 40px 32px;
	text-align: center;
}

@media (max-width: 767px) {
	.dp-edit-location-modal .dp-modal-body {
		flex: 1;
		min-height: 0;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		padding: 0 32px 32px;
	}
}

/* Variant copy: only one visible at a time */
.dp-edit-location-modal .dp-edit-location-copy {
	margin-bottom: 24px;
}

.dp-edit-location-modal .dp-edit-location-copy[hidden] {
	display: none;
}

/* Figma: Color - Black #070808; title size per design (no Title variable) */
.dp-edit-location-modal .dp-edit-location-title {
	margin: 0 0 16px;
	font-size: 18px !important;
	font-weight: 700;
	color: #070808;
	line-height: 1.3;
}

/* Figma: Body (16px, SemiBold 600, line-height 28), DP - Utility/Body text #4B5260 */
.dp-edit-location-modal .dp-edit-location-description {
	margin: 0;
	font-size: 14px;
	font-weight: 400;
	color: #4B5260;
	line-height: 1.5;
}

/* Standard DP Radar location form inside modal: full width, centered, Update button full width */
.dp-edit-location-modal .radar-location-form {
	width: 100%;
	max-width: none;
	margin: 0;
	padding-bottom: 0 !important;
}

.dp-edit-location-modal .radar-location-form .radar-input-box {
	max-width: none;
}

.dp-edit-location-modal .radar-location-form .wp-block-buttons {
	width: 100%;
	justify-content: center;
}

.dp-edit-location-modal .radar-location-form .wp-block-button {
	flex: 1;
	width: 100%;
}

/* Figma: Small Body Bold (14px, ExtraBold 800, line-height 26); sentence case */
.dp-edit-location-modal .radar-location-form .wp-block-button .dp-button {
	width: 100% !important;
	padding: 14px 24px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 800;
	line-height: 26px;
	text-transform: none;
}
