/*
 * The feed page chrome: the Auctions pill count (card 150), the floating
 * Submit Listing button and the header account icon (card 157), and the
 * loading state of the continuous-scroll link (card 153), its spinner and
 * "You're all caught up" end (change list item 23), and the Fashion pages'
 * subcategory pills (change list item 1).
 *
 * Enqueued site-wide by Assets. Every rule is scoped to a class only the
 * plugin prints, so nothing else on the page is touched.
 */

:root {
	/* Height of the floating Submit button. */
	--ys-fab-size: 56px;

	/*
	 * Room reserved ABOVE the Submit button for the chat bubble. 0 while the
	 * chatbot is off.
	 *
	 * chatbot.css (cards 157, 171) raises it on body.ys-has-chatbot to the
	 * bubble's height plus its gap, and pins the bubble at
	 *     bottom: calc(16px + env(safe-area-inset-bottom) + var(--ys-fab-size) + 12px)
	 * The page's bottom padding below already includes this value, so the
	 * footer clears both without another change.
	 */
	--ys-chat-clearance: 0px;
}

/* ------------------------------------------------------ Auctions pill count */

.ys-pill .ys-pill-badge {
	display: inline-block;
	min-width: 18px;
	height: 18px;
	margin-left: 6px;
	padding: 0 5px;
	border-radius: 9px;
	background: #d92d20;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	vertical-align: 1px;
	box-sizing: border-box;
}

/* ------------------------------------------------- floating Submit Listing */

.ys-submit-fab {
	position: fixed;
	right: calc(16px + env(safe-area-inset-right, 0px));
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	z-index: 900;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: var(--ys-fab-size);
	padding: 0 22px 0 18px;
	border-radius: 999px;
	background: #10301f;
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
	transition: transform .15s ease, box-shadow .15s ease;
}

.ys-submit-fab:hover,
.ys-submit-fab:focus {
	color: #fff;
	text-decoration: none;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
	transform: translateY(-1px);
}

.ys-submit-fab:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
	box-shadow: 0 0 0 6px #10301f;
}

.ys-submit-fab-icon {
	flex: 0 0 auto;
}

/* Clears the button, and the chat bubble once there is one, so the footer's
   last line is never under either. Front page only (FeedChromeRenderer). */
body.ys-has-fab {
	padding-bottom: calc(var(--ys-fab-size) + var(--ys-chat-clearance, 0px) + 24px);
}

@media (prefers-reduced-motion: reduce) {
	.ys-submit-fab {
		transition: none;
	}

	.ys-submit-fab:hover,
	.ys-submit-fab:focus {
		transform: none;
	}
}

/* ------------------------------------------------------ header account icon */

.ys-account-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin-right: 4px;
	border-radius: 50%;
	color: inherit;
	text-decoration: none;
}

.ys-account-icon:hover,
.ys-account-icon:focus {
	color: inherit;
	background: rgba(0, 0, 0, .06);
	text-decoration: none;
}

/*
 * Fix A16 + A17 (Round 3 Part 2): the header cart, beside the account icon at
 * every width, its count in the site green (SubmitBundle::headerCartHtml()).
 */
.ys-header-cart {
	position: relative;
}

.ys-header-cart-count {
	position: absolute;
	top: 0;
	right: -2px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: #2E9E3D;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}

/*
 * The account menu (card 169): a <details> disclosure, so it opens and closes
 * with no script. The summary IS the round icon above; the list drops below
 * it, right-aligned, above the page.
 */
.ys-account-menu {
	position: relative;
	display: none;
}

/*
 * Change list item 28a: logged out, the icon is one tap to the sign-in screen;
 * logged in, it opens the menu. Both are in the (identical, cacheable) markup
 * and WordPress's own `logged-in` body class picks one -- a signed-in
 * member's pages never come from the page cache, so the class is theirs.
 */
body.logged-in .ys-account-menu {
	display: inline-block;
}

body.logged-in .ys-account-signin {
	display: none;
}

.ys-account-menu > summary {
	list-style: none;
	cursor: pointer;
}

.ys-account-menu > summary::-webkit-details-marker {
	display: none;
}

.ys-account-menu > summary:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ys-account-menu-list {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 1000;
	min-width: 180px;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	background: #fff;
	border: 1px solid #e3e9e7;
	border-radius: 10px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .14);
}

