.materialgalleryContainer{
    width: 100%;
    max-width: 1000px;
    margin: auto;
    user-select: none;
    /*max-height: 47vh;
    aspect-ratio: 1 / 1;*/
}
.materialgalleryContainer .slideShowContainer{
    width: 100%;
    /*height: 100%;*/
    overflow: hidden;
    background-color: gainsboro;
    position: relative;
    aspect-ratio: 1 / 1;
}
.materialgalleryContainer .slideShowContainer #playPause{
    width: 32px;
    height: 32px;
    position: absolute;
    background-image: url(images/playPause.png);
    background-repeat: no-repeat;
    z-index: 5;
    background-size: cover;
    margin: 5px;
    cursor: pointer;
}
.materialgalleryContainer .slideShowContainer #playPause:hover{
    opacity: .7;
}
.materialgalleryContainer .slideShowContainer .imageHolder{
    width: 100%;
    height: auto;
    position: absolute;
    opacity: 0;
	aspect-ratio: 1 / 1;
}
.materialgalleryContainer .slideShowContainer .imageHolder img{
    width: 100%;
    height: auto;
	aspect-ratio: 1 / 1;
}
.materialgalleryContainer .slideShowContainer .imageHolder .captionText{
    display: none;
}

.materialgalleryContainer .slideShowContainer .leftArrow,.materialgalleryContainer .slideShowContainer .rightArrow{
    width: 50px;
    /*background: #00000036;*/
    position: absolute;
    left: 0;
    z-index: 1;
    transition: background 0.5s;
    height: 55px;
    top: 50%;
    transform: translateY(-50%);
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}
.materialgalleryContainer .slideShowContainer .rightArrow{
    left: auto;
    right: 0;
    border-top-right-radius: 0px;
    border-bottom-right-radius: 0px;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}
.materialgalleryContainer .slideShowContainer .leftArrow:hover,
.materialgalleryContainer .slideShowContainer .rightArrow:hover{
    background: #9f9f9fa8;
    cursor: pointer;
}
.materialgalleryContainer .slideShowContainer .leftArrow:hover .arrow{
	padding: 7px !important;
	margin-right: 10px;
}
.materialgalleryContainer .slideShowContainer .rightArrow:hover .arrow{
	padding: 7px !important;
	margin-left: 10px;
}
.materialgalleryContainer .arrow{
    display: inline-block;
    border: 2px solid black;
    width: 5px;
    height: 5px;
    border-left: none;
    border-bottom: none;
    margin: auto;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
	border-radius: 0px !important;
	padding: 5px !important;
}
.materialgalleryContainer .arrow.arrowLeft{
    transform: rotateZ(-135deg);
}
.materialgalleryContainer .arrow.arrowRight{
    transform: rotateZ(45deg);
}


.materialgalleryContainer .slideShowContainer>.captionTextHolder{
    position: absolute;
    bottom: 0;
    z-index: 1;
    color: white;
    font-family: sans-serif;
    font-size: 20px;
    text-align: center;
    width: 100%;
    background: #00000047;
    height: 50px;
    line-height: 50px;
    overflow: hidden;
}
.materialgalleryContainer .slideShowContainer>.captionTextHolder>.captionText{
    margin: 0;
}

.materialgalleryContainer .dotsContainer{
    width: 100%;
    height: 10%;
    text-align: center;
    padding-top: 20px;
    box-sizing: border-box;
}
.materialgalleryContainer .dotsContainer .dots{
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin-left: 5px;
    background-color: #bbb;
    cursor: pointer;
    transition:background-color 0.5s;
}
.materialgalleryContainer .dotsContainer .dots:first-child{
    margin-left: 0;
}
.materialgalleryContainer .dotsContainer .dots:hover,
.materialgalleryContainer .dotsContainer .dots.active{
    background-color: #717171;;
}



.materialgalleryContainer .moveLeftCurrentSlide{
    animation-name: moveLeftCurrent;
    animation-duration: 0.5s;
    animation-timing-function: linear;
    animation-fill-mode:forwards;

}
.materialgalleryContainer .moveLeftNextSlide{
    animation-name: moveLeftNext;
    animation-duration: 0.5s;
    animation-timing-function: linear;
    animation-fill-mode:forwards;
}
@keyframes moveLeftCurrent {
    from {margin-left: 0;opacity: 1;}
    to {margin-left: -100%;opacity: 1;}
}
@keyframes moveLeftNext {
    from {margin-left: 100%;opacity: 1;}
    to {margin-left: 0%;opacity: 1;}
}


