/* SellIt marketplace pages. Loaded after layout.css, which holds the colour tokens and Bootstrap overrides. */

.icon {
	vertical-align: -0.15em;
	flex-shrink: 0;
}

/* ---------- Header ---------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 1030;
	background: var(--paper);
	border-bottom: 1px solid var(--line);
}

.site-nav {
	padding-top: .85rem;
	padding-bottom: .85rem;
}

.site-nav .navbar-brand {
	padding: 0;
	margin-right: 2.25rem;
}

/* Kept small so the header has room to breathe around it. */
.site-logo {
	display: block;
	height: 30px;
	width: auto;
}

.nav-search {
	flex: 1 1 auto;
	max-width: 520px;
}

.nav-search .form-control {
	border-radius: 999px 0 0 999px;
	background: var(--mist);
	border-color: var(--mist);
	padding-left: 1.1rem;
}

.nav-search .form-control:focus {
	background: var(--paper);
}

.nav-search .btn {
	border-radius: 0 999px 999px 0;
	padding-left: 1rem;
	padding-right: 1.1rem;
}

.site-nav .nav-link {
	color: var(--ink-soft);
	font-weight: 500;
	padding-left: .75rem !important;
	padding-right: .75rem !important;
}

.site-nav .nav-link:hover {
	color: var(--ink);
}

/* Keep each menu item on one line; the search box gives way instead. */
.site-nav .nav-link,
.site-nav .btn-link,
.place-ad-btn {
	white-space: nowrap;
}

.nav-search {
	min-width: 12rem;
}

.site-nav .nav-item form .btn-link {
	color: var(--ink-soft) !important;
	font-weight: 500;
	text-decoration: none;
	padding: .5rem .75rem;
	border: 0;
}

.place-ad-btn {
	min-width: 8rem;
	font-weight: 700;
}

@media (max-width: 991.98px) {
	.site-logo {
		height: 26px;
	}

	.site-nav .navbar-collapse {
		padding-top: .75rem;
	}

	.nav-search {
		max-width: none;
		margin-bottom: .5rem;
	}
}

/* ---------- Home ---------- */

.hero {
	position: relative;
	color: var(--ink);
	background-color: #d9eff3;
	/* Pastel cottages above the harbour. The cream wash keeps the heading readable over the sky. */
	background-image: linear-gradient(90deg, rgba(246, 241, 231, .92) 0%, rgba(246, 241, 231, .7) 38%, rgba(246, 241, 231, 0) 62%), url("/img/hero-cottages.svg");
	background-size: cover;
	background-position: right bottom;
	padding: 4.5rem 0 3.5rem;
}

.hero-title {
	color: var(--ink);
	font-size: 2.75rem;
	max-width: 20ch;
	margin-bottom: .75rem;
}

.hero-lede {
	font-size: 1.125rem;
	color: var(--ink-soft);
	max-width: 36rem;
	margin-bottom: 2rem;
}

.hero-search {
	display: grid;
	grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
	gap: .5rem;
	background: var(--paper);
	padding: .5rem;
	border-radius: 14px;
	box-shadow: 0 18px 40px rgba(0, 0, 0, .25);
	max-width: 62rem;
}

.hero-search .form-control,
.hero-search .custom-select {
	height: 3.25rem;
	border-color: transparent;
	background-color: var(--mist);
	font-size: 1rem;
}

.hero-search .form-control:focus,
.hero-search .custom-select:focus {
	background-color: var(--paper);
	border-color: var(--harbour);
}

.hero-search .btn {
	height: 3.25rem;
	white-space: nowrap;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
}

@media (max-width: 991.98px) {
	.hero {
		padding: 2.5rem 0 2rem;
	}

	.hero-title {
		font-size: 2.1rem;
	}

	.hero-search {
		grid-template-columns: 1fr 1fr;
	}

	.hero-search > :first-child,
	.hero-search .btn {
		grid-column: 1 / -1;
	}
}

/* Narrow screens: the cottages sit behind the text, so wash the whole picture. */
@media (max-width: 767.98px) {
	.hero {
		background-image: linear-gradient(180deg, rgba(246, 241, 231, .94) 0%, rgba(246, 241, 231, .82) 60%, rgba(246, 241, 231, .55) 100%), url("/img/hero-cottages.svg");
	}
}

.page-section {
	padding: 3rem 0;
}

.page-section-mist {
	background: var(--mist);
}

.section-heading {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: .5rem 1rem;
	margin-bottom: 1.25rem;
}

.section-heading h2 {
	font-size: 1.563rem;
	margin: 0;
}

/* Section tiles with live counts: large icon on a mist circle, name and count centred below.
   The section icons are 80x80, so keep them at 80px or smaller. */
.section-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
	gap: .75rem;
}

.section-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: .1rem;
	padding: 1.25rem .75rem 1rem;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	color: var(--ink);
	transition: border-color .15s ease;
}

.section-tile:hover {
	border-color: var(--ink);
	text-decoration: none;
}

.section-tile:hover .section-tile-icon {
	background: var(--line);
}