.ys-account-menu-list li {
	margin: 0;
	padding: 0;
}

.ys-account-menu-link {
	display: block;
	padding: 10px 16px;
	color: #141d1b;
	font-size: 15px;
	line-height: 1.3;
	text-decoration: none;
	white-space: nowrap;
}

.ys-account-menu-link:hover,
.ys-account-menu-link:focus {
	background: #f4f7f5;
	color: #141d1b;
	text-decoration: none;
}

/* Fix A17(b): Sign out, last and set apart from the places to go. */
.ys-account-menu-out {
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px solid #e3e9e7;
}

/*
 * Fix A17(b) (Oct 5): the header's icon row on a computer. The theme hides
 * it from 992px (header.css: `header .navbar .nav-mob-block` display:none),
 * which took the cart, the account menu (My Dashboard, My account, Sign
 * out) and the install button with it: a logged-in seller on a computer had
 * no way to the dashboard but typing /dashboard/. It shows on every width
 * now, at the far right of the header after Sell Products. Only the phone
 * pieces stay phone-only -- the search button (the search box is in the
 * header on a computer) and the menu toggle (already hidden by the theme).
 * The id outranks the theme's rule whatever order the sheets load in.
 */
@media (min-width: 992px) {
	#fixedHeader .navbar .nav-mob-block {
		display: flex;
		align-items: center;
		flex: 0 0 auto;
		order: 5;
		gap: 4px;
		margin-left: 12px;
	}

	#fixedHeader .navbar .nav-mob-block .search-btn {
		display: none;
	}
}

/* --------------------------------------------- continuous scroll (card 153) */

.loadmore-btn.ys-loading {
	opacity: .6;
	pointer-events: none;
}

/*
 * Change list item 23: infinite scroll, not a "Load More" button. While
 * feed-scroll.js drives the link (.ys-autoload) it is drawn as a small green
 * spinner, the words kept for screen readers. A failed load takes the class
 * off again, so the plain button comes back and a tap still works; with
 * JavaScript off the class is never added and the button is the fallback.
 * The theme's rule is `.cat-list-outer .loadmore-btn` (and :hover), hence the
 * matching prefix here.
 */
.cat-list-outer a.loadmore-btn.ys-autoload,
.cat-list-outer a.loadmore-btn.ys-autoload:hover,
a.loadmore-btn.ys-autoload {
	position: relative;
	height: 56px;
	padding: 0;
	background: transparent;
	color: transparent;
	box-shadow: none;
	opacity: 1;
	pointer-events: none;
}

a.loadmore-btn.ys-autoload span {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

a.loadmore-btn.ys-autoload::before {
	content: "";
	display: block;
	width: 26px;
	height: 26px;
	border: 3px solid #B9DDBF;
	border-top-color: #2E9E3D;
	border-radius: 50%;
	box-sizing: border-box;
	animation: ys-feed-spin .8s linear infinite;
}

@keyframes ys-feed-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	a.loadmore-btn.ys-autoload::before {
		animation-duration: 2.4s;
	}
}

/* The end of the feed: "You're all caught up" (change list item 23). Quiet. */
.ys-feed-end {
	margin: 8px 0 24px;
	padding: 12px 16px;
	color: #5b6b60;
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
}

/* ------------------------------------ Fashion subcategory pills (item 1) */

/*
 * "All · Gowns/Dresses · Coats · Shoes · Accessories" under the Women's /
 * Men's Fashion page title (SubcategoryPillsRenderer). The active pill is
 * solid brand green; on a phone the row scrolls sideways, never wraps.
 */
