@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;600&display=swap');

/*
	
+---------+----------------------------+
| z-index |            item            |
+---------+----------------------------+
|       2 | #credits                   |
|       2 | #config_buttons            |
|       5 | #config_sidebar            |
|      10 | #logo_brand                |
|      10 | #titolo                    |
|      10 | #ar_model_viewer_container |
|      25 | .window                    |
|      50 | #intro_text                |
|     997 | #notifications             |
|     998 | .alertification            |
|     999 | #loader                    |
+---------+----------------------------+

+-------------+-------+---------+-------------------------------+
| background  | color | opacity |             item              |
+-------------+-------+---------+-------------------------------+
| white       | #333  |       1 | body                          |
| #dddddd     | _     |       1 | #configurator                 |
| 127,127,127 | _     |     0.1 | .closex                       |
| 0,0,0       | white |     0.5 | #loader                       |
| white       | #333  |       1 | #config_sidebar               |
| white       | _     |       1 | #config_sidebar .panel p span |
| #dddddd     | _     |       1 | #ar_model_viewer_container    |
+-------------+-------+---------+-------------------------------+

Screen sizes:	
iPad w1080
tablet w1024
smartphone w768
	
*/

:root {
	
	/* COLORS */
	--maincolor: #ff0000;
	--secondarycolor: #ffff00;
	--darkcolor: #333;
	--lightcolor: #eee;
	
	/* FONTS */
	--regularsize: 300;
	--boldsize: 600;
	
	/* APPEAL */
	--borderradius: 3px;

}

* {
	margin: 0;
	padding: 0;
	outline: 0;
	-webkit-box-sizing: border-box !important;
	    box-sizing: border-box !important;
	/*
	-webkit-touch-callout: none;
		-webkit-user-select: none;
			-khtml-user-select: none;
				-moz-user-select: none;
					-ms-user-select: none;
						user-select: none;
	*/
}

.clearfix:after {
	clear:both;
	content:".";
	display:block;
	height:0;
	line-height:0;
	visibility:hidden;
}

.hidden {
	display:none;
}

img {
	display:block;
	max-width:100%;
	max-height:100%;
	margin:auto;
}

html, body {
	height:100%;
	color: var(--darkcolor);
	font-family: 'Heebo', sans-serif;
	font-weight: 300;
	font-size: 16px;
	line-height: 1.25em;
}

@media (max-width: 768px) {

	html, body {
		font-size: 12px;
	}
	
}

#configurator, #config_graphics, #config_render, canvas {
	width: 100%;
	height: 100%;
	overflow: hidden;
	position: relative;
}

#configurator {
	background-color: var(--lightcolor);
	transition: background 1s ease;
}

#config_graphics {
	position:absolute;
	transition: all 1s ease;
	top:0;
	left:0;
}

#config_render {
	width:100vw;
	height: 100vh;
	position:absolute;
	top:50%;
	left:50%;
	transform: translate(-50%,-50%);
	cursor: grab;
}

@media (max-width: 1024px) {

	.configuring #config_graphics {
		height: 50%;
		top: 0%;
	}

}

@media (min-width: 1025px) {

	.configuring #config_graphics {
		width: 67%;
		right:33%;
	}

}

h1, h2, h3 {
	display:block;
	font-weight:600;
	margin:0 0 0.75em;
	flex-basis: 100%;
}

p {
	margin:0 0 0.5em;
}

b,strong {
	font-weight:600;
}

h1 {
	font-size: 1.6em;
}

h2 {
	font-size: 1.4em;
}

h3 {
	font-size: 1.2em;
}

a, .link {
	color: inherit;
	display:inline-block;
	cursor: pointer;
	text-decoration: underline;
}

.disabled {
	opacity: 0.25 !important;
	display: none !important;
}

.veil {
	position:relative;
}

.veil:after {
	content: '';
	display: block;
	background-color: rgba(0,0,0,0);
	top:0;
	right:0;
	bottom:0;
	left:0;
	position:absolute;
}

.button {
	cursor: pointer;
	/*text-transform: uppercase;*/
	display: inline-block;
	padding: 0.5em 1em;
	margin: 0.2em;
	background-color: rgba(127,127,127,0.1);
	border: solid 1px rgba(127,127,127,0.25);
	transition: all 0.25s ease;
	/*text-transform: uppercase;*/
	text-decoration: none;
	font-weight: 300;
	text-align: center;
	border-radius: var(--borderradius);
}

.button:hover {
	border: solid 1px rgba(127,127,127,0.5);
}

.button .button_text {
	margin-right: 0.5em;
}

input[type="text"], textarea, input {
	font: inherit;
	display: inline-block;
	padding: 0.5em 1em;
	margin: 0.2em;
	background-color: rgba(127,127,127,0.1);
	border: solid 1px rgba(127,127,127,0.25);
	transition: all 0.25s ease;
	font-weight: 300;
	border-radius: var(--borderradius);
}

