/*
 * header-vinted.css
 *
 * Re-skin Motta's #site-header to Vinted's actual top-row design.
 *
 * Verified live values from vinted.co.uk 2026-05-19 (Playwright eval):
 *   - <header class="l-header__main"> height = 52px
 *   - Search wrapper 493×24, bg light grey, NO border, 6px corners
 *   - Search input padding 1px 2px, font-size 16px
 *   - "Sell now" button: bg rgb(0,119,130) / 6px radius / padding 0 12px /
 *     font-size 12px / weight 375 (custom)
 *   - Everything uses ~6px border-radius. NOT a "pill" (999px) design.
 *
 * Banked: feedback_plugin-not-theme (override Motta, don't fork) +
 *         feedback_decide-once-no-rework (match verified reference).
 *
 * @package PrelovedBazaar
 */

/* ─── 1. Compact row, small everything ───────────────────────────────── */

#site-header .site-header__desktop .header-main {
	min-height: 52px;
	padding: 4px 0;
}

@media ( min-width: 1024px ) {
	#site-header .site-header__container {
		display: flex;
		align-items: center;
		gap: 16px;
	}
}

/* ─── 2. Logo: small wordmark ─────────────────────────────────────────── */

#site-header .header-logo img,
#site-header .header-logo .custom-logo,
#site-header .site-logo img {
	max-height: 24px !important;
	width: auto !important;
	height: auto !important;
}

#site-header .header-logo a {
	display: inline-flex;
	align-items: center;
}

#site-header .site-title {
	font-size: 0.9rem;
	line-height: 1;
	margin: 0;
	letter-spacing: -0.01em;
	font-weight: 600;
}

#site-header .site-title a {
	color: var(--pb-contrast, #1A1A1A);
	text-decoration: none;
}

/* ─── 3. Search: compact, 6px corners, magnifier left ───────────────── */

#site-header .header-center-items,
#site-header .header-search {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 440px;
}

#site-header .header-search {
	margin: 0;
	position: relative;
}

#site-header .header-search .search-form,
#site-header .header-search form {
	display: flex;
	align-items: stretch;
	width: 100%;
	background: #F4F4F4;
	border: 0;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: none;
	position: relative;
	height: 32px;
}

#site-header .header-search .search-form:focus-within,
#site-header .header-search form:focus-within {
	background: #ECECEC;
	box-shadow: inset 0 0 0 1px #C9C9C9;
}

#site-header .header-search form::before {
	content: "";
	position: absolute;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	pointer-events: none;
	z-index: 1;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
	background-repeat: no-repeat;
	background-size: contain;
}

#site-header .header-search input[type="search"],
#site-header .header-search input[type="text"] {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	background: transparent;
	padding: 0 12px 0 32px;
	font-size: 0.875rem;
	line-height: 32px;
	color: var(--pb-contrast, #1A1A1A);
	outline: none;
	box-shadow: none;
	height: 32px;
}

#site-header .header-search input::placeholder {
	color: #6B6B6B;
	opacity: 1;
}

#site-header .header-search button[type="submit"],
#site-header .header-search .search-submit,
#site-header .header-search .btn-search {
	display: none !important;
}

#site-header .header-search .search-category,
#site-header .header-search .product-cat-dropdown,
#site-header .header-search .search-form select {
	display: none !important;
}

/* ─── 4. Right cluster: icon-only utilities, tight ──────────────────── */
/* Verified Motta markup (2026-05-19):
 *   .header-cart > a.motta-button > .motta-button__icon > svg
 *   .header-account > a.motta-button > .motta-button__text > .motta-button__text--account ("Account")
 * Account has NO icon — Motta uses a text-only label. We inject a user
 * SVG via ::before pseudo-element so it becomes an icon button like cart.
 */

#site-header .header-right-items {
	display: flex;
	align-items: center;
	gap: 4px;
	height: 32px;
}

#site-header .header-right-items > * {
	display: inline-flex;
	align-items: center;
	height: 32px;
}

/* Strip the 117px auto-stretch on Motta's wrapper divs. */
#site-header .header-cart,
#site-header .header-account {
	height: 32px !important;
}

#site-header .header-right-items .motta-button {
	height: 32px;
	min-height: 32px;
	width: auto;
	min-width: 32px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	color: var(--pb-contrast, #1A1A1A);
	background: transparent;
	border: 0;
	box-shadow: none;
	transition: background 150ms ease;
}

#site-header .header-right-items .motta-button:hover {
	background: #F4F4F4;
}

#site-header .header-right-items .motta-button__icon,
#site-header .header-right-items .motta-svg-icon {
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

#site-header .header-right-items svg {
	width: 20px;
	height: 20px;
	color: var(--pb-contrast, #1A1A1A);
	fill: currentColor;
}

/* Hide all text labels in the right cluster (Vinted parity — icon-only). */
@media ( min-width: 768px ) {
	#site-header .header-right-items .motta-button__text,
	#site-header .header-right-items .motta-button__text--account,
	#site-header .header-cart .motta-button__count + span,
	#site-header .header-cart .motta-button > span:not(.motta-button__icon):not(.motta-button__count) {
		position: absolute !important;
		width: 1px !important;
		height: 1px !important;
		padding: 0 !important;
		margin: -1px !important;
		overflow: hidden !important;
		clip: rect(0,0,0,0) !important;
		white-space: nowrap !important;
		border: 0 !important;
	}
}

/* Inject a user-silhouette SVG icon onto the Account button (Motta ships
 * it as a text-only "Account" link). */
#site-header .header-account .motta-button {
	width: 32px;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A1A1A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/><circle cx='12' cy='7' r='4'/></svg>");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 20px 20px;
}

/* Cart count bubble — Motta paints it in its accent (red). Tone to dark. */
#site-header .header-cart .motta-button__count,
#site-header .header-cart .mini-cart__total-items {
	background: var(--pb-contrast, #1A1A1A) !important;
	color: #fff !important;
	font-size: 10px;
	font-weight: 600;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 8px;
	line-height: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #fff;
}

/* ─── 5. "Sell now" — 6px corners (Vinted parity, NOT a pill) ──────── */

#site-header .header-right-items .pb-header-sell-cta,
#site-header .header-right-items a.pb-header-sell-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 12px;
	height: 32px;
	border-radius: 6px;
	background: var(--pb-brand-green, #216A52);
	color: #fff !important;
	font-weight: 600;
	font-size: 0.8125rem;
	text-decoration: none;
	margin-left: 8px;
	white-space: nowrap;
	line-height: 1;
}

#site-header .header-right-items .pb-header-sell-cta:hover {
	background: var(--pb-brand-green-mid, #2A8068);
	color: #fff;
}

/* ─── 6. Mobile fallback ─────────────────────────────────────────────── */

@media ( max-width: 1023px ) {
	#site-header .header-logo img {
		max-height: 22px !important;
	}

	#site-header .header-search {
		max-width: none;
	}

	#site-header .header-right-items .pb-header-sell-cta {
		padding: 0 10px;
		font-size: 0.75rem;
		height: 30px;
	}
}
