/**
 * ACCESFY Premium AJAX Search
 */

.accesfy-search {
	position: relative;
	display: inline-flex;
}

.accesfy-search__trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	color: #ffffff;
	cursor: pointer;
	transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.accesfy-search__trigger:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.2);
}

.accesfy-search__overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
	backdrop-filter: blur(6px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	z-index: 100200;
}

.accesfy-search__panel {
	position: fixed;
	left: 50%;
	top: 12%;
	transform: translateX(-50%) translateY(-12px);
	width: min(640px, calc(100vw - 32px));
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
	z-index: 100201;
	pointer-events: none;
}

.accesfy-search.is-open .accesfy-search__overlay {
	opacity: 1;
	visibility: visible;
}

.accesfy-search.is-open .accesfy-search__panel {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
	pointer-events: auto;
}

.accesfy-search__panel-inner {
	background: rgba(17, 17, 17, 0.95);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 16px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
	overflow: hidden;
}

.accesfy-search__bar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 18px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.accesfy-search__bar-icon {
	color: #a1a1aa;
	flex-shrink: 0;
}

.accesfy-search__input {
	flex: 1;
	background: transparent;
	border: none;
	color: #ffffff;
	font-size: 15px;
	outline: none;
	font-family: Inter, system-ui, sans-serif;
}

.accesfy-search__input::placeholder {
	color: #71717a;
}

.accesfy-search__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 8px;
	color: #ffffff;
	cursor: pointer;
}

.accesfy-search__results {
	max-height: 420px;
	overflow-y: auto;
}

.accesfy-search__status {
	padding: 24px 18px;
	margin: 0;
	color: #a1a1aa;
	font-size: 14px;
	text-align: center;
}

.accesfy-search__list {
	list-style: none;
	margin: 0;
	padding: 8px 0;
}

.accesfy-search__item {
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.accesfy-search__item:last-child {
	border-bottom: none;
}

.accesfy-search__link {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 18px;
	text-decoration: none;
	color: #ffffff;
	transition: background 0.2s ease, transform 0.2s ease;
}

.accesfy-search__link:hover {
	background: rgba(255, 255, 255, 0.05);
	transform: translateX(3px);
}

.accesfy-search__thumb {
	width: 52px;
	height: 52px;
	object-fit: cover;
	border-radius: 10px;
	background: #0a0a0a;
	border: 1px solid rgba(255, 255, 255, 0.08);
	flex-shrink: 0;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.accesfy-search__meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.accesfy-search__name {
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
}

.accesfy-search__price {
	font-size: 13px;
	color: #a1a1aa;
}

body.accesfy-search-open {
	overflow: hidden;
}

/* ─── Inline field (header strip / drawer) ─── */
.accesfy-search--inline {
	display: block;
	width: 100%;
	position: relative;
}

.accesfy-search__field {
	display: flex;
	align-items: center;
	gap: 6px;
	width: 100%;
	height: 30px;
	padding: 0 10px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.09);
	border-radius: 8px;
	transition: border-color 0.2s ease, background 0.2s ease;
}

.accesfy-search--inline.is-active .accesfy-search__field,
.accesfy-search__field:focus-within {
	border-color: rgba(201, 169, 98, 0.4);
	background: rgba(255, 255, 255, 0.05);
}

.accesfy-search__field-icon {
	color: #c9a962;
	flex-shrink: 0;
	width: 13px;
	height: 13px;
}

.accesfy-search--inline .accesfy-search__input {
	flex: 1;
	min-width: 0;
	height: 100%;
	background: transparent;
	border: none;
	color: #ffffff;
	font-size: 12px;
	outline: none;
	font-family: Inter, system-ui, sans-serif;
	line-height: 1;
	padding: 0;
}

.accesfy-search--inline .accesfy-search__input::placeholder {
	color: rgba(255, 255, 255, 0.4);
}

.accesfy-search__dropdown {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 5px);
	z-index: 50;
	background: #0d0d0d;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-top: 2px solid #c9a962;
	border-radius: 12px;
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
	overflow: hidden;
	max-height: 0;
	opacity: 0;
	visibility: hidden;
	transition: max-height 0.28s ease, opacity 0.22s ease, visibility 0.22s ease;
}

.accesfy-hb__search-strip-field .accesfy-search__dropdown {
	max-width: none;
}

.accesfy-search--inline.is-active .accesfy-search__dropdown:not(:empty) {
	max-height: 340px;
	opacity: 1;
	visibility: visible;
	overflow-y: auto;
}

.accesfy-search__results-list {
	display: none;
}

.accesfy-search__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	padding: 10px;
}

.accesfy-search__grid-card {
	display: flex;
	flex-direction: column;
	gap: 5px;
	padding: 8px;
	text-decoration: none;
	color: #ffffff;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 10px;
	transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.accesfy-search__grid-card:hover {
	border-color: rgba(201, 169, 98, 0.45);
	background: rgba(255, 255, 255, 0.07);
	transform: translateY(-2px);
}

.accesfy-search__grid-media {
	display: block;
	aspect-ratio: 1;
	border-radius: 8px;
	overflow: hidden;
	background: #111;
}

.accesfy-search__grid-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.accesfy-search__grid-name {
	font-size: 11px;
	font-weight: 600;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.accesfy-search__grid-price {
	font-size: 11px;
	color: #c9a962;
	font-weight: 700;
}

.accesfy-search__inline-list {
	list-style: none;
	margin: 0;
	padding: 6px 0;
}

.accesfy-search__inline-item {
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.accesfy-search__inline-item:last-child {
	border-bottom: none;
}

.accesfy-search__inline-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	text-decoration: none;
	color: #ffffff;
	transition: background 0.2s ease;
}

.accesfy-search__inline-link:hover {
	background: rgba(255, 255, 255, 0.06);
}

.accesfy-search__inline-thumb {
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 10px;
	background: #111;
	border: 1px solid rgba(255, 255, 255, 0.1);
	flex-shrink: 0;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.accesfy-search__inline-meta {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.accesfy-search__inline-name {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
	color: #fff;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.accesfy-search__inline-price {
	font-size: 12px;
	color: #c9a962;
	font-weight: 700;
}

.accesfy-search--inline .accesfy-search__status {
	padding: 14px 12px;
	margin: 0;
	color: rgba(255, 255, 255, 0.6);
	font-size: 12px;
	text-align: center;
}

@media (max-width: 1024px) {
	.accesfy-hb__search-strip-field .accesfy-search__dropdown {
		max-width: none;
	}

	.accesfy-search--inline.is-active .accesfy-search__dropdown:not(:empty) {
		max-height: 360px;
	}

	.accesfy-search__results-grid {
		display: none;
	}

	.accesfy-search__results-list {
		display: block;
	}
}

@media (max-width: 480px) {
	.accesfy-search__field {
		height: 28px;
		padding: 0 9px;
	}

	.accesfy-search--inline .accesfy-search__input {
		font-size: 11px;
	}
}

@media (max-width: 768px) {
	.accesfy-search__panel {
		top: 0;
		left: 0;
		right: 0;
		width: 100%;
		transform: translateY(-100%);
	}

	.accesfy-search.is-open .accesfy-search__panel {
		transform: translateY(0);
	}

	.accesfy-search__panel-inner {
		border-radius: 0 0 16px 16px;
	}
}