.section-tile-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 88px;
	height: 88px;
	margin-bottom: .75rem;
	border-radius: 50%;
	background: var(--mist);
	transition: background-color .15s ease;
}

.section-tile-icon img {
	width: 64px;
	height: 64px;
}

/* A section without its own picture gets its line icon. */
.section-tile-icon .icon {
	color: var(--harbour);
}

/* Popular subsections (home page): icon, name, and its section and count. */
.popular-heading {
	margin-top: 2.5rem;
}

.subsection-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: .75rem;
}

.subsection-tile {
	display: flex;
	align-items: center;
	gap: .85rem;
	padding: .75rem .9rem;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	color: var(--ink);
	transition: border-color .15s ease;
}

.subsection-tile:hover {
	border-color: var(--ink);
	text-decoration: none;
}

.subsection-tile-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: #e7f2f5;
	color: var(--harbour);
	transition: background-color .15s ease;
}

.subsection-tile:hover .subsection-tile-icon {
	background: #d6eaef;
}

.subsection-tile-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.subsection-tile-name {
	font-weight: 500;
	line-height: 1.3;
}

.subsection-tile-meta {
	font-size: .8125rem;
	color: var(--muted);
}

.section-tile-name {
	font-weight: 500;
	line-height: 1.3;
}

.section-tile-count {
	font-size: .875rem;
	color: var(--muted);
}

/* Phones: three columns with smaller circles. */
@media (max-width: 575.98px) {
	.section-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: .5rem;
	}

	.section-tile {
		padding: .85rem .4rem .7rem;
	}

	.section-tile-icon {
		width: 64px;
		height: 64px;
		margin-bottom: .5rem;
	}

	.section-tile-icon img {
		width: 48px;
		height: 48px;
	}

	.section-tile-name {
		font-size: .8rem;
	}

	.section-tile-count {
		font-size: .75rem;
	}
}

/* Shortcut pills with counts (DoneDeal-style "popular" links). */
.pill-list {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	padding: 0;
	margin: 0;
	list-style: none;
}

.pill {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	padding: .45rem 1rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--paper);
	font-weight: 500;
	font-size: .95rem;
}

.pill:hover {
	border-color: var(--ink);
}

.pill-count {
	color: var(--muted);
	font-weight: 400;
	font-size: .85rem;
}

.sell-band {
	background: var(--ink);
	color: #fff;
	border-radius: 16px;
	padding: 2rem 2.25rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 2rem;
}

.sell-band h2 {
	color: #fff;
	font-size: 1.563rem;
	margin-bottom: .25rem;
}

.sell-band p {
	color: rgba(255, 255, 255, .78);
	margin: 0;
	max-width: 36rem;
}

/* ---------- Price tag (the logo's tag) ---------- */

.price-tag {
	position: relative;
	display: inline-flex;
	align-items: center;
	min-height: 1.9rem;
	padding: .2rem .8rem .2rem 1.35rem;
	background: var(--tag);
	color: #fff;
	font-weight: 700;
	font-size: 1rem;
	line-height: 1.2;
	white-space: nowrap;
	border-radius: 3px 6px 6px 3px;
	clip-path: polygon(.7rem 0, 100% 0, 100% 100%, .7rem 100%, 0 50%);
}

/* The tag's hole. */
.price-tag::before {
	content: "";
	position: absolute;
	left: .6rem;
	top: 50%;
	width: .36rem;
	height: .36rem;
	margin-top: -.18rem;
	border-radius: 50%;
	background: #fff;
}

.price-tag-wanted {
	background: var(--ink);
}

.price-tag-free {
	background: var(--harbour);
}

.price-tag-lg {
	min-height: 2.6rem;
	font-size: 1.5rem;
	padding: .3rem 1.1rem .3rem 1.8rem;
	clip-path: polygon(.95rem 0, 100% 0, 100% 100%, .95rem 100%, 0 50%);
}

/* Words rather than a figure ("Price on application"). */
.price-tag-words {
	font-size: .85rem;
}

.price-tag-lg.price-tag-words {
	font-size: 1.1rem;
}

.price-tag-lg::before {
	left: .8rem;
	width: .5rem;
	height: .5rem;
	margin-top: -.25rem;
}

/* ---------- Ad tiles (home) ---------- */

.listing-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
	gap: 1.25rem;
}

.listing-tile {
	display: flex;
	flex-direction: column;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	color: var(--ink);
	height: 100%;
}

.listing-tile:hover {
	border-color: var(--ink);
}

@media (max-width: 575.98px) {
	.listing-grid {
		grid-template-columns: 1fr 1fr;
		gap: .75rem;
	}

	.listing-tile-body {
		padding: .6rem .65rem .7rem;
	}

	.listing-tile-title {
		font-size: .9rem;
	}

	.listing-tile .listing-meta {
		font-size: .8rem;
		gap: .1rem .6rem;
	}
}

.listing-tile-media {
	position: relative;
	background: #e9ecef;
}

.listing-tile-media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.listing-tile-media .price-tag {
	position: absolute;
	left: .6rem;
	bottom: .6rem;
}

.listing-tile-body {
	padding: .75rem .85rem .9rem;
}

