/* K1 Search — front-end (autocomplete + results) and admin styles. */

:root {
	--k1s-red: #e4002b;
	--k1s-ink: #1a1a1a;
	--k1s-muted: #6b7280;
	--k1s-line: #e5e7eb;
	--k1s-bg: #fff;
	--k1s-radius: 8px;
}

/* ---------------------------------------------------------------- *
 * Search lightbox modal
 * ---------------------------------------------------------------- */
html.k1s-modal-open { overflow: hidden; }

.k1s-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
}
.k1s-modal[hidden] { display: none; }

.k1s-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 12, 16, .6);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}

.k1s-modal__panel {
	position: relative;
	width: 100%;
	max-width: 640px;
	max-height: 80vh;
	background: var(--k1s-bg);
	border-radius: 14px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform-origin: center;
	animation: k1s-pop .17s cubic-bezier(.2, .8, .3, 1);
}
@keyframes k1s-pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.k1s-modal__bar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--k1s-line);
}
.k1s-modal__icon { color: var(--k1s-muted); flex: 0 0 auto; display: flex; }
.k1s-modal__input {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: none;
	font-size: 20px;
	color: var(--k1s-ink);
	background: transparent;
	padding: 4px 0;
}
.k1s-modal__close {
	flex: 0 0 auto;
	border: 0;
	background: transparent;
	color: var(--k1s-muted);
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}
.k1s-modal__close:hover { color: var(--k1s-ink); }

.k1s-modal__results { overflow-y: auto; flex: 1; }

.k1s-modal__group {
	font: 600 11px/1 -apple-system, "Segoe UI", Roboto, sans-serif;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--k1s-muted);
	padding: 12px 16px 4px;
}

