@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

.autocomplete-container {
	position: relative;
}

.address-autocomplete {
	position: absolute;
	top: 100%;
	left: 0;
	width: 100%;
	z-index: 3;
	background: #fff;
	padding: 12px 0 8px;
	border: 1px solid var(--color-gray);
	border-radius: 5px;
	overflow: hidden;
	margin-top: 5px;
	display: none;

	&::before {
		content: 'Suggestions';
		text-transform: uppercase;
		font-size: 11px;
		margin: 0 0 5px 20px;
		display: block;
	}
}

.autocomplete-container:focus-within .address-autocomplete {
	display: block;
}

.address-button {
	padding: 0.8em 20px;
	font-size: 14px;
	cursor: pointer;
	display: block;
	text-align: left;
	width: 100%;

	&:hover {
		background: var(--color-light-gray);
	}
}

.show-password-input {
	width: 5rem;
	height: 100%;
	position: absolute;
	top: 0;
	right: 0;
	border-radius: 0 2rem 2rem 0;
	background: url("../img/icon-eye.svg") no-repeat center / 20px 12px;
}

.show-password-input.display-password::before {
	content: '';
	width: 2.5rem;
	position: absolute;
	top: 50%;
	left: 50%;
	translate: -50% -50%;
	border-top: 2px solid #697077;
	rotate: -40deg;
}

.cart-preview {
	position: absolute;
	top: 100%;
	background: #fff;
	padding: 8px 20px 25px;
	text-align: center;
	width: 390px;
	border-radius: 5px;
	right: 0;
	box-shadow: 0 0 34px #00000026;
	text-wrap: balance;
}

.cart-preview__contents {
	max-height: 90vh;
	overflow: auto;
}

.cart-preview__heading {
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 14px;
}

.close-icon {
	position: relative;
	width: 44px;
	height: 44px;
	text-indent: -300px;
	overflow: hidden;
	background: transparent;
	padding: 0;
	border: 0;
	margin-right: -15px;
	
	&::before,
	&::after {
		content: '';
		width: 3px;
		height: 20px;
		position: absolute;
		top: 50%;
		left: 50%;
		display: block;
		background: var(--color-accent);
		border-radius: 5px;
		transform: translate(-50%, -50%) rotate(45deg);
		transition: background 0.2s;
	}

	&::after {
		transform: translate(-50%, -50%) rotate(-45deg);
	}

	&:hover::before,
	&:hover::after {
		background: var(--color-accent-darker);
	}
}

.cart-preview__products {
	list-style-type: none;
	display: flex;
	flex-direction: column;
	margin: 10px 0 20px;
	gap: 10px;
	padding: 0;

	li {
		display: grid;
		grid-template-columns: 42px 1fr auto;
		align-items: center;
		text-align: left;
		gap: 10px;
		font-size: 14px;
		max-width: 100%;
	}

	strong {
		font-size: 16px;
	}

	a {
		color: inherit;
		text-decoration: none;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		min-width: 0;
	}
}

li:not(.cart-preview__child-product) + .cart-preview__child-product {
	margin-top: -10px;
}

.cart-preview__footer {
	display: flex;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
}

.cart-preview__footer .button {
	height: 3.6rem;
	font-size: 1.6rem;
	min-width: 0;
}

.cart-preview__totals {
	display: grid;
	grid-template-columns: 1fr auto;
	text-align: left;
	margin-bottom: 20px;

	dt {
		padding-left: 52px;
		font-size: 14px;
	}

	dd {
		font-weight: 600;
		font-size: 16px;
	}
}

.cart-preview__products img {
	width: 100%;
	height: auto;
}

@media (hover:hover) {
	.header-cart__summary:hover {
		color: var(--color-accent);
	}

	a:hover {
		text-decoration: none;
		color: var(--color-accent-darker);
	}

	.button:hover {
		--button-color: var(--color-accent-darker);
		color: #fff;
	}

	.button--outline:hover {
		color: var(--color-accent-darker);
	}
}

@media (hover:none) {
	.header-cart__summary:active {
		color: var(--color-accent);
	}

	a:active {
		text-decoration: none;
		color: var(--color-accent-darker);
	}

	.button:active {
		--button-color: var(--color-accent-darker);
		color: #fff;
	}

	.button--outline:active {
		color: var(--color-accent-darker);
	}
}

.menu-item-has-children {
	position: relative;
}
@media (min-width: 901px) {
	.sub-menu {
		position: absolute;
		top: 100%;
		left: 1.5rem;
		background: #fff;
		border-radius: 1rem;
		box-shadow: 0 0 2.5rem #0000002B;
		padding: 2rem;
		flex-direction: column;
		gap: 1rem;
		line-height: 1.5em;
		min-width: 15.5rem;
		z-index: 10;
		
		a ~ & {
			min-width: 25.5rem;
		}

		&::before {
			content: '';
			position: absolute;
			top: -28px;
			border-style: solid;
			border-width: 15px 20px;
			border-color: transparent transparent #fff;
			left: 20px;
		}

		a {
			padding: 0;
		}
	}

	.menu-item:hover > .sub-menu {
		display: flex;
	}
}