:root {
	color-scheme: dark;
	--bg: #0a0f1a;
	--panel: #111827;
	--border: #1f2937;
	--text: #f3f4f6;
	--muted: #9ca3af;
	--accent: #f6821f;
	--blue: #3b82f6;
	--green: #22c55e;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: Inter, system-ui, sans-serif;
	background: linear-gradient(160deg, #0a0f1a 0%, #111827 100%);
	color: var(--text);
	min-height: 100vh;
}

.header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 20px 28px;
	border-bottom: 1px solid var(--border);
	background: rgba(17, 24, 39, 0.8);
	backdrop-filter: blur(8px);
	flex-wrap: wrap;
}

.cart-toggle {
	background: var(--bg);
	border: 1px solid var(--border);
	color: var(--text);
	border-radius: 999px;
	padding: 8px 14px;
	font: inherit;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
}

.cart-count {
	background: var(--accent);
	color: #111;
	font-weight: 700;
	font-size: 0.75rem;
	min-width: 22px;
	height: 22px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.brand {
	display: flex;
	align-items: center;
	gap: 14px;
}

.logo {
	font-size: 2rem;
}

.brand h1 {
	margin: 0;
	font-size: 1.4rem;
}

.brand p {
	margin: 2px 0 0;
	color: var(--muted);
	font-size: 0.85rem;
}

.badges {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.badge {
	font-size: 0.75rem;
	padding: 6px 10px;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--panel);
}

.badge.orange {
	border-color: rgba(246, 130, 31, 0.4);
	color: #ffb86a;
}

.badge.blue {
	border-color: rgba(59, 130, 246, 0.4);
	color: #93c5fd;
}

.layout {
	display: grid;
	grid-template-columns: 1fr 360px;
	gap: 20px;
	padding: 24px 28px;
	max-width: 1200px;
	margin: 0 auto;
	align-items: start;
}

.sidebar {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.cart-panel,
.assistant {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 20px;
}

.panel-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}

.panel-header h2,
.assistant h2 {
	margin: 0;
	font-size: 1.1rem;
}

.link-btn,
.secondary-btn {
	background: transparent;
	border: 1px solid var(--border);
	color: var(--muted);
	border-radius: 8px;
	padding: 8px 12px;
	font: inherit;
	cursor: pointer;
}

.primary-btn {
	background: var(--accent);
	border: none;
	border-radius: 10px;
	color: #111;
	font-weight: 700;
	padding: 10px 16px;
	cursor: pointer;
	width: 100%;
}

.primary-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.cart-items {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 80px;
	max-height: 260px;
	overflow-y: auto;
	margin-bottom: 14px;
}

.empty-cart {
	color: var(--muted);
	font-size: 0.9rem;
	margin: 0;
}

.cart-item {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cart-item-info {
	display: flex;
	gap: 10px;
	align-items: center;
}

.cart-item-emoji {
	font-size: 1.4rem;
}

.cart-item-name {
	margin: 0;
	font-size: 0.92rem;
	font-weight: 600;
}

.cart-item-price {
	margin: 2px 0 0;
	font-size: 0.8rem;
	color: var(--muted);
}

.cart-item-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.qty-btn,
.remove-btn {
	background: var(--panel);
	border: 1px solid var(--border);
	color: var(--text);
	border-radius: 8px;
	width: 28px;
	height: 28px;
	cursor: pointer;
}

.remove-btn {
	margin-left: auto;
	width: auto;
	padding: 0 8px;
}

.qty {
	min-width: 20px;
	text-align: center;
	font-weight: 600;
}

.cart-footer {
	border-top: 1px solid var(--border);
	padding-top: 14px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.cart-total,
.checkout-summary {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.add-btn {
	margin-top: auto;
	background: transparent;
	border: 1px solid rgba(246, 130, 31, 0.5);
	color: #ffb86a;
	border-radius: 10px;
	padding: 10px 12px;
	font: inherit;
	cursor: pointer;
}

.add-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.modal {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	z-index: 100;
}

.modal.hidden {
	display: none;
}

.modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
}

.modal-card {
	position: relative;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 24px;
	width: min(440px, calc(100vw - 32px));
	z-index: 1;
}

.checkout-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.checkout-form label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 0.85rem;
	color: var(--muted);
}

.checkout-form input {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 10px;
	color: var(--text);
	padding: 10px 12px;
	font: inherit;
}

.modal-actions {
	display: flex;
	gap: 10px;
}

.modal-actions .primary-btn,
.modal-actions .secondary-btn {
	width: auto;
	flex: 1;
}

.success-card {
	text-align: center;
}

.success-icon {
	font-size: 2.5rem;
	margin-bottom: 8px;
}

.order-message {
	color: var(--muted);
	line-height: 1.5;
}

.catalog {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 20px;
}

.catalog-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
}

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

.catalog-header h2 {
	margin: 0;
	font-size: 1.1rem;
}

select {
	background: var(--bg);
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 8px 10px;
}

.product-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 14px;
}

.product-card {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 12px;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.product-emoji {
	font-size: 2rem;
}

.product-name {
	font-weight: 600;
	margin: 0;
}

.product-meta {
	color: var(--muted);
	font-size: 0.85rem;
	margin: 0;
}

.product-price {
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--accent);
	margin: 4px 0 0;
}

.stock {
	font-size: 0.8rem;
}

.stock.in {
	color: var(--green);
}

.stock.out {
	color: #f87171;
}

.assistant .hint {
	color: var(--muted);
	font-size: 0.85rem;
	margin: 0 0 12px;
}

.chat {
	height: 360px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 12px;
	padding-right: 4px;
}

.msg {
	padding: 10px 12px;
	border-radius: 12px;
	line-height: 1.45;
	font-size: 0.92rem;
	white-space: pre-wrap;
}

.msg.user {
	background: #1d4ed8;
	align-self: flex-end;
	max-width: 90%;
}

.msg.bot {
	background: var(--bg);
	border: 1px solid var(--border);
	align-self: flex-start;
	max-width: 95%;
}

.chat-form {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
}

.chat-form input {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 10px;
	color: var(--text);
	padding: 10px 12px;
	font: inherit;
}

.chat-form button {
	background: var(--accent);
	border: none;
	border-radius: 10px;
	color: #111;
	font-weight: 700;
	padding: 0 16px;
	cursor: pointer;
}

.chat-form button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}
