/* Modern boerse detail view (used by show_modern_detail()) */

/* Post-save page wrapper (bikeboerse_save.php) – same typography as detail view */
.bdv2-postsave-page {
	--bdv2-red: #b9111d;
	--bdv2-dark: #1c1f24;
	--bdv2-text: #2b2f36;
	--bdv2-muted: #6b7280;
	--bdv2-border: #e5e7eb;
	max-width: 1024px;
	margin: 0 auto 24px;
	padding: 0 12px;
	color: var(--bdv2-text);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.bdv2-postsave-page *,
.bdv2-postsave-page *::before,
.bdv2-postsave-page *::after {
	box-sizing: border-box;
}

body.ipsApp .bdv2-postsave-page,
body.ipsApp .bdv2-postsave-page h1,
body.ipsApp .bdv2-postsave-page p,
body.ipsApp .bdv2-postsave-page a {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

.bdv2-postsave-title {
	margin: 0 0 8px;
	padding: 0;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--bdv2-dark);
	letter-spacing: -0.02em;
	text-transform: none;
}

.bdv2-postsave-lead {
	margin: 0 0 16px;
	padding: 0;
	font-size: 15px;
	line-height: 1.55;
	color: var(--bdv2-muted);
	font-weight: 400;
}

.bdv2-postsave-lead a {
	color: var(--bdv2-red);
	text-decoration: none;
	font-weight: 600;
}

.bdv2-postsave-lead a:hover {
	text-decoration: underline;
}

.bdv2-postsave-preview {
	margin-top: 4px;
}

/* Post-save action bar (above the preview on bikeboerse_save.php) */
.bdv2-postsave-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 20px;
	max-width: 1024px;
	padding: 0;
}

.bdv2-postsave-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 20px;
	min-height: 46px;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	color: #1c1f24;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
	-webkit-tap-highlight-color: transparent;
}

.bdv2-postsave-btn:hover {
	background: #1c1f24;
	border-color: #1c1f24;
	color: #fff;
	transform: translateY(-1px);
}

.bdv2-postsave-btn--edit {
	background: #b9111d;
	border-color: #b9111d;
	color: #fff;
}

.bdv2-postsave-btn--edit:hover {
	background: #99131e;
	border-color: #99131e;
	color: #fff;
}

@media (max-width: 640px) {
	.bdv2-postsave-bar {
		gap: 8px;
	}
	.bdv2-postsave-btn {
		flex: 1 1 calc(50% - 4px);
		min-height: 48px;
		padding: 10px 14px;
		font-size: 13px;
	}
	.bdv2-postsave-btn--edit {
		flex-basis: 100%;
	}
}


.bdv2-detail {
	--bdv2-red: #b9111d;
	--bdv2-dark: #1c1f24;
	--bdv2-text: #2b2f36;
	--bdv2-muted: #6b7280;
	--bdv2-border: #e5e7eb;
	--bdv2-soft: #f5f6f8;
	--bdv2-soft-2: #fafbfc;
	max-width: 1024px;
	margin: 0 auto 24px;
	color: var(--bdv2-text);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
}

.bdv2-detail * { box-sizing: border-box; }

/* IPS / site theme – consistent fonts inside detail preview (post-save + live detail) */
body.ipsApp .bdv2-detail,
body.ipsApp .bdv2-detail h1,
body.ipsApp .bdv2-detail h2,
body.ipsApp .bdv2-detail .bdv2-title,
body.ipsApp .bdv2-detail .bdv2-title-brand,
body.ipsApp .bdv2-detail .bdv2-title-model,
body.ipsApp .bdv2-detail .bdv2-breadcrumb,
body.ipsApp .bdv2-detail .bdv2-meta,
body.ipsApp .bdv2-detail .bdv2-meta a,
body.ipsApp .bdv2-detail .bdv2-price-amount,
body.ipsApp .bdv2-detail span[itemprop] {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
	text-transform: none !important;
	letter-spacing: normal !important;
}

/* IPS override – beat the forum theme's button/anchor defaults inside the detail view */
.bdv2-detail a.bdv2-btn,
.bdv2-detail button.bdv2-btn,
.bdv2-detail a.bdv2-owner-btn,
.bdv2-detail button.bdv2-owner-btn,
body.ipsApp .bdv2-detail a.bdv2-btn,
body.ipsApp .bdv2-detail button.bdv2-btn,
body.ipsApp .bdv2-detail a.bdv2-owner-btn,
body.ipsApp .bdv2-detail button.bdv2-owner-btn {
	text-shadow: none !important;
	box-shadow: none !important;
	font-family: inherit !important;
	text-decoration: none !important;
}

