:root {
	--color-bg: #fdf8f3;
	--color-surface: #ffffff;
	--color-text: #3a3229;
	--color-text-muted: #7a6f60;
	--color-primary: #c97b5e;
	--color-primary-dark: #a85f45;
	--color-accent: #7a8b69;
	--color-border: #ece2d6;
	--radius: 14px;
	--shadow: 0 4px 16px rgba(58, 50, 41, 0.08);
	--shadow-lg: 0 12px 40px rgba(58, 50, 41, 0.18);
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	background: var(--color-bg);
	color: var(--color-text);
	font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
	line-height: 1.5;
}

a { color: var(--color-primary-dark); }

img { max-width: 100%; display: block; }

/* Header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: var(--color-surface);
	border-bottom: 1px solid var(--color-border);
}

.header-inner {
	max-width: 1100px;
	margin: 0 auto;
	padding: 14px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.logo {
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--color-primary-dark);
	text-decoration: none;
	letter-spacing: 0.02em;
}

.main-nav {
	display: flex;
	gap: 24px;
}

.main-nav a {
	text-decoration: none;
	color: var(--color-text);
	font-weight: 500;
}

.main-nav a:hover { color: var(--color-primary-dark); }

.cart-toggle {
	background: var(--color-primary);
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 8px 16px;
	font-size: 1rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 6px;
}

.cart-toggle:hover { background: var(--color-primary-dark); }

.cart-count {
	background: #fff;
	color: var(--color-primary-dark);
	border-radius: 999px;
	padding: 1px 8px;
	font-size: 0.85rem;
	font-weight: 700;
}

/* Hero */
.hero {
	text-align: center;
	padding: 56px 20px 40px;
	background: linear-gradient(180deg, #fbeee2 0%, var(--color-bg) 100%);
}

.hero h1 {
	font-size: 2.2rem;
	margin: 0 0 10px;
	color: var(--color-primary-dark);
}

.hero p {
	color: var(--color-text-muted);
	font-size: 1.1rem;
	margin: 0;
}

/* Catalog */
.catalog-section {
	max-width: 1100px;
	margin: 0 auto;
	padding: 30px 20px 60px;
}

.category-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 28px;
}

.chip {
	border: 1px solid var(--color-border);
	background: var(--color-surface);
	color: var(--color-text);
	padding: 7px 16px;
	border-radius: 999px;
	font-size: 0.9rem;
	cursor: pointer;
}

.chip:hover { border-color: var(--color-primary); }

.chip.active {
	background: var(--color-primary);
	border-color: var(--color-primary);
	color: #fff;
}

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

.product-card {
	background: var(--color-surface);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow);
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	display: flex;
	flex-direction: column;
}

.product-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-lg);
}

.product-card img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	background: #f2e9de;
}

.product-card-body {
	padding: 12px 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1;
}

.product-card-name {
	font-weight: 600;
	font-size: 0.98rem;
}

.product-card-category {
	font-size: 0.78rem;
	color: var(--color-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.product-card-price {
	margin-top: auto;
	font-weight: 700;
	color: var(--color-primary-dark);
	font-size: 1.05rem;
}

/* Modal */
.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(58, 50, 41, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 50;
	padding: 20px;
}

.modal-overlay.hidden { display: none; }

.modal {
	background: var(--color-surface);
	border-radius: var(--radius);
	max-width: 720px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	position: relative;
	box-shadow: var(--shadow-lg);
}

.modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: rgba(255,255,255,0.9);
	border: none;
	border-radius: 50%;
	width: 34px;
	height: 34px;
	font-size: 1.3rem;
	cursor: pointer;
	z-index: 2;
}

.modal-body {
	display: grid;
	grid-template-columns: 1fr;
}

@media (min-width: 640px) {
	.modal-body { grid-template-columns: 1fr 1fr; }
}

.modal-gallery img {
	width: 100%;
	aspect-ratio: 1/1;
	object-fit: cover;
}

.modal-gallery-thumbs {
	display: flex;
	gap: 6px;
	padding: 10px;
	flex-wrap: wrap;
}

.modal-gallery-thumbs img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 6px;
	cursor: pointer;
	border: 2px solid transparent;
}

