/**
 * Property Search - Property Detail widget styles
 *
 * Self-contained port of the static property-detail page. The plugin
 * does not load Bootstrap, so the 8/4 layout grid, gallery, info tiles
 * and sidebar cards are recreated here with editable CSS variables.
 *
 * @package PropertySearch
 */

.ps-property-detail {
	--ps-detail-page-bg: transparent;
	--ps-detail-card-bg: #ffffff;
	--ps-detail-card-border: rgba(0, 0, 0, 0.04);
	--ps-detail-card-shadow: rgba(0, 0, 0, 0.03);
	--ps-detail-primary: #003d2b;
	--ps-detail-primary-alt: #006241;
	--ps-detail-gold: #ffcc00;
	--ps-detail-muted: #6c757d;
	--ps-detail-badge-verified-bg: rgba(0, 61, 43, 0.9);
	--ps-detail-badge-verified-color: #ffcc00;
	--ps-detail-badge-featured-bg: rgba(255, 204, 0, 0.95);
	--ps-detail-badge-featured-color: #003d2b;
	--ps-detail-action-bg: rgba(255, 255, 255, 0.9);
	--ps-detail-action-color: #333333;
	--ps-detail-count-bg: rgba(0, 0, 0, 0.7);
	--ps-detail-count-color: #ffffff;
	--ps-detail-title-color: #003d2b;
	--ps-detail-section-title: #003d2b;
	--ps-detail-body: #333333;
	--ps-detail-info-bg: #f8faf9;
	--ps-detail-info-border: #e8ede9;
	--ps-detail-info-icon: #006241;
	--ps-detail-info-value: #003d2b;
	--ps-detail-amenity-bg: #f0f7f4;
	--ps-detail-amenity-border: #d0e8dc;
	--ps-detail-amenity-color: #006241;
	--ps-detail-price-start: #003d2b;
	--ps-detail-price-end: #006241;
	--ps-detail-price-main: #ffcc00;
	--ps-detail-price-text: #ffffff;
	--ps-detail-avatar-start: #003d2b;
	--ps-detail-avatar-end: #006241;
	--ps-detail-whatsapp-bg: #25d366;
	--ps-detail-call-bg: #ffcc00;
	--ps-detail-call-color: #003d2b;
	--ps-detail-input-border: #e8ede9;
	--ps-detail-safety-bg: #fff8e1;
	--ps-detail-safety-border: #ffe082;
	--ps-detail-timeline-dot: #003d2b;
	--ps-detail-similar-title: #222222;
	--ps-detail-similar-price: #003d2b;
	--ps-detail-similar-shadow: rgba(0, 61, 43, 0.1);

	background: var(--ps-detail-page-bg);
	font-family: inherit;
	line-height: 1.5;
	color: var(--ps-detail-body);
}

.ps-property-detail,
.ps-property-detail * {
	box-sizing: border-box;
}

.ps-detail-grid {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 24px;
	align-items: start;
}

.ps-detail-sidebar {
	display: flex;
	flex-direction: column;
	gap: 24px;
	position: sticky;
	top: 24px;
}

/* ------------------------------------------------------------------ */
/* Gallery (mirrors .gallery-main / .gallery-thumbs)                   */
/* ------------------------------------------------------------------ */

.ps-gallery-main {
	border-radius: 20px;
	overflow: hidden;
	position: relative;
}

.ps-gallery-main .swiper-slide img {
	width: 100%;
	height: 450px;
	object-fit: cover;
	display: block;
	cursor: zoom-in;
}

.ps-gallery-badge {
	position: absolute;
	top: 20px;
	left: 20px;
	display: flex;
	gap: 8px;
	z-index: 5;
}

.ps-gallery-badge span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 18px;
	border-radius: 50px;
	font-size: 0.8rem;
	font-weight: 700;
	backdrop-filter: blur(10px);
}

.ps-badge-verified {
	background: var(--ps-detail-badge-verified-bg);
	color: var(--ps-detail-badge-verified-color);
}

.ps-badge-featured {
	background: var(--ps-detail-badge-featured-bg);
	color: var(--ps-detail-badge-featured-color);
}

.ps-gallery-actions {
	position: absolute;
	top: 20px;
	right: 20px;
	display: flex;
	gap: 8px;
	z-index: 5;
}

