/* ============================================================
 * DROPE Live Search
 *
 * O campo costuma viver num header estreito, então o painel NÃO herda a
 * largura do input: ele tem largura própria e se alinha à direita quando
 * encostaria fora da tela. Sem isso as linhas ficam espremidas e nasce
 * rolagem horizontal.
 * ============================================================ */

.dls {
	--dls-ink: #14161a;
	--dls-ink-2: #3d424a;
	--dls-muted: #6b7076;
	--dls-faint: #9aa0a6;
	--dls-line: #e8e8ec;
	--dls-line-soft: #f1f1f4;
	--dls-surface: #fff;
	--dls-canvas: #f7f7f8;
	--dls-brand: #ff7e01;
	--dls-brand-ink: #a34700;
	--dls-brand-tint: #fff4e8;
	--dls-ok: #157f58;
	--dls-ok-tint: #eef8f3;

	position: relative;
	width: 100%;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.45;
	color: var(--dls-ink);
}

.dls *,
.dls *::before,
.dls *::after { box-sizing: border-box; }

.dls svg { display: block; }

/* ---------- Barra ---------- */

/* Pílula branca com o botão escuro arredondado na ponta direita, com um bico
   apontando para o campo. Sem bordas encostando na moldura do header — era o
   que parecia "borda dupla". */
.dls-bar {
	display: flex;
	align-items: center;
	margin: 0;
	border: none;
	border-radius: 999px;
	background: var(--dls-surface);
	box-shadow: inset 0 0 0 1px var(--dls-line);
	transition: box-shadow 0.16s ease;
}

.dls-bar:focus-within {
	box-shadow: inset 0 0 0 1px rgba(20, 22, 26, 0.18), 0 0 0 3px rgba(20, 22, 26, 0.06);
}

/* Altura e corpo de texto acompanham o submenu do header, que é onde a barra
   vive — maior que isso e ela rouba a cena da navegação. */
.dls-input {
	flex: 1;
	min-width: 0;
	height: 34px;
	padding: 0 6px 0 16px;
	border: none;
	background: transparent;
	font-family: inherit;
	font-size: 13px;
	color: var(--dls-ink);
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

/* O tema estiliza input[type=search] com borda, fundo e sombra próprios —
   era a moldura que aparecia dentro da pílula. Aqui o campo é só texto. */
.dls .dls-input,
.dls .dls-input:hover,
.dls .dls-input:focus,
.dls .dls-input:focus-visible,
.dls .dls-input:active {
	border: 0 none !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	outline: none !important;
	min-height: 0;
	line-height: normal;
}

.dls-input::placeholder { color: var(--dls-faint); opacity: 1; }
.dls-input::-webkit-search-cancel-button,
.dls-input::-webkit-search-decoration { display: none; }

.dls .dls-clear,
.dls .dls-clear:hover,
.dls .dls-clear:focus {
	border: none;
	box-shadow: none;
}

.dls .dls-clear {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--dls-faint);
	cursor: pointer;
	transition: color 0.14s ease, background 0.14s ease;
}

.dls .dls-clear svg { width: 14px; height: 14px; }

.dls .dls-clear:hover {
	background: var(--dls-canvas);
	color: var(--dls-ink);
}

.dls .dls-clear[hidden] { display: none; }

.dls .dls-go,
.dls .dls-go:hover,
.dls .dls-go:focus {
	border: none;
	box-shadow: none;
}

.dls .dls-go {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 42px;
	height: 34px;
	padding: 0;
	border-radius: 10px;
	background: var(--dls-brand);
	color: #fff;
	cursor: pointer;
	transition: background 0.16s ease, transform 0.16s ease;
}

/* O bico à esquerda do botão, apontando para o campo. */
.dls .dls-go::before {
	content: '';
	position: absolute;
	left: -4px;
	top: 50%;
	width: 11px;
	height: 11px;
	border-radius: 2px;
	background: inherit;
	transform: translateY(-50%) rotate(45deg);
}

.dls .dls-go svg {
	position: relative;
	z-index: 1;
	width: 16px;
	height: 16px;
}

.dls .dls-go:hover {
	background: #e06e00;
	color: #fff;
}

.dls .dls-go:active { transform: scale(0.97); }

.dls .dls-go:focus-visible {
	outline: 2px solid var(--dls-brand);
	outline-offset: 3px;
}

/* ---------- Painel ---------- */

.dls-panel {
	position: absolute;
	z-index: 99999;
	top: calc(100% + 8px);
	left: 0;
	/* Largura própria: nunca menor que 420px, nunca maior que a tela. */
	width: max(100%, 420px);
	max-width: calc(100vw - 24px);
	max-height: min(72vh, 620px);
	overflow-y: auto;
	overflow-x: hidden;
	overscroll-behavior: contain;
	border: 1px solid var(--dls-line);
	border-radius: 14px;
	background: var(--dls-surface);
	box-shadow: 0 16px 48px rgba(20, 22, 26, 0.18), 0 2px 6px rgba(20, 22, 26, 0.06);
	animation: dls-in 0.16s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Quando o campo está no canto direito, o painel ancora pela direita. */
.dls-panel.is-right { left: auto; right: 0; }

.dls-panel[hidden] { display: none; }

@keyframes dls-in {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: none; }
}