.materialgalleryContainer .moveRightCurrentSlide{
    animation-name: moveRightCurrent;
    animation-duration: 0.5s;
    animation-timing-function: linear;
    animation-fill-mode:forwards;
}
.materialgalleryContainer .moveRightPrevSlide{
    animation-name: moveRightPrev;
    animation-duration: 0.5s;
    animation-timing-function: linear;
    animation-fill-mode:forwards;
}
@keyframes moveRightCurrent {
    from {margin-left: 0;opacity: 1;}
    to {margin-left: 100%;opacity: 1;}
}
@keyframes moveRightPrev {
    from {margin-left: -100%;opacity: 1;}
    to {margin-left: 0%;opacity: 1;}
}
.slideTextFromBottom {
    animation-name: slideTextFromBottom;
    animation-duration: 0.7s;
    animation-timing-function: ease-out;
}
@keyframes slideTextFromBottom {
    from {opacity: 0;margin-top: 100px}
    to {opacity: 1;margin-top: 0px;}
}
.slideTextFromTop {
    animation-name: slideTextFromTop;
    animation-duration: 0.7s;
    animation-timing-function: ease-out;
}
@keyframes slideTextFromTop {
    from {opacity: 0;margin-top: -100px}
    to {opacity: 1;margin-top: 0px;}
}



