:root {
	--bg: #fff;
	--text: #222;
	--border: #ddd;
	--primary: #4a6fa5;
	--secondary: #f8f9fa;
	--error: #dc3545;
}
[data-theme="dark"] {
	--bg: #222;
	--text: #eee;
	--border: #444;
	--primary: #6c8fc7;
	--secondary: #333;
}
body {
	background: var(--bg);
	color: var(--text);
	font-family: Tahoma, sans-serif;
	margin: 2rem;
}
#theme-toggle {
	position: fixed;
	top: 1rem;
	right: 1rem;
	z-index: 100;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 50%;
	padding: 0.5rem;
	cursor: pointer;
}

#products-container {
	margin-top: 2rem;
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

.category-card {
	background: var(--secondary);
	border-radius: 8px;
	padding: 1rem;
}

.category-title {
	color: var(--primary);
	margin-bottom: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid var(--primary);
	text-align: center;
}

.products-grid {
	display: grid;
	grid-template-columns: repeat(var(--columns), 1fr);
	gap: 3rem;
	justify-items: center;
}

@media (max-width: 1200px) {
	.products-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 768px) {
	.products-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.products-grid {
		grid-template-columns: 1fr;
	}
}

.product-item {
	width: 100%;
	max-width: 300px;
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 1rem;
	background: var(--bg);
	text-align: center;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.product-image-container {
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	margin-bottom: 0.5rem;
}

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

.product-item h3 {
	margin: 0.5rem 0;
	color: var(--primary);
	font-size: 1.1rem;
	min-height: 2.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

.price {
	font-weight: bold;
	color: green;
	margin: 0.5rem 0;
}

.description {
	font-size: 0.9rem;
	line-height: 1.4;
	margin: 0.5rem 0;
	flex-grow: 1;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	min-height: 4.2rem;
}

.product-buttons {
	display: flex;
	gap: 0.5rem;
	margin-top: 1rem;
}

.product-buttons button {
	flex: 1;
	padding: 0.5rem;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.9rem;
}

.view-btn {
	background: var(--secondary);
	color: var(--text);
	border: 1px solid var(--border) !important;
}

.buy-btn {
	background: var(--primary);
	color: white;
}

.error {
	padding: 1rem;
	background: #f8d7da;
	color: var(--error);
	border-radius: 4px;
	border: 1px solid #f5c6cb;
	text-align: center;
}

footer {
	text-align: center;
	margin-top: 3rem;
	padding-top: 1rem;
	border-top: 1px solid var(--border);
}