input[type="text"]:focus, textarea:focus {
	border: solid 1px rgba(127,127,127,0.5);
}
	
/*
@media (max-width: 768px) {
	.button .button_text {
		display:none;
	}
}
*/

.toggle {
	display:block;
	position:relative;
	cursor: pointer;
	text-transform: uppercase;
	padding-left: 3em;
	margin: 0.2em;
}

.toggle:before {
	content: '';
	display: block;
	width: 2.2em;
	height: 1.2em;
	margin: 0 1em 0 0;
	background-color: rgba(127,127,127,0.1);
	border: solid 1px currentcolor;
	transition: all 0.25s ease;
	border-radius: calc(0.6em + 2px);
	position:absolute;
	top:50%;
	left:0;
	transform: translateY(-50%);
}

.toggle:after {
	content: '';
	display: block;
	width: 1em;
	height: 1em;
	background-color: currentcolor;
	opacity: 0.8;
	transition: all 0.25s ease;
	border-radius: 0.5em;
	position:absolute;
	top:50%;
	left: 0.2em;
	transform: translateY(-50%);
}

.toggle:hover:before {
	background-color: solid 1px rgba(127,127,127,0.25);
}

.toggle:hover:after {
	opacity: 1;
}

.toggle.active:before {
	background-color: rgba(127,127,127,0.5);
}
.toggle.active:after {
	left:calc( 2.2em - 1em );
	opacity: 1;
}

.closex, .closen {
	top:0;
	right:0;
	position:absolute;
	font-size:20px;
	line-height: 30px;
	width:30px;
	height:30px;
	text-align: center;
	vertical-align: middle;
	cursor: pointer;
	transition: all 0.25s ease;
	z-index: 1;
}

.closex:hover, .closen:hover {
	background-color: rgba(127,127,127,0.1);
}

.fas, .far, .fal, .fad, .fab {
	margin: 0 0.5em 0 0;
}

/******************************* OVERLAY INFO */

#logo_brand {
	position:absolute;
	top:2vh;
	left:2vh;
	z-index:10;

}

#logo_brand img {
	max-width:20vw;
	max-height:3vh;
}

@media (max-width: 768px) {

	#logo_brand img {
		max-width:40vw;
		max-height:3vh;
	}
}

#titolo {
	position:absolute;
	top:2vh;
	right:50%;
	z-index: 10;
	transform: translateX(50%);
	text-align: center;
	transition: all 1s ease;
	max-width:40vw;
}

@media (max-width: 768px) {

	#titolo {
		right:2vh;
		transform: translate(0,0);
		text-align: right;
		max-width:45vw;
		font-size: 12px;
	}

}

#credits {
	position:absolute;
	bottom:2px;
	right:1vh;
	z-index: 35;
	text-align: right;
	font-size: 12px;
	opacity:0.5;
	transition: all 0.25s ease;
	max-width:25vw;
	color: #FFFFFF;
}

#credits:hover {
	opacity:1;
}

@media (max-width: 768px) {

	#credits {
		display:none;
	}
	
}

#corner_info {
	position:absolute;
	top:2vh;
	right:2vh;
	z-index: 2;
	text-align: right;
	transition: all 0.25s ease;
	max-width:50vw;
}

/*
#intro_text {
	position:absolute;
	top:50%;
	left:50%;
	width:80%;
	max-width: 1024px;
	z-index: 50;
	transform: translate(-50%,-50%);
	text-align: center;
	font-size: 4vh;
	line-height: 1em;
	font-weight:600;
}
*/

#config_buttons {
	position:absolute;
	bottom:2vh;
	left:50%;
	transform: translateX(-50%);
	z-index: 2;
	text-align: center;
	 width: 80%;
	/*max-width: 80%;*/
	display:none;
}

#action_buttons {
	position:absolute;
	top:1em;
	right:1em;
	z-index: 2;
	text-align: right;
}

.configuring #panel_open {
	display:none;
}

/******************************* WINDOWS */

.window {
	display:none;
	position:absolute;
	top:50%;
	left:50%;
	padding:2vh;
	transform: translate(-50%,-50%);
	z-index: 25;
	text-align: center;
	background-color: #242424;
	color: #fff;
	box-shadow: 0px 0px 10px rgba(0,0,0,0.1);
	width: 50%;
	border-radius: var(--borderradius);
}

@media (max-width: 768px) {

	.window {
		width: 80%;
	}

}

.window.open {
	display:block;
}

/******************************* LOADER */

