/* =========================
     RESET & BASE
     ========================= */
* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: "Albert Sans", sans-serif;
	background-color: var(--bg-color);
	color: var(--text-color);
	line-height: 1.6;
	transition: all 0.3s ease;
}
main {
	padding: 2rem;
	min-height: 100dvh;
}
a {
	color: var(--accent-color);
	text-decoration: none;
}

a:hover {
	color: var(--accent-hover);
}
/*** =========================
     GLOBAL STYLES
     ========================= */
/* dyanmically assigned to icons by app.js depending on the theme selected for the site */
.light-icon {
	filter: invert(100%) sepia(39%) saturate(2%) hue-rotate(349deg) brightness(105%) contrast(101%);
}
.flex {
	display: flex;
}
.flex-col {
	flex-direction: column;
}
.flex-row {
	flex-direction: row;
}
.flex-center {
	justify-content: center;
	align-items: center;
}
.flex-space-between {
	justify-content: space-between;
	align-items: center;
}
.flex-space-around {
	justify-content: space-around;
	align-items: center;
}
.flex-space-evenly {
	justify-content: space-evenly;
	align-items: center;
}
.flex-wrap {
	flex-wrap: wrap;
}
.w-full {
	width: 100%;
}
.rounded {
	border-radius: 8px;
}
.border {
	border: 1px solid var(--border-color);
}
.hidden {
	display: none;
}
.hover-underline-animation {
	display: inline-block;
	position: relative;
}
.button {
	background-color: var(--accent-color);
	color: var(--text-color);
	padding: 0.5rem 1rem;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.2s ease;
	font-size: 0.95rem;
	text-align: center;
}

.button:hover {
	color: var(--text-color);
	background-color: var(--accent-hover);
}
.button-secondary {
	background-color: var(--bg-color);
	color: var(--text-color);
	padding: 0.5rem 1rem;
	border: 1px solid var(--accent-color);
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.2s ease;
	font-size: 0.95rem;
	text-align: center;
}
.button-secondary:hover {
	background-color: var(--accent-hover);
}
.hover-underline-animation::after {
	content: "";
	position: absolute;
	width: 100%;
	transform: scaleX(0);
	height: 2px;
	bottom: 0;
	left: 0;
	background-color: var(--accent-color);
	transition: transform 0.25s ease-out;
}
.hover-underline-animation:hover::after {
	transform: scaleX(1);
}
.hover-underline-animation.left::after {
	transform-origin: bottom right;
}

.hover-underline-animation.left:hover::after {
	transform-origin: bottom left;
}
/* buttons with the check-button class will display a checkmark upon clicking them */
.check-button {
	position: relative;
	background-color: var(--accent-color);
	color: var(--text-color);
	overflow: hidden;
}

.check-button .checkmark {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: var(--accent-color);
	color: var(--text-color);
	font-size: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transform: scale(0.8);
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: none;
}

.check-button .btn-text {
	transition: opacity 0.2s ease;
}

.check-button.show-check .btn-text {
	opacity: 0;
}

.check-button.show-check .checkmark {
	opacity: 1;
	transform: scale(1);
}

/* =========================
     CONTAINERS
     ========================= */
.container {
	width: 90%;
	max-width: 1200px;
	margin: 0 auto;
	padding-top: 2rem;
}
/* ========================
	LOGO
	========================*/
.logo-link {
	display: flex;
	align-items: center;
	justify-content: start;
	text-decoration: none;
}
.logo-img {
	width: 100%;
	max-width: 20%;
	height: auto;
	transition: transform 0.3s ease;
}

/* =========================
     HEADER
     ========================= */
header {
	background-color: var(--card-bg);
	padding: 1rem 0;
	border-bottom: 1px solid var(--border-color);
}

header h1 {
	font-size: 2rem;
	text-align: center;
}

nav {
	display: flex;
	justify-content: center;
	gap: 2rem;
	margin-top: 0.5rem;
}

nav a {
	color: var(--text-color);
	font-size: 16px;
	font-weight: 500;
	padding: 0.5rem;
	border-radius: 5px;
	transition: all ease 0.2s;
}
.user-menu-wrapper {
	position: relative;
	display: inline-block;
}

/* Always show the dropdown when hovering anywhere inside the wrapper */
.user-menu-wrapper:hover .user-menu-dropdown {
	display: flex;
}

.user-menu-toggle {
	cursor: pointer;
}

.user-menu-dropdown {
	position: absolute;
	left: 0;
	background-color: var(--card-bg);
	border: 1px solid var(--border-color);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
	padding: 0.5rem 0;
	margin: 0;
	min-width: 140px;
	z-index: 1000;
	display: none;
	flex-direction: column;
	top: calc(100% + 2px); /* adds a 2px buffer zone between icon and dropdown */
}

.user-menu-dropdown li {
	padding-right: 2rem;
	padding-left: 2rem;
}

.user-menu-dropdown li a {
	color: var(--text-color);
	text-decoration: none;
	display: block;
	transition: background 0.2s ease;
}

.user-menu-dropdown li a:hover {
	background-color: var(--accent-light);
}

#desktop-header ul {
	justify-content: center;
	gap: 2rem;
}
#desktop-header ul li {
	list-style: none;
	padding: 0.5rem;
	border-radius: 5px;
}
#mobile-toggle {
	display: none;
}
.mobile-sidebar {
	position: fixed;
	top: 0;
	left: -100%;
	width: 60%;
	height: 100vh;
	background-color: var(--card-bg);
	color: var(--text-color);
	z-index: 1001;
	padding: 2rem 1.5rem;
	box-shadow: 2px 0 10px rgba(0, 0, 0, 0.4);
	transition: left 0.3s ease-in-out;
	display: flex;
	flex-direction: column;
}

