/**
 * Custom Branch Map - Frontend Styles
 *
 * Clean, responsive two-column layout (map + sidebar list).
 * No CSS frameworks. Only simple, non-distracting transitions on
 * hover/active states - no elaborate animation.
 */

.cbm-map-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 24px;
	width: 100%;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.cbm-map-wrap *,
.cbm-map-wrap *::before,
.cbm-map-wrap *::after {
	box-sizing: border-box;
}

/* Desktop columns: map 70% / sidebar 30% */
.cbm-map-column {
	flex: 0 0 calc(70% - 12px);
	max-width: calc(70% - 12px);
}

.cbm-sidebar-column {
	flex: 0 0 calc(30% - 12px);
	max-width: calc(30% - 12px);
}

.cbm-map-canvas {
	width: 100%;
	height: 450px;
	border-radius: 8px;
	overflow: hidden;
	background: #eaeaea;
}

/* Sidebar list */
.cbm-location-list {
	list-style: none;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	border: 1px solid #e3e3e3;
	border-radius: 8px;
	background: #ffffff;
}

.cbm-location-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px;
	border-bottom: 1px solid #eeeeee;
	border-left: 3px solid transparent;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.cbm-location-item:last-child {
	border-bottom: none;
}

.cbm-location-item:hover {
	background-color: #f7f7f7;
}

.cbm-location-item:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: -2px;
}

.cbm-location-item.is-active {
	background-color: #fff6ea;
	border-left-color: #e08a1e;
}

.cbm-location-thumb {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	border-radius: 6px;
	overflow: hidden;
	background: #f0f0f0;
}

.cbm-location-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cbm-location-thumb-placeholder {
	width: 100%;
	height: 100%;
	background: #e5e5e5;
}

.cbm-location-info {
	min-width: 0;
}

.cbm-location-title {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	color: #1d1d1f;
}

.cbm-location-address {
	margin: 0;
	font-size: 13px;
	line-height: 1.4;
	color: #666666;
}

.cbm-no-locations {
	margin: 0;
	padding: 16px;
	border: 1px dashed #dddddd;
	border-radius: 8px;
	color: #666666;
	font-family: inherit;
}

/* Leaflet popup content */
.cbm-popup{
    display:flex;
    align-items:center;
    gap:15px;
    width:320px;
}

.cbm-popup-image{
    width:70px !important;
    min-width:70px;
    height:70px;
    border-radius:8px;
    object-fit:cover;
    margin:0;
}

.cbm-popup-content{
    flex:1;
}

.cbm-popup-title{
    margin:0 0 6px;
    font-size:18px;
    font-weight:700;
}

.cbm-popup-address{
    margin:0;
    font-size:15px;
}

/* Active marker: a small, simple scale-up - no elaborate animation */
.cbm-marker-active {
	transform: scale(1.15);
	transition: transform 0.15s ease;
	z-index: 1000 !important;
}
.leaflet-popup-content p {
    margin: 0;
}
.leaflet-popup-content {
    min-width: 285px;
}
.leaflet-marker-icon.cbm-marker-active {
    width: 100px !important;
    height: 100px !important;
    margin-left: -35px !important;
    margin-top: -30px !important;
    padding: 12px;
    background: #fff;
    border-radius: 100%;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    transition: .25s;
    padding: 10px !important;
}

.leaflet-marker-icon.cbm-marker-active img{

    width:100%;

    height:100%;

    object-fit:contain;
}


/* Product-availability state (Single Product Template context only).
   Persistent - independent of, and layered underneath, the .is-active
   click-selection state above. Fully scoped under .cbm-map-wrap. */
.cbm-map-wrap .cbm-location-item.cbm-product-available {
	border-left-color: #2e7d32;
	background-color: #f2f9f2;
}

.cbm-map-wrap .cbm-location-item.cbm-product-available.is-active {
	background-color: #fff6ea;
	border-left-color: #e08a1e;
}

.cbm-map-wrap .cbm-availability-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 4px;
	padding: 0;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	color: #2e7d32;
	background-color: transparent;
	border-radius: 0;
}

.cbm-map-wrap .cbm-availability-badge::before {
	content: '';
	width: 8px;
	height: 8px;
	flex: 0 0 auto;
	border-radius: 50%;
	background-color: #2e7d32;
}

/* Out-of-stock modifier for the same badge - single product availability
   list only; reuses .cbm-availability-badge's layout, just recolors the
   dot and the text. */
.cbm-map-wrap .cbm-availability-badge.cbm-out-of-stock {
	color: #d32f2f;
}

.cbm-map-wrap .cbm-availability-badge.cbm-out-of-stock::before {
	background-color: #d32f2f;
}

.cbm-map-wrap .leaflet-marker-icon.cbm-marker-product-available {
	width: 100px !important;
	height: 100px !important;
	margin-left: -35px !important;
	margin-top: -30px !important;
	padding: 10px !important;
	background: #fff;
	border-radius: 100%;
	box-shadow: 0 10px 30px rgba(0,0,0,.18);
	outline: 3px solid #2e7d32;
	outline-offset: 2px;
	transition: .25s;
	z-index: 900;
}

.cbm-map-wrap .leaflet-marker-icon.cbm-marker-product-available img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* Mobile: map on top, sidebar below */
@media ( max-width: 782px ) {
	.cbm-map-wrap {
		flex-direction: column;
	}

	.cbm-map-column,
	.cbm-sidebar-column {
		flex: 1 1 100%;
		max-width: 100%;
	}

	.cbm-map-canvas {
		height: 320px;
	}

	.cbm-location-list {
		max-height: 320px;
	}
}