.ps-gallery-actions button {
	width: 42px;
	height: 42px;
	border-radius: 12px;
	border: none;
	background: var(--ps-detail-action-bg);
	color: var(--ps-detail-action-color);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.3s ease, color 0.3s ease;
	backdrop-filter: blur(8px);
}

.ps-gallery-actions button:hover,
.ps-gallery-actions button.is-active {
	background: var(--ps-detail-gold);
	color: var(--ps-detail-primary);
}

.ps-photo-count {
	position: absolute;
	bottom: 20px;
	right: 20px;
	background: var(--ps-detail-count-bg);
	color: var(--ps-detail-count-color);
	padding: 8px 18px;
	border-radius: 50px;
	font-size: 0.85rem;
	z-index: 5;
	backdrop-filter: blur(8px);
}

.ps-gallery-thumbs {
	margin-top: 12px;
}

.ps-gallery-thumbs .swiper-slide {
	border-radius: 12px;
	overflow: hidden;
	cursor: pointer;
	opacity: 0.5;
	transition: opacity 0.3s ease, border-color 0.3s ease;
	border: 3px solid transparent;
}

.ps-gallery-thumbs .swiper-slide.swiper-slide-thumb-active {
	opacity: 1;
	border-color: var(--ps-detail-gold);
}

.ps-gallery-thumbs img {
	width: 100%;
	height: 85px;
	object-fit: cover;
	display: block;
}

/* ------------------------------------------------------------------ */
/* Cards                                                               */
/* ------------------------------------------------------------------ */

.ps-detail-card,
.ps-sidebar-card {
	background: var(--ps-detail-card-bg);
	border-radius: 16px;
	padding: 30px;
	border: 1px solid var(--ps-detail-card-border);
	box-shadow: 0 4px 15px var(--ps-detail-card-shadow);
	margin-bottom: 24px;
}

.ps-sidebar-card:last-child {
	margin-bottom: 0;
}

.ps-detail-title {
	font-size: 1.8rem;
	font-weight: 700;
	color: var(--ps-detail-title-color);
	margin: 0 0 8px;
}

.ps-detail-loc {
	color: var(--ps-detail-muted);
	font-size: 1rem;
	margin: 0 0 16px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.ps-detail-loc :is(i, svg) {
	color: var(--ps-detail-gold);
}

.ps-posted-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--ps-detail-info-bg);
	color: var(--ps-detail-muted);
	padding: 6px 14px;
	border-radius: 50px;
	font-size: 0.82rem;
	font-weight: 600;
	margin-bottom: 20px;
}

/* Price tag */
.ps-price-tag {
	background: linear-gradient(135deg, var(--ps-detail-price-start), var(--ps-detail-price-end));
	color: var(--ps-detail-price-text);
	padding: 20px 28px;
	border-radius: 16px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
}

.ps-price-sub {
	font-size: 0.85rem;
	opacity: 0.7;
}

.ps-price-main {
	font-size: 2rem;
	font-weight: 700;
	color: var(--ps-detail-price-main);
}

.ps-price-total {
	text-align: right;
}

.ps-price-total div:first-child {
	font-size: 0.78rem;
	opacity: 0.6;
}

.ps-price-total div:last-child {
	font-size: 1.3rem;
	font-weight: 700;
}

/* Section titles */
.ps-section-title-detail {
	font-weight: 700;
	color: var(--ps-detail-section-title);
	margin: 0 0 16px;
	padding-bottom: 12px;
	border-bottom: 2px solid #f0f0f0;
	display: flex;
	align-items: center;
	gap: 10px;
}

.ps-section-title-detail :is(i, svg) {
	color: var(--ps-detail-gold);
}

/* Info grid */
.ps-info-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 16px;
}

.ps-info-item {
	background: var(--ps-detail-info-bg);
	border-radius: 12px;
	padding: 18px;
	text-align: center;
	border: 1px solid var(--ps-detail-info-border);
	transition: border-color 0.3s ease, background 0.3s ease;
}

.ps-info-item:hover {
	border-color: var(--ps-detail-primary);
	background: var(--ps-detail-amenity-bg);
}

.ps-info-item :is(i, svg) {
	font-size: 1.3rem;
	color: var(--ps-detail-info-icon);
	margin-bottom: 8px;
	display: block;
}

.ps-info-label {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--ps-detail-muted);
	margin-bottom: 4px;
}

