#unit-mobile-gallery-slider {
    display: none;
}

#unit-gallery-grid {

}

#unit-gallery-grid.grid-layout {
	display: grid !important;/* TODO: Check whether there is a more elegant solution to stop everything from rendering before css is loaded*/
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
	padding: 0;
	margin: 0;
	list-style-type: none;
	overflow: hidden;
	grid-column-gap: 20px;
	grid-row-gap: 20px;
}

#unit-gallery-grid.grid-layout img {
    height: 100%;
    width: 100%;
    object-fit: cover;
	border-radius: var(--beon-unit-gallery-border-radius);
}

#unit-gallery-grid.grid-layout button.unit-gallery-button, #unit-mobile-gallery-slider button.unit-gallery-button {
	font: var(--beon-unit-gallery-button-font);
	color: var(--beon-unit-gallery-button-text-color);
	background-color: var(--beon-unit-gallery-button-bg-color);
	border: var(--beon-unit-gallery-button-border);
	border-radius: var(--beon-unit-gallery-button-border-radius);
	position: relative;
	bottom: 50%;
	transform: translate(-50%, -50%);
	left: 50%;
	height: 40px;
	padding: 0 15px;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 10px;
}
#unit-gallery-grid.grid-layout .popup-button-wrapper {
	display: flex;
	flex-direction: row;
	position: relative;
	bottom: 105px;
	transform: none;
	left: 20px;
	height: 40px;
	gap: 10px;
}
#unit-gallery-grid.grid-layout .highlight-marker-wrapper {
    display: flex;
    flex-direction: row;
	flex-wrap: wrap;
    position: relative;
    bottom: 380px;
    transform: none;
    left: 20px;
    height: 32px;
    gap: 5px;
}
#unit-mobile-gallery-slider .highlight-marker-wrapper {
	display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    position: relative;
    bottom: 240px;
    transform: none;
    left: 10px;
    height: 32px;
    gap: 5px;
}
#unit-gallery-grid.grid-layout .group-highlight-wrapper, #unit-mobile-gallery-slider .group-highlight-wrapper {
	display: flex;
	border-radius: var(--beon-listing-img-marker-border-radius);
	box-shadow: var(--beon-listing-img-marker-shadow);
	padding: 6px 10px 4px;
	font: var(--beon-listing-img-marker-font);
	cursor: default;
}
#unit-gallery-grid.grid-layout .group-highlight, #unit-mobile-gallery-slider .group-highlight {
	margin-bottom: 0px;
}
#unit-gallery-grid.grid-layout .group-highlight-wrapper.sylt-er-plus-highlight-wrapper img, #unit-mobile-gallery-slider .group-highlight-wrapper.sylt-er-plus-highlight-wrapper img {
	width: 22px !important;
	height: 22px !important;
}
#unit-gallery-grid.grid-layout .group-highlight-wrapper, #unit-gallery-grid.grid-layout a:hover .group-highlight-wrapper, 
#unit-mobile-gallery-slider .group-highlight-wrapper, #unit-mobile-gallery-slider a:hover .group-highlight-wrapper {
	background-color: var(--beon-listing-img-marker-group-bg-color);
	color: var(--beon-listing-img-marker-group-text-color);
}
#unit-gallery-grid.grid-layout .group-highlight-wrapper.sylt-er-plus-highlight-wrapper, #unit-gallery-grid.grid-layout a:hover .group-highlight-wrapper.sylt-er-plus-highlight-wrapper,
#unit-mobile-gallery-slider .group-highlight-wrapper.sylt-er-plus-highlight-wrapper, #unit-mobile-gallery-slider a:hover .group-highlight-wrapper.sylt-er-plus-highlight-wrapper {
	background-color: var(--beon-sylt-er-green);
	color: var(--beon-white);
	gap: 10px;
	max-height: 32px;
}
#unit-gallery-grid.grid-layout button.unit-gallery-button.open-pro360-popup, #unit-mobile-gallery-slider button.unit-gallery-button.open-pro360-popup, 
#unit-gallery-grid.grid-layout button.unit-gallery-button.open-video-popup, #unit-mobile-gallery-slider button.unit-gallery-button.open-video-popup {
	position: static;
	bottom: inherit;
	transform: none;
	left: inherit;
}
#unit-mobile-gallery-slider button.unit-gallery-button {

}
#unit-gallery-grid.grid-layout button.unit-gallery-button img, #unit-mobile-gallery-slider button.unit-gallery-button img {
	filter: var(--beon-unit-gallery-button-icon-filter);
	width: 12px;
	height: 11px;
	border-radius: 0;
}	
#unit-gallery-grid.grid-layout button.unit-gallery-button.open-pro360-popup img, #unit-mobile-gallery-slider button.unit-gallery-button.open-pro360-popup img {
	width: 16px;
}

