/* WPT Popup Search */

#wpt-popup-search-modal,
#wpt-popup-search-modal *,
#wpt-popup-search-modal *::before,
#wpt-popup-search-modal *::after,
.wpt-popup-search-wrap,
.wpt-popup-search-wrap *,
.wpt-popup-search-wrap *::before,
.wpt-popup-search-wrap *::after {
	box-sizing: border-box;
}

#wpt-popup-search-modal .screen-reader-text,
.wpt-popup-search-wrap .screen-reader-text {
	border: 0 !important;
	clip: rect(1px, 1px, 1px, 1px) !important;
	clip-path: inset(50%) !important;
	height: 1px !important;
	margin: -1px !important;
	overflow: hidden !important;
	padding: 0 !important;
	position: absolute !important;
	width: 1px !important;
	word-wrap: normal !important;
}

.wpt-popup-search-wrap {
	display: inline-block;
	vertical-align: middle;
}

/* Trigger button — base (hover override in PHP inline + JS) */
html body div.wpt-popup-search-wrap[data-wpt-ps-wrap] > button.wpt-popup-search-trigger[type="button"][data-wpt-ps-open] {
	-webkit-appearance: none !important;
	appearance: none !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: auto !important;
	min-width: 0 !important;
	min-height: 0 !important;
	height: auto !important;
	padding: 0.625rem !important;
	margin: 0 !important;
	border: none !important;
	border-radius: 8px !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	color: var(--wpt-ps-icon-color, #111) !important;
	font-family: inherit !important;
	font-size: inherit !important;
	font-weight: inherit !important;
	font-style: normal !important;
	line-height: 1 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-decoration: none !important;
	text-shadow: none !important;
	box-shadow: none !important;
	filter: none !important;
	opacity: 1 !important;
	cursor: pointer !important;
	vertical-align: middle !important;
	transition: background-color 0.2s ease !important;
}

html body div.wpt-popup-search-wrap[data-wpt-ps-wrap] > button.wpt-popup-search-trigger[type="button"][data-wpt-ps-open]:hover,
html body div.wpt-popup-search-wrap[data-wpt-ps-wrap] > button.wpt-popup-search-trigger[type="button"][data-wpt-ps-open]:focus,
html body div.wpt-popup-search-wrap[data-wpt-ps-wrap] > button.wpt-popup-search-trigger[type="button"][data-wpt-ps-open]:active,
html body div.wpt-popup-search-wrap[data-wpt-ps-wrap] > button.wpt-popup-search-trigger[type="button"][data-wpt-ps-open]:focus-visible {
	-webkit-appearance: none !important;
	appearance: none !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	border: none !important;
	border-color: transparent !important;
	color: var(--wpt-ps-icon-color, #111) !important;
	box-shadow: none !important;
	filter: none !important;
	opacity: 1 !important;
	outline: none !important;
	text-decoration: none !important;
	text-shadow: none !important;
	transform: none !important;
}

.wpt-popup-search-trigger__icon {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	pointer-events: none !important;
}

html body div.wpt-popup-search-wrap[data-wpt-ps-wrap] .wpt-popup-search-trigger__icon svg {
	display: block !important;
	stroke: var(--wpt-ps-icon-color, #111) !important;
	color: var(--wpt-ps-icon-color, #111) !important;
	fill: none !important;
}

html body div.wpt-popup-search-wrap[data-wpt-ps-wrap] > button.wpt-popup-search-trigger[type="button"][data-wpt-ps-open]:hover .wpt-popup-search-trigger__icon svg,
html body div.wpt-popup-search-wrap[data-wpt-ps-wrap] > button.wpt-popup-search-trigger[type="button"][data-wpt-ps-open]:focus .wpt-popup-search-trigger__icon svg,
html body div.wpt-popup-search-wrap[data-wpt-ps-wrap] > button.wpt-popup-search-trigger[type="button"][data-wpt-ps-open]:active .wpt-popup-search-trigger__icon svg,
html body div.wpt-popup-search-wrap[data-wpt-ps-wrap] > button.wpt-popup-search-trigger[type="button"][data-wpt-ps-open]:focus-visible .wpt-popup-search-trigger__icon svg {
	stroke: var(--wpt-ps-icon-color, #111) !important;
	color: var(--wpt-ps-icon-color, #111) !important;
	fill: none !important;
}

/* Fullscreen modal */
#wpt-popup-search-modal.wpt-popup-search-modal {
	--wpt-ps-duration: 0.5s;
	--wpt-ps-ease: cubic-bezier(0.4, 0, 0.2, 1);
	position: fixed !important;
	inset: 0 !important;
	z-index: 999999 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 100vw !important;
	height: 100vh !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	background: transparent !important;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition:
		opacity var(--wpt-ps-duration) var(--wpt-ps-ease),
		visibility var(--wpt-ps-duration) var(--wpt-ps-ease);
}

#wpt-popup-search-modal.wpt-popup-search-modal.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

#wpt-popup-search-modal.wpt-popup-search-modal[hidden] {
	display: flex !important;
}

#wpt-popup-search-modal .wpt-popup-search-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.94);
	backdrop-filter: blur(28px) saturate(1.2);
	-webkit-backdrop-filter: blur(28px) saturate(1.2);
	cursor: pointer;
	opacity: 0;
	transition: opacity var(--wpt-ps-duration) var(--wpt-ps-ease);
}

#wpt-popup-search-modal.is-open .wpt-popup-search-modal__overlay {
	opacity: 1;
}

#wpt-popup-search-modal .wpt-popup-search-modal__panel {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 2rem;
	pointer-events: none;
	opacity: 0;
	transform: translateY(28px) scale(0.96);
	transition:
		opacity var(--wpt-ps-duration) var(--wpt-ps-ease),
		transform var(--wpt-ps-duration) var(--wpt-ps-ease);
}

#wpt-popup-search-modal.is-open .wpt-popup-search-modal__panel {
	opacity: 1;
	transform: translateY(0) scale(1);
}