#loader {
	display:none;
	position: fixed;
	top:0;
	left:0;
	right:0;
	bottom:0;
	background-color: rgba(0,0,0,0.5);
	color:white;
	z-index: 999;
	text-align: center;
	cursor: wait;
}

/*#loader:before {*/
/*	content: '';*/
/*	position:absolute;*/
/*	top:50%;*/
/*	left:50%;*/
/*	width:10vh;*/
/*	height:10vh;*/
/*	transform: translate(-50%,-50%);*/
/*	background-image: url(images/sprite_loading.png);*/
/*	background-position: center center;*/
/*	background-repeat: no-repeat;*/
/*	background-size: contain;*/
/*	animation-name: rotate;*/
/*	animation-duration: 2s;*/
/*	animation-iteration-count: infinite;*/
/*	animation-timing-function: linear;*/
/*}*/

/*#loader #bytes {*/
/*	position:absolute;*/
/*	top:calc( 50% + 10vh );*/
/*	left:50%;*/
/*	width:50vw;*/
/*	transform: translate(-50%,-50%);*/
/*}*/

.loading #loader {
	display:block;
}
.loading-restore #loader {
	display:block;
}

@-webkit-keyframes rotate {
    from {
        -webkit-transform: translate(-50%,-50%) rotate(0deg);
    }
    to { 
        -webkit-transform: translate(-50%,-50%) rotate(360deg);
    }
}
/*

!* HTML: <div class="loader"></div> *!
#loader #bytes {
	position:absolute;
	top:calc( 50% );
	left:50%;
	width:5vw;
	transform: translate(-50%,-50%);
	!*height: 60px;*!
	aspect-ratio: 1;
	--c:no-repeat linear-gradient(#fff 0 0);
	background: var(--c), var(--c), var(--c), var(--c);
	background-size: 33.4% 33.4%;
	animation: l7 1.5s infinite linear;
}

!* HTML: <div class="loader"></div> *!

@keyframes l7 {
	0%,
	5%   {background-position:0 0,50% 0,0 50%,50% 50%}
	25%  {background-position:0 0,100% 0,0 100%,50% 50%}
	50%  {background-position:50% 0,100% 0,0 100%,0 50%}
	75%  {background-position:50% 0,100% 50%,0 100%,0 0}
	95%,
	100% {background-position:50% 0,50% 50%,0 50%,0 0}
}
*/

/* HTML: <div class="loader"></div> */
#loader #bytes  {
	--s: 30px;
	position:absolute;
		top:calc( 50%  );
		left:45%;
		width:50vw;
		transform: translate(-50%,-50%);
	--_d: calc(0.353*var(--s));
	width: calc(var(--s) + var(--_d));
	aspect-ratio: 1;
	display: grid;
}
#loader #bytes:before,
#loader #bytes:after {
	content: "";
	grid-area: 1/1;
	clip-path: polygon(var(--_d) 0,100% 0,100% calc(100% - var(--_d)),calc(100% - var(--_d)) 100%,0 100%,0 var(--_d));
	background:
			conic-gradient(from -90deg at calc(100% - var(--_d)) var(--_d),
			#fff 135deg,#666 0 270deg,#aaa 0);
	animation: l6 2s infinite;
}
#loader #bytes:after {
	animation-delay:-1s;
}
@keyframes l6{
	0%  {transform:translate(0,0)}
	25% {transform:translate(40px,0)}
	50% {transform:translate(40px,40px)}
	75% {transform:translate(0,40px)}
	100%{transform:translate(0,0)}
}



/******************************* SIDEBAR */

#config_sidebar_handle {
	position: absolute;
	bottom: 50%;
	right: 50%;
	width: 30px;
	height: 30px;
	background-color: white;
	color: #333;
	text-align: center;
	line-height: 32px;
	font-size: 20px;
	vertical-align: middle;
	transition: all 1s ease;
	z-index: 6;
	overflow: hidden;
	box-shadow: 0px 0px 10px rgba(0,0,0,0.1);
	border-radius: 15px;
	transform: translate(50%,-50%)
}

#config_sidebar_handle:hover {
	transform: translate(50%,-50%) scale(120%);
}

body:not(.configuring) #config_sidebar_handle .fa-minus {
	display:none;
}

.configuring #config_sidebar_handle .fa-plus {
	display:none;
}

@media (max-width: 1024px) {

	#config_sidebar_handle {
		bottom: calc( 15px);
	}
	.configuring #config_sidebar_handle {
		bottom: 60%;
	}

}
@media (min-width: 1025px) {

	#config_sidebar_handle {
		right:  calc(2vh + 15px);
	}
	.configuring #config_sidebar_handle {
		right: 33%;
	}
	
}