.listing-tile-title {
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.35;
	margin: 0 0 .35rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---------- Ad cards (browse results) ---------- */

.listing-card {
	position: relative;
	display: flex;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	margin-bottom: 1rem;
}

.listing-card:hover {
	border-color: var(--ink);
}

.listing-card-media {
	flex: 0 0 15rem;
	background: #e9ecef;
}

.listing-card-media img {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 11rem;
	object-fit: cover;
}

.listing-card-body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	padding: 1rem 1.15rem;
}

.listing-card-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: .5rem;
}

.listing-card-title {
	min-width: 0;
	font-size: 1.125rem;
	font-weight: 500;
	margin: 0 0 .35rem;
	color: var(--ink);
}

.listing-card-excerpt {
	color: var(--ink-soft);
	font-size: .925rem;
	margin: 0 0 .75rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.listing-card-foot {
	margin-top: auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .5rem;
}

/* Phones: a compact row, thumbnail on the left, no excerpt. */
@media (max-width: 575.98px) {
	.listing-card-media {
		flex-basis: 7.5rem;
	}

	.listing-card-media img {
		min-height: 7.5rem;
	}

	.listing-card-body {
		padding: .75rem .85rem;
	}

	.listing-card-title {
		font-size: 1rem;
	}

	/* Badges go under the title so it keeps the full width. */
	.listing-card-head {
		flex-direction: column;
		gap: 0;
	}

	.listing-card-head .listing-flags {
		order: -1;
		margin-bottom: .3rem;
	}

	.listing-card-head .listing-flags:not(:has(.badge)) {
		display: none;
	}

	.listing-card-head .listing-flags .badge {
		margin: 0 .25rem 0 0;
	}

	.listing-card-excerpt {
		display: none;
	}

	.listing-card-foot {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* Small facts: location and age. */
.listing-meta {
	display: flex;
	flex-wrap: wrap;
	gap: .25rem 1rem;
	color: var(--muted);
	font-size: .875rem;
}

.listing-meta span {
	display: inline-flex;
	align-items: center;
	gap: .3rem;
}

/* Car facts as chips. */
.spec-chips {
	display: flex;
	flex-wrap: wrap;
	gap: .35rem;
	list-style: none;
	padding: 0;
	margin: 0 0 .6rem;
}

.spec-chips li {
	background: var(--mist);
	border-radius: 6px;
	padding: .1rem .55rem;
	font-size: .85rem;
	color: var(--ink-soft);
}

.listing-flags .badge {
	margin-left: .25rem;
}

.badge-trade {
	background: var(--mist);
	color: var(--ink-soft);
	border: 1px solid var(--line);
}

/* ---------- Browse page ---------- */

.section-header {
	background: var(--mist);
	border-bottom: 1px solid var(--line);
	padding: 1.25rem 0 1.5rem;
}

.section-header .breadcrumb a {
	color: var(--ink-soft);
}

.section-header .breadcrumb a:hover {
	color: var(--ink);
	text-decoration: underline;
}

.browse-title {
	font-size: 2rem;
	margin: .5rem 0 0;
}

.browse-count {
	color: var(--muted);
	margin: 0;
}

.browse-search {
	width: 100%;
	max-width: 26rem;
}

.filters-card {
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1.1rem;
}

.filters-top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: .25rem;
}

.filters-top h2 {
	font-size: 1.125rem;
	margin: 0;
}

.filter-group {
	position: relative;
	padding: 1rem 0;
	border-top: 1px solid var(--line);
}

.filter-group:first-of-type {
	border-top: 0;
}

.filter-label {
	display: block;
	font-size: .95rem;
	font-weight: 500;
	margin: 0 0 .6rem;
}

/* No scrolling box: the first 8 show, and "Show all" reveals the rest. */
.subsection-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.subsection-list .is-extra {
	display: none;
}

.subsection-toggle:checked ~ .subsection-list .is-extra {
	display: list-item;
}

.subsection-list a {
	display: flex;
	justify-content: space-between;
	gap: .5rem;
	padding: .35rem .5rem;
	border-radius: 6px;
	color: var(--ink-soft);
}

.subsection-more {
	display: inline-block;
	margin: .25rem 0 0;
	padding: .25rem .5rem;
	border-radius: 6px;
	color: var(--harbour);
	font-size: .875rem;
	font-weight: 500;
	cursor: pointer;
	user-select: none;
}

.subsection-more:hover {
	color: var(--harbour-deep);
	text-decoration: underline;
}

/* The hidden checkbox sits beside its label at the bottom of the group. Clicking the label focuses the checkbox, and
   if it were at the top of the list the browser would scroll up to it. */
.subsection-toggle {
	top: auto;
	bottom: 1rem;
	left: 0;
}

/* The checkbox is visually hidden, so show its keyboard focus on the label. */
.subsection-toggle:focus-visible ~ .subsection-more {
	outline: 3px solid rgba(11, 106, 130, .5);
	outline-offset: 2px;
}

.subsection-more .when-expanded,
.subsection-toggle:checked ~ .subsection-more .when-collapsed {
	display: none;
}

.subsection-toggle:checked ~ .subsection-more .when-expanded {
	display: inline;
}

.subsection-list a:hover {
	background: var(--mist);
	color: var(--ink);
}

.subsection-list small {
	color: var(--muted);
}

/* Search results: sections named by the search words ("scooter" → Scooters). */
.matching-sections {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem;
	margin-bottom: 1rem;
}

.matching-sections-label {
	color: var(--muted);
	font-size: .9rem;
}

.matching-sections a {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .3rem .8rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--paper);
	color: var(--ink);
	font-size: .9rem;
}

.matching-sections a:hover,
.matching-sections a:focus {
	border-color: var(--harbour);
	color: var(--harbour-deep);
	text-decoration: none;
}

.matching-sections small {
	color: var(--muted);
}

/* Ad photos can't be dragged out, long-pressed or selected (see "Photos" in site.js). */
.listing-mosaic img,
.photo-viewer img,
.listing-card-media img,
.listing-tile-media img,
.similar-ads img {
	-webkit-user-drag: none;
	-webkit-touch-callout: none;
	user-select: none;
}

/* Segmented controls (seller type, for sale / wanted). */
.segmented {
	display: flex;
	width: 100%;
	background: var(--mist);
	border-radius: var(--radius-sm);
	padding: 3px;
}

.segmented .btn {
	flex: 1 1 0;
	border: 0;
	background: transparent;
	color: var(--ink-soft);
	font-size: .875rem;
	padding: .35rem .25rem;
	border-radius: 6px !important;
	box-shadow: none !important;
}

.segmented .btn.active {
	background: var(--paper);
	color: var(--ink);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .12) !important;
}

