/*
 * Version: 1.1
 * Author: Michael Urrang
 * Author URI: https://comple.no
 */

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

.bv-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
}

.bv-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(20, 16, 18, 0.72);
	backdrop-filter: blur(3px);
}

.bv-modal__dialog {
	position: relative;
	z-index: 2;
	width: min(1440px, calc(100vw - 32px));
	max-height: calc(100vh - 32px);
	margin: 16px auto;
	background: #ffffff;
	border-radius: 20px;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
	overflow: auto;
	z-index: 9999;
}

.bv-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 3;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92);
	color: #222;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.bv-modal__close:hover {
	background: #fff;
}

.bv-modal__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
	min-height: min(760px, calc(100vh - 32px));
}

.bv-modal__media {
	display: flex;
	flex-direction: column;
	background: #fff;
	padding: 60px;
	min-height: 320px;
	height: 100%;
}

.bv-modal__media-stage {
	position: relative;
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	min-height: 320px;
	max-height: 60vh;
	overflow: hidden;
}

.bv-modal__image {
	display: block;
	max-height: 100%;
	margin: 0 auto;
	object-fit: cover;
}

.bv-modal__media-empty {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	color: #7a7a7a;
	font-size: 15px;
	text-align: center;
}

.bv-modal__thumbs {
	display: none;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 10px;
	padding: 12px;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	flex: 0 0 auto;
}

.bv-modal__thumb {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	border: 0;
	padding: 0;
	border-radius: 10px;
	overflow: hidden;
	background: #ddd;
	cursor: pointer;
	opacity: 0.9;
	transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.bv-modal__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bv-modal__content {
	background: rgba(102,24,58,0.12);
	padding: 42px 36px 36px;
	overflow-y: auto;
}

.bv-modal__top {
	margin-bottom: 24px;
}

.bv-modal__title {
	margin: 0;
	font-size: clamp(28px, 3vw, 40px);
	line-height: 1.08;
	color: #5f1737;
}

.bv-modal__status-wrap {
	margin-bottom: 15px;
}

.bv-modal__status {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 8px 14px;
	border-radius: 6px;
	background: #2f5d34;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
}

.bv-modal__status.is-ledig {
	background: #2f5d34;
	color: #fff;
}

.bv-modal__status.is-reservert {
	background: #fff4d6;
	color: #946200;
}

.bv-modal__status.is-solgt {
	background: #5f1737;
	color: #fff;
}

.bv-modal__facts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 24px;
}

.bv-fact {
	padding: 10px 20px;
	background: #fff;
	border-radius: 14px;
}

.bv-fact__label {
	display: block;
	margin-bottom: 4px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #7b7b7b;
}

.bv-fact__value {
	display: block;
	font-size: 18px;
	font-weight: 700;
	color: #231f20;
}

.bv-modal__description-wrap {
	margin-bottom: 28px;
}

.bv-modal__description {
	margin: 0;
	font-size: 16px;
	line-height: 1.65;
	color: #403a3c;
}

.bv-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.bv-modal__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 0 22px;
	border-radius: 12px;
	background: #5f1737;
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	transition: transform 0.15s ease, opacity 0.15s ease;
}

.bv-modal__link:hover {
	color: #fff;
	opacity: 0.95;
	transform: translateY(-1px);
}

body.bv-modal-open {
	overflow: hidden;
}

/* BV Meglere */
.bv-brokers {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 25px;
}

.bv-broker__image {
	max-height: 150px;
	object-fit: auto;
}

.bv-broker__name {
	font-weight: 700;
	color: #5f1737;
}

.bv-broker__agency {
	font-weight: 300;
	margin-bottom: 15px;
}

.bv-broker__meta a {
	font-size: 1.6rem;
	color: #5f1737;
}

/* Image Map Pro statusfarger */
[data-title].is-ledig {
	fill: rgba(86, 165, 80, 0.45) !important;
	stroke: #333 !important;
}

[data-title].is-ledig:hover {
	fill: transparent !important;
	stroke: #333 !important;
}

[data-title].is-reservert {
	fill: rgba(234, 179, 8, 0.45) !important;
	stroke: rgba(234, 179, 8, 0.9) !important;
}

[data-title].is-reservert:hover {
	fill: rgba(234, 179, 8, 0.65) !important;
	stroke: #333 !important;
}

[data-title].is-solgt {
	fill: rgba(220, 38, 38, 0.45) !important;
	stroke: #333 !important;
}

[data-title].is-solgt:hover {
	fill: rgba(220, 38, 38, 0.65) !important;
	stroke: #333 !important;
}

/* Tooltips */
.bv-tooltip[hidden] {
	display: none !important;
}

.bv-tooltip {
	position: fixed;
	z-index: 10000;
	min-width: 180px;
	max-width: 260px;
	padding: 12px 14px;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
	pointer-events: none;
}

.bv-tooltip__title {
	margin: 0 0 6px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	color: #231f20;
}

.bv-tooltip__status {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 28px;
	padding: 4px 10px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 700;
	margin-bottom: 8px;
}

.bv-tooltip__status.is-ledig {
	background: #2f5d34;
	color: #fff;
}

.bv-tooltip__status.is-reservert {
	background: #fff4d6;
	color: #946200;
}

.bv-tooltip__status.is-solgt {
	background: #fde8e8;
	color: #a12828;
}

.bv-tooltip__meta {
	font-size: 14px;
	line-height: 1.55;
	color: #403a3c;
}

/* Tabellvisning av enheter */
.bv-list {
	margin: 50px 0;
	border-radius: 16px;
	overflow: hidden;
	background: #fff;
}

.bv-list__head,
.bv-list__row {
	display: grid;
	grid-template-columns: 1.1fr 1fr 1fr 1fr 1.2fr;
	gap: 16px;
	align-items: center;
	padding: 16px 20px;
}

.bv-list__head {
	background: #66183a;
	font-weight: 700;
	font-size: 14px;
	color: #fff;
}

.bv-list__row {
	width: 100%;
	border: 0;
	border-top: 1px solid rgba(0,0,0,0.06);
	background: #fff;
	text-align: left;
	cursor: pointer;
	font: inherit;
}

.bv-list__row:nth-child(odd) {
	background: #faf8f7;
}

.bv-list__row:hover {
	cursor: pointer;
	text-decoration: underline;
	border-top: 1px solid rgba(0,0,0,0.06);
}

@media (max-width: 900px) {
	.bv-modal__dialog {
		width: min(100vw - 16px, 1000px);
		max-height: calc(100vh - 16px);
		margin: 8px auto;
		border-radius: 16px;
	}

	.bv-modal__grid {
		grid-template-columns: 1fr;
		min-height: auto;
	}

	.bv-modal__media {
		min-height: 240px;
		max-height: none;
		padding: 20px;
	}

	.bv-modal__media-stage {
		min-height: 240px;
	}

	.bv-modal__thumbs {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 8px;
		padding: 10px;
	}

	.bv-modal__content {
		padding: 24px 18px 20px;
	}

	.bv-modal__facts {
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}

	.bv-tooltip {
		display: none !important;
	}

	/* Tabellvisning av enheter */

	.bv-list__row {
		gap: 10px 16px;
		padding: 16px;
	}

	.bv-list__row > div {
		font-size: 14px;
	}
}

@media (max-width: 640px) {
	.bv-modal__thumbs {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.bv-modal__top {
		flex-direction: column;
		align-items: flex-start;
	}

	.bv-modal__title {
		font-size: 28px;
	}

	.bv-modal__close {
		top: 10px;
		right: 10px;
		width: 40px;
		height: 40px;
		font-size: 24px;
	}
}