/******************************************************/
/*******************/
/*AE-PRODUCTGALLERY Flickity*/
/* Contedor Flickity */
body.single-product .ae-productgallery.flickity-enabled {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Cada slide Flickity */
body.single-product .ae-productgallery__slide.flickity-cell {
    width: 100%;
    height: 550px; 
    overflow: hidden;
    position: relative;
}
/* Contedor interno da slide */
body.single-product .ae-productgallery_slide_div.flickity-cell-inner {
    width: 100%;
    height: 100%;
}
/* Fondo da imaxe */
body.single-product .ae-productgallery_slide_bg.flickity-bg {
    width: 100%;
    height: 100%;
    background-size: contain; 
    /*background-size: auto; */
    background-position: center;
    background-repeat: no-repeat;
}
/* Flechas Flickity */
/*body.single-product .flickity-prev-next-button {
	position: absolute;
	top: 55%;
	transform: translateY(-50%);
	z-index: 10;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	border: none;
	background: rgba(234,79,47,0.8);
	background: transparent;
	/*color: #fff;
	cursor: pointer;
	transition: transform 0.3s ease, background 0.3s ease;
	padding: 0px;
}
body.single-product .flickity-prev-next-button::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-top: 2px solid #000;
    border-right: 2px solid #000;
    position: absolute;
    top: 50%;
}
*/
body.single-product .flickity-prev-next-button:hover  {
	transform: translateY(-50%) scale(1.4);
}

body.single-product .flickity-prev-next-button.previous{
	left: 0px;
}
body.single-product .flickity-prev-next-button.next {
    right: 0px;
}
body.single-product .flickity-prev-next-button.previous::before {
    transform: translate(-50%, -50%) rotate(-135deg);
	left: 10px;
}
body.single-product .flickity-prev-next-button.next::before {
    transform: translate(-50%, -50%) rotate(45deg);
    right: 0px;
}
/* Dots Flickity */
body.single-product .flickity-page-dots {
    display: none;
}
body.single-product .wpb_wrapper:has(.ae-productgallery.flickity-enabled){
	padding-right: 5%;
}

/* Center product name across full page width (not narrowed to gallery) */
body.single-product h2.product_title {
    text-align: center;
}

.ae-relatedproductgallery__slide .block_title {
	text-align: left;
	margin-top: 0.5rem;
	font-size: 20px;
	color: #333;
	line-height:normal;
	flex: none;
	padding: 1% 3% 1% 1%;
	font-style: normal;
}
.ae-relatedprojectgallery__slide .block_title {
	text-align: left;
	margin-top: 0.5rem;
	font-size: 25px;
	color: #333;
	line-height:normal;
	flex: none;
	padding: 1% 3% 1% 0px;
	font-style: normal;
} 
.ae-relatedprojectgallery__slide span.location{
	font-size: 16px;
}
.ae-relatedproductgallery .relatedcarousel-arrow, 
.ae-relatedproductgallery .carousel-arrow,
.ae-relatedprojectgallery .relatedcarousel-arrow, 
.ae-relatedprojectgallery .carousel-arrow {
	position: absolute;
	top: 55%;
	transform: translateY(-50%);
	z-index: 10;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	border: none;
	background: rgba(234,79,47,0.8);
	background: transparent;
	color: #fff;
	cursor: pointer;
	transition: transform 0.3s ease, background 0.3s ease;
	padding: 0px;
}
.ae-relatedproductgallery .relatedcarousel-arrow:hover,
.ae-relatedproductgallery .carousel-arrow:hover,
.ae-relatedprojectgallery .relatedcarousel-arrow:hover,
.ae-relatedprojectgallery .carousel-arrow:hover {
	transform: translateY(-50%) scale(1.4);
}

.ae-relatedproductgallery .carousel-container,
.ae-relatedprojectgallery .carousel-container {
    transition: transform 0.4s ease;
}
.ae-relatedproductgallery__slide,
.ae-relatedprojectgallery__slide {
    flex: 0 0 25%;
    width: 25%;
    flex: 0 0 calc(25% - 10px);
    width: calc(25% - 10px);
    position: relative;    /* cuadrados */
    overflow: visible;
    padding: 7px;
}
/*
.ae-relatedproductgallery__slide:first-child,
.ae-relatedprojectgallery__slide:first-child{
	padding-left:3px !important;
}	
.ae-relatedproductgallery__slide:last-child,
.ae-relatedprojectgallery__slide:last-child{
	padding-right:3px !important;
}*/
.container_blockpostproject.ae-relatedprojectgallery .carousel-container {
    min-height: 38vw;
}
.ae-relatedproductgallery__slide{
    aspect-ratio: 1 / 1.15;         /* cuadrados */
}
.ae-relatedprojectgallery__slide {
    aspect-ratio: 2 / 3;         /* alargados */
}
.container_blockpostproject.ae-relatedprojectgallery .ae-relatedprojectgallery__slide {
    aspect-ratio: 2 / 3;         /* alargados */
    position: relative;
    float: left;
	padding-bottom: 3%;
}

.ae-relatedproductgallery__slide:last-child,
.ae-relatedprojectgallery__slide:last-child {
    margin-right: 0; 
}
.ae-relatedproductgallery__slide .project-img,
.ae-relatedprojectgallery__slide .project-img {
    width: 100%;
    height: 85%;
    background-size: cover;
    background-position: center;
}
.ae-relatedproductgallery .flickity-viewport,
.ae-relatedprojectgallery .flickity-viewport {
	width: 100%;
    min-height: 250px;   
	display: flex;
}
.ae-relatedproductgallery .flickity-slider,
.ae-relatedprojectgallery .flickity-slider {
	width: 100%;
    min-height: 250px;   
	display: flex;
}

.relatedcarousel-arrow--prev,
.carousel-arrow--prev {
	left: 0px;
	margin-left: 7px;
}
.relatedcarousel-arrow--next,
.carousel-arrow--next {
    right: 0px;
	margin-right: 4px;
}
.relatedcarousel-arrow--prev::before,
.carousel-arrow--prev::before {
    transform: translate(-50%, -50%) rotate(-135deg);
	left: 10px;
}
.relatedcarousel-arrow--next::before,
.carousel-arrow--next::before {
    transform: translate(-50%, -50%) rotate(45deg);
    right: 0px;
}
/*
.ae-relatedproductgallery__slide:first-child:nth-last-child(-n+4),
.ae-relatedproductgallery__slide:first-child:nth-last-child(-n+4) ~ .ae-relatedproductgallery__slide,
.ae-relatedprojectgallery__slide:first-child:nth-last-child(-n+4),
.ae-relatedprojectgallery__slide:first-child:nth-last-child(-n+4) ~ .ae-relatedprojectgallery__slide {
    position: relative;
    left: 0 ;
    transform: none !important;
	float: left;
    display: inline-block;
}*/

/* ********* */
/* Lightbox */
/* ********* */
body.single-product #lightbox {
    position: fixed;
    top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

body.single-product #lightbox img {
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 0 20px #000;
}

