:root {
	--red: hsl(14, 86%, 42%);
	--green: hsl(159, 69%, 38%);
	--rose50: hsl(20, 50%, 98%);
	--rose100: hsl(13, 31%, 94%);
	--rose300: hsl(14, 25%, 72%);
	--rose400: hsl(7, 20%, 60%);
	--rose500: hsl(12, 20%, 44%);
	--rose900: hsl(14, 65%, 9%);
	--white: #fff;
	--black: #222;
	--gray: #eaeaea;
	--lt-gray: #f8f8f8;
	--font-size: 16px;
	--spacing: 1rem;
}

/* .red-hat-text-<uniquifier> {
  font-family: "Red Hat Text", sans-serif;
  font-optical-sizing: auto;
  font-weight: <weight>;
  font-style: normal;
} 
  
- Weights: 400, 600, 700*/

/* - Mobile: 375px
- Desktop: 1440px */

html {
	box-sizing: border-box;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0;
	font-family: "Red Hat Text", sans-serif;
	font-optical-sizing: auto;
	font-size: 100%;
	font-weight: 400;
	font-style: normal;
	background-color: var(--rose50);
	color: var(--black);
}

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

strong {
	font-weight: 600;
	color: var(--rose900);
}

.access-hidden {
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.main {
	margin: 4rem 0;
}

.primary-header {
	width: 100%;
	margin: 0 0 2rem;
	color: var(--black);
}

.secondary-header {
	margin: 0;
	color: var(--red);
}

.tertiary-header {
	margin: 0.5rem 0;
	font-size: 1rem;
	font-weight: 600;
	color: var(--rose900);
}

.inner-wrap {
	max-width: 1440px;
	margin: 0 auto;
	padding: 1rem;
	display: flex;
	flex-flow: row wrap;
	justify-content: space-between;
}

.grid {
	width: 68%;
}

.sidebar {
	width: 30%;
}

@media (max-width: 768px) {
	.grid,
	.sidebar {
		width: 100%;
	}
}

.grid-wrap {
	display: flex;
	flex-flow: row wrap;
	justify-content: space-between;
	align-items: stretch;
	gap: 1rem;
}

.grid-item {
	width: calc((100% - 2rem) / 3);
	margin-bottom: 1rem;
}

@media (max-width: 960px) {
	.grid-item {
		width: calc((100% - 2rem) / 2);
	}
}

@media (max-width: 600px) {
	.grid-item {
		width: 100%;
	}
}

.image-container {
	position: relative;
	width: 100%;
	height: 0;
	margin: 0;
	padding-bottom: 100%;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 0 0 2px transparent;
}

.image-container:has(~ .cart-plus-minus.active) {
	box-shadow: 0 0 0 2px var(--red);
}

@media (max-width: 600px) {
	.image-container {
		padding-bottom: 66.666%;
	}
}

.image-container img {
	position: absolute;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.button-container {
	position: relative;
	margin-bottom: 2rem;
}

.cart-button {
	display: none;
	appearance: none;
	border: 1px solid var(--rose900);
	border-radius: 50vh;
	padding: 0.65rem 1.25rem;
	white-space: nowrap;
	color: var(--rose900);
	min-width: 150px;
	height: 43px;
	flex-flow: row nowrap;
	justify-content: space-evenly;
	align-items: center;
	position: absolute;
	bottom: -1rem;
	left: 50%;
	transform: translateX(-50%);
	cursor: pointer;
	transition: all 300ms ease-in-out;
	z-index: 1;

	&:hover,
	&:active,
	&:focus {
		border-color: var(--red);
		color: var(--red);
	}
}

.cart-button svg {
	pointer-events: none;
}

.cart-button.active {
	display: flex;
}

.item-category {
	font-size: 0.9rem;
	color: var(--rose500);
}

.item-price {
	font-weight: 600;
	color: var(--red);
}

.cart-plus-minus {
	display: none;
	appearance: none;
	border: 1px solid var(--red);
	border-radius: 50vh;
	background-color: var(--red);
	padding: 0.65rem 1rem;
	min-width: 150px;
	height: 43px;
	flex-flow: row nowrap;
	justify-content: space-between;
	align-items: center;
	position: absolute;
	bottom: -1rem;
	left: 50%;
	color: var(--white);
	transform: translateX(-50%);
	z-index: 2;
}

.cart-plus-minus.active {
	display: flex;
}

.more-less {
	appearance: none;
	border: none;
	background: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-flow: row wrap;
	justify-content: center;
	align-items: center;
	width: 18px;
	height: 18px;
	border: 1px solid var(--white);
	border-radius: 50%;
	cursor: pointer;
	transition: all 300ms ease-in-out;
}

.more-less svg {
	display: block;
	width: 10px;
	height: 10px;
	fill: var(--white);
	transition: all 300ms ease-in-out;
}

.more-less:hover,
.more-less:active,
.more-less:focus {
	background-color: var(--white);

	& svg {
		fill: var(--red);
	}
}

/* Sidebar Cart Starts Here */
.side-wrap {
	padding: 1rem;
	background-color: var(--white);
	border-radius: 10px;
}

/* full cart is hidden on page load because the cart is empty */
.full-cart {
	display: none;
}

/* full cart is displayed when the cart is active and has items */
.full-cart:has(.cart-container > .cart-item) {
	display: block;
}

/* empty cart is displayed on page load because the cart is empty */
.empty-cart {
	display: block;
	margin: 0 auto;
	text-align: center;
}

/* when the cart is full, the empty cart is not displayed */
.full-cart:has(.cart-container > .cart-item) + .empty-cart {
	display: none;
}

.cart-item {
	display: flex;
	flex-flow: row nowrap;
	justify-content: space-between;
	align-items: flex-end;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--gray);
}

.cart-quantity {
	display: flex;
	flex-flow: column nowrap;
	justify-content: space-between;
	width: 150px;
}

.cart-heading {
	width: 100%;
	color: var(--rose900);
	font-weight: 600;
}

.quantity-wrap {
	display: flex;
	flex-flow: row nowrap;
	justify-content: space-between;
	align-items: center;
	width: 100%;
}

.quantity {
	font-weight: 600;
	color: var(--red);
}

.each-item {
	color: var(--rose400);
}

.item-total {
	color: var(--rose500);
}

.remove-item {
	display: flex;
	flex-flow: row nowrap;
	justify-content: center;
	align-items: center;
	appearance: none;
	width: 25px;
	height: 25px;
	padding: 0;
	border: 2px solid #caafa7;
	border-radius: 50%;
	background-color: transparent;
	cursor: pointer;
	transition: all 300ms ease-in-out;
}

.remove-item svg {
	display: block;
	width: 15px;
	height: 15px;
	fill: #caafa7;
	transition: all 300ms ease-in-out;
}

.remove-item:hover,
.remove-item:active,
.remove-item:focus {
	border-color: var(--rose900);
}

.remove-item:hover > svg,
.remove-item:active > svg,
.remove-item:focus > svg {
	fill: var(--rose900);
}

.order-total {
	display: flex;
	flex-flow: row nowrap;
	justify-content: space-between;
	align-items: center;
	color: var(--rose900);
}

.total-amount {
	font-size: 2rem;
	font-weight: 700;
}

.carbon-neutral {
	display: flex;
	flex-flow: row nowrap;
	justify-content: center;
	align-items: center;
	padding: 0.5rem 1rem;
	margin: 2rem 0;
	background-color: var(--rose50);
	border-radius: 10px;
	text-align: center;
}

.carbon-neutral svg {
	display: block;
	width: 30px;
	height: auto;
	margin-right: 10px;
}

.carbon-neutral p {
	width: auto;
}

.clear-cart,
.confirm-order {
	width: 100%;
	padding: 1rem;
	appearance: none;
	border: 2px solid var(--red);
	border-radius: 50vh;
	background-color: var(--red);
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--white);
	cursor: pointer;
	transition: all 300ms ease-in-out;
}

