.unit-main-wrapper{
	margin-top: 60px;
}
.gallery-wrapper{
	padding-bottom: 26px;
	padding-inline: 50px;
}
.gallery-wrapper .main-content{
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap:18px;
}
#unit-mobile-gallery-slider {
    display: none;
}
#unit-gallery-grid.grid-layout {
	display: block !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:0 0 0 50px;
}

#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-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: 11px;
	height: 11px;
	border-radius: 0;
}	


/* 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;
	padding:0px;
}
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);
}

/* 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-gallery-grid.grid-layout .swiper-slide{
	/* grid-column: 1 / 3; */
	/* grid-row: 1 / 3;	 */
	height: 400px;
}
/* #unit-gallery-grid.grid-layout div:not(:first-child) {
	height: 185px;
} */
.videos_all_btn {
    /* position: absolute; */
    /* left: 30px; */
    /* bottom: 30px; */
    display: flex;
    gap: 18px;
	flex-wrap: wrap;
	width:100%;
}

.grundrisse_btn, .video_btn, .rundgang_btn, .unit-gallery-button {
    background-color: #FFF !important;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--beon-primary-text-color) !important;
    border: 1px solid var(--beon-border-color) !important;
    padding: 13px 20px !important;
}
.c-lightbox button{
	border:none !important;
	padding: 0px !important;
}

#unit-gallery-grid .beon-swiper-button-prev, #unit-gallery-grid .beon-swiper-button-next{
	position: absolute;
    width: 36px;
    height: 36px;
    bottom:45px;
    cursor: pointer;
    border-radius: 50%;
	z-index:9;
}
#unit-gallery-grid .swiper-button-disabled{
	opacity: 0.5;
}
#unit-gallery-grid .beon-swiper-button-prev{
	right:70px;
	content: url('/wp-content/themes/port54-theme/assets/images/gallery-left-arrow.svg');
}
#unit-gallery-grid .beon-swiper-button-next{
	right:20px;
	content: url('/wp-content/themes/port54-theme/assets/images/gallery-right-arrow.svg');
}

.unit-wrap-gallery{
	display: flex;
    flex-direction: column;
}

.grid-layout .special_selected_unit{
	display:inline-flex;
	align-items: center;
	gap:8px;
	padding: 5px 15px;
	background-color: #1E243B;
	border-radius: 40px;
	color:white;
	position: absolute;
    z-index: 9;
    left: 32%;
    top: 20px;
}
.grid-layout .special_selected_unit img{
	width:15px !important;
	height:15px !important;
	object-fit: contain !important;
    border-radius: 0 !important;
}

@media only screen and (min-width:1800px){
	.grid-layout .special_selected_unit{
		left: 35%;
	}
}

@media only screen and (max-width:1400px){
	.grid-layout .special_selected_unit{
		left:36%;
	}
}

@media only screen and (min-width:1200px){
	#unit-gallery-grid .beon-swiper-button-prev{
		right:calc((100vw - 1200px) / 2 + 60px);
	}
	#unit-gallery-grid .beon-swiper-button-next{
		right:calc((100vw - 1200px) / 2);
	}
}

@media only screen and (min-width:660px){
	.videos_all_btn .unit-gallery-button{
		margin-left: auto;
	}
}
@media only screen and (max-width: 1200px){
	#unit-gallery-grid.grid-layout {
		display: block !important;
	}
	#unit-mobile-gallery-slider { 
		display: none !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;

	}
	#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;
	}
	.gallery-wrapper{
		padding-inline: 20px;
	}
}


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

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

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

	.gallery-popup-image-wrapper {
		gap: 10px;
	}
	#unit-gallery-grid.grid-layout .swiper-slide{
		height: 260px;
	}
	#unit-gallery-grid .beon-swiper-button-prev, #unit-gallery-grid .beon-swiper-button-next{
		display:none;	
	}
	.unit-main-wrapper{
		margin-top:0px;
	}
	.gallery-wrapper{
		order:2;
		padding-top: 26px;
		padding-bottom: 0px;;
	}
	.videos_all_btn, .gallery-wrapper .main-content{
		gap:10px;
	}
	.grid-layout .special_selected_unit{
		left:20px;
	}
}
