/* Vintage — Jelly UI theme (warm vintage palette; jelly-ui.com) */
:root {
	--bg: #faf7f2;
	--ink: #1c1917;
	--ink-soft: #57534e;
	--muted: #78716c;
	--line: #e7e0d6;
	--accent: #b45309; /* terracotta */
	--accent-soft: #fdf0e3;
	--card: #ffffff;
	--gem: #16a34a;
	--vinted: #09b1ba;
	--dba: #e11d48;
	--shadow: 0 1px 3px rgba(28, 25, 23, 0.07);
	--shadow-lg: 0 6px 18px rgba(28, 25, 23, 0.1);
}

/* jelly theme tokens */
html[data-jelly-mode="light"] {
	--jelly-color-background-accent: var(--accent);
	--jelly-color-foreground-on-accent: #fff;
	--jelly-color-background-neutral: var(--line);
	--jelly-color-border-default: var(--line);
	--jelly-color-foreground-muted: var(--muted);
	--jelly-label: var(--ink);
	--jelly-ring: var(--accent);
	--jelly-ring-width: 2px;
	--jelly-button-radius: 999px;
	--jelly-button-height: 44px;
	--jelly-button-padding-inline: 24px;
	--jelly-button-font-size: 1rem;
	--jelly-input-radius: 14px;
	--jelly-select-radius: 12px;
	--jelly-select-row-radius: 10px;
	--jelly-card-radius: 14px;
	--jelly-range-track-height: 6px;
	--jelly-range-radius: 999px;
}

* {
	box-sizing: border-box;
}
html,
body {
	margin: 0;
	padding: 0;
}
body {
	background: var(--bg);
	color: var(--ink);
	font:
		16px / 1.45 "Fredoka",
		system-ui,
		-apple-system,
		"Segoe UI",
		Roboto,
		sans-serif;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* header */
.top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding: 18px 22px 8px;
}
.logo {
	font-weight: 700;
	font-size: 26px;
	letter-spacing: -0.5px;
	text-decoration: none;
	color: var(--ink);
	font-style: italic;
}
.tag {
	color: var(--muted);
	font-size: 13px;
	margin-left: 10px;
}
.home-link {
	color: var(--muted);
	text-decoration: none;
	font-size: 13px;
}
.home-link:hover {
	color: var(--accent);
}

main {
	width: min(1200px, 96vw);
	margin: 8px auto 0;
	flex: 1;
}

/* search bar */
.search-bar {
	display: flex;
	gap: 8px;
	align-items: center;
	background: var(--card);
	border: 2px solid var(--line);
	border-radius: 16px;
	padding: 8px 10px;
	box-shadow: var(--shadow);
}
.search-bar:focus-within {
	border-color: var(--accent);
}
#q {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: 0;
	font-size: 18px;
	background: transparent;
	font-family: inherit;
	padding: 6px 4px;
}
#q::placeholder {
	color: var(--muted);
}
.camera {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 10px;
	color: var(--muted);
	cursor: pointer;
	flex: 0 0 auto;
	transition: background 0.15s;
}
.camera:hover {
	background: #f1ece4;
	color: var(--accent);
}
#go {
	border: 0;
	border-radius: 999px;
	background: var(--ink);
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	padding: 10px 22px;
	cursor: pointer;
	flex: 0 0 auto;
	font-family: inherit;
}
#go:hover {
	background: var(--accent);
}
#go:disabled {
	opacity: 0.6;
	pointer-events: none;
}
#go.loading {
	opacity: 0.6;
	pointer-events: none;
}

/* photo mode banner */
.photo-mode {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 12px;
	background: var(--accent-soft);
	border: 1px solid #f5d9b8;
	border-radius: 12px;
	padding: 8px 14px;
	font-size: 14px;
}
.photo-mode.hidden {
	display: none;
}
.photo-mode img {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 8px;
}
.photo-mode button {
	margin-left: auto;
	border: 0;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	font-size: 14px;
	text-decoration: underline;
}