.multiselect-native-select .btn-group {
	width: 100%;
}

.multiselect-native-select .multiselect {
	background: var(--paper);
	border: 1px solid #cfd5db;
	border-radius: var(--radius-sm) !important;
	height: calc(1.5em + .75rem + 2px);
	color: var(--ink);
	font-weight: 400;
}

.results-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .5rem 1rem;
	margin-bottom: 1rem;
}

.results-bar .custom-select {
	width: auto;
}

.empty-state {
	text-align: center;
	padding: 3rem 1.5rem;
	border: 1px dashed #cfd5db;
	border-radius: var(--radius);
	background: var(--paper);
}

/* "This ad has ended" (410) and "We couldn't find that page" (404). */
.ended-ad,
.not-found {
	margin-bottom: 2.5rem;
}

.ended-ad p,
.not-found p,
.not-found-search {
	max-width: 34rem;
	margin-left: auto;
	margin-right: auto;
}

.ended-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .5rem;
}

/* ---------- Ad page ---------- */

.listing-page {
	padding-top: 1rem;
	padding-bottom: 3.5rem;
}

/* One evenly spaced row: no band, ends with the ad's title. */
.listing-crumbs {
	display: flex;
	align-items: center;
	min-height: 2.5rem;
	margin-bottom: .75rem;
}

.listing-crumbs .breadcrumb {
	align-items: center;
	min-width: 0;
}

.listing-crumbs .breadcrumb a {
	color: var(--ink-soft);
}

.listing-crumbs .breadcrumb a:hover {
	color: var(--ink);
	text-decoration: underline;
}

.listing-crumbs .breadcrumb-item.active {
	/* Block, not Bootstrap's flex, so a long title ends in "…" instead of being cut off. */
	display: block;
	color: var(--muted);
	min-width: 0;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.owner-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75rem 1rem;
	background: #e7f2f5;
	border-radius: var(--radius);
	padding: .75rem 1rem;
	margin-bottom: 1rem;
}

.owner-bar strong {
	color: var(--harbour-deep);
}

.owner-bar-note {
	color: var(--muted);
}

.owner-bar-actions {
	display: flex;
	gap: .5rem;
}

.owner-bar-actions .btn {
	padding-left: 1rem;
	padding-right: 1rem;
}

/* Photo mosaic: the main photo large on the left, up to four more beside it. */
.listing-mosaic {
	position: relative;
	display: grid;
	gap: 8px;
	height: 420px;
	border-radius: 14px;
	overflow: hidden;
	background: var(--mist);
}

.listing-mosaic.has-1 { grid-template-columns: 1fr; }
.listing-mosaic.has-2 { grid-template-columns: 1fr 1fr; }
.listing-mosaic.has-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.listing-mosaic.has-4 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.listing-mosaic.has-5 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }

.listing-mosaic.has-3 .is-main,
.listing-mosaic.has-4 .is-main,
.listing-mosaic.has-5 .is-main {
	grid-row: 1 / 3;
}

.listing-mosaic.has-4 .mosaic-tile:nth-child(2) {
	grid-column: 2 / 4;
}

.mosaic-tile {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	min-height: 0;
	padding: 0;
	border: 0;
	background: var(--mist);
	overflow: hidden;
	cursor: zoom-in;
}

.mosaic-tile img {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: filter .15s ease;
}

.mosaic-tile:hover img {
	filter: brightness(.92);
}

