.countdown-box {
	text-align: center;

	.box-time {
		padding: 0 13px;
		display: inline-block;
		position: relative;

		.box-count {
			min-width: 80px;
			height: 70px;
			display: inline-block;
			vertical-align: middle;
			display: inline-block;
			letter-spacing: -0.03em;
			font-weight: 600;
			font-size: 28px;
			line-height: 94px;
			font-family: $font_titles;
			text-align: center;
			color: $color_dark;
		}

		.box-label {
			display: block;
			text-align: center;
			margin-top: 0;
		}
	}
}

.countdown-classic {
	.box-time {
		font-size: 45px;

		// Dots
		&:after, &:before {
			content: '.';
			color: $color_dark;
			display: block;
			width: 6px;
			height: 7px;
			border-left: none;
			border-right: none;
			border-radius: 1px;
			position: absolute;
			margin-top: -1.08em;
			top: 50%;
			left: -0.13em;
			font-size: 130%;
		}

		&:before {
			margin-top: -0.80em;
		}

		&:first-child {
			&:after, &:before {
				display: none;
			}
		}

		.box-count {
			min-width: 1em;
			height: 1em;
			line-height: 1;
			font-size: inherit;
		}

		.box-label {
			display: none;
		}
	}
}

.countdown-boxed {
	text-align: center;

	// Hidde dots
	.box-time {
		&:after, &:before {
			display: none;
		}
	}

	.box-time .box-count {
		min-width: 80px;
		height: 80px;
		line-height: 83px;
		font-size: 28px;
		color: #fff;
	}
	
	.box-count {
		background: #454545;
		position: relative;
		perspective: 300px;

		.box-current,
		.box-next {
			background: #ffffff;
			position: absolute;
			outline: 1px solid transparent;
			top: 0px;
			left: 0;
			z-index: 1;
		}

		.box-current.box-top,
		.box-next.box-bottom {
			transform-origin: 50% 100%;
			transition: none;
			transform: rotateX(0deg);
			backface-visibility: hidden;
			z-index: 2;
		}

		.box-current.box-top {
			z-index: 3;
		}

		.box-next.box-bottom {
			transform-origin: 50% 0%;
			transform: rotateX(180deg);
		}

		.box-top {
			background: inherit;

			&:after {
				content: '';
				background: rgba(0,0,0,.15);
				width: 100%;
				height: 100%;
				position: absolute;
				top: 0;
				left: 0;
			}
		}

		.box-bottom {
			background: inherit;
		}

		.box-top,
		.box-bottom {
			width: 100%;
			height: 50%;
			overflow: hidden;
		}

		.box-bottom {
			height: 50%;
			border-top: none;
			line-height: 3px;
			top: 50%;
			margin-top: 0px;
		}

		.number {
			position: relative;
			z-index: 4;
		}
	}

	.box-time {
		&:after {
			margin-top: -32px;
		}

		.box-label {
			margin-top: 15px;
		}

		@media screen and (max-width: 768px) {
			&:after {
				margin-top: -28px;
			}
		}
	}

	.flip {
		.box-current.box-top {
			transition: transform .5s ease-in-out;
			transform: rotateX(-180deg);
		}

		.box-next.box-bottom {
			transition: transform .5s ease-in-out;
			transform: rotateX(0);
		}
	}


	&.rounded {
		.box-count {
			border-radius: 5px;
		}

		.box-top {
			border-radius: 5px 5px 0 0;
		}

		.box-bottom {
			border-radius: 0 0 5px 5px;
		}
	}
}

@media screen and (max-width: 768px){
	.countdown-box,
	.countdown-boxed {
		.box-time {
			.box-count {
				min-width: 50px;
				height: 50px;
				line-height: 54px;
				font-size: 20px;
			}
		}
	}

	.countdown-box .box-time {
		padding: 0 5px;
	}

	.countdown-classic {
		.box-time {
			&:after, &:before {
				width: 5px;
				height: 5px;
			}

			.box-count {
				min-width: 10px;
				font-size: 30px;
			}
		}
	}
}