.ps-info-value {
	font-weight: 700;
	color: var(--ps-detail-info-value);
	font-size: 1rem;
	word-break: break-word;
}

/* Amenity tags */
.ps-amenity-tag {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--ps-detail-amenity-bg);
	border: 1px solid var(--ps-detail-amenity-border);
	padding: 10px 20px;
	border-radius: 50px;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--ps-detail-amenity-color);
	margin: 4px;
}

.ps-amenity-tag :is(i, svg) {
	color: var(--ps-detail-gold);
}

.ps-detail-description p {
	margin: 0 0 12px;
}

.ps-detail-description p:last-child {
	margin-bottom: 0;
}

/* Documents */
.ps-doc-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px;
	border: 1px solid var(--ps-detail-info-border);
	border-radius: 12px;
	transition: border-color 0.3s ease, background 0.3s ease;
	margin-bottom: 8px;
}

.ps-doc-item:last-child {
	margin-bottom: 0;
}

.ps-doc-item:hover {
	border-color: var(--ps-detail-primary);
	background: var(--ps-detail-amenity-bg);
}

.ps-doc-icon {
	width: 45px;
	height: 45px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2rem;
	flex-shrink: 0;
}

.ps-doc-icon-success {
	background: rgba(40, 167, 69, 0.1);
	color: #28a745;
}

.ps-doc-icon-primary {
	background: rgba(13, 110, 253, 0.1);
	color: #0d6efd;
}

.ps-doc-title {
	display: block;
	font-weight: 700;
	font-size: 0.9rem;
}

.ps-doc-note {
	display: block;
	color: var(--ps-detail-muted);
	font-size: 0.8rem;
}

.ps-doc-badge {
	margin-left: auto;
	font-size: 0.75rem;
	font-weight: 700;
	color: #28a745;
	background: rgba(40, 167, 69, 0.1);
	border: 1px solid rgba(40, 167, 69, 0.3);
	border-radius: 50px;
	padding: 4px 12px;
}

.ps-doc-download {
	margin-left: auto;
	color: #0d6efd;
}

/* Map */
.ps-map-container {
	border-radius: 16px;
	overflow: hidden;
	border: 2px solid var(--ps-detail-info-border);
}

.ps-map-container iframe {
	width: 100%;
	height: 350px;
	border: 0;
	display: block;
}

/* ------------------------------------------------------------------ */
/* Sidebar                                                             */
/* ------------------------------------------------------------------ */

.ps-owner-info {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 20px;
}

.ps-owner-avatar {
	width: 60px;
	height: 60px;
	border-radius: 16px;
	background: linear-gradient(135deg, var(--ps-detail-avatar-start), var(--ps-detail-avatar-end));
	color: var(--ps-detail-gold);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 1.3rem;
	flex-shrink: 0;
}

.ps-owner-name {
	display: block;
	font-weight: 700;
	font-size: 1.1rem;
	color: var(--ps-detail-title-color);
}

.ps-owner-type {
	font-size: 0.82rem;
	color: var(--ps-detail-muted);
}

.ps-btn-contact {
	width: 100%;
	padding: 14px;
	border-radius: 12px;
	font-weight: 700;
	font-size: 1rem;
	border: none;
	transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
	margin-bottom: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-decoration: none;
	cursor: pointer;
}

.ps-btn-contact:hover {
	transform: translateY(-2px);
}

.ps-btn-contact-primary {
	background: var(--ps-detail-primary);
	color: #ffffff;
}

.ps-btn-contact-primary:hover {
	color: #ffffff;
	box-shadow: 0 8px 25px rgba(0, 61, 43, 0.25);
}

.ps-btn-contact-whatsapp {
	background: var(--ps-detail-whatsapp-bg);
	color: #ffffff;
}

.ps-btn-contact-whatsapp:hover {
	color: #ffffff;
	box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
}

.ps-btn-contact-call {
	background: var(--ps-detail-call-bg);
	color: var(--ps-detail-call-color);
}

.ps-btn-contact-call:hover {
	color: var(--ps-detail-call-color);
	box-shadow: 0 8px 25px rgba(255, 204, 0, 0.3);
}

.ps-btn-contact:disabled {
	opacity: 0.7;
	cursor: progress;
	transform: none;
}

/* Hide Quick Inquiry by default while leaving its markup and workflow intact. */
.ps-property-detail .ps-detail-quick-inquiry { display: none; }