/* The main photo is never cropped: it sits on a blurred copy of itself. */
.mosaic-tile.is-main img {
	object-fit: contain;
}

.mosaic-tile.is-empty {
	cursor: default;
}

.mosaic-tile.is-empty img {
	object-fit: none;
}

.photo-blur {
	position: absolute;
	inset: -40px;
	background-position: center;
	background-size: cover;
	filter: blur(30px) saturate(1.1);
	transform: scale(1.1);
	opacity: .9;
}

.photo-blur::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, .15);
}

.mosaic-all {
	position: absolute;
	right: 14px;
	bottom: 14px;
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	background: var(--paper);
	border: 1px solid var(--ink);
	color: var(--ink);
	font-size: .875rem;
	box-shadow: 0 2px 8px rgba(29, 31, 34, .15);
}

.mosaic-all:hover {
	background: var(--mist);
}

/* Title row under the photos. */
.listing-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem 1.5rem;
	margin-top: 1.5rem;
}

.listing-head-main {
	min-width: 0;
}

.listing-h1 {
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.25;
	margin: 0 0 .4rem;
	overflow-wrap: anywhere;
}

.listing-facts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .35rem 1.1rem;
	margin: 0;
	color: var(--muted);
	font-size: .9375rem;
}

.listing-facts span {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
}

.listing-actions {
	display: flex;
	flex-shrink: 0;
	gap: .5rem;
}

/* Spacing only: which label shows ("Save" or "Saved") is set by the .when-saved / .when-unsaved rules below. */
.listing-actions .save-ad-btn > span {
	gap: .4rem;
}

.listing-actions .save-ad-btn.is-saved {
	color: var(--tag);
	border-color: var(--tag);
}

.listing-h2 {
	font-size: 1.15rem;
	font-weight: 700;
	margin: 2rem 0 .85rem;
}

/* Each fact is its own small box, so a short list (just "Condition") doesn't leave an empty bordered space. */
.fact-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
	gap: .5rem;
	margin: 0;
}

.fact-grid div {
	padding: .65rem .9rem;
	background: var(--mist);
	border-radius: var(--radius-sm);
}

.fact-grid dt {
	font-weight: 400;
	font-size: .8125rem;
	color: var(--muted);
}

.fact-grid dd {
	margin: 0;
	font-weight: 500;
}

.listing-desc {
	white-space: pre-line;
	overflow-wrap: anywhere;
	color: var(--ink-soft);
	font-size: 1rem;
	line-height: 1.7;
	max-width: 44rem;
	margin: 0;
}

.listing-video {
	margin-top: 1.5rem;
	border-radius: var(--radius);
}

/* Same size as the rest of the page, so it reads as advice rather than small print. */
.safety-note {
	display: flex;
	gap: .85rem;
	margin-top: 2rem;
	padding: 1.1rem 1.25rem;
	background: var(--mist);
	border-radius: var(--radius);
	color: var(--ink-soft);
	line-height: 1.6;
}

.safety-note > .icon {
	flex-shrink: 0;
	color: var(--harbour);
}

.safety-title {
	font-size: 1rem;
	font-weight: 600;
	color: var(--ink);
	margin: .1rem 0 .3rem;
}

.safety-note ul {
	margin: 0;
	padding-left: 1.1rem;
}

/* The price, seller and contact buttons stay in view while you read. On smaller screens they come straight after the
   title (the columns swap order in the view). */
.listing-side {
	position: sticky;
	top: 5.5rem;
	margin-top: 2rem;
}

/* Not while a form is open: it could be taller than the screen. */
.listing-side:has(.collapse.show, .collapsing) {
	position: static;
}

.listing-panel {
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 1.4rem;
	box-shadow: 0 6px 24px rgba(29, 31, 34, .06);
}

.listing-panel .price-tag {
	margin-bottom: 1.25rem;
}

.seller {
	display: flex;
	align-items: center;
	gap: .8rem;
}

.seller-avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: #e7f2f5;
	color: var(--harbour-deep);
	font-weight: 700;
}

.seller-nm {
	font-weight: 600;
	font-size: 1.05rem;
	overflow-wrap: anywhere;
}

.seller-sub {
	color: var(--muted);
	font-size: .875rem;
}

.listing-panel-note {
	margin: 1rem 0 0;
	color: var(--muted);
	font-size: .9rem;
}

.contact-buttons {
	display: grid;
	gap: .5rem;
	margin-top: 1.1rem;
}

.btn-call,
.btn-soft {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	width: 100%;
	padding: .7rem 1rem;
	font-size: 1rem;
}

.btn-call,
.btn-call:visited {
	background: var(--harbour);
	border-color: var(--harbour);
	color: #fff;
}

.btn-call:hover,
.btn-call:focus {
	background: var(--harbour-deep);
	border-color: var(--harbour-deep);
	color: #fff;
}

.phone-error {
	margin: 0;
	color: #b02a37;
	font-size: .875rem;
	text-align: center;
}

.btn-call.is-number {
	font-weight: 700;
	letter-spacing: .02em;
}

.btn-soft {
	background: #e7f2f5;
	border-color: transparent;
	color: var(--harbour-deep);
}

