* {
	box-sizing: border-box;
}
body {
	font-family: sans-serif;
	margin: 0;
	background: #fff0f6;
}
#topnav {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 3rem;
	background: hotpink;
	color: white;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 0 1rem;
	gap: 1rem;
	z-index: 1002;
}
#topnav button {
	background: white;
	color: hotpink;
	position: relative;
	border-radius: 1rem;
	padding: 0.25rem 0.75rem;
}
#topnav span.nav-user {
	margin-right: auto;
	font-weight: bold;
}
#topnav span[id$="count"] {
	position: absolute;
	top: -0.5rem;
	right: -0.5rem;
	background: hotpink;
	color: white;
	border-radius: 50%;
	font-size: 0.75rem;
	padding: 0 0.4rem;
}
.login {
	padding: 2rem;
	max-width: 300px;
	margin: auto;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
button {
	background: hotpink;
	color: white;
	border: none;
	padding: 1rem;
	border-radius: 0.5rem;
	cursor: pointer;
}
.store-header {
	padding: 1rem;
	background: white;
	border-radius: 1rem;
	margin: 1rem;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.store-header h2 {
	margin-top: 0;
	color: hotpink;
	text-align: center;
}

.store-controls {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-top: 1rem;
}

.search-container {
	position: relative;
	flex: 2;
}

.search-container input[type="text"] {
	padding: 0.75rem 3rem 0.75rem 0.75rem;
	border: 2px solid hotpink;
	border-radius: 0.5rem;
	font-size: 1rem;
	outline: none;
	transition: border-color 0.3s ease;
	width: 100%;
	box-sizing: border-box;
}

.search-icon {
	position: absolute;
	right: 0.75rem;
	top: 50%;
	transform: translateY(-50%);
	color: hotpink;
	pointer-events: none;
	font-size: 1.2rem;
}

.store-controls input[type="text"] {
	padding: 0.75rem;
	border: 2px solid hotpink;
	border-radius: 0.5rem;
	font-size: 1rem;
	outline: none;
	transition: border-color 0.3s ease;
}

.store-controls input[type="text"]:focus,
.search-container input[type="text"]:focus {
	border-color: #ff1493;
	box-shadow: 0 0 0 3px rgba(255, 20, 147, 0.1);
}

.store-controls select {
	padding: 0.75rem;
	border: 2px solid hotpink;
	border-radius: 0.5rem;
	font-size: 1rem;
	background: white;
	cursor: pointer;
}

.price-filter {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.price-filter label {
	font-weight: bold;
	color: hotpink;
}

.price-filter input[type="range"] {
	width: 100%;
	height: 6px;
	border-radius: 3px;
	background: #ddd;
	outline: none;
	-webkit-appearance: none;
}

.price-filter input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: hotpink;
	cursor: pointer;
}

.price-filter input[type="range"]::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: hotpink;
	cursor: pointer;
	border: none;
}

#products-count {
	text-align: center;
	color: #666;
	font-style: italic;
	margin: 0 1rem;
}

.keyboard-shortcuts {
	text-align: center;
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid #eee;
}

.keyboard-shortcuts small {
	color: #888;
	font-size: 0.85rem;
}

.keyboard-hint {
	text-align: center;
	margin-top: 1rem;
	color: #666;
	font-size: 0.9rem;
}

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1.5rem;
	padding: 1rem;
}
.card {
	background: white;
	border-radius: 1rem;
	padding: 1rem;
	text-align: center;
	cursor: pointer;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease;
	border: 2px solid transparent;
}

.card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 15px rgba(255, 20, 147, 0.2);
	border-color: hotpink;
}

.card img {
	border-radius: 0.5rem;
	margin-bottom: 0.5rem;
}

.card h3 {
	color: #333;
	margin: 0.5rem 0;
	font-size: 1.1rem;
}