/* Hide the complete owner/contact card in the property-detail sidebar. */
.ps-property-detail .ps-detail-owner-contact-card { display: none; }

/* Inquiry form */
.ps-inquiry-heading {
	font-weight: 700;
	margin: 8px 0 14px;
	color: var(--ps-detail-title-color);
	display: flex;
	align-items: center;
	gap: 8px;
}

.ps-inquiry-form input,
.ps-inquiry-form textarea {
	width: 100%;
	border: 2px solid var(--ps-detail-input-border);
	border-radius: 12px;
	padding: 12px 14px;
	font-size: 0.95rem;
	font-family: inherit;
	margin-bottom: 10px;
	outline: none;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.ps-inquiry-form input:focus,
.ps-inquiry-form textarea:focus {
	border-color: var(--ps-detail-primary);
	box-shadow: 0 0 0 3px rgba(0, 61, 43, 0.1);
}

.ps-inquiry-form textarea {
	resize: vertical;
	min-height: 90px;
}

.ps-inquiry-message {
	margin-top: 4px;
	padding: 10px 14px;
	border-radius: 10px;
	font-size: 0.88rem;
}

.ps-inquiry-message.ps-is-success {
	background: #e8f5e9;
	color: #1b5e20;
}

.ps-inquiry-message.ps-is-error {
	background: #fdecea;
	color: #b71c1c;
}

.ps-safety-tip {
	background: var(--ps-detail-safety-bg);
	border: 1px solid var(--ps-detail-safety-border);
	border-radius: 12px;
	padding: 18px;
	margin-top: 20px;
}

.ps-safety-tip p {
	margin: 0;
	font-size: 0.85rem;
}

.ps-safety-tip p:first-child {
	font-weight: 700;
	margin-bottom: 6px;
}

/* Timeline */
.ps-timeline-item {
	display: flex;
	gap: 16px;
	padding: 12px 0;
}

.ps-timeline-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--ps-detail-timeline-dot);
	margin-top: 6px;
	flex-shrink: 0;
	position: relative;
}

.ps-timeline-dot::after {
	content: '';
	position: absolute;
	top: 14px;
	left: 5px;
	width: 2px;
	height: calc(100% + 12px);
	background: var(--ps-detail-info-border);
}

.ps-timeline-item:last-child .ps-timeline-dot::after {
	display: none;
}

.ps-timeline-title {
	display: block;
	font-weight: 700;
	font-size: 0.9rem;
}

.ps-timeline-date {
	display: block;
	color: var(--ps-detail-muted);
	font-size: 0.82rem;
}

/* Property ID card */
.ps-property-id-card {
	text-align: center;
}

.ps-property-id-card div {
	font-size: 0.82rem;
	color: var(--ps-detail-muted);
}

.ps-property-id-card strong {
	display: block;
	font-size: 1.25rem;
	color: var(--ps-detail-primary);
	margin: 6px 0;
}

.ps-property-id-card span {
	font-size: 0.82rem;
	color: var(--ps-detail-muted);
}

/* ------------------------------------------------------------------ */
/* Similar properties                                                  */
/* ------------------------------------------------------------------ */

.ps-similar {
	margin-top: 40px;
}

.ps-similar h4 {
	font-weight: 700;
	margin-bottom: 24px;
	color: var(--ps-detail-title-color);
	display: flex;
	align-items: center;
	gap: 8px;
}

.ps-similar h4 :is(i, svg) {
	color: var(--ps-detail-gold);
}

.ps-similar-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
}

.ps-similar-card {
	background: var(--ps-detail-card-bg);
	border-radius: 16px;
	overflow: hidden;
	border: 1px solid var(--ps-detail-card-border);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ps-similar-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 10px 30px var(--ps-detail-similar-shadow);
}

.ps-similar-card a {
	text-decoration: none;
	color: inherit;
	display: block;
}

.ps-similar-card img {
	height: 160px;
	object-fit: cover;
	width: 100%;
	display: block;
}