#wpt-popup-search-modal .wpt-popup-search-modal__inner {
	position: relative;
	width: 100%;
	max-width: 720px;
	pointer-events: auto;
}

/* Close button — theme-safe reset */
#wpt-popup-search-modal button.wpt-popup-search-modal__close[type="button"] {
	-webkit-appearance: none !important;
	appearance: none !important;
	position: fixed !important;
	top: 1.25rem !important;
	right: 1.25rem !important;
	z-index: 2 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	min-height: 0 !important;
	padding: 0.5rem !important;
	margin: 0 !important;
	border: none !important;
	border-radius: 8px !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	color: #111 !important;
	font-family: inherit !important;
	font-size: inherit !important;
	font-weight: inherit !important;
	line-height: 1 !important;
	text-transform: none !important;
	text-decoration: none !important;
	box-shadow: none !important;
	filter: none !important;
	cursor: pointer !important;
	opacity: 0;
	transform: scale(0.85) rotate(-90deg);
	transition:
		background-color 0.2s ease,
		opacity var(--wpt-ps-duration) var(--wpt-ps-ease),
		transform var(--wpt-ps-duration) var(--wpt-ps-ease) !important;
	pointer-events: auto;
}

#wpt-popup-search-modal.is-open button.wpt-popup-search-modal__close[type="button"] {
	opacity: 1;
	transform: scale(1) rotate(0deg);
	transition-delay: 0.12s;
}

#wpt-popup-search-modal button.wpt-popup-search-modal__close[type="button"]:hover,
#wpt-popup-search-modal button.wpt-popup-search-modal__close[type="button"]:focus,
#wpt-popup-search-modal button.wpt-popup-search-modal__close[type="button"]:focus-visible {
	background: rgba(0, 0, 0, 0.06) !important;
	background-color: rgba(0, 0, 0, 0.06) !important;
	background-image: none !important;
	color: #111 !important;
	box-shadow: none !important;
	outline: none !important;
}

#wpt-popup-search-modal button.wpt-popup-search-modal__close[type="button"]:focus-visible {
	outline: 2px solid #111 !important;
	outline-offset: 2px !important;
}

#wpt-popup-search-modal button.wpt-popup-search-modal__close[type="button"] svg {
	display: block !important;
	stroke: #111 !important;
	color: #111 !important;
	fill: none !important;
}

#wpt-popup-search-modal button.wpt-popup-search-modal__close[type="button"]:hover svg,
#wpt-popup-search-modal button.wpt-popup-search-modal__close[type="button"]:focus svg,
#wpt-popup-search-modal button.wpt-popup-search-modal__close[type="button"]:focus-visible svg {
	stroke: #111 !important;
	color: #111 !important;
}

#wpt-popup-search-modal .wpt-popup-search-modal__extra {
	margin-bottom: 1.25rem;
	color: #111;
}