.k1s-modal__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	color: var(--k1s-ink) !important;
	text-decoration: none !important;
}
.k1s-modal__item.is-active,
.k1s-modal__item:hover { background: #f6f7f9; }

.k1s-modal__thumb {
	flex: 0 0 auto;
	width: 46px;
	height: 34px;
	border-radius: 5px;
	background: #eee center/cover no-repeat;
}
.k1s-modal__thumb--empty { background: #f0f1f3; }

/* Popular-search term rows (empty state) */
.k1s-modal__termicon {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--k1s-red);
	background: #fff0f2;
	border-radius: 8px;
}
.k1s-modal__item--term .k1s-modal__label { text-transform: capitalize; font-weight: 500; }

.k1s-modal__label {
	font-size: 15px;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.k1s-modal__empty { padding: 22px 16px; color: var(--k1s-muted); font-size: 15px; }

.k1s-modal__footer { border-top: 1px solid var(--k1s-line); }
.k1s-modal__all {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 16px;
	color: var(--k1s-red) !important;
	font-weight: 600;
	font-size: 14px;
	text-decoration: none !important;
}
.k1s-modal__all:hover { background: #fff5f6; }

@media (max-width: 600px) {
	.k1s-modal__panel { width: 100%; max-width: none; margin-top: 0; max-height: 100vh; border-radius: 0; height: 100%; }
	.k1s-modal__input { font-size: 17px; }
}

/* ---------------------------------------------------------------- *
 * Results page
 * ---------------------------------------------------------------- */
/* Extra top clearance so the search bar sits below the fixed header + the
   full-width "BUY GIFT CARDS" (.redstring) banner instead of under it. */
.k1s-results { max-width: 900px; margin: 0 auto 40px; padding: 70px 16px 0; font-family: -apple-system, "Segoe UI", Roboto, sans-serif; }
@media (max-width: 768px) { .k1s-results { padding-top: 50px; } }

.k1s-results__title { font-size: 28px; margin: 0 0 16px; }
.k1s-results__title span { color: var(--k1s-red); }

.k1s-results__form { display: flex; gap: 8px; margin: 0 0 10px; }
.k1s-results__form input[type="search"] {
	flex: 1;
	padding: 12px 14px;
	border: 1px solid var(--k1s-line);
	border-radius: var(--k1s-radius);
	font-size: 16px;
}
.k1s-results__form button {
	padding: 12px 22px;
	background: var(--k1s-red);
	color: #fff;
	border: 0;
	border-radius: var(--k1s-radius);
	font-weight: 600;
	cursor: pointer;
}

.k1s-results__count { color: var(--k1s-muted); font-size: 14px; margin: 0 0 20px; }

.k1s-facets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.k1s-facet {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	border: 1px solid var(--k1s-line);
	border-radius: 999px;
	font-size: 13px;
	color: var(--k1s-ink) !important;
	text-decoration: none !important;
	cursor: pointer;
	background: #fff;
}
.k1s-facet.is-active { background: var(--k1s-red); border-color: var(--k1s-red); color: #fff !important; }
.k1s-facet__n { opacity: .7; font-size: 12px; }

.k1s-list { display: flex; flex-direction: column; gap: 4px; }

.k1s-card {
	display: flex;
	gap: 16px;
	padding: 18px 0;
	border-bottom: 1px solid var(--k1s-line);
}
.k1s-card__media { flex: 0 0 auto; }
.k1s-card__media img { width: 120px; height: 80px; object-fit: cover; border-radius: 6px; display: block; }
.k1s-card__body { min-width: 0; }

.k1s-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--k1s-muted);
	background: #f0f1f3;
	padding: 2px 8px;
	border-radius: 4px;
	margin-bottom: 6px;
}
.k1s-badge--page { color: #0b5; background: #e8f8ef; }
.k1s-badge--post { color: #06c; background: #e8f1fd; }

.k1s-card__title { font-size: 18px; margin: 0 0 6px; line-height: 1.3; }
.k1s-card__title a { color: var(--k1s-ink) !important; text-decoration: none !important; }
.k1s-card__title a:hover { color: var(--k1s-red) !important; }

.k1s-card__snippet { font-size: 14px; color: #374151; margin: 0 0 6px; line-height: 1.5; }
.k1s-card__snippet mark { background: #fff2a8; padding: 0 1px; }

.k1s-card__url { font-size: 12px; color: #16a34a; word-break: break-all; }

.k1s-empty-state { text-align: center; padding: 40px 0; color: var(--k1s-muted); }
.k1s-suggestions { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 0; margin: 16px 0 0; }
.k1s-suggestions a {
	display: inline-block;
	padding: 8px 16px;
	border: 1px solid var(--k1s-line);
	border-radius: 999px;
	text-decoration: none;
	color: var(--k1s-ink);
	font-size: 14px;
}

.k1s-more { text-align: center; margin: 28px 0; }
.k1s-more__btn {
	padding: 12px 32px;
	background: #fff;
	border: 2px solid var(--k1s-red);
	color: var(--k1s-red);
	border-radius: var(--k1s-radius);
	font-weight: 600;
	cursor: pointer;
}
.k1s-more__btn:hover { background: var(--k1s-red); color: #fff; }

@media (max-width: 600px) {
	.k1s-card__media img { width: 84px; height: 60px; }
}

/* ---------------------------------------------------------------- *
 * Admin dashboard
 * ---------------------------------------------------------------- */
.k1s-admin .k1s-range { margin: 14px 0 20px; }

.k1s-stats { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 28px; }
.k1s-stat {
	background: #fff;
	border: 1px solid var(--k1s-line);
	border-radius: var(--k1s-radius);
	padding: 18px 22px;
	min-width: 150px;
	flex: 1;
	display: flex;
	flex-direction: column;
}
.k1s-stat__value { font-size: 30px; font-weight: 700; line-height: 1.1; }
.k1s-stat__value small { font-size: 14px; color: var(--k1s-muted); font-weight: 400; }
.k1s-stat__label { font-size: 13px; color: var(--k1s-muted); margin-top: 4px; }

.k1s-columns { display: flex; flex-wrap: wrap; gap: 28px; margin: 10px 0 20px; }
.k1s-col { flex: 1; min-width: 320px; }
.k1s-hint { font-size: 12px; font-weight: 400; color: var(--k1s-muted); }
.k1s-empty { color: var(--k1s-muted); font-style: italic; }

.k1s-trend {
	display: flex;
	align-items: flex-end;
	gap: 3px;
	height: 140px;
	padding: 10px;
	background: #fff;
	border: 1px solid var(--k1s-line);
	border-radius: var(--k1s-radius);
	margin: 0 0 24px;
	overflow-x: auto;
}
.k1s-trend__col { flex: 1 0 8px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.k1s-trend__bar { width: 100%; min-height: 2px; background: var(--k1s-red); border-radius: 2px 2px 0 0; }
.k1s-trend__n { font-size: 10px; color: var(--k1s-muted); margin-top: 3px; }
