.pd-directory {
	width: 100%;
	--pd-primary: var(--wp--preset--color--primary, #2271b1);
	--pd-text: var(--wp--preset--color--contrast, #1d2327);
	--pd-muted: var(--wp--preset--color--secondary, #646970);
	--pd-border: #e5e7eb;
	--pd-input-border: #d1d5db;
	--pd-card-bg: var(--wp--preset--color--base, #fff);
	--pd-light-bg: #f3f4f6;
	--pd-radius: 12px;
}

/* Search */
.pd-search {
	margin-bottom: 28px;
}

.pd-search-input {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 18px;
	border: 1px solid var(--pd-input-border);
	border-radius: 999px;
	font-size: 14px;
	color: var(--pd-text);
	background: var(--pd-card-bg);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pd-search-input:focus {
	border-color: var(--pd-primary);
	outline: none;
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--pd-primary) 15%, transparent);
}

/* Results grid */
.pd-results {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}

/* Card */
.pd-card {
	display: flex;
	flex-direction: column;
	background: var(--pd-card-bg);
	border: 1px solid var(--pd-border);
	border-radius: var(--pd-radius);
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pd-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.09);
}

.pd-image-wrap {
	aspect-ratio: 4 / 3;
	background: var(--pd-light-bg);
	overflow: hidden;
}

.pd-photo,
.pd-no-photo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
}

.pd-no-photo {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--pd-muted);
	font-size: 12px;
}

.pd-content {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 16px;
	min-width: 0;
}

.pd-header {
	margin-bottom: 10px;
}

.pd-name {
	margin: 0 !important;
	font-size: 15px;
	line-height: 1.3;
	font-weight: 600;
	color: var(--pd-text);
}

.pd-clinic-name {
	margin-top: 3px;
	font-size: 12px;
	line-height: 1.4;
	font-weight: 500;
	color: var(--pd-primary);
}

/* Details: inline  Address | Email | Phone */
.pd-directory .pd-details {
	display: flex;
	flex-wrap: wrap;
	margin: auto 0 0;
	padding: 8px 0 0;
	list-style: none;
	border-top: 1px solid var(--pd-border);
	font-size: 10.5px;
	line-height: 1.5;
	color: var(--pd-muted);
}

.pd-directory .pd-detail,
.pd-directory .pd-detail a {
	font-size: 10.5px;
	line-height: 1.5;
}

.pd-directory .pd-detail {
	margin: 0;
	padding: 0;
	min-width: 0;
	overflow-wrap: anywhere;
}

.pd-directory .pd-detail:not(:last-child)::after {
	content: "|";
	margin: 0 5px;
	color: #c3c4c7;
}

.pd-directory .pd-detail a {
	color: var(--pd-text);
	text-decoration: none;
}

.pd-directory .pd-detail a:hover {
	color: var(--pd-primary);
	text-decoration: underline;
}

/* Tablet */
@media (max-width: 1024px) {
	.pd-results {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Mobile */
@media (max-width: 600px) {
	.pd-results {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.pd-image-wrap {
		aspect-ratio: 16 / 10;
	}
}

/* AJAX loading */
.pd-results-wrapper {
	position: relative;
	min-height: 100px;
}

.pd-loading-overlay {
	position: absolute;
	inset: 0;
	z-index: 10;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	padding-top: 40px;
	background: rgba(255, 255, 255, 0.75);
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

.pd-loading-overlay.active {
	visibility: visible;
	opacity: 1;
}

.pd-spinner {
	width: 34px;
	height: 34px;
	border: 4px solid #e5e7eb;
	border-top-color: var(--pd-primary);
	border-radius: 50%;
	animation: pd-spin 0.8s linear infinite;
}

@keyframes pd-spin {
	to {
		transform: rotate(360deg);
	}
}

.pd-loading-text {
	margin-top: 10px;
	font-size: 13px;
	color: var(--pd-muted);
}

.pd-directory.pd-is-loading .pd-card {
	opacity: 0.5;
}

/* Load more */
.pd-load-wrapper {
	text-align: center;
	margin-top: 28px;
}

.pd-load-wrapper .pd-load-more {
	display: inline-block;
	padding: 10px 22px;
	background-color: var(--pd-primary);
	color: #fff;
	border: none;
	border-radius: 999px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	transition: background-color 0.2s ease, opacity 0.2s ease;
}

.pd-load-wrapper .pd-load-more:hover {
	background-color: color-mix(in srgb, var(--pd-primary) 85%, #000);
}

.pd-load-wrapper .pd-load-more:focus-visible {
	outline: 2px solid var(--pd-primary);
	outline-offset: 3px;
}

.pd-load-wrapper .pd-load-more:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}