.bdv2-detail a.bdv2-btn:hover,
.bdv2-detail a.bdv2-owner-btn:hover,
body.ipsApp .bdv2-detail a.bdv2-btn:hover,
body.ipsApp .bdv2-detail a.bdv2-owner-btn:hover {
	text-decoration: none !important;
}

/* ====== Owner bar (you-own-this card) ====== */
.bdv2-owner-bar {
	background: #fff;
	border: 1px solid var(--bdv2-border);
	border-left: 4px solid var(--bdv2-red);
	border-radius: 10px;
	padding: 16px 18px;
	margin-bottom: 20px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.bdv2-owner-bar-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
}

.bdv2-owner-bar-icon {
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #fff0f1;
	color: var(--bdv2-red);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
}

.bdv2-owner-bar-info {
	min-width: 0;
	flex: 1;
}

.bdv2-owner-bar-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--bdv2-dark);
	line-height: 1.25;
}

.bdv2-owner-bar-sub {
	font-size: 13px;
	color: var(--bdv2-muted);
	margin-top: 3px;
	line-height: 1.4;
}

.bdv2-owner-bar-status {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	vertical-align: 1px;
}

.bdv2-owner-bar-status.is-on {
	background: #e6f4ea;
	color: #1f7a3c;
}

.bdv2-owner-bar-status.is-off {
	background: #f3f4f6;
	color: #6b7280;
}

.bdv2-owner-actions {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 10px;
}

.bdv2-owner-btn {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	min-height: 56px;
	border-radius: 9px;
	border: 1px solid var(--bdv2-border);
	background: #fff;
	color: var(--bdv2-dark);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
	-webkit-tap-highlight-color: transparent;
}

.bdv2-owner-btn i {
	font-size: 18px;
	flex: 0 0 22px;
	text-align: center;
}

.bdv2-owner-btn-text {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.bdv2-owner-btn-label {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
}

.bdv2-owner-btn-hint {
	font-size: 11px;
	font-weight: 400;
	color: var(--bdv2-muted);
	line-height: 1.2;
}

.bdv2-owner-btn:hover,
.bdv2-owner-btn:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	outline: none;
}

.bdv2-owner-btn:active {
	transform: translateY(0);
	box-shadow: none;
}

.bdv2-owner-btn--primary {
	background: var(--bdv2-red);
	border-color: var(--bdv2-red);
	color: #fff;
}

.bdv2-owner-btn--primary .bdv2-owner-btn-hint {
	color: rgba(255, 255, 255, 0.78);
}

.bdv2-owner-btn--primary:hover,
.bdv2-owner-btn--primary:focus-visible {
	background: #99131e;
	border-color: #99131e;
	color: #fff;
}

.bdv2-owner-btn--success {
	background: #fff;
	border-color: #b4dfc2;
	color: #1f7a3c;
}

.bdv2-owner-btn--success .bdv2-owner-btn-hint {
	color: #5b8c70;
}

.bdv2-owner-btn--success:hover,
.bdv2-owner-btn--success:focus-visible {
	background: #1f9d55;
	border-color: #1f9d55;
	color: #fff;
}

.bdv2-owner-btn--success:hover .bdv2-owner-btn-hint,
.bdv2-owner-btn--success:focus-visible .bdv2-owner-btn-hint {
	color: rgba(255, 255, 255, 0.85);
}

.bdv2-owner-btn--ghost {
	background: #fff;
	border-color: var(--bdv2-border);
	color: var(--bdv2-dark);
}

.bdv2-owner-btn--ghost:hover,
.bdv2-owner-btn--ghost:focus-visible {
	background: var(--bdv2-dark);
	border-color: var(--bdv2-dark);
	color: #fff;
}

.bdv2-owner-btn--ghost:hover .bdv2-owner-btn-hint,
.bdv2-owner-btn--ghost:focus-visible .bdv2-owner-btn-hint {
	color: rgba(255, 255, 255, 0.78);
}

.bdv2-owner-btn--danger {
	background: #fff;
	border-color: #f3c8c8;
	color: #b9111d;
}

.bdv2-owner-btn--danger .bdv2-owner-btn-hint {
	color: #c87c80;
}

.bdv2-owner-btn--danger:hover,
.bdv2-owner-btn--danger:focus-visible {
	background: var(--bdv2-red);
	border-color: var(--bdv2-red);
	color: #fff;
}

.bdv2-owner-btn--danger:hover .bdv2-owner-btn-hint,
.bdv2-owner-btn--danger:focus-visible .bdv2-owner-btn-hint {
	color: rgba(255, 255, 255, 0.85);
}

/* ====== Head row (title + price) ====== */
.bdv2-head {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 24px;
	align-items: start;
	padding: 18px 0 16px;
	border-bottom: 1px solid var(--bdv2-border);
	margin-bottom: 20px;
}