/* filters */
.filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin: 14px 0 4px;
	font-size: 14px;
}
.price-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 260px;
}
#price {
	flex: 1;
}
.price-label {
	color: var(--ink-soft);
	font-size: 13px;
	white-space: nowrap;
	min-width: 92px;
	text-align: right;
}
.eu {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	color: var(--ink-soft);
	font-size: 14px;
	user-select: none;
}

/* recent searches */
.history {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 10px 0 0;
}
.history.hidden {
	display: none;
}
.hist-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	border: 1px solid var(--line);
	background: var(--card);
	border-radius: 999px;
	padding: 3px 12px 3px 4px;
	font-family: inherit;
	font-size: 13px;
	color: var(--ink-soft);
	cursor: pointer;
	max-width: 240px;
}
.hist-chip img {
	width: 26px;
	height: 26px;
	border-radius: 999px;
	object-fit: cover;
}
.hist-chip span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.hist-chip:hover {
	border-color: var(--accent);
	color: var(--accent);
}

/* status */
.status {
	margin: 12px 0 4px;
	font-size: 14px;
	color: var(--muted);
	min-height: 20px;
}
.status .err {
	color: #b91c1c;
	display: block;
}

/* grid */
.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 14px;
	margin: 10px 0 30px;
}
.card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 14px;
	overflow: hidden;
	position: relative;
	display: flex;
	flex-direction: column;
	transition:
		transform 0.12s,
		box-shadow 0.12s;
}
.card:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-lg);
}
.card .card-link {
	text-decoration: none;
	color: inherit;
	display: flex;
	flex-direction: column;
	flex: 1;
}
.card .imgwrap {
	position: relative;
	aspect-ratio: 1 / 1;
	background: #eee9e1;
}
.card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.badge {
	position: absolute;
	top: 8px;
	left: 8px;
	font-size: 11px;
	font-weight: 600;
	color: #fff;
	padding: 3px 9px;
	border-radius: 999px;
	letter-spacing: 0.3px;
	background: var(--gem);
}
.badge.vinted {
	background: var(--vinted);
}
.badge.dba {
	background: var(--dba);
}
.card .body {
	padding: 10px 12px 12px;
	display: flex;
	flex-direction: column;
	gap: 3px;
	flex: 1;
}
.card .title {
	font-size: 14px;
	font-weight: 500;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.card .price {
	font-weight: 700;
	font-size: 16px;
	margin-top: auto;
	padding-top: 6px;
}
.card .price small {
	color: var(--muted);
	font-weight: 500;
	font-size: 12px;
}
.card .meta {
	color: var(--muted);
	font-size: 12px;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.similar-btn {
	position: absolute;
	right: 8px;
	bottom: 8px;
	background: rgba(28, 25, 23, 0.75);
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 5px 11px;
	font-size: 12px;
	cursor: pointer;
	z-index: 1;
	transition: background 0.12s;
	font-family: inherit;
}
.similar-btn:hover {
	background: var(--accent);
}

/* skeleton */
.skel {
	display: flex;
	flex-direction: column;
	aspect-ratio: 200 / 290; /* image square + body strip ≈ card proportions */
	border-radius: 14px;
	overflow: hidden;
	background: var(--card);
	border: 1px solid var(--line);
}
.skel .skel-img {
	position: relative;
	flex: 1;
	min-height: 0;
	background: #eee9e1;
}
.skel jelly-skeleton {
	display: block;
	width: 100%;
	height: 100%;
}
.skel-body {
	padding: 10px 12px 12px;
	display: flex;
	flex-direction: column;
	gap: 7px;
}
.skel-body::before {
	content: "";
	height: 14px;
	border-radius: 6px;
	background: #e7e0d6;
	width: 92%;
}
.skel-body::after {
	content: "";
	height: 12px;
	border-radius: 6px;
	background: #e7e0d6;
	width: 45%;
}

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

.foot {
	text-align: center;
	color: var(--muted);
	font-size: 13px;
	padding: 22px 16px 26px;
}
.foot a {
	color: var(--muted);
}
.foot a:hover {
	color: var(--accent);
}

@media (max-width: 640px) {
	.grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 10px;
	}
	.tag {
		display: none;
	}
	.price-wrap {
		min-width: 100%;
	}
}
