/**
 * Signal Pack Global Components — Search
 * Uses existing brand CSS variables with safe fallbacks (same pattern
 * as the other components in this plugin). Depends on buttons.css for
 * the .spgc-icon-btn trigger styling.
 */

.spgc-search-overlay {
	position: fixed;
	inset: 0;
	background: rgba(23, 22, 46, 0.55);
	z-index: 9000;
	display: none;
	align-items: flex-start;
	justify-content: center;
	padding: 80px 20px;
}
.spgc-search-overlay.spgc-is-open { display: flex; }

/* Screen-reader-only label (same fix as footer.css — don't rely on the
   active WordPress theme already defining this class). */
.spgc-search-overlay .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.spgc-search-modal {
	background: var(--paper, #ffffff);
	border-radius: 10px;
	width: 100%;
	max-width: 640px;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 18px 40px rgba(23, 22, 46, 0.14);
	overflow: hidden;
}

.spgc-search-modal-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 18px 20px;
	border-bottom: 1px solid var(--line, rgba(23, 22, 46, 0.10));
}
.spgc-search-modal-head .spgc-search-field { flex: 1; position: relative; }
.spgc-search-modal-head .spgc-search-field svg {
	position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
	width: 16px; height: 16px; stroke: var(--grey-text, #55536b); pointer-events: none;
}
.spgc-search-modal-head input {
	height: 44px; border: none; background: var(--grey-bg, #f6f6f9); border-radius: 6px;
	padding-left: 40px; font-size: 15px; width: 100%; font-family: inherit; color: var(--ink, #17162e);
}
.spgc-search-modal-head input:focus { outline: 2px solid var(--navy, #2C2A78); outline-offset: -2px; }

.spgc-search-modal-body { padding: 20px; overflow-y: auto; }
.spgc-search-section-title {
	font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
	color: var(--grey-text, #55536b); margin: 16px 0 10px;
}
.spgc-search-section-title:first-child { margin-top: 0; }

.spgc-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.spgc-chip {
	font-size: 12.5px; padding: 7px 14px; border-radius: 999px;
	background: var(--grey-bg, #f6f6f9); color: var(--ink, #17162e);
	border: 1px solid var(--line, rgba(23, 22, 46, 0.10)); cursor: pointer;
}
.spgc-chip:hover { border-color: var(--navy, #2C2A78); color: var(--navy, #2C2A78); }

.spgc-search-result {
	display: flex; align-items: center; justify-content: space-between; gap: 14px;
	padding: 12px 0; border-bottom: 1px solid var(--line, rgba(23, 22, 46, 0.10)); text-decoration: none;
}
.spgc-search-result:last-child { border-bottom: none; }
.spgc-search-result-info h5 { font-size: 13.5px; font-weight: 700; margin: 0 0 3px; color: var(--ink, #17162e); }
.spgc-search-result-info .spgc-meta { font-size: 11.5px; color: var(--grey-text, #55536b); display: flex; gap: 10px; flex-wrap: wrap; }
.spgc-search-result-price { font-weight: 700; color: var(--navy, #2C2A78); font-size: 13.5px; white-space: nowrap; }

/* Loading skeleton */
.spgc-search-loading { display: flex; flex-direction: column; gap: 12px; }
.spgc-skel-row {
	height: 48px; border-radius: 6px;
	background: linear-gradient(90deg, var(--grey-bg, #f6f6f9) 25%, var(--grey-alt, #eef0f5) 37%, var(--grey-bg, #f6f6f9) 63%);
	background-size: 400% 100%;
	animation: spgc-search-skeleton 1.4s ease infinite;
}
@keyframes spgc-search-skeleton {
	0% { background-position: 100% 50%; }
	100% { background-position: 0 50%; }
}

/* Empty / error states */
.spgc-search-empty, .spgc-search-error { text-align: center; padding: 40px 20px; color: var(--grey-text, #55536b); }
.spgc-search-empty svg, .spgc-search-error svg { width: 36px; height: 36px; margin: 0 auto 12px; stroke: var(--grey-text, #55536b); }
.spgc-search-empty h5, .spgc-search-error h5 { color: var(--ink, #17162e); font-size: 15px; margin: 0 0 6px; }
.spgc-search-error h5 { color: #c8151f; }
.spgc-search-error svg { stroke: #c8151f; }

/* Mobile: full-screen */
@media (max-width: 700px) {
	.spgc-search-overlay { padding: 0; }
	.spgc-search-modal { max-width: none; height: 100%; max-height: none; border-radius: 0; }
}