.bdv2-breadcrumb {
	font-size: 13px;
	color: var(--bdv2-muted);
	margin-bottom: 6px;
}

.bdv2-breadcrumb a {
	color: var(--bdv2-muted);
	text-decoration: none;
}

.bdv2-breadcrumb a:hover {
	color: var(--bdv2-red);
}

.bdv2-title {
	margin: 0 0 10px;
	font-size: 26px;
	line-height: 1.3;
	font-weight: 700;
	color: var(--bdv2-dark);
	letter-spacing: -0.02em;
}

.bdv2-title-brand,
.bdv2-title-model {
	display: inline;
	font-size: inherit;
	line-height: inherit;
	font-weight: inherit;
	font-family: inherit;
	vertical-align: baseline;
}

.bdv2-title-brand {
	color: var(--bdv2-red);
}

.bdv2-title-model {
	color: var(--bdv2-dark);
}

.bdv2-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 8px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	vertical-align: middle;
	line-height: 1;
}

.bdv2-badge--new {
	background: #e6f4ea;
	color: #1f7a3c;
}

.bdv2-meta {
	font-size: 14px;
	color: var(--bdv2-muted);
	line-height: 1.6;
	font-weight: 400;
}

.bdv2-meta a {
	color: var(--bdv2-dark);
	font-weight: 600;
	text-decoration: none;
}

.bdv2-meta a:hover {
	color: var(--bdv2-red);
}

.bdv2-meta-sub {
	color: #9aa1ab;
	font-weight: 400;
}

.bdv2-meta i {
	color: var(--bdv2-red);
	margin-right: 4px;
	font-size: 13px;
	vertical-align: -1px;
}

.bdv2-price-box {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: center;
	min-width: 160px;
}

.bdv2-price-amount {
	font-size: 30px;
	font-weight: 700;
	color: var(--bdv2-red);
	line-height: 1;
	white-space: nowrap;
}

/* ====== Grid (gallery + sidebar) ====== */
.bdv2-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 24px;
	margin-bottom: 24px;
}

/* ====== Gallery ====== */
.bdv2-gallery {
	min-width: 0;
}

.bdv2-gallery-hero {
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	overflow: hidden;
	background: var(--bdv2-soft);
	border: 1px solid var(--bdv2-border);
	/* Cap the hero so vertical (portrait) photos don't blow up the page.
	   Image is letterboxed via object-fit:contain against the soft bg. */
	max-height: 520px;
	min-height: 280px;
}

.bdv2-gallery-hero img {
	display: block;
	/* Override any width/height HTML attributes coming from bild->show() */
	width: auto !important;
	height: auto !important;
	max-width: 100%;
	max-height: 520px;
	object-fit: contain;
	transition: transform 0.3s;
}

.bdv2-gallery-hero:hover img {
	transform: scale(1.02);
}

.bdv2-thumbs {
	display: flex;
	gap: 8px;
	margin-top: 10px;
	flex-wrap: wrap;
}

.bdv2-thumb {
	flex: 0 0 auto;
	display: block;
	width: 90px;
	height: 65px;
	border-radius: 6px;
	overflow: hidden;
	border: 2px solid transparent;
	transition: border-color 0.15s, transform 0.15s;
	background: var(--bdv2-soft);
}

.bdv2-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bdv2-thumb:hover {
	border-color: var(--bdv2-red);
	transform: translateY(-1px);
}

.bdv2-thumb.is-active {
	border-color: var(--bdv2-red);
}

.bdv2-gallery-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 280px;
	background: var(--bdv2-soft);
	border: 1px dashed var(--bdv2-border);
	border-radius: 10px;
	color: var(--bdv2-muted);
}

.bdv2-gallery-empty i {
	font-size: 40px;
	color: #c5c9d0;
}

/* ====== Sidebar ====== */
.bdv2-sidebar {
	background: var(--bdv2-soft-2);
	border: 1px solid var(--bdv2-border);
	border-radius: 10px;
	padding: 18px;
	align-self: start;
	position: sticky;
	top: 16px;
}

.bdv2-facts {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding-bottom: 14px;
	margin-bottom: 14px;
	border-bottom: 1px solid var(--bdv2-border);
}

.bdv2-fact {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	font-size: 14px;
}

.bdv2-fact-key {
	color: var(--bdv2-muted);
	font-size: 13px;
}

.bdv2-fact-val {
	color: var(--bdv2-dark);
	font-weight: 500;
	text-align: right;
	word-break: break-word;
}

.bdv2-fact-val a {
	color: var(--bdv2-red);
	text-decoration: none;
}

.bdv2-fact-val a:hover {
	text-decoration: underline;
}

.bdv2-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.bdv2-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 18px;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	border: 1px solid transparent;
	transition: background 0.15s, color 0.15s, transform 0.05s;
	line-height: 1.2;
}

