/* ==========================================================================
   PBC Direct Listings — Frontend Styles
   ========================================================================== */

/* Wrapper */
.pbc-dl-wrapper {
	max-width: 1080px;
	margin: 0 auto;
}

/* Legacy plain-text intro (shortcode intro="" attribute) */
.pbc-dl-intro {
	margin-bottom: 2em;
	padding: 1.25em 1.5em;
	background: #f5f5f5;
	border-left: 4px solid #2d3849;
	border-radius: 2px;
	font-size: .97em;
	line-height: 1.7;
}

/* ---- Intro block ---- */
.pbc-dl-intro-block {
	border: 1px solid #ddd;
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 2em;
}

.pbc-dl-intro-block__top {
	background: #2d3849;
	padding: 1.75em 2em;
}

.pbc-dl-intro-block__eyebrow {
	font-size: .7em;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #baaa67;
	margin: 0 0 .5em;
}

.pbc-dl-intro-block__heading {
	font-size: 1.35em !important;
	font-weight: 600 !important;
	color: #fff !important;
	line-height: 1.3 !important;
	margin: 0 0 .65em !important;
}

.pbc-dl-intro-block__lead {
	font-size: .97em;
	color: #b8bec9;
	line-height: 1.7;
	margin: 0;
	max-width: 680px;
}

.pbc-dl-intro-block__bottom {
	background: #fff;
	border-top: 3px solid #baaa67;
	display: flex;
	flex-wrap: wrap;
}

.pbc-dl-intro-block__point {
	display: flex;
	align-items: flex-start;
	gap: .75em;
	flex: 1;
	min-width: 180px;
	padding: 1.1em 1.5em 1.1em 1.5em;
	border-right: 1px solid #eee;
}

.pbc-dl-intro-block__point:first-child {
	padding-left: 2em;
}

.pbc-dl-intro-block__point:last-child {
	border-right: none;
}

.pbc-dl-intro-block__icon {
	color: #baaa67;
	font-size: 1.4em;
	flex-shrink: 0;
	margin-top: .1em;
	width: auto;
	height: auto;
}

.pbc-dl-intro-block__point-label {
	font-size: .9em;
	font-weight: 700;
	color: #2d3849;
	margin: 0 0 .2em;
}

.pbc-dl-intro-block__point-desc {
	font-size: .8em;
	color: #777;
	line-height: 1.5;
	margin: 0;
}

@media (max-width: 620px) {
	.pbc-dl-intro-block__point {
		border-right: none;
		border-bottom: 1px solid #eee;
		padding: 1em 1.5em;
	}
	.pbc-dl-intro-block__point:first-child {
		padding-left: 1.5em;
	}
	.pbc-dl-intro-block__point:last-child {
		border-bottom: none;
	}
}

/* ---- Listing cards ---- */
.pbc-dl-listings {
	display: flex;
	flex-direction: column;
	gap: 1.25em;
}

.pbc-dl-card {
	display: flex;
	align-items: stretch;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0,0,0,.07);
	transition: box-shadow .18s ease;
}

.pbc-dl-card:hover {
	box-shadow: 0 4px 14px rgba(0,0,0,.13);
}

/* Thumbnail — fills the left block completely */
.pbc-dl-card__thumb {
	flex: 0 0 220px !important;
	display: block !important;
	overflow: hidden;
	background: #e8e8e8;
	text-decoration: none;
	align-self: stretch;
	position: relative;
}

/* Target WordPress-generated img (has inline width/height attrs) with !important */
.pbc-dl-card__thumb img,
.pbc-dl-card__img {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	display: block !important;
	max-width: none !important;
}

.pbc-dl-card__thumb-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	position: absolute;
	inset: 0;
	background: #e8e8e8;
	color: #bbb;
	font-size: 3em;
}

/* Body */
.pbc-dl-card__body {
	flex: 1;
	padding: 1.25em 1.5em;
	display: flex;
	flex-direction: column;
	gap: 0;
}

/* Main row: info left, buttons right */
.pbc-dl-card__main {
	display: flex !important;
	flex-direction: row !important;
	align-items: center;
	gap: 1em;
	flex: 1;
}

.pbc-dl-card__info {
	flex: 1 !important;
	display: flex;
	flex-direction: column;
	gap: .65em;
	min-width: 0;
}

/* Action buttons — stacked on the right, vertically centred */
.pbc-dl-card__actions {
	flex: 0 0 140px !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch;
	justify-content: center;
	gap: .5em;
	width: 140px;
}

