/* XCamera Smart Search */
.xcs-panel,
.xcs-overlay {
	--xcs-primary: #5fa463;
	--xcs-price: #e02b2b;
	--xcs-radius: 12px;
	--xcs-text: #1f2328;
	--xcs-muted: #6b7280;
	--xcs-line: #eef0f2;
	--xcs-soft: #f6f8f7;
	--xcs-hl: rgba(95, 164, 99, .16);
	font-family: inherit;
	color: var(--xcs-text);
	line-height: 1.35;
	-webkit-font-smoothing: antialiased;
	box-sizing: border-box;
}
.xcs-panel *, .xcs-overlay * { box-sizing: border-box; }
.xcs-panel[hidden], .xcs-overlay[hidden] { display: none !important; }

/* ---------- desktop dropdown ---------- */
.xcs-panel {
	position: absolute;
	z-index: 100000;
	background: #fff;
	border-radius: var(--xcs-radius);
	box-shadow: 0 18px 48px -12px rgba(16, 24, 40, .28), 0 0 0 1px rgba(16, 24, 40, .06);
	overflow: hidden;
	animation: xcs-in .14s ease-out;
}
.xcs-panel.is-empty { display: none; }
.xcs-panel__inner { max-height: min(72vh, 680px); overflow-y: auto; overscroll-behavior: contain; padding: 6px 0 0; }
@keyframes xcs-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- sections ---------- */
.xcs-sec { padding: 10px 16px 6px; }
.xcs-sec__head {
	display: flex; align-items: center; justify-content: space-between;
	font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
	color: var(--xcs-muted); margin-bottom: 8px;
}
.xcs-sec__head--pad { padding: 12px 16px 4px; margin: 0; }
.xcs-link { background: none; border: 0; padding: 0; color: var(--xcs-primary); font-size: 12px; font-weight: 600; cursor: pointer; text-transform: none; letter-spacing: 0; }

