/** Hayat Jalali (Shamsi) date picker. */

.hayat-jdp[hidden] {
	display: none !important;
}

.hayat-jdp {
	--hayat-jdp-green: #47b369;
	--hayat-jdp-green-soft: #ecf8f0;
	--hayat-jdp-text: #2b2b2b;
	--hayat-jdp-muted: #9a9a9a;
	--hayat-jdp-line: #ececec;
	position: fixed;
	inset: 0;
	z-index: 100000;
	pointer-events: none;
	font-family: peyda, 'Vazirmatn', tahoma, sans-serif;
	direction: rtl;
}

.hayat-jdp__backdrop {
	display: none;
}

.hayat-jdp__panel {
	position: fixed;
	width: 300px;
	padding: 14px;
	background: #fff;
	border: 1px solid var(--hayat-jdp-line);
	border-radius: 16px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
	color: var(--hayat-jdp-text);
	pointer-events: auto;
	box-sizing: border-box;
}

.hayat-jdp__panel *,
.hayat-jdp__panel *::before,
.hayat-jdp__panel *::after {
	box-sizing: border-box;
	font-family: inherit;
}

.hayat-jdp__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 10px;
}

.hayat-jdp__title {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 1 1 auto;
	justify-content: center;
}

.hayat-jdp__select {
	appearance: none;
	-webkit-appearance: none;
	height: 34px;
	min-width: 0;
	margin: 0;
	padding: 0 10px;
	border: 1px solid var(--hayat-jdp-line);
	border-radius: 10px;
	background: #fafafa;
	color: var(--hayat-jdp-text);
	font-size: 14px;
	font-weight: 700;
	text-align: center;
	text-align-last: center;
	cursor: pointer;
}

.hayat-jdp__select:focus {
	outline: none;
	border-color: var(--hayat-jdp-green);
}

.hayat-jdp__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--hayat-jdp-line);
	border-radius: 10px;
	background: #fff;
	color: var(--hayat-jdp-text);
	cursor: pointer;
	flex-shrink: 0;
}

.hayat-jdp__nav svg {
	width: 18px;
	height: 18px;
}

.hayat-jdp__nav:hover:not(:disabled) {
	border-color: var(--hayat-jdp-green);
	color: var(--hayat-jdp-green);
}

.hayat-jdp__nav:disabled {
	opacity: 0.35;
	cursor: default;
}

.hayat-jdp__week,
.hayat-jdp__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
}

.hayat-jdp__week {
	margin-bottom: 4px;
}

.hayat-jdp__week span {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 28px;
	color: var(--hayat-jdp-muted);
	font-size: 12px;
	font-weight: 700;
}

.hayat-jdp__week span:last-child {
	color: #e04848;
}

.hayat-jdp__day {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--hayat-jdp-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.12s ease, color 0.12s ease;
}

.hayat-jdp__day--empty {
	cursor: default;
}

.hayat-jdp__day.is-friday {
	color: #e04848;
}

.hayat-jdp__day:hover:not(:disabled):not(.is-selected) {
	background: var(--hayat-jdp-green-soft);
}

.hayat-jdp__day.is-today {
	box-shadow: inset 0 0 0 1px var(--hayat-jdp-green);
	color: var(--hayat-jdp-green);
}

.hayat-jdp__day.is-selected {
	background: var(--hayat-jdp-green);
	color: #fff;
	box-shadow: none;
}

.hayat-jdp__day:disabled {
	color: #d0d0d0;
	cursor: not-allowed;
}

.hayat-jdp__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid var(--hayat-jdp-line);
}

.hayat-jdp__link {
	margin: 0;
	padding: 6px 10px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--hayat-jdp-green);
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
}

.hayat-jdp__link:hover:not(:disabled) {
	background: var(--hayat-jdp-green-soft);
}

.hayat-jdp__link--muted {
	color: var(--hayat-jdp-muted);
}

.hayat-jdp__link:disabled {
	opacity: 0.4;
	cursor: default;
}

/* Mobile: bottom sheet */
.hayat-jdp.is-sheet {
	pointer-events: auto;
}

.hayat-jdp.is-sheet .hayat-jdp__backdrop {
	display: block;
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
}

.hayat-jdp.is-sheet .hayat-jdp__panel {
	top: auto !important;
	right: 0;
	bottom: 0;
	left: 0 !important;
	width: 100%;
	padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px));
	border: 0;
	border-radius: 20px 20px 0 0;
	animation: hayat-jdp-up 0.2s ease-out;
}

.hayat-jdp.is-sheet .hayat-jdp__day {
	font-size: 15px;
}

html.hayat-jdp-lock,
html.hayat-jdp-lock body {
	overflow: hidden;
}

@keyframes hayat-jdp-up {
	from {
		transform: translateY(24px);
		opacity: 0.6;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}
