/* Step 5: property-card decisions, shortlist and comparison. */

.swre-property-archive .swre-property-card__save,
.swre-property-archive .swre-property-card__compare {
	pointer-events: none;
	visibility: hidden;
}

.swre-property-archive .swre-property-card__save,
.swre-property-archive .swre-property-card__compare {
	display: inline-flex;
}

.swre-property-decision-tools {
	display: flex;
	pointer-events: none;
	visibility: hidden;
}

.swre-property-results-ready .swre-property-archive .swre-property-card__save,
.swre-property-results-ready .swre-property-archive .swre-property-card__compare {
	pointer-events: auto;
	visibility: visible;
}

.swre-property-results-ready .swre-property-decision-tools {
	pointer-events: auto;
	visibility: visible;
}

.swre-property-archive__toolbar-actions {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: flex-end;
}

.swre-property-decision-tools button {
	align-items: center;
	background: var(--swre-property-surface);
	border: 1px solid var(--swre-property-line);
	color: var(--swre-property-ink);
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 800;
	gap: 0.55rem;
	min-height: 46px;
	padding: 0.65rem 0.75rem;
}

.swre-property-decision-tools strong {
	align-items: center;
	background: var(--swre-property-gold);
	display: inline-flex;
	font-size: 0.7rem;
	height: 24px;
	justify-content: center;
	min-width: 24px;
	padding: 0 0.3rem;
}

.swre-property-compare-tray {
	align-items: center;
	background: var(--swre-property-ink);
	bottom: 1rem;
	box-shadow: 0 18px 48px rgba(11, 11, 13, 0.3);
	color: var(--swre-property-surface);
	display: flex;
	gap: 1rem;
	justify-content: space-between;
	left: 50%;
	max-width: min(920px, calc(100vw - 2rem));
	padding: 0.85rem 1rem;
	position: fixed;
	transform: translateX(-50%);
	width: 100%;
	z-index: 100090;
}

.swre-property-compare-tray[hidden] {
	display: none;
}

.swre-property-compare-tray__summary {
	min-width: 0;
}

.swre-property-compare-tray__summary > strong {
	display: block;
	font-size: 0.78rem;
	margin-bottom: 0.35rem;
}

.swre-property-compare-tray__items {
	display: flex;
	gap: 0.35rem;
	overflow: hidden;
}

.swre-property-compare-tray__item {
	background: rgba(255, 255, 255, 0.12);
	font-size: 0.72rem;
	max-width: 10rem;
	overflow: hidden;
	padding: 0.35rem 0.5rem;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.swre-property-compare-tray__actions {
	display: flex;
	flex: 0 0 auto;
	gap: 0.5rem;
}

.swre-property-compare-tray button,
.swre-property-decision-dialog button {
	font: inherit;
}

.swre-property-compare-tray__clear,
.swre-property-compare-tray__open {
	border: 1px solid rgba(255, 255, 255, 0.4);
	cursor: pointer;
	font-size: 0.78rem;
	font-weight: 800;
	min-height: 42px;
	padding: 0.6rem 0.8rem;
}

.swre-property-compare-tray__clear {
	background: transparent;
	color: var(--swre-property-surface);
}

.swre-property-compare-tray__open {
	background: var(--swre-property-gold);
	border-color: var(--swre-property-gold);
	color: var(--swre-property-ink);
}

.swre-property-compare-tray__open:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.swre-property-decision-dialog {
	background: transparent;
	border: 0;
	color: var(--swre-property-ink);
	max-height: calc(100dvh - 2rem);
	max-width: min(1050px, calc(100vw - 2rem));
	padding: 0;
	width: 100%;
}

.swre-property-decision-dialog::backdrop {
	background: rgba(11, 11, 13, 0.72);
}

.swre-property-decision-dialog__surface {
	background: var(--swre-property-surface);
	border: 1px solid var(--swre-property-line);
	max-height: calc(100dvh - 2rem);
	overflow: auto;
}

.swre-property-decision-dialog__header {
	align-items: flex-start;
	background: var(--swre-property-ink);
	color: var(--swre-property-surface);
	display: flex;
	gap: 1rem;
	justify-content: space-between;
	padding: 1.25rem;
	position: sticky;
	top: 0;
	z-index: 2;
}

.swre-property-decision-dialog__header h2 {
	color: inherit;
	font-family: var(--swrep-heading-font, Arial, Helvetica, sans-serif);
	font-size: clamp(1.5rem, 3vw, 2.3rem);
	line-height: 1.15;
	margin: 0;
}

.swre-property-decision-dialog__close {
	align-items: center;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.4);
	color: inherit;
	cursor: pointer;
	display: inline-flex;
	font-size: 1.5rem;
	height: 44px;
	justify-content: center;
	padding: 0;
	width: 44px;
}