.btn-soft:hover,
.btn-soft:focus,
.btn-soft[aria-expanded="true"] {
	background: #d6eaef;
	color: var(--harbour-deep);
}

.contact-form {
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--line);
}

.contact-form-note {
	color: var(--muted);
	font-size: .875rem;
}

.contact-form label,
.report-form label {
	font-size: .9rem;
	font-weight: 500;
	margin-bottom: .3rem;
}

.report {
	margin-top: .9rem;
	text-align: center;
}

.report-link {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .25rem .5rem;
	border: 0;
	background: none;
	color: var(--muted);
	font-size: .9rem;
}

.report-link:hover,
.report-link[aria-expanded="true"] {
	color: var(--ink);
}

.report-form {
	margin-top: .75rem;
	padding: 1.1rem;
	text-align: left;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}

.similar-ads {
	margin-top: 3.5rem;
}

.similar-ads .section-heading h2 {
	font-size: 1.25rem;
}

/* Full-screen photo viewer, on a blurred copy of the photo. */
.photo-viewer {
	position: fixed;
	inset: 0;
	z-index: 1080;
	display: flex;
	flex-direction: column;
	background: #15171a;
	overflow: hidden;
	/* Not even scrollable by script: the blurred backdrop is bigger than the screen. */
	overflow: clip;
}

.photo-viewer[hidden] {
	display: none;
}

.photo-viewer .photo-blur {
	opacity: .55;
}

.photo-viewer .photo-blur::after {
	background: rgba(0, 0, 0, .35);
}

body.viewer-open {
	overflow: hidden;
}

.viewer-bar {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: .75rem 1rem;
	color: #fff;
}

.viewer-count {
	font-size: .9rem;
	font-weight: 500;
}

.viewer-close,
.viewer-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: var(--ink);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

.viewer-close:hover,
.viewer-nav:hover {
	background: #fff;
}

.viewer-stage {
	position: relative;
	flex: 1;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 4.5rem;
}

.viewer-img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 6px;
	user-select: none;
}

.viewer-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
}

.viewer-prev {
	left: 1rem;
}

.viewer-next {
	right: 1rem;
}

.viewer-thumbs {
	position: relative;
	display: flex;
	justify-content: safe center;
	gap: 8px;
	padding: .9rem 1rem 1rem;
	overflow-x: auto;
}

.viewer-thumb {
	flex: 0 0 auto;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: none;
	overflow: hidden;
	opacity: .55;
	outline: 2px solid transparent;
	outline-offset: 2px;
}

.viewer-thumb.is-active {
	opacity: 1;
	outline-color: #fff;
}

.viewer-thumb img {
	display: block;
	width: 76px;
	height: 57px;
	object-fit: cover;
}

@media (max-width: 991.98px) {
	.listing-mosaic {
		height: 360px;
	}

	.listing-side {
		position: static;
		margin-top: 1.5rem;
	}
}

/* Phones: just the main photo, with the count on the button. */
@media (max-width: 767.98px) {
	.listing-mosaic {
		display: block;
		height: auto;
		aspect-ratio: 4 / 3;
		margin: 0 -15px;
		border-radius: 0;
	}

	.listing-mosaic .mosaic-tile:not(.is-main) {
		display: none;
	}

	.mosaic-all {
		right: 12px;
		bottom: 12px;
		border-color: transparent;
		padding: .3rem .7rem;
		font-size: .8125rem;
	}

	.listing-head {
		flex-direction: column;
		gap: .9rem;
		margin-top: 1.1rem;
	}

	.listing-h1 {
		font-size: 1.5rem;
	}

	.viewer-stage {
		padding: 0;
	}

	.viewer-nav {
		width: 38px;
		height: 38px;
		background: rgba(255, 255, 255, .8);
	}

	.viewer-prev {
		left: .5rem;
	}

	.viewer-next {
		right: .5rem;
	}

	.viewer-thumb img {
		width: 60px;
		height: 45px;
	}
}

/* ---------- Forms, My ads, moderation ---------- */

.photo-thumb {
	width: 120px;
	height: 90px;
	object-fit: cover;
	border-radius: 6px;
	margin: 0 6px 6px 0;
	background: #e9ecef;
}

.existing-photo {
	cursor: pointer;
}

.price-input {
	max-width: 240px;
}

.my-ad-image {
	width: 100%;
	height: 100%;
	max-height: 140px;
	object-fit: cover;
}

.review-description {
	max-height: 12rem;
	overflow-y: auto;
}

.form-card-heading {
	font-size: 1.125rem;
	margin-bottom: 1rem;
}

/* ---------- Footer ---------- */

.site-footer {
	background: var(--ink);
	color: rgba(255, 255, 255, .72);
	padding: 3rem 0 1.25rem;
	margin-top: 3rem;
	font-size: .95rem;
}

.site-footer a:hover,
.site-footer .link-button:hover,
.site-footer .link-button:focus {
	color: #fff;
}

.site-footer li {
	margin-bottom: .4rem;
}

.footer-brand img {
	display: block;
	height: 34px;
	width: auto;
	margin-bottom: .75rem;
}