.xcs-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.xcs-pill {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 6px 12px; border-radius: 999px; background: var(--xcs-soft);
	border: 1px solid var(--xcs-line); color: var(--xcs-text) !important;
	font-size: 13px; text-decoration: none !important; transition: background .15s, border-color .15s;
}
.xcs-pill:hover { border-color: var(--xcs-primary); background: #fff; }
.xcs-pill--hot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #f97316; }
.xcs-pill--recent { padding-right: 4px; }
.xcs-pill--recent a { color: inherit !important; text-decoration: none !important; }
.xcs-pill--recent::before { content: "↺"; color: var(--xcs-muted); font-size: 12px; }
.xcs-pill--recent button { border: 0; background: none; color: var(--xcs-muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 6px; margin: 0; min-height: 0; }

/* ---------- filter chips ---------- */
.xcs-chips { display: flex; gap: 6px; padding: 6px 16px 4px; overflow-x: auto; scrollbar-width: none; }
.xcs-chips::-webkit-scrollbar { display: none; }
.xcs-chip {
	flex: none; border: 1px solid var(--xcs-line); background: #fff; color: var(--xcs-text);
	border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; margin: 0; min-height: 0;
	line-height: 1.4; text-transform: none; letter-spacing: 0; font-weight: 500;
}
.xcs-chip b { color: var(--xcs-muted); font-weight: 600; margin-left: 2px; }
.xcs-chip:hover { border-color: var(--xcs-primary); }
.xcs-chip.is-active { background: var(--xcs-primary); border-color: var(--xcs-primary); color: #fff; }
.xcs-chip.is-active b { color: rgba(255, 255, 255, .85); }

/* ---------- best match card ---------- */
.xcs-best {
	display: grid; grid-template-columns: 132px 1fr; gap: 16px;
	margin: 8px 12px 4px; padding: 14px; border-radius: calc(var(--xcs-radius) - 2px);
	background: linear-gradient(135deg, #f4faf4 0%, #fff 70%);
	border: 1px solid #e3efe3;
}
.xcs-best__img {
	display: flex; align-items: center; justify-content: center; aspect-ratio: 1;
	background: #fff; border-radius: 10px; overflow: hidden; border: 1px solid var(--xcs-line);
}
.xcs-best__img img { width: 100%; height: 100%; object-fit: contain; }
.xcs-best__img.is-active { outline: 2px solid var(--xcs-primary); outline-offset: 2px; }
.xcs-best__body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.xcs-best__title { font-size: 18px; font-weight: 700; color: var(--xcs-text) !important; text-decoration: none !important; line-height: 1.25; }
.xcs-best__title:hover { color: var(--xcs-primary) !important; }
.xcs-best__price .xcs-price ins { font-size: 20px; }
.xcs-best__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }

.xcs-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	height: 36px; padding: 0 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
	cursor: pointer; text-decoration: none !important; border: 1px solid transparent; margin: 0;
	text-transform: none; letter-spacing: 0; line-height: 1; transition: filter .15s, background .15s;
}
.xcs-btn--primary { background: var(--xcs-primary); color: #fff !important; }
.xcs-btn--primary:hover { filter: brightness(.94); }
.xcs-btn--ghost { background: #fff; color: var(--xcs-text) !important; border-color: #dfe3e6; }
.xcs-btn--ghost:hover { border-color: var(--xcs-primary); color: var(--xcs-primary) !important; }
.xcs-btn.is-loading { opacity: .6; pointer-events: none; }
.xcs-btn.is-loading::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: xcs-spin .6s linear infinite; }
.xcs-btn.is-done { background: #16a34a; }
@keyframes xcs-spin { to { transform: rotate(360deg); } }

.xcs-cross { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; padding-top: 8px; border-top: 1px dashed #dfe8df; }
.xcs-cross__label { font-size: 12px; color: var(--xcs-muted); margin-right: 2px; }
.xcs-cross__item {
	display: inline-flex; align-items: center; gap: 6px; max-width: 220px;
	padding: 3px 10px 3px 3px; border-radius: 999px; background: #fff; border: 1px solid var(--xcs-line);
	font-size: 12px; color: var(--xcs-text) !important; text-decoration: none !important;
}
.xcs-cross__item img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.xcs-cross__item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xcs-cross__item:hover { border-color: var(--xcs-primary); }

/* ---------- rows ---------- */
.xcs-list { padding: 2px 6px 6px; }
.xcs-row {
	display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 14px;
	padding: 8px 10px; border-radius: 10px; color: var(--xcs-text) !important; text-decoration: none !important;
	transition: background .12s;
}
.xcs-row:hover, .xcs-row.is-active { background: var(--xcs-soft); }
.xcs-row.is-active { box-shadow: inset 3px 0 0 var(--xcs-primary); }
.xcs-thumb {
	width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: #fff;
	border: 1px solid var(--xcs-line); display: flex; align-items: center; justify-content: center;
}
.xcs-thumb img { width: 100%; height: 100%; object-fit: contain; }
.xcs-noimg { width: 100%; height: 100%; background: var(--xcs-soft); }
.xcs-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.xcs-title { font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.xcs-title mark, .xcs-best__title mark { background: var(--xcs-hl); color: inherit; font-weight: 700; border-radius: 3px; padding: 0 1px; }
.xcs-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; color: var(--xcs-muted); }
.xcs-brand { font-weight: 600; color: #4b5563; }

.xcs-tag { padding: 1px 7px; border-radius: 5px; font-size: 11px; font-weight: 600; background: #eef2f6; color: #475467; }
.xcs-tag[data-type="body"] { background: #e7f4e8; color: #2f7a35; }
.xcs-tag[data-type="lens"] { background: #e8f0fe; color: #2950a8; }
.xcs-tag[data-type="gear"] { background: #f3e8ff; color: #7139b0; }
.xcs-tag[data-type="used"] { background: #fff4e5; color: #a15c07; }
.xcs-tag[data-type="rental"] { background: #e6f7f8; color: #0e7480; }

.xcs-stock { display: inline-flex; align-items: center; gap: 5px; }
.xcs-stock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.xcs-stock--low::before { background: #f59e0b; }
.xcs-stock--back::before { background: #3b82f6; }
.xcs-stock--out { color: #9ca3af; }
.xcs-stock--out::before { background: #cbd5e1; }

.xcs-side { text-align: right; }
.xcs-price { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; white-space: nowrap; }
.xcs-best__price .xcs-price { flex-direction: row; align-items: baseline; gap: 8px; }
.xcs-price ins { text-decoration: none; color: var(--xcs-price); font-weight: 700; font-size: 15px; }
.xcs-price del { color: #9ca3af; font-size: 12px; }
.xcs-price small { font-size: 11px; color: var(--xcs-muted); }
.xcs-price--contact { color: var(--xcs-primary); font-weight: 700; font-size: 14px; }
.xcs-off { font-size: 11px; font-weight: 700; color: #fff; background: var(--xcs-price); padding: 1px 6px; border-radius: 4px; }

/* ---------- footer ---------- */
.xcs-footer {
	position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 12px 16px; background: #fbfcfb; border-top: 1px solid var(--xcs-line);
	font-size: 13.5px; font-weight: 600; color: var(--xcs-primary) !important; text-decoration: none !important;
}
.xcs-footer:hover, .xcs-footer.is-active { background: #f1f7f1; }
.xcs-keys { color: var(--xcs-muted); font-weight: 400; font-size: 11.5px; display: flex; gap: 4px; align-items: center; }
.xcs-keys kbd { font-family: inherit; font-size: 10.5px; border: 1px solid #dfe3e6; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: #fff; color: #4b5563; }

/* ---------- empty / no results ---------- */
.xcs-empty { padding: 22px 16px 6px; text-align: center; }
.xcs-empty__title { font-size: 15px; font-weight: 600; }
.xcs-empty__dym { margin-top: 6px; font-size: 14px; color: var(--xcs-muted); }
.xcs-empty__dym a { color: var(--xcs-primary) !important; font-weight: 700; }
.xcs-help { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 12px 16px 16px; font-size: 13px; color: var(--xcs-muted); border-top: 1px solid var(--xcs-line); }

/* ---------- skeleton ---------- */
.xcs-skel .xcs-thumb, .xcs-skel i { background: linear-gradient(90deg, #f1f3f4 25%, #e7eaec 50%, #f1f3f4 75%); background-size: 200% 100%; animation: xcs-sh 1.1s infinite; border: 0; }
.xcs-skel i { display: block; height: 11px; border-radius: 4px; width: 70%; }
.xcs-skel i + i { width: 40%; }
@keyframes xcs-sh { to { background-position: -200% 0; } }

/* ---------- mobile overlay ---------- */
.xcs-overlay { position: fixed; inset: 0; z-index: 100001; background: #fff; display: flex; flex-direction: column; animation: xcs-in .16s ease-out; }
.xcs-overlay__bar { display: flex; align-items: center; gap: 6px; padding: 10px 10px; border-bottom: 1px solid var(--xcs-line); margin: 0; background: var(--xcs-primary); }
.xcs-overlay__back, .xcs-overlay__clear { flex: none; width: 40px; height: 40px; border: 0; background: transparent; color: #fff; font-size: 30px; line-height: 1; cursor: pointer; padding: 0; margin: 0; min-height: 0; }
.xcs-overlay__clear { font-size: 24px; }
.xcs-overlay__input { flex: 1; height: 42px !important; border-radius: 10px !important; border: 0 !important; padding: 0 14px !important; font-size: 16px !important; margin: 0 !important; background: #fff !important; box-shadow: none !important; color: var(--xcs-text) !important; }
.xcs-overlay__body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-top: 6px; }
html.xcs-lock, html.xcs-lock body { overflow: hidden !important; }

@media (max-width: 768px) {
	.xcs-row { grid-template-columns: 60px 1fr; gap: 12px; padding: 10px; min-height: 64px; }
	.xcs-thumb { width: 60px; height: 60px; }
	.xcs-side { grid-column: 2; text-align: left; margin-top: -2px; }
	.xcs-price { align-items: flex-start; flex-direction: row; gap: 6px; align-items: baseline; }
	.xcs-best { grid-template-columns: 100px 1fr; gap: 12px; margin: 8px 10px 4px; }
	.xcs-best__title { font-size: 16px; }
	.xcs-keys { display: none; }
	.xcs-footer { padding: 14px 16px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}

/* ---------- shortcode form ---------- */
.xcs-form { position: relative; display: flex; max-width: 100%; }
.xcs-form .xcs-input { flex: 1; margin: 0; padding-right: 44px; height: 44px; border-radius: 10px; }
.xcs-form button { position: absolute; right: 4px; top: 4px; height: 36px; width: 36px; border: 0; background: transparent; cursor: pointer; padding: 0; margin: 0; min-height: 0; color: var(--xcs-primary, #5fa463); }

@media (prefers-reduced-motion: reduce) {
	.xcs-panel, .xcs-overlay, .xcs-skel i, .xcs-skel .xcs-thumb { animation: none; }
}
.xcs-overlay__input::-webkit-search-cancel-button { display: none; }
