#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;
}
.youtube_popup_btn{
	font: var(--beon-unit-gallery-button-font);
	color: var(--beon-unit-gallery-button-text-color) !important;
	background-color: var(--beon-unit-gallery-button-bg-color) !important;
	border: var(--beon-unit-gallery-button-border);
	border-radius: var(--beon-unit-gallery-button-border-radius) !important;
	position: absolute;
	height: 40px;
	padding: 0 15px !important;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 10px;
	left:33px;
	bottom: 26px;
	& img{
		filter: var(--beon-unit-gallery-button-icon-filter);
		width: 11px !important;
		height: 11px !important;
		border-radius: 0 !important;
	}
}

#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%;
    width: 100vw;/*hides scrollbar, 100% does not*/
	max-width: 100vw;
    z-index: 10;
    display: flex;
    flex-direction: column;
    padding: 50px;
	overflow: auto;
}
.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;
}
.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);
	transition: filter ease-out 0.3s;
}
.gallery-popup-image img {
    height: 100% !important;
    width: 100%;
    object-fit: cover;
}
.gallery-popup-image:hover {
	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;
}



/* 
.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) {
	height: 185px;
}
.c-lightbox .swiper-button-next{
	margin-top: -5px !important;
}

@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;

	}
	#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-popup .gallery-popup-close{
		z-index: 9;
	}
}


@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;
	}
}