.ps-similar-body {
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.ps-similar-title {
	font-weight: 700;
	color: var(--ps-detail-similar-title);
}

.ps-similar-loc {
	font-size: 0.85rem;
	color: var(--ps-detail-muted);
}

.ps-similar-price {
	font-weight: 700;
	color: var(--ps-detail-similar-price);
	margin-top: 4px;
}

.ps-similar-price small {
	font-weight: 400;
	color: var(--ps-detail-muted);
	font-size: 0.78rem;
}

/* Scroll reveal */
.ps-property-detail .ps-reveal {
	opacity: 0;
	transform: translateY(40px);
	transition: opacity 0.7s ease, transform 0.7s ease;
}

.ps-property-detail .ps-reveal.ps-show {
	opacity: 1;
	transform: translateY(0);
}

.ps-detail-empty {
	background: var(--ps-detail-amenity-bg);
	color: var(--ps-detail-primary);
	border-radius: 16px;
	padding: 40px 24px;
	text-align: center;
	font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 991.98px) {
	.ps-detail-grid {
		grid-template-columns: 1fr;
	}

	.ps-detail-sidebar {
		position: static;
	}

	.ps-similar-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767.98px) {
	.ps-gallery-main .swiper-slide img {
		height: 280px;
	}

	.ps-detail-title {
		font-size: 1.4rem;
	}

	.ps-price-tag {
		flex-direction: column;
		gap: 12px;
		text-align: center;
	}

	.ps-price-total {
		text-align: center;
	}

	.ps-detail-card,
	.ps-sidebar-card {
		padding: 22px;
	}
}

@media (max-width: 575.98px) {
	.ps-similar-grid {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ps-property-detail .ps-reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* Keep Swiper's intrinsic width and long owner text inside their grid tracks. */
.ps-property-detail .ps-detail-grid { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.ps-property-detail .ps-detail-grid-full { grid-template-columns: minmax(0, 1fr); }
.ps-property-detail .ps-detail-main,
.ps-property-detail .ps-detail-sidebar,
.ps-property-detail .ps-owner-info > span:last-child { min-width: 0; }
.ps-property-detail .ps-detail-sidebar {
 --ps-detail-sticky-offset: 100px;
 top: var(--ps-detail-sticky-offset);
 gap: 24px;
 max-height: calc(100dvh - var(--ps-detail-sticky-offset) - 24px);
 overflow-y: auto;
 scrollbar-width: thin;
}
/* Flex gap already provides spacing: margins used to double every sidebar gap. */
.ps-property-detail .ps-detail-sidebar .ps-sidebar-card { margin: 0; flex-shrink: 0; padding: 24px; }
.ps-property-detail .ps-owner-name,
.ps-property-detail .ps-owner-type,
.ps-property-detail .ps-timeline-title { overflow-wrap: anywhere; }
.ps-property-detail .ps-inquiry-form { display: block; margin: 0; width: 100%; }
.ps-property-detail .ps-inquiry-form input,
.ps-property-detail .ps-inquiry-form textarea {
 display: block; min-width: 0; max-width: 100%; height: auto;
 background: var(--ps-detail-card-bg); color: var(--ps-detail-body);
 font: inherit; line-height: 1.5; box-shadow: none;
}
.ps-property-detail .ps-btn-contact { white-space: normal; line-height: 1.5; text-align: center; min-height: 48px; }
.ps-property-detail .ps-btn-contact-primary { color: #fff; background: var(--ps-detail-primary); }
.ps-property-detail .ps-btn-contact-call { color: var(--ps-detail-call-color); background: var(--ps-detail-call-bg); }
.ps-property-detail .ps-btn-contact-whatsapp { color: #fff; background: var(--ps-detail-whatsapp-bg); }
.ps-property-detail .ps-inquiry-heading { font-size: 1rem; line-height: 1.5; }
.ps-property-detail .ps-sidebar-card hr { border: 0; border-top: 1px solid var(--ps-detail-info-border); margin: 20px 0; }
.ps-property-detail .ps-timeline-item > span:last-child { min-width: 0; }
.ps-property-detail :focus-visible { outline: 3px solid var(--ps-detail-gold); outline-offset: 3px; }
@media (max-width: 991.98px) {
 .ps-property-detail .ps-detail-grid { grid-template-columns: minmax(0, 1fr); }
 .ps-property-detail .ps-detail-sidebar { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 575.98px) {
 .ps-property-detail .ps-gallery-badge { top: 12px; left: 12px; flex-direction: column; }
 .ps-property-detail .ps-gallery-actions { top: 12px; right: 12px; }
 .ps-property-detail .ps-gallery-badge span { padding: 5px 10px; font-size: .7rem; }
}