/* Gallery Pop up*/
.open-gallery-popup {
	cursor: pointer;
}
.gallery-popup {
    background-color: var(--beon-unit-gallery-popup-bg-color);
    /* position: fixed; */
    /* bottom: 0; */
    /* left: 0; */
	height: 100%;
	max-height: 100%;
    width: 100vw;/*hides scrollbar, 100% does not*/
	max-width: 100vw;
    z-index: 10;
    /* display: flex; */
    /* flex-direction: column; */
    padding: 50px;
	overflow: auto;
	border: none;
}
button.gallery-popup-close {
	position: fixed;
	top: 50px;
	right: 50px;
	cursor: pointer;
    height: 40px;
    width: 40px;
	border-radius: 50%;
	border: var(--beon-unit-gallery-popup-close-border);
	background-color: var(--beon-unit-gallery-popup-bg-color);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1;
}
button.gallery-popup-close:hover, button.gallery-popup-close:focus {
	background-color: var(--beon-unit-gallery-popup-bg-color);
	border: var(--beon-unit-gallery-popup-close-border);
}
.gallery-popup-close img {
    height: 20px;
    width: 20px;
    filter: var(--beon-unit-gallery-popup-close-icon-filter);
}
.gallery-popup-image-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    gap: 20px 20px;
    align-items: stretch;
    justify-items: stretch;
}

.gallery-popup-image-wrapper .gallery-popup-image:nth-child(3n) {
    grid-column: span 2;
	grid-row: span 1;
}

.gallery-popup-image {
    height: 300px;
    width: 100%;
    overflow: hidden;
	border-radius: var(--beon-unit-gallery-border-radius);
}
.gallery-popup-image img {
    height: 100%;
    width: 100%;
    object-fit: cover;
	transition: filter ease-out 0.3s;
}
.gallery-popup-image img:hover, .gallery-popup-image img:focus-visible {
	filter: brightness(0.7);
}
/*TODO Check for errors*/
.c-lightbox.open {
	overflow-y: hidden;
	overflow: hidden;
}

#unit-mobile-gallery-slider.flexslider .flex-control-nav {
	bottom: 20px;
	opacity: 1;
}
#unit-mobile-gallery-slider.flexslider .flex-control-nav li a {
	width: 7px;
	height: 7px;
	background: var(--beon-unit-gallery-dots-color-inactive);
	box-shadow: none;
}
#unit-mobile-gallery-slider.flexslider .flex-control-nav li a.flex-active {
	background: var(--beon-unit-gallery-dots-color-active);
}
#unit-mobile-gallery-slider .popup-button-wrapper {
	display: flex;
	flex-direction: row;
	bottom: 85px;
	position: relative;
	left: 10px;
	gap: 10px;
}

/* Work further */

#unit-mobile-gallery-slider.flexslider {
	background: transparent !important;
	border: none !important;
}

#unit-mobile-gallery-slider .flex-next, #unit-mobile-gallery-slider .flex-next::before, #unit-mobile-gallery-slider .flex-prev::before, #unit-mobile-gallery-slider .flex-prev {
	/* display: none; */
}

#unit-mobile-gallery-slider .flex-prev::before {
	content: url(/wp-content/themes/sylt-er-theme/assets/images/arrow_left.svg) !important;
	font-size: 0 !important;
	height: 10px;
	width: 10px;
	filter: var(--beon-listing-gallery-icon-filter);
	left: 13px;
	top: 13px;
	position: relative;
}

#unit-mobile-gallery-slider .flex-direction-nav .flex-prev {
	background-color: var(--beon-listing-gallery-icon-bg-color);
	border: var(--beon-listing-gallery-icon-border);
	border-radius: var(--beon-listing-gallery-icon-border-radius);
	left: 20px !important;
	content: '';
    font-size: 0 !important;
    line-height: 0 !important;
}

#unit-mobile-gallery-slider.flexslider:hover .flex-direction-nav .flex-prev, #unit-mobile-gallery-slider.flexslider:hover .flex-direction-nav .flex-next {
	opacity: 1;
}