.clear-cart:hover,
.clear-cart:active,
.clear-cart:focus,
.confirm-order:hover,
.confirm-order:active,
.confirm-order:focus {
	background-color: var(--white);
	color: var(--red);
}

.copyright {
	text-align: center;
}

.modal-popover {
	width: 500px;
	max-width: 100%;
	max-height: 100vh;
	padding: 2rem;
	background-color: var(--white);
	border-radius: 10px;
}

.modal-popover::backdrop {
	background-color: rgba(0, 0, 0, 65%);
}

.cart-popover-heading {
	margin-bottom: 0.5rem;
	font-size: 2rem;
	color: var(--rose900);
}

.cart-popover-heading + p {
	margin: 1rem 0 2rem;
	color: var(--rose500);
}

.cart-popover-container {
	padding: 1rem;
	margin: 0 0 2rem;
	border-radius: 10px;
	background-color: var(--rose50);
}

.cart-item-popover {
	display: flex;
	flex-flow: row nowrap;
	justify-content: space-between;
	align-items: center;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--gray);
}

.cart-item-popover .image-container {
	width: 85px;
	padding-bottom: 85px;
}

.cart-item-popover .quantity-wrap {
	justify-content: flex-start;
}

.cart-item-popover .quantity {
	display: inline-block;
	margin-right: 15px;
}

.cart-item-popover .cart-quantity {
	width: calc(100% - 170px);
}

.cart-item-popover .item-total {
	font-weight: 700;
	font-size: 1.1rem;
}

.total-amount-popover {
	font-weight: 700;
	font-size: 1.5rem;
}