.footer-heading {
	font-size: 1rem;
	font-weight: 500;
	color: #fff;
	margin-bottom: .9rem;
}

.footer-columns {
	columns: 2;
}

.footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, .12);
	padding-top: 1.25rem;
	margin-top: 1rem;
	font-size: .85rem;
}

/* ---------- eMoo-style extras: saved searches, featured ads, event dates, similar ads, saved page ---------- */

.browse-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem;
}

.browse-actions form {
	margin: 0;
}

/* Side by side from tablets up; the search box stacks above the button on phones. */
@media (min-width: 768px) {
	.browse-actions {
		flex-wrap: nowrap;
		width: 34rem;
		max-width: 100%;
	}

	.browse-actions .browse-search {
		flex: 1 1 auto;
		max-width: none;
	}
}

.save-search-btn {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	white-space: nowrap;
	border: 1px solid var(--line);
	background: var(--paper);
}

.results-controls .custom-select {
	width: auto;
}

.badge-featured {
	background: #fff4d6;
	color: #7a5300;
	border: 1px solid #f0d58c;
}

.listing-card.is-featured {
	border-color: #f0d58c;
	box-shadow: 0 0 0 1px #f0d58c;
}

.listing-tile-flag {
	position: absolute;
	top: .5rem;
	right: .5rem;
}

.save-ad-btn .when-unsaved,
.save-ad-btn.is-saved .when-saved {
	display: inline-flex;
	align-items: center;
	gap: .3rem;
}

.save-ad-btn .when-saved,
.save-ad-btn.is-saved .when-unsaved {
	display: none;
}

.event-banner {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .75rem 1rem;
	border-radius: var(--radius);
	background: var(--mist);
	border-left: 4px solid var(--harbour);
}

.event-banner .icon {
	width: 22px;
	height: 22px;
	color: var(--harbour);
}

.event-banner-date {
	font-weight: 500;
}

.event-banner.is-past {
	border-left-color: var(--muted);
	color: var(--muted);
}

.saved-list {
	display: grid;
	gap: .75rem;
}

.saved-item {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: .75rem;
	flex-direction: row;
}

.saved-item-media img {
	display: block;
	width: 120px;
	height: 90px;
	object-fit: cover;
	border-radius: calc(var(--radius) - 4px);
	background: var(--mist);
}

.saved-item-body {
	flex: 1 1 auto;
	min-width: 0;
}

.saved-item-title {
	display: block;
	font-weight: 500;
	color: var(--ink);
	margin-bottom: .25rem;
}

.saved-item .listing-meta .price-tag {
	font-size: .8125rem;
	min-height: 1.5rem;
}

.saved-item.is-gone .saved-item-media img {
	opacity: .5;
}

.saved-item-action {
	flex-shrink: 0;
	margin: 0;
}

@media (max-width: 575.98px) {
	.saved-item {
		flex-wrap: wrap;
	}

	.saved-item-media img {
		width: 88px;
		height: 66px;
	}

	.saved-item-action {
		width: 100%;
	}
}

.footer-social a {
	color: inherit;
}

/* About and How it works. */
.prose h2 {
	font-size: 1.25rem;
	margin-top: 2rem;
}

.prose .steps li {
	margin-bottom: .6rem;
}

/* ---------- Printing an ad ---------- */

@media print {
	.site-header,
	.site-footer,
	.listing-crumbs,
	.owner-bar,
	.listing-actions,
	.mosaic-all,
	.contact-buttons,
	#contactForm,
	.report,
	.similar-ads,
	.photo-viewer {
		display: none !important;
	}

	.listing-mosaic {
		height: 9cm;
	}

	.col-lg-8,
	.col-lg-4 {
		flex: 0 0 100%;
		max-width: 100%;
	}

	.listing-side {
		position: static;
	}

	.listing-panel {
		box-shadow: none;
	}

	a[href]::after {
		content: none;
	}
}

/* ---------- Busy buttons (site.js, as on hondarepairs.ie) ---------- */
/* While a form is sending, its button shows data-busy-text ("Sending…") with three dots that pulse in turn. */

.btn[aria-busy="true"] {
	opacity: .85;
	cursor: progress;
}

.busy-dots {
	display: inline-block;
	width: 1.1em;
	text-align: left;
	letter-spacing: .05em;
}

.busy-dots span {
	animation: busy-dot 1.2s infinite ease-in-out;
	opacity: .2;
}

.busy-dots span:nth-child(2) {
	animation-delay: .2s;
}

.busy-dots span:nth-child(3) {
	animation-delay: .4s;
}

@keyframes busy-dot {
	0%, 80%, 100% { opacity: .2; }
	40% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.busy-dots span {
		animation: none;
		opacity: 1;
	}

	.section-tile,
	.section-tile-icon {
		transition: none;
	}
}

/* ---------- Sign-in pages ---------- */

.auth-card {
	max-width: 460px;
	margin: 1.5rem auto 2rem;
}

.grecaptcha-badge {
	visibility: hidden;
}

.recaptcha-note {
	font-size: .75rem;
	color: var(--muted);
}