.card .price {
	color: hotpink;
	font-weight: bold;
	font-size: 1.2rem;
	margin: 0;
}
.popup {
	position: fixed;
	top: 2rem;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	justify-content: center;
	align-items: center;
}
.popup-content {
	background: white;
	padding: 1rem;
	border-radius: 1rem;
	max-width: min(800px, 95vw);
	position: relative;
	max-height: calc(90dvh - 3rem);
	overflow-y: scroll;
}
.popup .close {
	position: absolute;
	top: 0.5rem;
	right: 1rem;
	cursor: pointer;
	font-size: 1.5rem;
}
.lightbox {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.9);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 999;
}
.lightbox img {
	max-width: 90%;
	max-height: 90%;
	border: 4px solid white;
	border-radius: 1rem;
	cursor: pointer;
}
.side-panel {
	position: fixed;
	top: 0;
	right: 0;
	width: 280px;
	height: 100vh;
	background: #fff;
	border-left: 2px solid hotpink;
	padding: 1rem;
	box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
	z-index: 1001;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding-bottom: 3rem;
	transform: translateX(0);
	transition: transform 0.3s ease;
}
.side-panel h3 {
	margin-top: 0;
}
.side-panel ul {
	list-style: none;
	padding: 0;
	margin: 0;
	height: fit-content;
	overflow-y: scroll;
}
.side-panel li {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.25rem 0;
	border-bottom: 1px solid #eee;
	margin-bottom: 1.5rem;
}
.cart-thumb {
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 0.5rem;
	flex-shrink: 0;
}
.cart-item-meta {
	flex: 1;
	display: flex;
	flex-direction: column;
}
.cart-item-name {
	font-weight: bold;
	font-size: 0.9rem;
}
.cart-item-controls {
	display: flex;
	justify-content: end;
	align-items: center;
	margin-top: 0.25rem;
	gap: 12px;
	margin-bottom: 1.5rem;
	margin-top: 1.5rem;
}
.cart-item-controls button {
	padding: 0.5rem 0.75rem;
	background: hotpink;
	color: white;
	border-radius: 0.25rem;
	font-size: 0.8rem;
}
.cart-total {
	margin-top: auto;
	padding-top: 0.5rem;
	border-top: 2px solid hotpink;
	font-weight: bold;
}
.image-slider {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1.4;
}
.slider-image {
	width: 100%;
	max-height: 100%;
	object-fit: contain;
}
.slider-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.8);
	border: none;
	color: hotpink;
	font-size: 2rem;
	padding: 0 0.5rem;
	cursor: pointer;
	z-index: 1;
}
.slider-nav.left {
	left: 0.5rem;
}
.slider-nav.right {
	right: 0.5rem;
}
#order-panel {
	width: 360px;
	right: 0;
}

/* Responsive design improvements */
@media (max-width: 768px) {
	.store-controls {
		gap: 0.75rem;
	}

	.store-controls input[type="text"],
	.search-container input[type="text"],
	.store-controls select {
		font-size: 16px; /* Prevents zoom on iOS */
	}

	.grid {
		grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
		gap: 1rem;
		padding: 0.5rem;
	}

	.store-header {
		margin: 0.5rem;
		padding: 0.75rem;
	}

	.side-panel {
		width: 100%;
		right: 0;
		transform: translateX(0);
	}

	.popup-content {
		max-width: 95vw;
		margin: 1rem;
	}

	.keyboard-shortcuts {
		display: none; /* Hide on mobile */
	}
}

@media (min-width: 769px) {
	.store-controls {
		flex-direction: row;
		align-items: center;
		gap: 1rem;
	}

	.search-container {
		flex: 2;
	}

	.store-controls select {
		flex: 1;
	}

	.price-filter {
		flex: 1;
		align-items: center;
	}

	.price-filter input[type="range"] {
		width: 100%;
	}
}

/* Loading and empty states */
.loading {
	text-align: center;
	padding: 2rem;
	color: #666;
}

.empty-state {
	text-align: center;
	padding: 3rem;
	color: #999;
	font-style: italic;
}

/* Enhanced button styles */
button {
	background: hotpink;
	color: white;
	border: none;
	padding: 1rem;
	border-radius: 0.5rem;
	cursor: pointer;
	transition:
		background-color 0.3s ease,
		transform 0.1s ease;
	font-weight: 500;
}

button:hover {
	background: #ff1493;
	transform: translateY(-1px);
}

button:active {
	transform: translateY(0);
}

.secondary-btn {
	background: #6c757d;
	color: white;
	border: none;
	padding: 1rem;
	border-radius: 0.5rem;
	cursor: pointer;
	transition:
		background-color 0.3s ease,
		transform 0.1s ease;
	font-weight: 500;
	margin-left: 0.5rem;
}

.secondary-btn:hover {
	background: #5a6268;
	transform: translateY(-1px);
}

.secondary-btn:active {
	transform: translateY(0);
}

/* Form enhancements */
input[type="text"],
input[type="password"],
textarea {
	border: 2px solid #ddd;
	border-radius: 0.5rem;
	padding: 0.75rem;
	font-size: 1rem;
	transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
	outline: none;
	border-color: hotpink;
}

/* Loading States */
.loading-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 3rem;
	color: #666;
}

.loading-spinner {
	width: 40px;
	height: 40px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid hotpink;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-bottom: 1rem;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

.loading-state p {
	margin: 0;
	font-style: italic;
}

/* Skeleton loading for cards */
.skeleton-card {
	background: white;
	border-radius: 1rem;
	padding: 1rem;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
	animation: pulse 1.5s ease-in-out infinite alternate;
}

.skeleton-image {
	width: 100%;
	height: 200px;
	background: #f0f0f0;
	border-radius: 0.5rem;
	margin-bottom: 1rem;
}

.skeleton-text {
	height: 1rem;
	background: #f0f0f0;
	border-radius: 0.25rem;
	margin-bottom: 0.5rem;
}

.skeleton-text.short {
	width: 60%;
}

@keyframes pulse {
	0% {
		opacity: 1;
	}
	100% {
		opacity: 0.6;
	}
}