.ys-subfilter {
	display: flex;
	gap: 8px;
	margin: 12px 0 4px;
	padding: 2px 0 6px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.ys-subfilter::-webkit-scrollbar {
	display: none;
}

.ys-subfilter-pill {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 16px;
	border: 1px solid #B9DDBF;
	border-radius: 999px;
	background: #fff;
	color: #10301F;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .15s ease, border-color .15s ease;
}

.ys-subfilter-pill:hover,
.ys-subfilter-pill:focus-visible {
	border-color: #2E9E3D;
	background: #EEF7EF;
	color: #10301F;
	text-decoration: none;
}

.ys-subfilter-pill:focus-visible {
	outline: 2px solid #2E9E3D;
	outline-offset: 2px;
}

.ys-subfilter-pill.is-active,
.ys-subfilter-pill.is-active:hover {
	border-color: #2E9E3D;
	background: #2E9E3D;
	color: #fff;
}

/*
 * Change list item 28: the sign-in popup behind the logged-out account icon
 * (account-popup.js). The form inside is the /account/ sign-in form, fetched
 * live, so these rules restate that screen's look (AccountScreens) scoped to
 * the popup -- the account stylesheet is not loaded on feed pages.
 */
.ys-signin-pop {
	width: min(400px, calc(100vw - 32px));
	max-height: calc(100vh - 32px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 16px;
	background: #fff;
	color: #141D1B;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
	overflow: auto;
}

.ys-signin-pop::backdrop {
	background: rgba(20, 29, 27, .45);
}

.ys-signin-pop__card {
	position: relative;
	padding: 22px 20px 20px;
}

.ys-signin-pop__title {
	margin: 0 0 14px;
	font-size: 20px;
	font-weight: 700;
}

.ys-signin-pop__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #4A5A57;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.ys-signin-pop__close:hover,
.ys-signin-pop__close:focus-visible {
	background: #EEF7EF;
	color: #10301F;
}

.ys-signin-pop .ys-ac-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0;
}

.ys-signin-pop .ys-ac-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin: 0;
	font-size: 13px;
	color: #4A5A57;
}

/* 16px stops iOS Safari zooming the page when a box is tapped. */
.ys-signin-pop .ys-ac-field input {
	font: inherit;
	font-size: 16px;
	color: #141D1B;
	padding: 11px 13px;
	border: 1px solid #E3E9E7;
	border-radius: 10px;
	background: #fff;
}

.ys-signin-pop .ys-ac-field input:focus {
	outline: 2px solid #2E9E3D;
	outline-offset: -1px;
	border-color: #2E9E3D;
}

.ys-signin-pop .ys-ac-check {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 13.5px;
	color: #4A5A57;
}

.ys-signin-pop .ys-ac-btn {
	font: inherit;
	font-size: 15px;
	font-weight: 650;
	cursor: pointer;
	padding: 12px 18px;
	border-radius: 99px;
	border: 0;
	background: #2E9E3D;
	color: #fff;
}

.ys-signin-pop .ys-ac-btn:hover {
	background: #25843A;
}

.ys-signin-pop .ys-ac-alt {
	margin: 14px 0 0;
	font-size: 13.5px;
	color: #4A5A57;
	text-align: center;
}

.ys-signin-pop .ys-ac-alt a {
	color: #237C30;
	font-weight: 600;
}

.ys-signin-pop .ys-ac-btn:focus-visible,
.ys-signin-pop .ys-ac-alt a:focus-visible {
	outline: 2px solid #2E9E3D;
	outline-offset: 2px;
}

/*
 * Hover tooltips on the header's icon buttons (account, install app), on
 * devices with a mouse only -- a phone has no hover, and its icons are
 * labelled for screen readers already. Below the icon, centred, never wider
 * than its words; hidden while the account menu is open.
 */
@media (hover: hover) and (pointer: fine) {
	[data-ys-tip] {
		position: relative;
	}

	[data-ys-tip]::after {
		content: attr(data-ys-tip);
		position: absolute;
		top: calc(100% + 6px);
		left: 50%;
		transform: translateX(-50%);
		padding: 4px 8px;
		border-radius: 6px;
		background: #10301F;
		color: #fff;
		font-size: 12px;
		font-weight: 600;
		line-height: 1.3;
		white-space: nowrap;
		pointer-events: none;
		opacity: 0;
		visibility: hidden;
		transition: opacity .12s ease;
		z-index: 1000;
	}

	[data-ys-tip]:hover::after,
	[data-ys-tip]:focus-visible::after {
		opacity: 1;
		visibility: visible;
	}

	.ys-account-menu[open] > [data-ys-tip]::after {
		display: none;
	}
}
