/* ==========================================================================
   دليل الصيدليات - الضفة الغربية | تصميم الواجهة الأمامية
   ========================================================================== */

.pdwb-directory,
.pdwb-submit-form,
.pdwb-single {
	--pdwb-primary: #0f9d68;
	--pdwb-primary-dark: #0b7a51;
	--pdwb-primary-light: #16b87a;
	--pdwb-accent: #25d366;
	--pdwb-danger: #e0433f;
	--pdwb-text: #16241f;
	--pdwb-muted: #6b7a77;
	--pdwb-bg: #f4faf7;
	--pdwb-border: #e1ece7;
	--pdwb-radius: 16px;
	--pdwb-shadow: 0 4px 16px rgba(15, 157, 104, 0.08), 0 1px 3px rgba(15, 157, 104, 0.08);

	direction: rtl;
	text-align: right;
	color: var(--pdwb-text);
	font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
	font-size: 16px;
	line-height: 1.7;
	box-sizing: border-box;
}

.pdwb-directory *,
.pdwb-submit-form *,
.pdwb-single * {
	box-sizing: border-box;
}

/* --------------------------------- الهيدر -------------------------------- */

.pdwb-hero {
	background: linear-gradient(150deg, var(--pdwb-primary) 0%, var(--pdwb-primary-dark) 100%);
	border-radius: var(--pdwb-radius);
	padding: 42px 24px 56px;
	text-align: center;
	color: #fff;
	position: relative;
	overflow: hidden;
}

.pdwb-hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image: radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.12) 0, transparent 40%),
		radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.1) 0, transparent 45%);
	pointer-events: none;
}

.pdwb-hero-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	font-size: 32px;
	background: rgba(255, 255, 255, 0.16);
	border-radius: 50%;
	margin-bottom: 14px;
}

.pdwb-hero-title {
	margin: 0 0 8px;
	font-size: clamp(24px, 4vw, 34px);
	font-weight: 800;
	position: relative;
}

.pdwb-hero-subtitle {
	margin: 0 auto;
	max-width: 480px;
	font-size: 15px;
	color: rgba(255, 255, 255, 0.88);
	position: relative;
}

.pdwb-hero-stats {
	display: flex;
	justify-content: center;
	gap: 36px;
	margin-top: 26px;
	position: relative;
	flex-wrap: wrap;
}

.pdwb-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
}

.pdwb-stat strong {
	font-size: 24px;
	font-weight: 800;
}

.pdwb-stat span {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.85);
}

/* ---------------------------- شريط الأدوات ---------------------------- */

.pdwb-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: #fff;
	border: 1px solid var(--pdwb-border);
	border-radius: var(--pdwb-radius);
	padding: 14px 16px;
	margin: -32px 12px 24px;
	position: relative;
	z-index: 1;
	box-shadow: 0 12px 28px rgba(15, 157, 104, 0.14);
}

.pdwb-directory > .pdwb-toolbar:first-child {
	margin-top: 0;
}

.pdwb-toolbar-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	flex: 1;
}

.pdwb-search,
.pdwb-governorate-filter {
	padding: 11px 16px;
	border: 1px solid var(--pdwb-border);
	border-radius: 999px;
	background: var(--pdwb-bg);
	font-family: inherit;
	font-size: 14px;
	color: var(--pdwb-text);
	min-width: 180px;
}

.pdwb-governorate-filter {
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7a77' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 16px center;
	padding-left: 34px;
}

.pdwb-search {
	flex: 1;
	min-width: 220px;
}

.pdwb-search:focus,
.pdwb-governorate-filter:focus {
	outline: 2px solid var(--pdwb-primary);
	outline-offset: 1px;
}

.pdwb-duty-toggle {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	white-space: nowrap;
	color: var(--pdwb-primary-dark);
	font-weight: 600;
}

.pdwb-duty-toggle input {
	accent-color: var(--pdwb-primary);
	width: 16px;
	height: 16px;
}

.pdwb-view-toggle {
	display: flex;
	background: var(--pdwb-bg);
	border-radius: 999px;
	padding: 4px;
	gap: 4px;
}

.pdwb-view-btn {
	border: 0;
	background: transparent;
	padding: 8px 18px;
	border-radius: 999px;
	cursor: pointer;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	color: var(--pdwb-muted);
	transition: background 0.2s, color 0.2s;
}

.pdwb-view-btn.is-active {
	background: var(--pdwb-primary);
	color: #fff;
}

/* ------------------------------- الشبكة -------------------------------- */

.pdwb-results {
	padding: 0 12px;
}

.pdwb-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 20px;
}

.pdwb-card {
	background: #fff;
	border: 1px solid var(--pdwb-border);
	border-radius: var(--pdwb-radius);
	overflow: hidden;
	box-shadow: var(--pdwb-shadow);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	display: flex;
	flex-direction: column;
}

.pdwb-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 14px 28px rgba(15, 157, 104, 0.16);
}

.pdwb-card-media {
	position: relative;
	height: 110px;
	background: linear-gradient(135deg, var(--pdwb-bg), #e7f5ee);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.pdwb-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pdwb-card-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 8px rgba(15, 157, 104, 0.15);
	font-size: 24px;
}

.pdwb-badge {
	position: absolute;
	top: 10px;
	inset-inline-start: 10px;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	color: #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.pdwb-badge-duty {
	background: var(--pdwb-danger);
}

.pdwb-badge-24h {
	background: var(--pdwb-primary);
}

.pdwb-card-body {
	padding: 16px 18px 18px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1;
}

.pdwb-card-title {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
}

.pdwb-card-title a {
	color: var(--pdwb-text);
	text-decoration: none;
}

.pdwb-card-title a:hover {
	color: var(--pdwb-primary);
}

.pdwb-card-meta {
	margin: 0;
	font-size: 13px;
	color: var(--pdwb-muted);
}

.pdwb-card-hours {
	margin: 0;
	font-size: 13px;
	color: var(--pdwb-muted);
}

.pdwb-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.pdwb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 9px 16px;
	border-radius: 999px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	border: 1px solid transparent;
	cursor: pointer;
	transition: opacity 0.15s, transform 0.15s;
}