.bdv2-btn:hover {
	transform: translateY(-1px);
}

.bdv2-btn--primary {
	background: var(--bdv2-red);
	color: #fff;
	border-color: var(--bdv2-red);
}

.bdv2-btn--primary:hover {
	background: #99131e;
	border-color: #99131e;
	color: #fff;
}

.bdv2-btn--ghost {
	background: #fff;
	color: var(--bdv2-dark);
	border-color: var(--bdv2-border);
}

.bdv2-btn--ghost:hover {
	background: var(--bdv2-dark);
	color: #fff;
	border-color: var(--bdv2-dark);
}

.bdv2-haendler {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid var(--bdv2-border);
	font-size: 13px;
	color: var(--bdv2-muted);
}

.bdv2-haendler i {
	color: var(--bdv2-red);
	margin-right: 4px;
}

.bdv2-haendler a {
	color: var(--bdv2-dark);
	text-decoration: none;
}

.bdv2-haendler a:hover {
	color: var(--bdv2-red);
}

/* ====== Description / sections ====== */
.bdv2-section {
	margin: 24px 0;
	padding: 18px 20px;
	background: #fff;
	border: 1px solid var(--bdv2-border);
	border-radius: 10px;
}

.bdv2-section-title {
	margin: 0 0 12px;
	font-size: 18px;
	font-weight: 600;
	color: var(--bdv2-dark);
}

.bdv2-description {
	font-size: 15px;
	line-height: 1.6;
	color: var(--bdv2-text);
	word-wrap: break-word;
}

.bdv2-description .bdv2-willhaben-link,
.bdv2-willhaben-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 4px 0;
	padding: 8px 14px;
	background: var(--bdv2-red);
	color: #fff !important;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.3;
	vertical-align: middle;
}

.bdv2-description .bdv2-willhaben-link:hover,
.bdv2-willhaben-link:hover {
	background: #99131e;
	color: #fff !important;
	text-decoration: none;
}

.bdv2-description .bdv2-willhaben-link .fa,
.bdv2-willhaben-link .fa {
	font-size: 13px;
}

.bdv2-stats {
	margin-top: 18px;
	padding-top: 14px;
	border-top: 1px solid var(--bdv2-border);
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	font-size: 12px;
	color: var(--bdv2-muted);
}

/* ====== Responsive ====== */
@media (max-width: 880px) {
	.bdv2-grid {
		grid-template-columns: 1fr;
		gap: 18px;
	}
	.bdv2-sidebar {
		position: static;
	}
	.bdv2-head {
		grid-template-columns: 1fr;
		gap: 12px;
	}
	.bdv2-price-box {
		align-items: flex-start;
	}
	.bdv2-price-amount {
		font-size: 26px;
	}
	.bdv2-title {
		font-size: 22px;
	}
	.bdv2-gallery-hero,
	.bdv2-gallery-hero img {
		max-height: 460px;
	}
	.bdv2-gallery-hero {
		min-height: 240px;
	}
}

@media (max-width: 640px) {
	.bdv2-gallery-hero,
	.bdv2-gallery-hero img {
		max-height: 380px;
	}
	.bdv2-gallery-hero {
		min-height: 200px;
	}
	.bdv2-owner-bar {
		padding: 14px;
		border-left-width: 3px;
	}
	.bdv2-owner-bar-icon {
		flex-basis: 34px;
		width: 34px;
		height: 34px;
		font-size: 14px;
	}
	.bdv2-owner-bar-title {
		font-size: 14px;
	}
	.bdv2-owner-bar-sub {
		font-size: 12px;
	}
	.bdv2-owner-actions {
		grid-template-columns: 1fr 1fr;
		gap: 8px;
	}
	.bdv2-owner-btn {
		min-height: 60px;
		padding: 10px 12px;
		gap: 10px;
	}
	/* Primary action takes the full row on phones */
	.bdv2-owner-btn--primary {
		grid-column: 1 / -1;
		min-height: 56px;
	}
	.bdv2-owner-btn-label {
		font-size: 13px;
	}
	.bdv2-owner-btn-hint {
		font-size: 10px;
	}
	.bdv2-owner-btn i {
		font-size: 16px;
	}
}

@media (max-width: 380px) {
	.bdv2-owner-bar-sub {
		display: none;
	}
	.bdv2-owner-btn {
		min-height: 64px;
	}
	.bdv2-owner-btn-text {
		gap: 2px;
	}
}

@media (max-width: 520px) {
	.bdv2-thumb {
		width: 70px;
		height: 50px;
	}
	.bdv2-section {
		padding: 14px 16px;
	}
	.bdv2-fact {
		font-size: 13px;
	}
	.bdv2-btn {
		font-size: 14px;
		padding: 10px 14px;
	}
}
