/* ==========================================================================
   Artwallz DE – Header Search
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Search trigger button (magnifying glass icon in the header)
   -------------------------------------------------------------------------- */

.awz-search-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 6px;
	margin-left: 12px;
	color: #000;
	line-height: 1;
	flex-shrink: 0;
	transition: color 0.15s ease, opacity 0.15s ease;
	/* Vertically centre inside the header flex row */
	align-self: center;
}

.awz-search-trigger:hover,
.awz-search-trigger:focus-visible {
	color: #555;
	outline: none;
}

.awz-search-trigger svg {
	display: block;
	width: 20px;
	height: 20px;
}

/* Hide default browser focus ring; show custom one */
.awz-search-trigger:focus-visible {
	box-shadow: 0 0 0 2px #000;
	border-radius: 2px;
}

/* --------------------------------------------------------------------------
   2. Dark backdrop (fades in behind the overlay)
   -------------------------------------------------------------------------- */

.awz-search-backdrop {
	position: fixed;
	top: 132px;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9990;
	background: rgba(0, 0, 0, 0.4);

	/* Hidden by default */
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

body.awz-search-open .awz-search-backdrop {
	opacity: 1;
	pointer-events: auto;
}

/* --------------------------------------------------------------------------
   3. Search overlay panel
   -------------------------------------------------------------------------- */

.awz-search-overlay {
	position: fixed;
	top: 132px; /* aligns with mega menu dropdown — 134px from top of header */
	left: 0;
	right: 0;
	z-index: 9999;
	background: #fff;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
	border-top: 2px solid #000; /* matches mega menu border */

	/* Hidden state: same fade-in-from-bottom as mega menu */
	opacity: 0;
	transform: translateY(10px);
	pointer-events: none;
	visibility: hidden;
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
	will-change: transform, opacity;
}

/* Open state */
body.awz-search-open .awz-search-overlay {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
	visibility: visible;
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0s;
}

/* --------------------------------------------------------------------------
   4. Overlay inner layout
   -------------------------------------------------------------------------- */

.awz-search-overlay-inner {
	display: flex;
	align-items: center;
	gap: 0;
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 2rem;
	height: 70px; /* matches typical Astra header height */
}

/* --------------------------------------------------------------------------
   5. Search form & field
   -------------------------------------------------------------------------- */

.awz-search-form {
	flex: 1;
	min-width: 0;
}

.awz-search-field-wrap {
	display: flex;
	align-items: center;
	gap: 12px;
	border-bottom: 1.5px solid #000;
	padding-bottom: 4px;
}

.awz-search-icon {
	display: flex;
	align-items: center;
	color: #888;
	flex-shrink: 0;
}

.awz-search-icon svg {
	display: block;
	width: 18px;
	height: 18px;
}

.awz-search-input {
	flex: 1;
	border: none;
	outline: none;
	box-shadow: none;
	background: transparent;
	font-family: 'Roboto', sans-serif;
	font-size: 17px;
	font-weight: 400;
	color: #000;
	padding: 4px 0;
	/* Remove browser default search input decorations */
	-webkit-appearance: none;
	appearance: none;
}

.awz-search-input:focus,
.awz-search-input:focus-visible {
	outline: none;
	box-shadow: none;
}

.awz-search-input::placeholder {
	color: #aaa;
	font-weight: 300;
}

/* Remove the browser's native × clear button */
.awz-search-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

/* --------------------------------------------------------------------------
   6. Close button
   -------------------------------------------------------------------------- */

.awz-search-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	background: transparent;
	border: none;
	cursor: pointer;
	color: #000;
	padding: 6px;
	margin-left: 16px;
	transition: color 0.15s ease, transform 0.2s ease;
}

.awz-search-close:hover {
	color: #555;
	transform: rotate(90deg);
}

.awz-search-close:focus-visible {
	outline: 2px solid #000;
	border-radius: 2px;
}

.awz-search-close svg {
	display: block;
	width: 22px;
	height: 22px;
}

/* --------------------------------------------------------------------------
   7. Mobile: compact overlay height
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
	.awz-search-overlay-inner {
		height: 60px;
		padding: 0 1rem;
	}

	.awz-search-input {
		font-size: 16px; /* prevent iOS zoom */
	}
}