body.single-product #lightbox .close,
body.single-product #lightbox .lightbox-prev,
body.single-product #lightbox .lightbox-next {
    position: absolute;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    user-select: none;
}

body.single-product #lightbox .close { top: 20px; right: 30px; }
body.single-product #lightbox .lightbox-prev { left: 30px; top:50%; transform:translateY(-50%); }
body.single-product #lightbox .lightbox-next { right: 30px; top:50%; transform:translateY(-50%); }

/******************************************************/
/******************************************************/
/* RESPONSIVE */
@media (min-width: 1920px) {
	.materialgalleryContainer .slideShowContainer .imageHolder img{
		aspect-ratio: 1/1;
	}
	.materialgalleryContainer,
	.materialgalleryContainer .slideShowContainer,
	.materialgalleryContainer .slideShowContainer .imageHolder, {
		height: auto;
	}
}

@media (max-width: 1280px) {
	body.single-product .ae-productgallery .back-arrow{
		left: 0;
	}
	body.single-product .ae-productgallery .forward-arrow{
		left: 95%;
	}
}

@media (max-width: 1024px) {
	.ae-relatedproductgallery__slide,
	.ae-relatedprojectgallery__slide { 
		flex: 0 0 calc(50% - 6px); 
	} 
	body.single-product .ae-productgallery .back-arrow{
		left: 0;
	}
	body.single-product .ae-productgallery .forward-arrow{
		left: 95%;
	}
}

@media (min-width: 992px) {
  body.single-product .ae-productgallery__slide {
    flex: 0 0 100%; /* 3 imaxes visibles */
  }
  body.single-product .ae-productgallery {
    overflow-x: hidden;
  }
}

@media (max-width: 767px) {
	body.single-product .wpb_wrapper:has(.ae-productgallery){		
    	margin: auto;
	}
	body.single-product .ae-productgallery__slide {
		flex: 0 0 100%; 
	}
	body.single-product .ae-productgallery{
		max-width: 100%;
		margin-left: auto;
		display: block;
		margin-bottom: 10%;
	}
	body.single-product .gallery-dots {
		position: absolute;
		bottom: 7px;
		gap: 8px;
		z-index: 5;
		text-align: left; 
		top: 95%;
		pointer-events: auto;
		left: 0;
		right: 0;
		display: flex;
		justify-content: left; 
		align-items: left;
	}
	.ae-relatedproductgallery__slide,
	.ae-relatedprojectgallery__slide { 
		flex: 0 0 100%; 
		width: 100%;
	} 
	body.single-product .ae-productgallery .back-arrow{
		left: 0px;
	}
	body.single-product .ae-productgallery .forward-arrow{
		left: 95%;
	}
	.relatedcarousel-arrow--prev,
	.carousel-arrow--prev {
		margin-left: 0px;
	}
	.relatedcarousel-arrow--next,
	.carousel-arrow--next {
		margin-right: 0px;
	}
}

@media (max-width: 600px) {
	body.single-product .gallery-dots {
		left: 10%; 
		width: auto;
		top: 91%;
	}
	body.single-product .ae-productgallery_slide_div {
		max-height: 100%;
		height: 100%;
		margin-top: -7%;
	}
	body.single-product .ae-productgallery__slide.flickity-cell{
		height: 350px;
	}
}

@media (max-width: 500px) {
	body.single-product .ae-productgallery .back-arrow{
		left: 0px;
	}
	body.single-product .ae-productgallery .forward-arrow{
		left: 95%;
	}
}

@media (max-width: 475px) {
	body.single-product .gallery-dots {
		left: 0;
	}
	body.single-product ul.custom_values{
		margin-top: 3%;
	}
}

@media (max-width: 400px) {
	body.single-product .gallery-dots {
		left: 0;
	}
	body.single-product .ae-productgallery .forward-arrow{
		left: 95%;
	}
}