@import url("fonts/fonts.css");

:root {
	--primary-color: #009fe3;
	--secondary-color: #007bb3;
	--background-color: #ffffff;
	--text-color: #464b46;
}

/* CSS Reset */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	line-height: 1;
}

html,
body {
	font-family: Borna, sans-serif;
	height: 100%;
	line-height: 1;
	display: flex;
	flex-direction: column;
}

ul,
ol {
	list-style: none;
}

a {
	text-decoration: none;
	color: inherit;
}

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

button,
input,
textarea,
select {
	font: inherit;
	border: none;
	outline: none;
	appearance: none;
}

table {
	border-collapse: collapse;
	border-spacing: 0;
}

/* Header */

header {
	padding: 0 20px 0 10px;
}

header:has(.menu-toggle.active) h1 {
	display: none;
}

/* Menú */

nav {
	flex: 1;
}

.menu {
	display: flex;
	flex-direction: row;
	justify-content: space-around;
	align-items: center;
	transition: right 0.3s ease;
	z-index: 1000;
	padding: 20px 20px 20px 0;
	max-width: 400px;
}

.menu.hidden {
	display: none;
}

.menu ul {
	display: flex;
	flex-direction: row;
	gap: 30px;
}

.menu li a {
	display: block;
	font-size: 1rem;
	padding: 10px;
	transition: color 0.3s ease;
	text-wrap: balance;
}

.menu li a:hover {
	color: var(--secondary-color);
}

.index .menu_home a,
.serveis .menu_serveis a,
.contacte .menu_contacte a {
	text-decoration: underline;
	text-underline-offset: 0.2em;
	text-decoration-color: var(--primary-color);
}

.index .menu_home a {
	text-underline-offset: 0.1em;
}

.menu-toggle {
	display: flex;
	flex-direction: column;
	cursor: pointer;
	width: 32px;
	height: 26px;
	justify-content: space-between;
	z-index: 1001;
	background-color: transparent;
}

.menu-toggle span {
	display: block;
	width: 32px;
	height: 4px;
	background-color: var(--primary-color);
	transition: all 0.3s ease;
	transform-origin: center;
}

.menu-toggle.active span:nth-child(1) {
	transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
	opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
	transform: rotate(-45deg) translate(8px, -8px);
}

/* Logo + menú */

