/* cs-locations leaflet mode. Loaded only when the map provider is 'leaflet'. Everything is scoped to
   .cs-map-leaflet / .cs-leaflet-*, so Google mode and the theme's own rules are untouched.
   Cards, search box and state buttons use the theme's existing frontend.css; this file only adds
   what leaflet mode needs on top. */

/* Map wrapper. Leaflet mode uses .cs-leaflet-map-area instead of the theme's .map_area, because the Complianz
   "Google Maps placeholder (school map)" Script Center entry puts its placeholder on .map_area. Same layout as the
   theme's .locations_page .left .map_area rules (frontend.css ~6717, 1499px ~9317, 991px ~11700). */
.locations_page.cs-map-leaflet .left .cs-leaflet-map-area { line-height: 0; height: calc(100vh - 100px); position: sticky; top: 100px; }
.locations_page.cs-map-leaflet .left .cs-leaflet-map-area #cs-locations-map { position: absolute; top: 0; right: 0; bottom: 0; left: 0; height: 100%; }
@media all and (max-width: 1499px) {
	.locations_page.cs-map-leaflet .left .cs-leaflet-map-area { height: calc(100vh - 66px); top: 66px; }
}
@media (max-width: 991px) {
	.locations_page.cs-map-leaflet .left .cs-leaflet-map-area { height: calc(100vh - 62px); top: 62px; }
}

/* Keep Leaflet's internal z-indexes (400+) inside the map, below the sticky header. */
.locations_page.cs-map-leaflet .left .cs-leaflet-map-area #cs-locations-map { z-index: 0; background: #e8e8e8; }
.cs-map-leaflet .leaflet-container { font-family: Outfit, sans-serif; line-height: 1.4; }

/* Single "Search By ZIP" label styled by the theme's .loc-tab button.active; not clickable here. */
.locations_page.cs-map-leaflet .loc-tab button.cs-leaflet-tablabel { cursor: default; }

/* ZIP result message under the search box. */
.cs-map-leaflet .cs-leaflet-message { margin: 12px 4px 0; font-family: Outfit, sans-serif; font-size: 16px; line-height: 1.45; color: #333333; }
.cs-map-leaflet .cs-leaflet-message:empty { display: none; }
.cs-map-leaflet .cs-leaflet-message.is-error { color: #9765A9; font-weight: 500; }

/* Leaflet mode adds one line to the theme's card: distance on ZIP searches. Same selector depth as the theme's card rules. */
#cs-locations #cs-locations-results .card .inner .text_area .bottom_area .contact_details ul li.cs-leaflet-distance span {
	display: block; padding: 0 0 0 22px; color: #9765A9; font-weight: 600; font-family: Outfit, sans-serif;
}
/* Map popup: brand colours, theme-style yellow button. */
.cs-map-leaflet .leaflet-popup-content-wrapper { border-radius: 16px; }
.cs-leaflet-popup { font-family: Outfit, sans-serif; font-size: 14px; color: #333333; }
.cs-leaflet-popup .cs-leaflet-popup-title { display: block; color: #9765A9; font-size: 16px; line-height: 20px; font-weight: 600; text-decoration: none; margin-bottom: 6px; }
.cs-leaflet-popup .cs-leaflet-popup-address { margin-bottom: 8px; }
.cs-leaflet-popup .cs-leaflet-popup-links a { color: #33BBDA; text-decoration: underline; }
.cs-leaflet-popup .cs-leaflet-popup-cta { margin-top: 10px; }
.cs-leaflet-popup .cs-leaflet-popup-cta .tour_action_btn {
	display: block; width: 100%; box-sizing: border-box; text-align: center;  /* full width across the popup bottom */
	padding: 10px 16px; background: #FCEE21; border-radius: 30px; text-decoration: none; text-transform: uppercase;
	font-size: 12px; font-weight: 600; color: #000000; white-space: nowrap;
}

/* School cards (desktop/tablet): uniform layout. Name reserves 2 lines; phone and the tour button sit on one line
   along the bottom of every card. Card heights are equalised in leaflet-mode.js. Phones keep the theme layout. */
@media (min-width: 768px) {
	.cs-map-leaflet #cs-locations #cs-locations-results .card .inner .text_area { flex: 1 1 auto; display: flex; flex-direction: column; }
	.cs-map-leaflet #cs-locations #cs-locations-results .card .inner .text_area h2 { min-height: 52px; }
	.cs-map-leaflet #cs-locations #cs-locations-results .card .inner .text_area .bottom_area { flex: 1 1 auto; align-items: stretch; }
	.cs-map-leaflet #cs-locations #cs-locations-results .card .inner .text_area .bottom_area .contact_details,
	.cs-map-leaflet #cs-locations #cs-locations-results .card .inner .text_area .bottom_area .opening_hours { display: flex; flex-direction: column; }
	.cs-map-leaflet #cs-locations #cs-locations-results .card .inner .text_area .bottom_area .contact_details ul { flex: 1 1 auto; }
	.cs-map-leaflet #cs-locations #cs-locations-results .card .inner .text_area .bottom_area .contact_details li.phone { margin-top: auto; min-height: 43px; display: flex; align-items: center; }
	.cs-map-leaflet #cs-locations #cs-locations-results .card .inner .text_area .bottom_area .opening_hours .tour_action_btn:first-of-type { margin-top: auto; }
	.cs-map-leaflet #cs-locations #cs-locations-results .card .inner .text_area .bottom_area .opening_hours .tour_action_btn + .tour_action_btn { margin-top: 10px; }
}

/* Phones: show the map (Google mode hides it on purpose) as a block above the list. */
@media (max-width: 767px) {
	/* Beats the theme rule and the live Additional CSS rule `html body .locations_page .left { display: none !important }`. */
	html body .locations_page.cs-map-leaflet .left { display: block !important; width: 100%; }
	.locations_page.cs-map-leaflet .left .cs-leaflet-map-area { position: relative; top: auto; height: 50vh; min-height: 280px; max-height: 420px; }
}
