/**
 * Product Search overlay / sidebar styles.
 *
 * @package Kadence_Child
 */

/* Closed by default, open via .is-open class
-------------------------------------------------------------- */
header .header-html-inner {
	display: flex;
}

header .header-html-inner p {
	margin: 0;
}

.kc-search {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999;
	justify-content: center;
}

.kc-search.is-open {
	display: flex;
}

/* Inner elements hidden by default, shown via .is-visible
-------------------------------------------------------------- */
.kc-search__results,
.kc-search__no-results,
.kc-search__loading {
	display: none;
}

.kc-search__results.is-visible {
	display: block;
}

.kc-search__no-results.is-visible {
	display: block;
}

.kc-search__loading.is-visible {
	display: flex;
}

/* Trigger button
-------------------------------------------------------------- */
.kc-search-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: center;
	width: 24px;
	height: 24px;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	color: var(--global-palette3, #1A1A2E);
	transition: color 0.2s;
	margin-right: 10px;
}

.kc-search-trigger:hover {
	color: var(--global-palette1, #c569ff);
	background-color: transparent !important;
}

/* Backdrop
-------------------------------------------------------------- */
.kc-search__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
}

/* Panel — desktop: top overlay
-------------------------------------------------------------- */
.kc-search__panel {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: var(--global-content-width);
	max-height: 80vh;
	margin-top: 0;
	background: #fff;
	border-radius: 0 0 24px 24px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: kc-search-slide-down 0.25s ease-out;
}

@keyframes kc-search-slide-down {
	from {
		opacity: 0;
		transform: translateY(-20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Header
-------------------------------------------------------------- */
.kc-search__header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 20px 24px;
	border-bottom: 1px solid #E5D7EE;
}

.kc-search__input-wrap {
	flex: 1;
	position: relative;
}

.kc-search__input-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
	z-index: 1;
}

.kc-search__input {
	display: block;
	width: 100%;
	padding: 12px 16px 12px 44px !important;
	border: none !important;
	border-radius: 16px;
	font-size: 16px;
	color: var(--global-palette3, #1A1A2E);
	background: transparent !important;
	box-sizing: border-box;
}

.kc-search__input:focus {
	outline: none;
	box-shadow: none !important;
}

.kc-search__close {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: transparent;
	color: var(--global-palette3, #1A1A2E);
	cursor: pointer;
	padding: 0 !important;
}

/* Body
-------------------------------------------------------------- */
.kc-search__body {
	flex: 1;
	overflow-y: auto;
	padding: 24px;
}

/* Search results
-------------------------------------------------------------- */
.kc-search__results {
	margin-bottom: 28px;
}

.kc-search__no-results {
	text-align: center;
	color: #9ca3af;
	padding: 24px 0;
	margin: 0;
}

/* Smaller cards inside search panel
-------------------------------------------------------------- */
.kc-search .kc-product-cards {
	gap: 24px;
}

.kc-search .kc-product-cards__image-link img {
	box-shadow: -4px 4px 6px rgba(0, 0, 0, 0.3);
}

.kc-search .kc-product-cards__title {
	font-size: 16px;
}

.kc-search .kc-product-cards__excerpt {
	font-size: 14px;
	margin-bottom: 8px;
}

.kc-search .kc-product-cards__price {
	font-size: 16px;
}

.kc-search .kc-product-cards__price .kc-product-card__from {
	font-size: 16px;
}

/* Static content: Common Searches + Now Trending side by side
-------------------------------------------------------------- */
.kc-search__static {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
	align-items: start;
}

/* Section titles
-------------------------------------------------------------- */
.kc-search__section {
	margin: 0;
}

.kc-search__section-title {
	font-size: 14px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #9ca3af;
	margin: 0 0 14px;
}

/* Common search tags
-------------------------------------------------------------- */
.kc-search__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.kc-search__tag {
	padding: 8px 16px;
	border: 1px solid #E5D7EE;
	border-radius: 20px;
	background: transparent;
	font-size: 14px;
	color: var(--global-palette3, #1A1A2E);
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s;
}

.kc-search__tag:hover {
	background: #faf5ff;
	border-color: var(--global-palette1, #c569ff);
	color: var(--global-palette1, #c569ff);
}

/* Loading spinner
-------------------------------------------------------------- */
.kc-search__loading {
	justify-content: center;
	padding: 24px 0;
}

.kc-search__spinner {
	width: 24px;
	height: 24px;
	border: 2px solid #E5D7EE;
	border-top-color: var(--global-palette1, #c569ff);
	border-radius: 50%;
	animation: kc-search-spin 0.6s linear infinite;
}

@keyframes kc-search-spin {
	to { transform: rotate(360deg); }
}

/* Mobile: sidebar
-------------------------------------------------------------- */
@media (max-width: 768px) {
	.kc-search {
		justify-content: flex-end;
	}

	.kc-search__panel {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		width: 85vw;
		max-width: 360px;
		max-height: none;
		margin-top: 0;
		border-radius: 0;
		animation: kc-search-slide-left 0.25s ease-out;
	}

	@keyframes kc-search-slide-left {
		from {
			opacity: 0;
			transform: translateX(100%);
		}
		to {
			opacity: 1;
			transform: translateX(0);
		}
	}

	.kc-search__header {
		padding: 16px;
	}

	.kc-search__body {
		padding: 16px;
	}

	.kc-search__static {
		grid-template-columns: 1fr;
	}

	.kc-search .kc-product-cards {
		grid-template-columns: 1fr;
		gap: 32px;
	}
}