.pdwb-btn:hover {
	opacity: 0.9;
	transform: translateY(-1px);
}

.pdwb-btn-call {
	background: var(--pdwb-primary);
	color: #fff;
}

.pdwb-btn-whatsapp {
	background: var(--pdwb-accent);
	color: #fff;
}

.pdwb-btn-details {
	background: transparent;
	color: var(--pdwb-primary-dark);
	border-color: var(--pdwb-border);
}

.pdwb-btn-submit {
	background: var(--pdwb-primary);
	color: #fff;
	padding: 13px 30px;
	font-size: 15px;
}

/* ------------------------------- الحالات ------------------------------- */

.pdwb-loading,
.pdwb-empty {
	text-align: center;
	color: var(--pdwb-muted);
	padding: 30px 0;
}

/* -------------------------------- الخريطة ------------------------------- */

.pdwb-map,
.pdwb-directory .pdwb-map {
	height: 420px;
	border-radius: var(--pdwb-radius);
	overflow: hidden;
	border: 1px solid var(--pdwb-border);
}

.pdwb-map-view {
	padding: 0 12px;
}

#pdwb-submit-map {
	height: 320px;
}

/* ----------------------------- نموذج التقديم ---------------------------- */

.pdwb-submit-form {
	background: #fff;
	border: 1px solid var(--pdwb-border);
	border-radius: var(--pdwb-radius);
	padding: 28px;
	box-shadow: var(--pdwb-shadow);
	max-width: 780px;
}

.pdwb-form-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 16px;
	margin-bottom: 18px;
}

.pdwb-form-field-full {
	grid-column: 1 / -1;
}

.pdwb-form-field label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	margin-bottom: 6px;
	color: var(--pdwb-text);
}

.pdwb-form-field input[type='text'],
.pdwb-form-field input[type='tel'],
.pdwb-form-field input[type='email'],
.pdwb-form-field input[type='datetime-local'],
.pdwb-form-field input[type='file'],
.pdwb-form-field select {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--pdwb-border);
	border-radius: 10px;
	background: var(--pdwb-bg);
	font-family: inherit;
	font-size: 14px;
	color: var(--pdwb-text);
}

.pdwb-form-field input:focus,
.pdwb-form-field select:focus {
	outline: 2px solid var(--pdwb-primary);
	outline-offset: 1px;
}

.pdwb-form-field-inline {
	display: flex;
	align-items: center;
}

.pdwb-form-field-inline label {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 6px;
	font-weight: 500;
}

.pdwb-form-note {
	font-size: 12px;
	color: var(--pdwb-muted);
	margin-top: 10px;
}

.pdwb-honeypot {
	position: absolute;
	left: -9999px;
	top: -9999px;
}

.pdwb-notice {
	padding: 14px 18px;
	border-radius: 10px;
	margin-bottom: 16px;
	font-size: 14px;
}

.pdwb-notice-success {
	background: #e7f8ee;
	color: var(--pdwb-primary-dark);
	border: 1px solid #bfe9d1;
}

.pdwb-notice-error {
	background: #fdeceb;
	color: var(--pdwb-danger);
	border: 1px solid #f6c6c3;
}

/* --------------------------- صفحة الصيدلية المفردة ----------------------- */

.pdwb-single-header {
	display: flex;
	gap: 18px;
	align-items: center;
	margin-bottom: 22px;
	background: #fff;
	border: 1px solid var(--pdwb-border);
	border-radius: var(--pdwb-radius);
	padding: 20px;
	box-shadow: var(--pdwb-shadow);
}

.pdwb-single-media {
	width: 96px;
	height: 96px;
	border-radius: var(--pdwb-radius);
	overflow: hidden;
	background: var(--pdwb-bg);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.pdwb-single-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pdwb-single-heading h1 {
	margin: 0 0 4px;
	font-size: 26px;
	font-weight: 800;
}

.pdwb-single-location {
	margin: 0 0 8px;
	color: var(--pdwb-muted);
}

.pdwb-single-badges {
	display: flex;
	gap: 8px;
}

.pdwb-single-badges .pdwb-badge {
	position: static;
}

.pdwb-single-body {
	display: grid;
	grid-template-columns: 1fr 1.2fr;
	gap: 24px;
	align-items: start;
}

.pdwb-single-info {
	background: #fff;
	border: 1px solid var(--pdwb-border);
	border-radius: var(--pdwb-radius);
	padding: 20px;
	box-shadow: var(--pdwb-shadow);
}

.pdwb-info-list {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	font-size: 15px;
}

.pdwb-info-list a {
	color: var(--pdwb-text);
	text-decoration: none;
}

.pdwb-back-link {
	margin-top: 24px;
}

.pdwb-back-link a {
	color: var(--pdwb-primary-dark);
	text-decoration: none;
	font-weight: 700;
}

/* --------------------------------- تجاوب --------------------------------- */

@media (max-width: 720px) {
	.pdwb-hero {
		padding: 32px 18px 46px;
	}

	.pdwb-toolbar {
		flex-direction: column;
		align-items: stretch;
		margin: -26px 8px 20px;
	}

	.pdwb-results,
	.pdwb-map-view {
		padding: 0 8px;
	}

	.pdwb-single-body {
		grid-template-columns: 1fr;
	}

	.pdwb-single-header {
		flex-direction: column;
		text-align: center;
	}
}