/* ---------- Contact us (/contact) ---------- */

.contact-head {
	max-width: 46rem;
	margin: .5rem 0 1.5rem;
}

.contact-head h1 {
	margin-bottom: .5rem;
}

.contact-us-form textarea {
	resize: vertical;
}

/* The honeypot field: off screen for people, still in the form for bots. */
.hp-field {
	position: absolute;
	left: -10000px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.contact-aside {
	background: var(--mist);
	border-radius: var(--radius);
	padding: 1.25rem 1.35rem;
}

.contact-help {
	list-style: none;
	padding: 0;
	margin: 0 0 1rem;
}

.contact-help li {
	display: flex;
	flex-direction: column;
	gap: .15rem;
	padding: .75rem 0;
	border-bottom: 1px solid var(--line);
	font-size: .925rem;
}

.contact-help li:first-child {
	padding-top: 0;
}

.contact-help span {
	color: var(--ink-soft);
}

.contact-note {
	font-size: .875rem;
	color: var(--muted);
}

.contact-sent-icon {
	color: var(--harbour);
	margin-bottom: 1rem;
}

.contact-sent p {
	max-width: 34rem;
	margin-left: auto;
	margin-right: auto;
}

/* Admin → Messages: the message as it was typed. */
.contact-message-text {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	background: var(--mist);
	border-radius: var(--radius-sm);
	padding: .75rem .9rem;
	font-size: .95rem;
}

/* ---------- 404: nobody's home ---------- */

.lost {
	text-align: center;
	padding: 1rem 0 3rem;
}

.lost-chart {
	display: block;
	width: 100%;
	max-width: 320px;
	height: auto;
	margin: 0 auto 1.5rem;
}

.lost h1 {
	font-size: clamp(1.6rem, 4vw, 2.25rem);
	margin-bottom: .6rem;
}

.lost-lead {
	max-width: 32rem;
	margin: 0 auto 1.5rem;
	color: var(--ink-soft);
}

.lost .not-found-search {
	margin-bottom: 1.25rem;
}

.lost-sections {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .5rem;
	list-style: none;
	padding: 0;
	margin: 0 auto 1.5rem;
	max-width: 40rem;
}

.lost-sections a {
	display: inline-block;
	padding: .35rem .85rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	color: var(--ink);
	background: var(--paper);
	font-size: .9rem;
}

.lost-sections a:hover,
.lost-sections a:focus {
	border-color: var(--harbour);
	color: var(--harbour-deep);
	text-decoration: none;
}

/* ---------- Terms, privacy and cookies ---------- */

.legal h2 {
	scroll-margin-top: 5.5rem;
}

.legal h3 {
	margin-top: 1.25rem;
}

.legal-contents {
	background: var(--mist);
	border-radius: var(--radius);
	padding: 1rem 1.25rem;
	margin: 1.25rem 0 2rem;
	font-size: .925rem;
}

.legal-contents ol {
	columns: 2 14rem;
	column-gap: 2rem;
	margin: 0;
	padding-left: 1.25rem;
}

.legal-contents li {
	break-inside: avoid;
	margin-bottom: .2rem;
}

.legal-table {
	font-size: .9rem;
}

.legal-table td:first-child {
	font-weight: 500;
	overflow-wrap: anywhere;
}

/* ---------- Cookie banner ---------- */

.cookie-banner {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1070;
	background: var(--ink);
	color: #fff;
	padding: 1rem 0;
	box-shadow: 0 -4px 18px rgba(0, 0, 0, .18);
	font-size: .9rem;
}

.cookie-banner[hidden] {
	display: none;
}

.cookie-banner-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75rem 1.5rem;
}

.cookie-banner p {
	flex: 1 1 26rem;
	margin: 0;
}

.cookie-banner a {
	color: #fff;
	text-decoration: underline;
}

.cookie-actions {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

/* The "Cookie settings" link in the footer is a button. */
.link-button {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.link-button:hover,
.link-button:focus {
	text-decoration: underline;
}

.consent-status {
	background: var(--mist);
	border-radius: var(--radius);
	padding: 1rem 1.15rem;
	margin-bottom: 1.5rem;
}

/* ---------- Admin tables (Users, Roles) on phones ---------- */

/* material-table's toolbar: the title, search and action icons wrap instead of squeezing the title to "U…". */
@media (max-width: 575.98px) {
	.MuiToolbar-root[class*="MTableToolbar"] {
		flex-wrap: wrap;
		padding-top: .5rem;
		padding-bottom: .5rem;
	}

	.MuiToolbar-root[class*="MTableToolbar"] > [class*="-title-"] {
		flex: 1 1 100%;
		overflow: visible;
	}

	.MuiToolbar-root[class*="MTableToolbar"] > [class*="-spacer-"] {
		display: none;
	}

	.MuiToolbar-root[class*="MTableToolbar"] > .MuiTextField-root {
		flex: 1 1 auto;
		min-width: 0;
		padding-left: 0;
	}

	.MuiToolbar-root[class*="MTableToolbar"] > [class*="-actions-"] > div > div {
		display: flex;
	}
}
