/**
 * Red Bluff Deals — Maps
 * Leaflet map, popup, and address-picker styling.
 */

/* Namespaced deliberately. These used to be declared as --rbd-* on :root,
   which collided with the identically named palette used by rbd-core and
   the child theme — whichever stylesheet loaded last won, so text colours
   depended on plugin load order rather than on design. */

:root {
	--rbdm-red: #ce2029;
	--rbdm-red-dark: #9e121a;
	--rbdm-ink: #17130f;
	--rbdm-ink-2: #5b524b;
	--rbdm-rule: #e0d9d0;
}

/* ------------------------------------------------------------------ map */

.rbd-map-wrap {
	position: relative;
	margin: 0 0 1.5rem;
}

.rbd-map {
	width: 100%;
	min-height: 320px;
	border: 1px solid var(--rbdm-rule);
	border-radius: 4px;
	background: #2a2726;
	z-index: 0; /* keep tiles under sticky headers and modals */
}

.rbd-map__empty {
	margin: 0.75rem 0 0;
	font-size: 0.95rem;
	color: var(--rbdm-ink-2);
	text-align: center;
}

/* Leaflet draws the pin SVG; strip the div wrapper's default chrome. */
.rbd-pin {
	background: none;
	border: 0;
}

.rbd-pin svg {
	display: block;
	filter: drop-shadow( 0 2px 3px rgba( 0, 0, 0, 0.35 ) );
}

/* --------------------------------------------------------------- popups */

.leaflet-popup-content-wrapper {
	border-radius: 4px;
}

.leaflet-popup-content {
	margin: 12px 14px;
	line-height: 1.45;
}

.rbd-pop {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 170px;
}

.rbd-pop__title {
	font-weight: 700;
	font-size: 1rem;
	color: var(--rbdm-ink);
	text-decoration: none;
	line-height: 1.3;
}

.rbd-pop__title:hover,
.rbd-pop__title:focus {
	color: var(--rbdm-red-dark);
	text-decoration: underline;
}

.rbd-pop__cat {
	font-size: 0.7rem;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--rbdm-red);
	font-weight: 700;
}

/* When the sale actually runs — the thing a shopper needs most. */
.rbd-pop__when {
	font-size: 0.87rem;
	font-weight: 700;
	color: var(--rbdm-ink);
}

.rbd-pop__addr {
	font-size: 0.85rem;
	color: var(--rbdm-ink-2);
}

.rbd-pop__dir {
	display: inline-block;
	margin-top: 6px;
	padding: 8px 14px;
	background: var(--rbdm-red);
	color: #fff !important;
	font-weight: 700;
	font-size: 0.85rem;
	text-align: center;
	text-decoration: none !important;
	border-radius: 3px;
}

.rbd-pop__dir:hover,
.rbd-pop__dir:focus {
	background: var(--rbdm-red-dark);
}

/* ------------------------------------------------------- address picker */

.rbd-loc {
	position: relative;
}

.rbd-loc__list {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 1000;
	margin: 2px 0 0;
	padding: 0;
	list-style: none;
	background: #fff;
	border: 1px solid var(--rbdm-rule);
	border-radius: 3px;
	box-shadow: 0 6px 18px rgba( 0, 0, 0, 0.12 );
	max-height: 260px;
	overflow-y: auto;
	display: none;
}

.rbd-loc__list.is-open {
	display: block;
}

.rbd-loc__list li {
	margin: 0;
	padding: 9px 12px;
	font-size: 0.88rem;
	line-height: 1.35;
	color: var(--rbdm-ink);
	cursor: pointer;
	border-bottom: 1px solid #f2efea;
}

.rbd-loc__list li:last-child {
	border-bottom: 0;
}

.rbd-loc__list li:hover,
.rbd-loc__list li.is-active {
	background: #fbeaea;
	color: var(--rbdm-red-dark);
}

@media ( prefers-reduced-motion: reduce ) {
	.leaflet-fade-anim .leaflet-popup,
	.leaflet-zoom-anim .leaflet-zoom-animated {
		transition: none !important;
	}
}