.swre-property-decision-dialog__body {
	padding: clamp(1rem, 3vw, 2rem);
}

.swre-property-decision-dialog__empty {
	align-items: flex-start;
	display: flex;
	gap: 1rem;
	min-height: 10rem;
	padding: 1rem 0;
}

.swre-property-decision-dialog__empty-mark {
	background: var(--swre-property-gold);
	height: 4px;
	margin-top: 0.65rem;
	width: 42px;
}

.swre-property-decision-dialog__empty p {
	color: var(--swre-property-muted);
	margin: 0;
	max-width: 34rem;
}

.swre-property-shortlist {
	display: grid;
	gap: 0.75rem;
}

.swre-property-shortlist__item {
	align-items: center;
	border: 1px solid var(--swre-property-line);
	display: grid;
	gap: 1rem;
	grid-template-columns: 8rem minmax(0, 1fr) auto;
	padding: 0.75rem;
}

.swre-property-shortlist__image {
	aspect-ratio: 16 / 10;
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.swre-property-shortlist__content {
	display: grid;
	gap: 0.2rem;
	min-width: 0;
}

.swre-property-shortlist__content a {
	color: var(--swre-property-ink);
	font-family: var(--swrep-heading-font, Arial, Helvetica, sans-serif);
	font-size: 1.05rem;
	font-weight: 800;
	text-decoration: none;
}

.swre-property-shortlist__content span {
	color: var(--swre-property-muted);
	font-size: 0.8rem;
}

.swre-property-shortlist__remove {
	background: transparent;
	border: 1px solid var(--swre-property-line);
	cursor: pointer;
	font-size: 0.75rem;
	font-weight: 800;
	min-height: 40px;
	padding: 0.5rem 0.65rem;
}

.swre-property-compare-table-wrap {
	overflow: auto;
	overscroll-behavior-inline: contain;
}

.swre-property-compare-table-hint {
	color: var(--swre-property-muted);
	display: none;
	font-size: 0.78rem;
	margin: 0 0 0.65rem;
}

.swre-property-compare-table {
	border-collapse: collapse;
	min-width: 720px;
	table-layout: fixed;
	width: 100%;
}

.swre-property-compare-table th,
.swre-property-compare-table td {
	border: 1px solid var(--swre-property-line);
	line-height: 1.45;
	padding: 0.85rem;
	text-align: left;
	vertical-align: top;
}

.swre-property-compare-table thead th {
	background: var(--swre-property-ink);
	color: var(--swre-property-surface);
}

.swre-property-compare-table thead th:first-child,
.swre-property-compare-table tbody th {
	width: 9rem;
}

.swre-property-compare-table a {
	color: inherit;
	font-family: var(--swrep-heading-font, Arial, Helvetica, sans-serif);
	font-weight: 800;
}

.swre-property-compare-table tbody th {
	background: var(--swre-property-canvas);
	font-size: 0.8rem;
}

.swre-property-compare-table td {
	color: var(--swre-property-muted);
	font-size: 0.85rem;
}

.swre-property-results-ready :where(.swre-property-decision-tools, .swre-property-compare-tray, .swre-property-decision-dialog) :where(button, a):focus-visible {
	outline: 3px solid var(--swrep-orange, #ee1c00);
	outline-offset: 3px;
}

@media (max-width: 767px) {
	body.swre-property-compare-active .swre-property-archive.site-main {
		padding-bottom: 12rem;
	}

	.swre-property-archive__toolbar-actions {
		align-items: stretch;
		flex-direction: column;
	}

	.swre-property-decision-tools button {
		justify-content: space-between;
		width: 100%;
	}

	.swre-property-compare-tray {
		align-items: stretch;
		bottom: 0;
		flex-direction: column;
		gap: 0.65rem;
		max-width: none;
		padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0));
		width: 100%;
	}

	.swre-property-compare-tray__actions {
		display: grid;
		grid-template-columns: 0.7fr 1.3fr;
	}

	.swre-property-decision-dialog {
		margin: 0;
		max-height: 100dvh;
		max-width: none;
		width: 100%;
	}

	.swre-property-decision-dialog__surface {
		max-height: 100dvh;
		min-height: 100dvh;
	}

	.swre-property-compare-table-hint {
		display: block;
	}

	.swre-property-shortlist__item {
		grid-template-columns: 5rem minmax(0, 1fr);
	}

	.swre-property-shortlist__remove {
		grid-column: 1 / -1;
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.swre-property-compare-tray,
	.swre-property-decision-dialog {
		scroll-behavior: auto;
	}
}
