/* ============================================================
   Hunter Imports — Busca de Fornecedores — Componentes
   Tokens re-declarados em page-busca.php (inline).
   Este arquivo cobre os componentes novos: search, dropdown,
   grid, cards, paginação, skeleton, estados.
   ============================================================ */

/* ── Campo de busca e wrapper ── */

.hi-search-wrapper {
	position: relative;
	max-width: 560px;
	width: 100%;
	margin: 0 0 24px;
}

#hi-search-input {
	width: 100%;
	box-sizing: border-box;
	padding: 16px 48px 16px 16px;
	border-radius: 999px;
	border: 2px solid transparent;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 1rem;
	font-family: inherit;
	outline: none;
	transition: border-color 200ms, background 200ms;
	backdrop-filter: blur(4px);
}

#hi-search-input::placeholder {
	color: rgba(255, 255, 255, 0.55);
}

#hi-search-input:focus {
	border-color: rgba(255, 255, 255, 0.55);
	background: rgba(255, 255, 255, 0.18);
}


/* ── Área de resultados ── */

.hi-results-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}

#hi-results-count {
	font-size: 0.9rem;
	color: #334155;
	margin: 0;
	font-weight: 600;
}

#hi-clear-filters-btn {
	font-size: 0.85rem;
	color: #e63946;
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 6px;
	transition: background 150ms;
	font-family: inherit;
}

#hi-clear-filters-btn:hover {
	background: rgba(230, 57, 70, 0.08);
}

/* ── Grid de fornecedores ── */

#hi-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

@media (max-width: 1023px) {
	#hi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
	#hi-grid { grid-template-columns: 1fr; }
}

/* ── Card de fornecedor ── */

.hi-card {
	border: 1px solid rgba(15, 23, 42, 0.10);
	border-radius: 18px;
	overflow: hidden;
	background: #fff;
	position: relative;
	transition: transform 220ms ease, box-shadow 220ms ease;
	display: flex;
	flex-direction: column;
}

.hi-card::before {
	content: '';
	display: block;
	height: 4px;
	background: #e63946;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 220ms ease;
}

.hi-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 20px 50px rgba(2, 6, 23, 0.13);
}

.hi-card:hover::before {
	transform: scaleX(1);
}

.hi-card__image {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	display: block;
}

.hi-card__avatar {
	width: 100%;
	aspect-ratio: 16 / 9;
	background: linear-gradient(135deg, #e63946, #c92f3c);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 2.4rem;
	font-weight: 900;
	letter-spacing: -0.03em;
}

.hi-card__avatar::before {
	content: attr(data-initials);
}

.hi-card__body {
	padding: 16px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.hi-card__badge {
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 999px;
	background: #f1f5f9;
	color: #334155;
	margin-bottom: 8px;
}

.hi-card__title {
	font-size: 0.975rem;
	font-weight: 800;
	letter-spacing: -0.01em;
	margin: 0 0 8px;
	line-height: 1.3;
}

.hi-card__title a {
	color: #0f172a;
	text-decoration: none;
}

.hi-card__title a:hover {
	color: #e63946;
}

.hi-card__meta {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.hi-card__meta li {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.82rem;
}

.hi-card__meta-label {
	color: #9ca3af;
	font-weight: 600;
	min-width: 72px;
}

.hi-card__meta-value {
	color: #334155;
	font-weight: 700;
}

.hi-card__link {
	display: block;
	margin-top: auto;
	text-align: right;
	color: #e63946;
	font-weight: 700;
	font-size: 0.875rem;
	text-decoration: none;
	transition: opacity 150ms;
}

.hi-card__link:hover {
	opacity: 0.75;
}

/* ── Skeleton loader ── */

@keyframes hi-shimmer {
	0%   { background-position: -300px 0; }
	100% { background-position: 300px 0; }
}

.hi-card--skeleton {
	height: 290px;
	background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%) 0 0 / 600px 100%;
	animation: hi-shimmer 1.4s infinite;
	border: none;
	border-radius: 18px;
}

.hi-card--skeleton::before {
	display: none;
}

/* ── Paginação ── */

.hi-pagination {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 40px;
	padding-bottom: 64px;
}

.hi-pagination[hidden] {
	display: none !important;
}

.hi-page-link {
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(15, 23, 42, 0.14);
	border-radius: 10px;
	text-decoration: none;
	color: #0f172a;
	font-size: 0.875rem;
	font-weight: 700;
	transition: border-color 150ms, background 150ms, color 150ms;
}

.hi-page-link:hover {
	border-color: #e63946;
	color: #e63946;
}

.hi-page-link--active {
	background: #e63946;
	color: #fff !important;
	border-color: #e63946;
}

/* ── Estado vazio ── */

.hi-empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 72px 24px;
	gap: 16px;
}

.hi-empty-state__icon {
	font-size: 3rem;
	line-height: 1;
}

.hi-empty-state h2 {
	font-size: 1.25rem;
	font-weight: 800;
	color: #0f172a;
	margin: 0;
}

.hi-empty-state p {
	color: #64748b;
	margin: 0;
	font-size: 0.95rem;
}

/* ── Estado de erro ── */

.hi-error-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 72px 24px;
	gap: 16px;
}

.hi-error-state h2 {
	font-size: 1.25rem;
	font-weight: 800;
	color: #0f172a;
	margin: 0;
}

.hi-error-state p {
	color: #64748b;
	margin: 0;
	font-size: 0.95rem;
}

/* ── Botões de ação (CTA de estados) ── */

.hi-btn--action {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 24px;
	border-radius: 999px;
	font-size: 0.9rem;
	font-weight: 800;
	cursor: pointer;
	border: none;
	font-family: inherit;
	transition: opacity 150ms, transform 150ms;
}

.hi-btn--action:hover {
	transform: translateY(-1px);
	opacity: 0.9;
}

.hi-btn--action-primary {
	background: #e63946;
	color: #fff;
	box-shadow: 0 8px 24px rgba(230, 57, 70, 0.28);
}

.hi-btn--action-ghost {
	background: transparent;
	color: #e63946;
	border: 2px solid #e63946;
}

/* ── Correção: display:flex não deve sobrepor [hidden] ── */

#hi-empty-state[hidden],
#hi-error-state[hidden],
#hi-grid[hidden] { display: none !important; }