#unit-mobile-gallery-slider.flexslider:hover .flex-direction-nav .flex-prev:hover {
	left: 15px !important;
}

#unit-mobile-gallery-slider .flex-next::before {
	content: url(/wp-content/themes/sylt-er-theme/assets/images/arrow_right.svg) !important;
	font-size: 0 !important;
	height: 10px;
	width: 10px;
	filter: var(--beon-listing-gallery-icon-filter);
	right: 13px;
	top: 13px;
	position: relative;
}

#unit-mobile-gallery-slider .flex-direction-nav .flex-next {
	background-color: var(--beon-listing-gallery-icon-bg-color);
	border: var(--beon-listing-gallery-icon-border);
	border-radius: var(--beon-listing-gallery-icon-border-radius);
	right: 20px !important;
	content: '';
    font-size: 0 !important;
    line-height: 0 !important;
}

#unit-mobile-gallery-slider.flexslider:hover .flex-direction-nav .flex-next:hover {
	right: 15px !important;
}

#unit-mobile-gallery-slider.flexslider .flex-direction-nav a {
	/* margin-top: -15px !important; */
	height: 36px !important;
	width: 36px !important;
	color: transparent;
	/* visually erases the "Next"/"Previous" */
	z-index: 1;
}

#unit-mobile-gallery-slider.flexslider .flex-control-nav {
	bottom: 0px;
	opacity: 1;
	line-height: 24px;
}

#unit-mobile-gallery-slider.flexslider .flex-control-nav li a {
	width: 7px;
	height: 7px;
	background: var(--beon-listing-gallery-dots-color-inactive);
	box-shadow: none;
}

#unit-mobile-gallery-slider.flexslider .flex-control-nav li a.flex-active {
	background: var(--beon-listing-gallery-dots-color-active);
}


/* 
.flex-direction-nav a {
	margin-top: -15px !important;
	height: 30px !important;
}

.fit-height .flex-direction-nav {
	height: 0 !important;
}

.flexslider .flex-direction-nav a {
	opacity: 1;
}

.flex-direction-nav .flex-next {
	right: -50px !important;
}

.flex-direction-nav .flex-prev {
	left: -50px !important;
} */

#unit-gallery-grid.grid-layout div:first-child {
	grid-column: 1 / 3;
	grid-row: 1 / 3;	
	height: 390px;
}
#unit-gallery-grid.grid-layout div:not(:first-child):not(.popup-button-wrapper):not(.highlight-marker-wrapper):not(.sylt-er-plus-highlight):not(.sylt-er-tooltip-content):not(.group-highlight-wrapper) {
	height: 185px;
}
.beon-unit-popup-content:has(iframe) {
	display: flex;
	flex-direction: column;
}
.beon-unit-popup-content iframe {
	min-width: 800px;
}
@media only screen and (max-width: 1200px){
	#unit-gallery-grid.grid-layout {
		display: none !important;
	}
	#unit-mobile-gallery-slider { 
		display: block !important;
		height: 250px;
		/* margin-bottom: -20px; */
	}
	
	
	#unit-mobile-gallery-slider.flexslider .slides > li {
		height: 250px;
	}
	#unit-mobile-gallery-slider.flexslider .flex-viewport {
		height: 250px;
	}
	#unit-mobile-gallery-slider.flexslider .slides > li img {
		height: 250px;
		border-radius: 0;
	}
	#unit-mobile-gallery-slider.flexslider .slides .unit-gallery-button img {
		height: 11px;
	}
	.open-gallery-popup {
		height: 100%;
	}

    .gallery-popup {
		padding: 20px;
		padding-top: 70px;
	}
	.gallery-popup-image {
		height: 200px;
	}
	.gallery-popup-close {
		top: 20px;
		right: 20px;
	}
	.beon-unit-popup-content iframe {
		min-width: 500px;
        max-width: calc(90vw - 2 * 20px);
	}
}


@media only screen and (max-width: 767px) {

	.beon-unit-popup-content iframe {
		min-width: 250px;
        max-width: calc(90vw - 2 * 20px);
	}
	/* .flex-direction-nav .flex-next {
		right: 30px !important;
	}

	.flex-direction-nav .flex-prev {
		left: 30px !important;
	} */

	.gallery-popup-image-wrapper {
		gap: 10px;
	}
}