.pbc-dl-card__title {
	margin: 0;
	font-size: 1.15em;
	line-height: 1.35;
}

.pbc-dl-card__title a {
	text-decoration: none;
	color: #1a1a1a;
}

.pbc-dl-card__title a:hover {
	color: #1a6e2e;
}

.pbc-dl-card__ref {
	font-size: .8em;
	font-weight: 400;
	color: #999;
	margin-left: .35em;
}

/* Meta list (Location / Turnover / Price) */
.pbc-dl-card__meta {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: .35em 2em;
}

.pbc-dl-card__meta-item {
	display: flex;
	flex-direction: column;
}

.pbc-dl-meta__label {
	font-size: .7em;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: #999;
	font-weight: 600;
}

.pbc-dl-meta__value {
	font-size: 1em;
	font-weight: 700;
	color: #222;
}

.pbc-dl-meta__value--price {
	color: #1a6e2e;
	font-size: 1.1em;
}

/* Excerpt — full width below the main row */
.pbc-dl-card__excerpt {
	margin-top: 1em;
	padding-top: 1em;
	border-top: 1px solid #eee;
	font-size: .85em !important;
	font-weight: 400 !important;
	color: #555;
	line-height: 1.6;
}

.pbc-dl-card__excerpt p,
.pbc-dl-card__excerpt p:last-child {
	font-size: inherit !important;
	font-weight: 400 !important;
	margin-bottom: 0;
	color: inherit;
}

/* Buttons */
.pbc-dl-btn {
	display: block;
	padding: .55em 1em;
	border: none;
	border-radius: 3px;
	cursor: pointer;
	font-size: .875em;
	font-weight: 600;
	font-family: inherit;
	text-decoration: none;
	text-align: center;
	transition: background .18s, color .18s;
	line-height: 1.4;
	white-space: nowrap;
}

.pbc-dl-btn--details {
	background: #4a4a4a;
	color: #fff;
	border: none;
}

.pbc-dl-btn--details:hover,
.pbc-dl-btn--details:focus {
	background: #333;
	color: #fff;
	outline: none;
}

.pbc-dl-btn--contact {
	background: #1a6e2e;
	color: #fff;
}

.pbc-dl-btn--contact:hover,
.pbc-dl-btn--contact:focus {
	background: #145523;
	color: #fff;
	outline: none;
}

.pbc-dl-btn--submit {
	display: block;
	width: 100%;
	padding: .75em 1em;
	font-size: 1em;
	background: #1a6e2e;
	color: #fff;
	text-align: center;
	border-radius: 3px;
	margin-top: .5em;
}

.pbc-dl-btn--submit:hover,
.pbc-dl-btn--submit:focus {
	background: #145523;
	color: #fff;
	outline: none;
}

.pbc-dl-btn--submit:disabled {
	opacity: .6;
	cursor: not-allowed;
}

/* Empty state */
.pbc-dl-no-listings {
	padding: 2em;
	text-align: center;
	color: #777;
	background: #fafafa;
	border: 1px dashed #ddd;
	border-radius: 4px;
}

/* Expired notice on single */
.pbc-dl-expired-notice {
	padding: 1em 1.5em;
	background: #fff8e1;
	border: 1px solid #ffe082;
	border-radius: 4px;
	color: #795548;
}

/* ---- Single listing meta block ---- */
/*
   Desktop layout (grid):
   +-------------------------------+------------------+
   |  (empty)                      | [Contact Seller] |
   +-------------------------------+------------------+
   | Location   Turnover   Price                      |
   +--------------------------------------------------+
*/
.pbc-dl-single-meta {
	display: grid !important;
	grid-template-columns: 1fr auto;
	grid-template-rows: auto auto;
	gap: .75em 1em;
	padding: 1.1em 1.25em;
	background: #f5f5f5;
	border-radius: 4px;
	margin-bottom: 1.5em;
}

/* Fields: second row, full width */
.pbc-dl-single-meta__fields {
	grid-column: 1 / -1;
	grid-row: 2;
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap;
	gap: .4em 2.5em;
}

/* Button: top-right cell */
.pbc-dl-single-meta__action {
	grid-column: 2;
	grid-row: 1;
	align-self: start;
	justify-self: end;
}

.pbc-dl-single-meta__action .pbc-dl-btn--contact {
	white-space: nowrap;
}

.pbc-dl-single-meta__item {
	display: flex;
	flex-direction: column;
}

.pbc-dl-single-meta__label {
	font-size: .7em;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: #999;
	font-weight: 600;
}