.dls-panel::-webkit-scrollbar { width: 10px; }
.dls-panel::-webkit-scrollbar-track { background: transparent; }
.dls-panel::-webkit-scrollbar-thumb {
	background: #d9d9df;
	border: 3px solid var(--dls-surface);
	border-radius: 999px;
}
.dls-panel::-webkit-scrollbar-thumb:hover { background: #c2c2cb; }

/* ---------- Filtros ---------- */

.dls-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 12px 14px;
	border-bottom: 1px solid var(--dls-line-soft);
	background: var(--dls-surface);
	position: sticky;
	top: 0;
	z-index: 2;
}

.dls .dls-chip,
.dls .dls-chip:hover,
.dls .dls-chip:focus {
	box-shadow: none;
	text-decoration: none;
}

.dls .dls-chip {
	padding: 6px 13px;
	border: 1px solid var(--dls-line);
	border-radius: 999px;
	background: var(--dls-surface);
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--dls-muted);
	white-space: nowrap;
	cursor: pointer;
	transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.dls .dls-chip:hover {
	border-color: #d4d4da;
	background: var(--dls-canvas);
	color: var(--dls-ink);
}

.dls .dls-chip.is-on {
	background: var(--dls-ink);
	border-color: var(--dls-ink);
	color: #fff;
}

/* ---------- Lista ---------- */

.dls-list { padding: 6px; }

.dls-head {
	padding: 10px 10px 6px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--dls-faint);
}

.dls .dls-item,
.dls .dls-item:hover {
	text-decoration: none;
	box-shadow: none;
}

.dls-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
	border-radius: 10px;
	color: inherit;
	transition: background 0.12s ease;
}

.dls-item + .dls-item { margin-top: 2px; }

.dls-item:hover,
.dls-item.is-active { background: var(--dls-canvas); }

.dls-thumb {
	flex: 0 0 auto;
	width: 58px;
	height: 44px;
	border-radius: 8px;
	border: 1px solid var(--dls-line);
	background: var(--dls-canvas) center/cover no-repeat;
}

.dls-body {
	flex: 1 1 auto;
	min-width: 0; /* deixa o ellipsis funcionar dentro do flex */
}

.dls-title {
	display: flex;
	align-items: baseline;
	gap: 8px;
	min-width: 0;
}

.dls-name {
	flex: 0 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 14px;
	font-weight: 600;
	color: var(--dls-ink);
}

.dls-name mark {
	padding: 0;
	background: transparent;
	color: var(--dls-brand-ink);
	font-weight: 700;
}

.dls-ver {
	flex: 0 0 auto;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 11.5px;
	font-weight: 600;
	color: var(--dls-muted);
	white-space: nowrap;
}

.dls-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 5px;
	min-width: 0;
	font-size: 11.5px;
	color: var(--dls-faint);
}

.dls-cat {
	flex: 0 0 auto;
	padding: 2px 8px;
	border-radius: 5px;
	background: var(--dls-canvas);
	font-weight: 600;
	color: var(--dls-ink-2);
	white-space: nowrap;
}

.dls-date {
	flex: 0 1 auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dls-flag {
	flex: 0 0 auto;
	padding: 2px 8px;
	border-radius: 5px;
	background: var(--dls-ok-tint);
	font-weight: 600;
	color: var(--dls-ok);
	white-space: nowrap;
}

/* ---------- Rodapé e estados ---------- */

.dls .dls-more,
.dls .dls-more:hover { text-decoration: none; box-shadow: none; }

.dls-more {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 13px;
	border-top: 1px solid var(--dls-line-soft);
	background: var(--dls-surface);
	font-size: 13px;
	font-weight: 600;
	color: var(--dls-brand-ink);
	position: sticky;
	bottom: 0;
	transition: background 0.14s ease;
}

.dls-more:hover { background: var(--dls-brand-tint); color: var(--dls-brand-ink); }
.dls-more[hidden] { display: none; }

.dls-empty {
	padding: 30px 18px;
	text-align: center;
	font-size: 13.5px;
	color: var(--dls-muted);
}

.dls-empty strong { color: var(--dls-ink); font-weight: 600; }

.dls-skeleton {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
}

.dls-skeleton i {
	display: block;
	border-radius: 6px;
	background: linear-gradient(90deg, #f1f1f4 25%, #e7e7ec 37%, #f1f1f4 63%);
	background-size: 400% 100%;
	animation: dls-shimmer 1.3s ease-in-out infinite;
}

.dls-skeleton > i { width: 58px; height: 44px; flex: 0 0 auto; border-radius: 8px; }
.dls-skeleton span { flex: 1; min-width: 0; }
.dls-skeleton span i { height: 10px; }
.dls-skeleton span i:first-child { width: 70%; margin-bottom: 8px; }
.dls-skeleton span i:last-child { width: 40%; height: 8px; }

@keyframes dls-shimmer {
	from { background-position: 100% 50%; }
	to   { background-position: 0 50%; }
}

@media (prefers-reduced-motion: reduce) {
	.dls-panel,
	.dls-skeleton i { animation: none; }
}

@media (max-width: 640px) {
	.dls-panel {
		width: calc(100vw - 24px);
		max-height: 68vh;
	}

	.dls-thumb { width: 48px; height: 38px; }
	.dls-name { font-size: 13.5px; }
}