#config_sidebar {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 100%;
	height: 100%;
	background-color: white;
	color: #333;
	text-align: left;
	transition: all 1s ease;
	z-index: 5;
	overflow: hidden;
	opacity: 0;
	box-shadow: 0px 0px 10px rgba(0,0,0,0.1);	
	display: flex;
	flex-direction: column;
}

.configuring #config_sidebar {
	transform: none;
	opacity: 1;
}

@media (max-width: 1024px) {

	#config_sidebar {
		transform: translateY(100%);
		height: 50%;
	}

}
@media (min-width: 1025px) {

	#config_sidebar {
		transform: translateX(100%);
		width: 33%;
	}
	
}

.scroll {
	overflow-y: scroll;
	height:100%;
 	margin-right:-17px;
}

.panel,
.fixed_panel {
	/*padding:2vh;*/
	padding:1vh 2vh;
	/*border-bottom: solid 1px rgba(127,127,127,0.25);*/
}

/*
body.isIframe:not(.fullscreen) .panel,
body.isIframe:not(.fullscreen) .fixed_panel {
	padding-left:0;
}
*/

.panel:last-child,
.fixed_panel:last-child {
	border-bottom: none;
}

.panel {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	align-content: flex-start;
}

.panel h2 {
	display: block;
	margin:0 0 10px 0;
	flex-basis: 100%;
}

.subtitle {
	position: relative;
	cursor: pointer;
	margin: 0.5em 0;
}

.subtitle:before {
	display:inline-block;
	content: '‣';
	margin-right:10px;
	transition: all 0.5s ease;
	opacity: 0.8;
}

.subtitle:hover:before {
	opacity: 1;
}

.subtitle.selected:before {
	transform: rotate(90deg);
}

.subtitle + .subpanel {
	display:none;

	background-color: rgba(127, 127, 127, 0.3);

}

.subtitle.selected ~ .subpanel {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	align-content: flex-start;
	width: calc(100% + 4vh);
	margin: 0 -2vh 1em;
	padding: 2vh 2vh calc(2vh - 0.5em);
}

.subtitle.selected ~.subpanel:last-child {
	margin-bottom:-2vh;
}

.item {
	display: block;
	cursor: pointer;
	text-align: center;
	flex-basis: 50%;
	width: 50%;
	padding:0.5em;
	transition: all 0.25s ease;
	opacity: 0.8;
}

.item:hover {
	opacity: 1;
}

.item.selected {
	opacity: 1;
	font-weight: 600;
	border: 1px solid;
}

.item span {
	display: block;
	width:100%;
	/*padding-bottom:100%;*/
	transition: all 0.25s ease;
	aspect-ratio: 1;
	/*border:solid 1px black;*/
	/*border-radius: 50%;*/
	/*border: solid 1px rgba(127,127,127,0.2);*/
	/*background-color: white;*/
	background-position: center center;
	background-size: contain;
	background-repeat: no-repeat;
	margin: 0 auto 5px;


}

/* item list */

.items_list .item {
	flex-basis: 250px;
	width:250px;
	text-align: left;
}

.items_list .item span {
	display: inline-block;
	width:75px;
	height:75px;
	padding:0;
	margin: 0 10px 0 0;
	vertical-align: middle;
}

	/* in tablet tutti i toggle hanno span più piccolino */
	 
	@media (max-width: 1080px) {

		.items_list .item span {
			width:50px;
			height:50px;
		}
	
	}

	@media (max-width: 768px) {
	
		.items_list .item {
			flex-basis: 50%;
			width: 50%;
			text-align: left;
		}
	
	}

/* item thumbs */

.items_thumb .item {
	flex-basis: 75px;
	width: 75px;
	width: 100%;
}

	/* in tablet tutti i toggle hanno span più piccolino */

	@media (max-width: 768px) {
	
		items_thumb .item {
			flex-basis: 50px;
			width: 50px;
		}
	
	}

/******************************* EDITOR */

#panel_editor {
	padding:0 !important;
}

#panel_credits {
	font-size: 10px;
}

/******************************* GOOGLE MODEL VIEWER */

#ar_model_viewer_container {
	position:fixed;
	top:0;
	left:0;
	right:0;
	bottom:0;
	background-color: #dddddd;
	z-index: 10;
}

model-viewer {
	width:100%;
	height:100%;
}

/******************************* NOTIFICATIONS & ALTERTIFICATIONS */

#notifications {
	position:absolute;
	bottom: 1vh;
	right: 1vh;
	z-index: 997;
	max-width: 33vw;
	max-height: 33vh;
	overflow: auto;
}

@media (max-width: 767px) {

	#notifications {
		max-width:66vw;
	}

}

.notification {
	position:relative;
	background-color: white;
	padding:1em 2em;
	margin:0.5em 0 0;
	box-shadow: 0px 0px 5px rgba(0,0,0,0.2);
	border-radius: var(--borderradius);
}
