/* Globals */
:root {
	--white: #ffffff;
	--black: #000000;
	--very-light-pink: #c7c7c7;
	--text-input-field: #f7f7f7;
	--hospital-green: #acd9b2;
	--sm: 14rem;
	--md: 16rem;
	--lg: 18rem;
	--md-height: 60px;
	--lg-height: 100px;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	font-size: 6.25%;
}

body {
	width: 100%;
	min-width: 320px;
	height: auto;
	font-family: 'Quicksand', sans-serif;
	font-size: var(--md);
}

/* Navbar */
nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-width: fit-content;
	height: var(--md-height);
	padding: 0 24px;
	position: fixed;
	top: 0;
	background-color: var(--white);
	border-bottom: 1px solid var(--very-light-pink);
	z-index: 1;
}

.mobile-menu-icon {
	display: none;
	width: 25px;
	cursor: pointer;
}

.navbar__logo {
	width: 100px;
}

.navbar__left-section {
	display: flex;
	gap: 12px;
}

.navbar__left-section ul,
.navbar__right-section ul {
	list-style-type: none;
	display: flex;
	align-items: center;
}

.navbar__right-section ul {
	gap: 12px;
}

.navbar__left-section a,
.navbar__right-section a {
	text-decoration: none;
	color: var(--very-light-pink);
	padding: 8px;
}

.navbar__left-section a:hover,
.navbar__right-section a:hover {
	border: 1px solid var(--hospital-green);
	color: var(--hospital-green);
	border-radius: 8px;
}

.navbar__email {
	max-width: 150px;
	padding: 5px;
	color: var(--very-light-pink);
	font-size: var(--sm);
	overflow-wrap: break-word;
	cursor: pointer;
}

.navbar__email:hover {
	color: var(--hospital-green);
	border: 1px solid var(--hospital-green);
	border-radius: 8px;
}

.navbar__shopping-cart {
	position: relative;
	cursor: pointer;
}

.navbar__shopping-cart div {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 16px;
	height: 16px;
	position: absolute;
	top: -6px;
	right: -3px;
	font-size: calc(var(--sm) - 2rem);
	font-weight: bold;
	background-color: var(--hospital-green);
	border-radius: 50%;
}

/* Desktop menu */
.desktop-menu {
	min-width: 150px;
	max-width: 200px;
	height: auto;
	padding: 20px;
	position: absolute;
	top: var(--md-height);
	right: 60px;
	background-color: var(--white);
	border: 1px solid var(--very-light-pink);
	border-radius: 6px;
	z-index: 1;
}

.desktop-menu ul {
	display: flex;
	flex-direction: column;
	gap: 20px;
	list-style: none;
}

.desktop-menu li {
	text-align: end;
}

.desktop-menu li:nth-child(1),
.desktop-menu li:nth-child(2) {
	font-weight: bold;
}

.desktop-menu li:last-child {
	padding-top: 20px;
	border-top: 1px solid var(--very-light-pink);
}

.desktop-menu a {
	color: var(--black);
	text-decoration: none;
}

.desktop-menu li:last-child a {
	color: var(--hospital-green);
	font-size: var(--sm);
}

/* Mobile menu */
.mobile-menu {
	display: grid;
	grid-template-rows: auto auto 1fr;
	gap: 24px;
	width: 38vw;
	min-width: 240px;
	max-width: 280px;
	height: calc(100vh - var(--md-height));
	padding: 24px;
	position: absolute;
	top: var(--md-height);
	left: 0;
	background-color: var(--white);
	border: 1px solid var(--very-light-pink);
	border-radius: 0 8px 8px 0;
	z-index: 1;
}

.mobile-menu ul {
	display: flex;
	flex-direction: column;
	gap: 16px;
	list-style: none;
}

.mobile-menu ul:first-child {
	padding-bottom: 24px;
	border-bottom: 1px solid var(--very-light-pink);
}

.mobile-menu a {
	display: inline-block;
	width: 100%;
	padding: 4px 0;
	text-decoration: none;
	color: var(--black);
	font-weight: 500;
}

.mobile-menu .mobile-menu__title {
	font-weight: 700;
}

.mobile-menu .mobile-menu__email {
	font-size: var(--sm);
	font-weight: 300;
}

.mobile-menu .mobile-menu__sign-out {
	font-size: var(--sm);
	color: var(--hospital-green);
}

main {
	margin-top: var(--md-height);
}

/* Shopping cart */
.shopping-cart {
	display: grid;
	grid-template-rows: auto 1fr auto;
	gap: 16px;
	width: 35vw;
	min-width: 340px;
	max-width: 420px;
	height: calc(100vh - var(--md-height));
	padding: 16px;
	position: fixed;
	right: 0;
	background-color: var(--white);
	border: 1px solid var(--very-light-pink);
	border-radius: 8px 0 0 8px;
	z-index: 1;
}

.shopping-cart__title-container {
	display: flex;
	align-items: center;
	gap: 8px;
}

.shopping-cart__close-icon {
	display: flex;
	padding: 6px 8px;
	cursor: pointer;
}

.shopping-cart__close-icon img {
	width: 10px;
	transform: rotate(180deg);
}

