/*--------Media query 420px--------*/
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html {
	font-size: 62.5%;
	font-family: "Source Sans 3", serif;
}

body {
	background-color: #4bb4af48;
	width: 100vw;
	height: 100%;
	max-width: 100%;
}

/*------------------HEADER-------------------*/
header {
	height: 8rem;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	padding: 1rem;
	gap: 2rem;
	background-color: #40a19c8c;
}

h1 {
	margin: 0;
	grid-column: 2;
	font-size: 3rem;
	font-family: "Lexend Deca", serif;
	grid-row: 1;
	z-index: 1;
}

nav {
	grid-column: 1 / -1;
	grid-row: 1;
}

nav ul {
	display: flex;
	justify-content: space-between;
	list-style: none;
	margin: 0;
	padding: 0 1rem;
}

a {
	text-decoration: none;
	color: black;
	font-size: 1.8rem;
}

svg:active {
	fill: white;
}

/*--------------------MAIN-------------------*/
main {
	width: 90%;
	height: 100%;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
}

.busqueda-container {
	width: 100%;
	margin: 2rem auto;
	position: relative;
}

#buscador {
	width: 100%;
	padding: 10px 15px;
	border: 1px solid #ccc;
	border-radius: 20px;
	font-size: 16px;
	font-family: "Source Sans 3", serif;
}

#buscador:focus {
	outline: none;
	box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.resultados-busqueda {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: white;
	border: 1px solid #ccc;
	border-radius: 4px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	margin-top: 5px;
	max-height: 300px;
	overflow-y: auto;
	z-index: 1;
	font-size: 1.7rem;
}

.resultado-item {
	padding: 10px 15px;
	cursor: pointer;
}

.resultado-item:hover {
	background-color: #f5f5f5;
}

/*-------------------DROPDOWN-----------------*/
.dropdown {
	position: relative;
	display: inline-block;
	width: 100%;
	border-top: 1px solid grey;
}

.dropdown:last-of-type {
	border-bottom: 1px solid grey;
}

.dropdown-btn {
	width: 100%;
	padding: 1.5rem;
	text-align: left;
	background-color: transparent;
	border: none;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-family: "Source Sans 3", serif;
	font-size: 1.9rem;
}

.dropdown-content {
	display: none;
	position: absolute;
	background-color: white;
	border: 1px solid #ccc;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	z-index: 1;
	width: 100%;
	padding: 2rem;
	max-height: 300px;
	overflow: auto;
	transition: all 0.5s ease;
}

.dropdown.active .dropdown-content {
	display: block;
}

.dropdown-content label {
	display: flex;
	justify-content: space-between;
	margin-bottom: 5px;
	padding: 1rem;
	border-bottom: 1px solid rgb(212, 212, 212);
	font-size: 1.8rem;
}

.dropdown-content input[type="checkbox"] {
	margin-right: 10px;
	width: 1.6rem;
}

#generar-lista, .borrar-lista, .lista-nueva, #añadir-productos {
	width: 20rem;
	padding: 1rem;
	margin: 0 auto;
	background-color: #7acee760;
	font-size: 1.7rem;
	font-family: "Source Sans 3", serif;
	border: 1px solid rgb(180, 180, 180);
	border-radius: 3rem;
	margin-bottom: 2rem;
	margin-top: 1rem;
	text-align: center;
}

#generar-lista:active {
	background-color: #2d5e6da2;
}

.div-hacer-lista, .div-borrar-lista {
	width: 90%;
	margin: 2rem auto;
	display: flex;
	align-items: center;
	flex-direction: column;
}

/* --------PÁGINA DE PRODUCTOS SELECCIONADOS (LISTA)------ */
h2 {
	font-size: 2.2rem;
	font-weight: 200;
	margin: 1rem 0;
	padding: 1rem;
	background-color: rgba(144, 238, 144, 0.541);
}

a.lista-nueva {
	display: block;
	margin: 0 auto;
	margin-bottom: 1rem;
	width: auto;
	padding: 1rem 3rem;
}

.productos-seleccionados {
	width: 100%;
	height: 100%;
}

.lista-productos li {
	width: 100%;
	padding: 1.5rem;
	text-align: left;
	background-color: transparent;
	border: none;
	font-family: "Source Sans 3", serif;
	font-size: 1.9rem;
	list-style-type: none;
	border-top: 1px solid grey;
}

.lista-productos li:last-child {
	border-bottom: 1px solid grey;
}

/*----------------TACHAR PRODUCTOS-----------------*/
.producto-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 0;
	transition: background-color 0.2s;
}

.producto-item input[type="checkbox"] {
	cursor: pointer;
	width: 18px;
	height: 18px;
	margin: 0;
}

.producto-item span {
	font-size: 18px;
	transition: all 0.3s ease;
}

.producto-item span.tachado {
	text-decoration: line-through;
	color: #888;
}

/*-----------------MEDIA QUERY-------------------*/

@media (min-width: 1024px) {
	body {
		width: 100vw;
		height: 100%;
		max-width: 100rem;
		margin: 0 auto;
	}
	.div-borrar-lista, .div-hacer-lista {
		width: 80%;
		margin: 2rem auto;
		display: flex;
		flex-direction: row;
		justify-content: center;
	}

	.lista-nueva {
		width: auto;
		height: auto;
		margin-top: 1rem;
	}
}