.pbc-dl-single-meta__value {
	font-size: 1.05em;
	font-weight: 700;
	color: #222;
}

.pbc-dl-single-meta__value--price {
	color: #1a6e2e;
}

/* Mobile: stack everything */
@media (max-width: 540px) {
	.pbc-dl-single-meta {
		display: block !important;
	}

	.pbc-dl-single-meta__action {
		display: block;
		margin-bottom: .85em;
	}

	.pbc-dl-single-meta__action .pbc-dl-btn--contact {
		display: block;
		width: 100%;
		text-align: center;
	}

	.pbc-dl-single-meta__fields {
		flex-direction: column !important;
		gap: .6em;
	}
}

/* ========================================================================
   Modal
   ======================================================================== */

.pbc-dl-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1em;
	box-sizing: border-box;
}

.pbc-dl-modal[hidden] {
	display: none;
}

.pbc-dl-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .55);
}

.pbc-dl-modal__inner {
	position: relative;
	background: #fff;
	border-radius: 6px;
	padding: 1.75em 2em;
	width: 100%;
	max-width: 520px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 8px 36px rgba(0,0,0,.28);
}

.pbc-dl-modal__close {
	position: absolute;
	top: .6em;
	right: .75em;
	background: none;
	border: none;
	font-size: 1.6em;
	cursor: pointer;
	color: #888;
	line-height: 1;
	padding: .2em .4em;
}

.pbc-dl-modal__close:hover {
	color: #222;
}

.pbc-dl-modal__heading {
	margin: 0 0 .2em;
	font-size: 1.3em;
}

.pbc-dl-modal__listing-name {
	margin: 0 0 1em;
	color: #666;
	font-style: italic;
	font-size: .9em;
}

.pbc-dl-modal__notice {
	margin-bottom: 1.25em;
	padding: .7em 1em;
	background: #e8f5e9;
	border: 1px solid #a5d6a7;
	border-radius: 3px;
	font-size: .85em;
	color: #2e7d32;
	line-height: 1.5;
}

/* Messages */
.pbc-dl-modal__messages {
	margin-bottom: .5em;
}

.pbc-dl-msg {
	padding: .75em 1em;
	border-radius: 4px;
	margin-bottom: .75em;
	font-size: .9em;
	line-height: 1.5;
}

.pbc-dl-msg--success {
	background: #e8f5e9;
	color: #1b5e20;
	border: 1px solid #a5d6a7;
}

.pbc-dl-msg--error {
	background: #ffebee;
	color: #b71c1c;
	border: 1px solid #ef9a9a;
}

/* Form fields */
.pbc-dl-field {
	margin-bottom: .9em;
}

.pbc-dl-field label {
	display: block;
	font-weight: 600;
	font-size: .875em;
	margin-bottom: .3em;
	color: #333;
}

.pbc-dl-required {
	color: #c00;
}

.pbc-dl-field input[type="text"],
.pbc-dl-field input[type="email"],
.pbc-dl-field input[type="tel"],
.pbc-dl-field textarea {
	width: 100%;
	padding: .5em .75em;
	border: 1px solid #ccc;
	border-radius: 3px;
	font-size: 1em;
	font-family: inherit;
	box-sizing: border-box;
	background: #fff;
	color: #222;
}

.pbc-dl-field input:focus,
.pbc-dl-field textarea:focus {
	outline: none;
	border-color: #1a6e2e;
	box-shadow: 0 0 0 2px rgba(26,110,46,.2);
}

.pbc-dl-required-note {
	font-size: .8em;
	color: #888;
	margin-bottom: .5em;
}

/* Honeypot – must stay invisible */
.pbc-dl-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
}

/* ========================================================================
   Responsive
   ======================================================================== */

@media (max-width: 680px) {
	.pbc-dl-card {
		flex-direction: column;
	}

	/* On mobile the thumb needs an explicit height since it's no longer
	   constrained by the card's row height */
	.pbc-dl-card__thumb {
		flex: none !important;
		width: 100% !important;
		height: 200px;
	}

	.pbc-dl-card__main {
		flex-direction: column !important;
	}

	.pbc-dl-card__actions {
		flex-direction: row !important;
		flex: none !important;
		width: 100% !important;
	}

	.pbc-dl-card__actions .pbc-dl-btn {
		flex: 1;
	}

	.pbc-dl-card__meta {
		flex-direction: column;
		gap: .5em;
	}

	.pbc-dl-modal__inner {
		padding: 1.25em;
	}
}