.shopping-cart__title {
	font-size: var(--lg);
	font-weight: bold;
}

.shopping-cart__content {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.shopping-cart__product {
	display: grid;
	grid-template-columns: auto 1fr auto auto;
	gap: 16px;
	align-items: center;
}

.shopping-cart__product img {
	max-width: 100px;
	height: auto;
	border-radius: 12px;
	object-fit: contain;
}

.shopping-cart__product p:nth-child(2) {
	color: var(--very-light-pink);
}

.shopping-cart__product p:nth-child(3) {
	font-size: var(--md);
	font-weight: bold;
}

.shopping-cart__footer {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.shopping-cart__total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 24px;
	background-color: var(--text-input-field);
	border-radius: 8px;
}

.shopping-cart__total p:first-child {
	display: flex;
	flex-direction: column;
}

.shopping-cart__total p:last-child {
	font-weight: bold;
}

.shopping-cart__total p span:first-child {
	font-size: var(--md);
	font-weight: bold;
}

/* Products */
.cards-container {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	place-content: center;
	place-items: center;
	gap: 36px 16px;
	padding: 40px 22px;
}

.cards-container__product-card {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 10px;
	max-width: 280px;
}

.product-card__image {
	border-radius: 20px;
	object-fit: cover;
	cursor: pointer;
	transition: transform 0.3s;
	transform-origin: bottom center;
}

.product-card__image:hover {
	transform: scale(1.15);
}

.product-card__footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 12px;
}

.product-card__info {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.product-card__shopping-cart-icon {
	width: 35px;
	height: 35px;
}

.product-card__info p:nth-child(1) {
	font-weight: bold;
	font-size: var(--md);
}

.product-card__info p:nth-child(2) {
	font-size: var(--sm);
	color: var(--very-light-pink);
}

/* Product details */
.product-details {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 16px;
	width: 35vw;
	min-width: 300px;
	max-width: 420px;
	height: calc(100vh - var(--md-height));
	position: fixed;
	right: 0;
	background-color: var(--white);
	border: 1px solid var(--very-light-pink);
	border-radius: 8px 0 0 8px;
	z-index: 1;
}

.product-details__close-icon {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	position: absolute;
	top: 28px;
	left: 28px;
	background-color: var(--white);
	border-radius: 50%;
	cursor: pointer;
}

.product-details__close-icon img {
	width: 50%;
	height: 50%;
	filter: brightness(40%);
}

.product-details__image {
	width: 100%;
	object-fit: cover;
	border-radius: 20px;
}

.product-details__info-container {
	flex-grow: 1;
}

.product-details__price {
	font-size: var(--md);
	font-weight: bold;
}

.product-details__name {
	margin-top: 4px;
	color: var(--very-light-pink);
	font-size: var(--md);
}

.product-details__description {
	margin-top: 32px;
	text-align: justify;
	color: var(--very-light-pink);
	font-size: var(--sm);
}

.add-to-cart-button {
	display: flex;
	justify-content: center;
	align-items: center;
}

/* Footer */
footer {
	display: flex;
	justify-content: space-around;
	align-items: center;
	gap: 22px;
	width: 100%;
	height: var(--lg-height);
	padding: 8px 16px;
	background-color: var(--text-input-field);
	border-top: 1px solid var(--very-light-pink);
}

.footer__social-media-section {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
}

.social-media-section__first-group,
.social-media-section__second-group {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 16px;
	list-style: none;
}

.footer__social-media-section a {
	display: flex;
	justify-content: center;
	align-items: center;
}

.footer__social-media-section img {
	width: 38px;
	height: 38px;
}

.footer__logo {
	min-width: 125px;
}

/* Utils */
.inactive {
	display: none;
}

.button--primary {
	background-color: var(--hospital-green);
	border: none;
	border-radius: 8px;
	color: var(--white);
	width: 100%;
	cursor: pointer;
	font-size: var(--md);
	font-weight: bold;
	min-height: 40px;
}

.vertical-scroll {
	overflow-y: auto;
	overscroll-behavior-y: contain;
}

/* Media queries */
@media (min-width: 769px) {
	.mobile-menu {
		display: none;
	}
}

@media (max-width: 769px) {
	.mobile-menu-icon {
		display: block;
	}
	.navbar__left-section ul {
		display: none;
	}
	.navbar__email {
		display: none;
	}
	.desktop-menu {
		display: none;
	}
	.cards-container {
		grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	}
	.cards-container__product-card {
		max-width: 260px;
	}
}

@media (max-width: 501px) {
	.product-details {
		width: 100%;
		max-width: 100%;
	}
}

@media (max-width: 426px) {
	.mobile-menu {
		width: 100%;
		min-width: 100%;
		max-width: 100%;
	}
	.shopping-cart {
		width: 100%;
		min-width: 100%;
		max-width: 100%;
	}
	.cards-container {
		grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	}
	.cards-container__product-card {
		max-width: 80%;
	}
	footer {
		justify-content: space-between;
	}
	.footer__logo {
		width: 125px;
	}
	.footer__social-media-section {
		gap: 4px;
	}
	.social-media-section__first-group {
		gap: 4px;
	}
	.social-media-section__second-group {
		gap: 8px;
	}
}