header {
	background-color: #fff;
	padding: 0 20px;
	height: 82px;
	order: 2;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

h1 {
	background: url(img/logo_bugatex.svg) no-repeat center;
	background-size: contain;
	width: 160px;
	height: 45px;
	text-indent: -9999em;
	margin-right: auto;
}

h1 a {
	display: block;
	height: 100%;
}

/* Main */

main {
	height: calc(100dvh - 82px);
	flex: 1;
	order: 1;
	display: grid;
	grid-template-columns: 1fr;
	grid-template-rows: 1fr;
	justify-content: center;
	align-items: center;
}

.cuereta_animacio {
	position: absolute;
	bottom: 68px;
	right: 10%;
	width: 200px;
	height: auto;
	z-index: 10;
}

/* Carousel */

.carousel-container {
	grid-column: 1 / 2;
	grid-row: 1 / 2;
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.carousel-slides {
	position: relative;
	width: 100%;
	height: 100%;
}

.carousel-slide {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	transition: opacity 0.5s ease-in-out;
	pointer-events: none;
	display: grid;
	grid-template-columns: 1fr;
	grid-template-rows: 1fr;
	justify-content: center;
	align-items: center;
}

.carousel-slide.active {
	opacity: 1;
	pointer-events: auto;
}

.carousel-slide img,
.carousel-slide video {
	width: 100%;
	height: calc(100dvh - 82px);
	object-fit: cover;
	grid-column: 1 / 2;
	grid-row: 1 / 2;
	z-index: 1;
}

.carousel-text {
	grid-column: 1 / 2;
	grid-row: 1 / 2;
	align-self: center;
	justify-self: center;
	text-align: center;
	color: var(--primary-color);
	padding: 20px;
	max-width: 90%;
	z-index: 2;
}

.carousel-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background-color: transparent;
	color: #000;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100;
	transition: all 0.3s ease;
	width: clamp(20px, 3vw, 60px);
	height: clamp(21.3px, 3.2vw, 64px);
}

.carousel-arrow:hover {
	transform: translateY(-50%);
}

.carousel-arrow-left {
	left: clamp(10px, 3vw, 30px);
	background: url(img/arrow_left_mobile.svg) no-repeat center;
	background-size: contain;
}

.carousel-arrow-right {
	right: clamp(10px, 3vw, 30px);
	background: url(img/arrow_right_mobile.svg) no-repeat center;
	background-size: contain;
}

.carousel-arrow svg {
	object-fit: contain;
}

/* Video play overlay button */

.carousel-video {
	position: relative;
	z-index: 1;
}
.video-play-overlay {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 100;
	background-color: rgba(0, 159, 227, 0.8);
	border: none;
	border-radius: 50%;
	width: 100px;
	height: 100px;
	display: none;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.video-play-overlay:hover {
	background-color: rgba(0, 159, 227, 1);
	transform: translate(-50%, -50%) scale(1.1);
}

.video-play-overlay.show {
	display: flex;
}

.video-play-overlay svg {
	margin-left: 5px;
}

/* Mides tipografia  */

.carousel-text {
	text-wrap: balance;
}

.carousel-text h2 {
	font-size: 3rem;
	margin-bottom: 1rem;
	font-weight: 500;
}

.blau .carousel-text h2 {
	font-size: clamp(48px, 11vw, 224px);
	line-height: 1;
}

.cuereta .carousel-text p {
	font-size: clamp(32px, 4vw, 100px);
	color: #fff;
	text-shadow: 0 0 0.15em rgba(0, 123, 179, 0.5);
}

.page-serveis .carousel-text p {
	font-size: clamp(32px, 5vw, 100px);
	color: var(--text-color);
	font-weight: 600;
	margin-bottom: 0.5em;
	text-wrap: balance;
}

.page-contacte .carousel-text {
	display: flex;
	flex-direction: column;
	align-items: end;
}

.page-contacte p.telefon {
	font-size: clamp(32px, 9vw, 165px);
	color: var(--primary-color);
	font-weight: 700;
	letter-spacing: 0.025em;
}

.page-contacte p.whatsapp {
	font-size: clamp(23px, 3.5vw, 50px);
	color: var(--text-color);
	font-weight: 700;
	margin-top: 6px;
	letter-spacing: 0.025em;
	padding-right: 6px;
}

.page-contacte p.whatsapp svg {
	width: clamp(28.8px, 4.2vw, 90px);
	height: auto;
}

.page-contacte p.whatsapp a {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: end;
	gap: 16px;
}

/* Responsive  */
@media (min-width: 650px) {
	header {
		gap: 40px;
	}
	header:has(.menu-toggle.active) h1 {
		display: block;
	}

	.carousel-text {
		padding: 20px 40px;
	}

	.menu {
		padding: 0;
		gap: 15px;
	}
}

@media (min-width: 768px) {
	header {
		padding: 0 38px 0 38px;
		height: 95px;
	}

	h1 {
		width: 220px;
		height: 62px;
	}

	.menu {
		max-width: none;
		justify-content: end;
	}

	main,
	.carousel-slide img,
	.page-content > img,
	.carousel-slide video {
		height: calc(100dvh - 95px);
	}

	.cuereta_animacio {
		bottom: 73px;
		width: 300px;
		opacity: 1;
		transition: opacity 0.3s ease;
	}

	.page-video .cuereta_animacio {
		opacity: 0;
		transition: opacity 0.3s ease;
	}

	.page-contacte p.whatsapp a {
		gap: 26px;
	}

	/* Carousel */

	.carousel-arrow-left {
		background: url(img/arrow_left.svg) no-repeat center;
		background-size: contain;
	}

	.carousel-arrow-right {
		background: url(img/arrow_right.svg) no-repeat center;
		background-size: contain;
	}

	/* Menú */

	.menu-toggle {
		width: 38px;
		height: 31px;
	}

	.menu-toggle span {
		width: 38px;
		height: 5px;
	}

	.menu-toggle.active span:nth-child(1) {
		transform: rotate(45deg) translate(9px, 9px);
	}

	.menu-toggle.active span:nth-child(3) {
		transform: rotate(-45deg) translate(9px, -9px);
	}
}

@media (min-width: 1024px) {
	main,
	.carousel-slide img,
	.page-content > img,
	.carousel-slide video {
		height: calc(100dvh - 110px);
	}

	h1 {
		width: 280px;
		height: 77px;
	}

	header {
		padding: 0 70px;
		height: 110px;
	}

	.cuereta_animacio {
		bottom: 88px;
	}

	.page-contacte p.whatsapp {
		padding-right: 20px;
	}

	/* Menú */

	.menu {
		gap: 30px;
		padding-right: 45px;
	}

	.menu li a {
		font-size: 1.25rem;
	}

	.menu-toggle {
		width: 44px;
		height: 36px;
	}

	.menu-toggle span {
		width: 44px;
		height: 6px;
	}

	.menu-toggle.active span:nth-child(1) {
		transform: rotate(45deg) translate(11px, 11px);
	}

	.menu-toggle.active span:nth-child(3) {
		transform: rotate(-45deg) translate(10px, -10px);
	}
}

@media (min-width: 1250px) {
	header {
		padding-right: 95px;
	}

	/* Menú */

	.menu {
		gap: 40px;
		padding-right: 35px;
	}

	.menu li a {
		font-size: 1.5rem;
		font-weight: 500;
		letter-spacing: 0.025em;
	}

	.menu-toggle {
		width: 51px;
		height: 41px;
	}

	.menu-toggle span {
		width: 51px;
		height: 7px;
	}

	.menu-toggle.active span:nth-child(1) {
		transform: rotate(45deg) translate(12px, 12px);
	}

	.menu-toggle.active span:nth-child(3) {
		transform: rotate(-45deg) translate(12px, -12px);
	}
}