#wpt-popup-search-modal .wpt-popup-search-modal__extra:last-child {
	margin-bottom: 0;
	margin-top: 1.25rem;
}

#wpt-popup-search-modal .wpt-popup-search-form {
	display: flex;
	gap: 1rem;
	align-items: stretch;
	width: 100%;
}

#wpt-popup-search-modal .wpt-popup-search-form__input[type="search"] {
	-webkit-appearance: none !important;
	appearance: none !important;
	flex: 1;
	min-width: 0;
	width: auto !important;
	min-height: 3.75rem !important;
	height: 3.75rem !important;
	padding: 0 1.25rem !important;
	margin: 0 !important;
	font-family: inherit !important;
	font-size: clamp(1.125rem, 3vw, 1.5rem) !important;
	font-weight: inherit !important;
	line-height: 1.4 !important;
	color: #111 !important;
	background: rgba(255, 255, 255, 0.98) !important;
	background-image: none !important;
	border: 1px solid #e4e4e4 !important;
	border-radius: 12px !important;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06) !important;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#wpt-popup-search-modal .wpt-popup-search-form__input[type="search"]:focus {
	outline: none !important;
	box-shadow:none !important;
}

/* Submit button — icon only */
#wpt-popup-search-modal button.wpt-popup-search-form__submit[type="submit"] {
	-webkit-appearance: none !important;
	appearance: none !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex-shrink: 0;
	width: 3.75rem !important;
	min-width: 3.75rem !important;
	height: 3.75rem !important;
	padding: 0 !important;
	margin: 0 !important;
	font-family: inherit !important;
	font-size: 0 !important;
	font-weight: inherit !important;
	font-style: normal !important;
	line-height: 1 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-decoration: none !important;
	text-shadow: none !important;
	color: #fff !important;
	background: var(--wpt-ps-icon-color, #111) !important;
	background-color: var(--wpt-ps-icon-color, #111) !important;
	background-image: none !important;
	border: none !important;
	border-radius: 12px !important;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
	cursor: pointer !important;
	transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease !important;
}

#wpt-popup-search-modal button.wpt-popup-search-form__submit[type="submit"] .wpt-popup-search-form__submit-icon {
	display: block !important;
	width: 22px !important;
	height: 22px !important;
	stroke: #fff !important;
	color: #fff !important;
}

#wpt-popup-search-modal button.wpt-popup-search-form__submit[type="submit"]:hover,
#wpt-popup-search-modal button.wpt-popup-search-form__submit[type="submit"]:focus,
#wpt-popup-search-modal button.wpt-popup-search-form__submit[type="submit"]:focus-visible {
	background: var(--wpt-ps-icon-color, #111) !important;
	background-color: var(--wpt-ps-icon-color, #111) !important;
	color: #fff !important;
	filter: brightness(0.88) !important;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28) !important;
	outline: none !important;
	transform: translateY(-1px);
}

body.wpt-popup-search-open {
	overflow: hidden;
}

.wpt-popup-search-extra-source {
	display: none !important;
}

@media (max-width: 640px) {
	#wpt-popup-search-modal .wpt-popup-search-modal__panel {
		padding: 1.25rem;
		align-items: flex-start;
		padding-top: 5rem;
	}

	#wpt-popup-search-modal button.wpt-popup-search-modal__close[type="button"] {
		top: 1rem !important;
		right: 1rem !important;
		padding: 0.375rem !important;
	}

	#wpt-popup-search-modal .wpt-popup-search-form {
		flex-direction: row;
	}

	#wpt-popup-search-modal button.wpt-popup-search-form__submit[type="submit"] {
		width: 3.25rem !important;
		min-width: 3.25rem !important;
		height: 3.25rem !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	#wpt-popup-search-modal.wpt-popup-search-modal,
	#wpt-popup-search-modal .wpt-popup-search-modal__overlay,
	#wpt-popup-search-modal .wpt-popup-search-modal__panel,
	#wpt-popup-search-modal button.wpt-popup-search-modal__close[type="button"] {
		transition-duration: 0.01ms !important;
		transition-delay: 0ms !important;
	}

	#wpt-popup-search-modal .wpt-popup-search-modal__panel {
		transform: none;
	}

	#wpt-popup-search-modal button.wpt-popup-search-modal__close[type="button"] {
		transform: none;
	}
}