.modal-gallery-thumbs img.active { border-color: var(--color-primary); }

.modal-info {
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.modal-info h2 { margin: 0; }

.modal-price {
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--color-primary-dark);
}

.modal-description {
	color: var(--color-text-muted);
	font-size: 0.95rem;
	white-space: pre-line;
}

.btn-add-cart {
	background: var(--color-primary);
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 12px 20px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	margin-top: auto;
}

.btn-add-cart:hover { background: var(--color-primary-dark); }

/* Cart drawer */
.drawer-overlay {
	position: fixed;
	inset: 0;
	background: rgba(58, 50, 41, 0.5);
	z-index: 60;
	display: flex;
	justify-content: flex-end;
}

.drawer-overlay.hidden { display: none; }

.cart-drawer {
	background: var(--color-surface);
	width: 100%;
	max-width: 400px;
	height: 100%;
	display: flex;
	flex-direction: column;
	box-shadow: var(--shadow-lg);
}

.cart-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
	border-bottom: 1px solid var(--color-border);
}

.cart-drawer-header h2 { margin: 0; font-size: 1.2rem; }

.cart-drawer-header button {
	background: none;
	border: none;
	font-size: 1.5rem;
	cursor: pointer;
	color: var(--color-text-muted);
}

.cart-items {
	flex: 1;
	overflow-y: auto;
	padding: 12px 20px;
}

.cart-item {
	display: flex;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--color-border);
}

.cart-item img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 8px;
	flex-shrink: 0;
}

.cart-item-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

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

.cart-item-controls {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.9rem;
}

.cart-item-controls button {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: 1px solid var(--color-border);
	background: var(--color-surface);
	cursor: pointer;
	line-height: 1;
}

.cart-item-remove {
	background: none;
	border: none;
	color: var(--color-text-muted);
	cursor: pointer;
	text-decoration: underline;
	font-size: 0.82rem;
	align-self: flex-start;
}

.cart-item-price {
	font-weight: 700;
	color: var(--color-primary-dark);
	white-space: nowrap;
}

.cart-footer {
	padding: 16px 20px 24px;
	border-top: 1px solid var(--color-border);
}

.cart-total-row {
	display: flex;
	justify-content: space-between;
	font-size: 1.15rem;
	font-weight: 700;
	margin-bottom: 6px;
}

.cart-shipping-note {
	font-size: 0.8rem;
	color: var(--color-text-muted);
	margin: 0 0 14px;
}

.cart-empty-note {
	text-align: center;
	color: var(--color-text-muted);
	padding: 30px 0;
}

.hidden { display: none !important; }

/* Footer */
.site-footer {
	background: #2f2820;
	color: #ede4d8;
	padding: 40px 20px 20px;
	margin-top: 40px;
}

.footer-inner {
	max-width: 1100px;
	margin: 0 auto;
	display: flex;
	flex-wrap: wrap;
	gap: 40px;
	justify-content: space-between;
}

.footer-inner h3, .footer-inner h4 {
	margin: 0 0 8px;
	color: #fff;
}

.footer-inner a { color: #ede4d8; }

.footer-note {
	max-width: 1100px;
	margin: 24px auto 0;
	font-size: 0.8rem;
	color: #b5a893;
	text-align: center;
}

/* Toast */
.toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--color-accent);
	color: #fff;
	padding: 12px 22px;
	border-radius: 999px;
	box-shadow: var(--shadow-lg);
	z-index: 100;
	font-size: 0.95rem;
}

@media (prefers-color-scheme: dark) {
	:root {
		--color-bg: #211c17;
		--color-surface: #2b241d;
		--color-text: #f1e9dd;
		--color-text-muted: #b5a893;
		--color-border: #423a2f;
	}
	.hero { background: linear-gradient(180deg, #3a2f24 0%, var(--color-bg) 100%); }
	.product-card img { background: #423a2f; }
	.chip { color: var(--color-text); }
}
