/* --- Positionnement des conteneurs (spécifique à chaque box) --- */
.site-header, .header-main {
	position: relative;
}
.custom-search-box {
	display: inline-flex;
	align-items: center;
}
.custom-search-box form {
	display: flex;
	align-items: center;
	background: #ffe1cc;
	border: none;
	border-radius: 0;
	overflow: hidden;
	width: 400px;
	max-width: 100%;
	position: relative;
}
.sidebar-search-form {
	display: flex;
	align-items: center;
	background: #ffe1cc;
	border: none;
	border-radius: 0;
	overflow: hidden;
	width: min(400px, 100%);
	position: relative;
	height: 48px;
}

/* --- Règles communes aux 2 box (input, placeholder, bouton clear, message d'erreur) --- */
.custom-search-box .search-input-wrap,
.sidebar-search-form .search-input-wrap {
	position: relative;
	flex: 1;
	display: flex;
	align-items: center;
}
.custom-search-box input[type="search"],
.sidebar-search-form input[type="search"] {
	font-family: inherit;
	width: 100%;
	border: none !important;
	outline: none !important;
	padding: 12px 34px 12px 18px !important;
	font-size: 16px !important;
	font-weight: 400 !important;
	background: transparent !important;
	color: #333 !important;
	box-shadow: none !important;
}
.custom-search-box input[type="search"]::placeholder,
.sidebar-search-form input[type="search"]::placeholder {
	font-family: inherit;
	color: #aaa;
	font-weight: 400;
	font-size: 16px;
}
.custom-search-box input[type="search"]::-webkit-search-cancel-button,
.sidebar-search-form input[type="search"]::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}
.custom-search-box .search-clear-btn,
.sidebar-search-form .search-clear-btn {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	color: #999;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease, color 0.15s ease;
}
.custom-search-box .search-clear-btn.visible,
.sidebar-search-form .search-clear-btn.visible {
	opacity: 1;
	pointer-events: auto;
}
.custom-search-box .search-clear-btn:hover,
.sidebar-search-form .search-clear-btn:hover {
	color: #ff6900;
}
.custom-search-box .search-error-msg,
.sidebar-search-form .search-error-msg {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	padding: 12px 18px;
	font-size: 16px;
	font-weight: 400;
	font-family: inherit;
	color: #ff6900;
	background: #ffe1cc;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.15s ease;
}
.custom-search-box .search-error-msg.show,
.sidebar-search-form .search-error-msg.show {
	opacity: 1;
}

/* --- Bouton submit (spécifique à chaque box) --- */
.custom-search-box button[type="submit"] {
	background: transparent !important;
	border: none !important;
	padding: 15px 16px !important;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: none !important;
	outline: none !important;
	transition: background-color 0.3s ease;
}
.custom-search-box button[type="submit"]:hover {
	background-color: #ff6900 !important;
}
.custom-search-box button[type="submit"] svg path {
	fill: #ff6900;
	transition: fill 0.3s ease;
}
.custom-search-box button[type="submit"]:hover svg path {
	fill: #ffe1cc;
}
.custom-search-box button svg.search-icon {
	display: block;
}

.sidebar-search-form button.search-submit {
	background: transparent !important;
	border: none !important;
	padding: 15px 16px !important;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: none !important;
	outline: none !important;
	transition: background-color 0.3s ease;
	line-height: 1 !important;
	margin-left: 0 !important;
}
.sidebar-search-form button.search-submit:hover {
	background-color: #ff6900 !important;
}
.sidebar-search-form button.search-submit svg {
	width: 20px !important;
	height: 21px !important;
	display: block;
	position: relative;
	top: 1px;
	transform: scale(1);
	transform-origin: center;
}
.sidebar-search-form button.search-submit svg path {
	fill: #ff6900;
	transition: fill 0.3s ease;
}
.sidebar-search-form button.search-submit:hover svg path {
	fill: #ffe1cc !important;
}

/* --- Responsive : box du header (positionnement absolu) --- */
@media (min-width: 1025px) {
	.custom-search-box {
		position: absolute;
		top: 20px;
		left: 62%;
		z-index: 9999;
	}
}
@media (min-width: 769px) and (max-width: 1024px) {
	.header-bottom .light-mode,
	.header-bottom-inner.light-mode {
		background: transparent !important;
		box-shadow: none !important;
	}
	.custom-search-box {
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
		top: 20px;
		z-index: 9999;
		width: 400px;
		max-width: 90%;
	}
	.custom-search-box form {
		width: 100%;
	}
	body.category #page-titlebar,
	body.tag #page-titlebar,
	body.archive #page-titlebar,
	body.page #page-titlebar {
		margin-top: 30px;
	}
}
@media (max-width: 768px) {
	.header-bottom .light-mode,
	.header-bottom-inner.light-mode {
		background: transparent !important;
		box-shadow: none !important;
	}
	.custom-search-box {
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
		width: 90%;
		max-width: 400px;
		margin-top: -6px !important;
	}
	.custom-search-box form {
		width: 100%;
	}
	.custom-search-box input[type="search"]::placeholder {
		font-size: 14px;
	}
	body.category #page-titlebar,
	body.tag #page-titlebar,
	body.archive #page-titlebar,
	body.page #page-titlebar {
		margin-top: 40px;
	}
}

/* --- Responsive : box du footer/sidebar --- */
@media (max-width: 480px) {
	.sidebar-search-form button.search-submit {
		padding: 15px 16px !important;
	}
	.sidebar-search-form button.search-submit svg {
		width: 20px !important;
		height: 21px !important;
		transform: scale(1);
	}
}
@media (max-width: 768px) {
	.sidebar-search-form input[type="search"]::placeholder {
		font-size: 14px;
	}
}