.mobile-sidebar.show {
	left: 0;
}

.sidebar-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(0, 0, 0, 0.4);
	z-index: 1000;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
	opacity: 1;
	visibility: visible;
}

.close-button {
	align-self: flex-end;
	background: none;
	border: none;
	font-size: 1.5rem;
	color: var(--text-color);
	cursor: pointer;
	margin-bottom: 2rem;
}
#mobile-menu-toggle {
	cursor: pointer;
}
/* =========================
     PRODUCT CARD
     ========================= */
.product-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 2rem;
	margin-top: 2rem;
}
#cart-items .product-grid {
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

.product-card {
	background-color: var(--card-bg);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	padding: 1rem;
	transition: transform 0.2s ease;
}

.product-card:hover {
	transform: translateY(-5px);
}

.product-card img {
	width: 100%;
	height: auto;
	border-radius: 6px;
	margin-bottom: 1rem;
}

.product-card h2 {
	font-size: 1.2rem;
	margin-bottom: 0.5rem;
}

.product-card p {
	color: var(--secondary-text);
	margin-bottom: 1rem;
}

.product-card .price {
	font-weight: bold;
	font-size: 1.1rem;
	color: var(--accent-color);
}

/* =========================
     FORMS
     ========================= */
input,
textarea,
select {
	width: 100%;
	padding: 0.6rem;
	border: 1px solid var(--border-color);
	background-color: var(--input-bg);
	color: var(--text-color);
	border-radius: 6px;
}

input:focus,
textarea:focus,
select:focus {
	outline: 2px solid var(--accent-color);
}

/* =========================
     ALERTS / MESSAGES
     ========================= */
.alert {
	padding: 1rem;
	background-color: var(--error-color);
	color: white;
	margin-bottom: 1rem;
	border-radius: 5px;
}

/* =========================
     FOOTER
     ========================= */

.footer-container {
	background-color: var(--card-bg);
	color: var(--text-color);
	border-top: 1px solid var(--border-color);
}

.footer-container a {
	color: var(--accent-color);
	text-decoration: none;
	font-size: 0.95rem;
}

.footer-container a:hover {
	color: var(--accent-hover);
}

.footer-container h4 {
	margin-bottom: 0.5rem;
	font-size: 1.1rem;
}
/* CTA BANNER */
.cta-banner {
	margin-top: 4rem;
	background: var(--card-bg);
	border: 1px solid var(--border-color);
	border-radius: 12px;
	padding: 2rem;
	text-align: center;
}

/* Horizontal fluid card  */
.horizontal-fluid-card {
	width: 100%;
	max-width: 100%;
	margin-bottom: 1rem;
	border: 1px solid var(--border-color);
	background-color: var(--card-bg);
	border-radius: 8px;
	overflow: hidden;
	font-family: sans-serif;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.horizontal-fluid-row {
	display: flex;
	flex-wrap: wrap;
}

.horizontal-fluid-image {
	flex: 0 0 20%;
	max-width: 20%;
}

.horizontal-fluid-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-top-left-radius: 8px;
	border-bottom-left-radius: 8px;
}

.horizontal-fluid-content {
	display: flex;
	justify-content: space-between;
	flex-direction: column;
	flex: 1;
	padding: 2rem;
}

.horizontal-fluid-title {
	margin: 0 0 0.5rem;
	font-size: 1.25rem;
	color: var(--text-color);
	width: 100%;
}

.horizontal-fluid-text {
	margin: 0 0 0.5rem;
	font-size: 0.95rem;
	width: 100%;
	color: var(--secondary-text);
}

.horizontal-fluid-text .small {
	font-size: 0.8rem;
	color: var(--secondary-text);
	width: 100%;
}

.actionable-buttons {
	display: flex;
	flex-direction: row;
	justify-content: end;
	gap: 1rem;
	align-items: center;
	place-items: stretch;
}
.actionable-buttons p {
	color: var(--accent-color);
	font-weight: 700;
	font-size: 1.5em;
	margin: 0;
}
/* mobile devices */
@media (max-width: 700px) {
	.footer-container .flex-col {
		width: 100%;
	}
	/* hide desktop header */
	#desktop-only {
		display: none;
	}
	/* show mobile header */
	#mobile-toggle {
		display: flex;
	}
	.mobile-header {
		display: flex;
	}

	.horizontal-fluid-row {
		flex-direction: column;
	}

	.horizontal-fluid-image,
	.horizontal-fluid-image img {
		max-width: 100%;
		border-radius: 8px 8px 0 0;
	}

	.horizontal-fluid-image {
		flex: none;
	}
	header .logo-link {
		justify-content: flex-end;
	}
}
/* tablets */
@media (min-width: 701px) and (max-width: 1024px) {
	.footer-container .flex-col {
		width: 100%;
	}
	/* hide desktop header */
	#desktop-only {
		display: none;
	}
	/* show mobile header */
	#mobile-toggle {
		display: flex;
	}
	.mobile-header {
		display: flex;
	}
	header .logo-link {
		justify-content: flex-end;
	}
}

/* desktop */

@media (min-width: 1024px) {
	/* hide mobile header */
	.mobile-header,
	#mobile-nav-menu {
		display: none;
	}
}
