/**
 * Everstory date/time dropdown pickers (shared panel).
 *
 * @package Everstory
 */

:root {
	--evst-datetime-picker-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Shared popup shell */
.evst-datetime-picker {
	position: fixed;
	z-index: 100001;
	display: none;
	background: var(--tblr-bg-surface, #fff);
	border: 1px solid var(--tblr-border-color, #e5e7eb);
	border-radius: var(--tblr-border-radius-lg, 0.5rem);
	box-shadow: var(--tblr-shadow-lg, 0 4px 16px rgba(0, 0, 0, 0.12));
	font-family: var(--evst-datetime-picker-font-family);
	font-size: 0.875rem;
	padding: 0.5rem;
}

.evst-datetime-picker.is-open {
	display: block;
}

.evst-datetime-picker__option {
	border: 0;
	background: transparent;
	color: var(--tblr-body-color, #1f2937);
	border-radius: var(--tblr-border-radius, 4px);
	cursor: pointer;
	font-family: var(--evst-datetime-picker-font-family);
	font-size: inherit;
	font-weight: inherit;
	line-height: 1.25;
}

.evst-datetime-picker__option:hover:not(:disabled) {
	background: rgba(var(--tblr-primary-rgb, 6, 111, 209), 0.08);
	color: var(--tblr-primary, #066fd1);
}

.evst-datetime-picker__option.is-selected {
	background: var(--tblr-primary, #066fd1);
	color: var(--tblr-primary-fg, #fff);
	font-weight: 600;
}

input[data-litepicker],
input[data-evst-date-picker],
input[data-evst-time-picker],
input[data-evst-time-mask] {
	cursor: pointer;
}

/* —— Time picker —— */
.evst-time-picker {
	width: 13rem;
	min-width: 13rem;
	max-width: min(13rem, calc(100vw - 1rem));
	box-sizing: border-box;
}

.evst-time-picker__columns {
	display: flex;
	gap: 0.5rem;
}

.evst-time-picker__column {
	flex: 1 1 0;
	min-width: 0;
	max-width: 5.5rem;
}

.evst-time-picker__label {
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--tblr-secondary, #6b7280);
	text-align: center;
	padding: 0.25rem 0.5rem 0.35rem;
}

.evst-time-picker__scroll {
	max-height: 220px;
	overflow-y: auto;
	border-radius: var(--tblr-border-radius, 4px);
	border: 1px solid var(--tblr-border-color-translucent, rgba(0, 0, 0, 0.08));
}

.evst-time-picker .evst-datetime-picker__option {
	display: block;
	width: 100%;
	padding: 0.4rem 0.5rem;
	text-align: center;
}

/* —— Date picker —— */
.evst-date-picker {
	width: 17.5rem;
	min-width: 17.5rem;
	max-width: min(17.5rem, calc(100vw - 1rem));
	box-sizing: border-box;
}

.evst-date-picker__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.35rem;
	margin-bottom: 0.5rem;
}

.evst-date-picker__title {
	flex: 1;
	text-align: center;
	font-weight: 600;
	color: var(--tblr-body-color, #1f2937);
	font-size: 0.9rem;
}

.evst-datetime-picker .evst-date-picker__nav {
	flex: 0 0 auto;
	width: 2rem;
	height: 2rem;
	padding: 0;
	display: inline-flex;

	justify-content: center;
	font-size: 1.25rem;

	color: var(--tblr-secondary, #6b7280);
	border: 0 !important;
	border-radius: 5px;
	background: transparent !important;
	box-shadow: none !important;
	outline: 0;
	appearance: none;
	-webkit-appearance: none;
}

.evst-datetime-picker .evst-date-picker__nav:hover {
	color: var(--tblr-primary, #066fd1);
	background: rgba(var(--tblr-primary-rgb, 6, 111, 209), 0.08) !important;
}

.evst-datetime-picker .evst-date-picker__nav:focus-visible {
	box-shadow: 0 0 0 0.25rem rgba(var(--tblr-primary-rgb, 6, 111, 209), 0.25) !important;
}

.evst-date-picker__weekdays {
	display: grid;
	grid-template-columns: repeat(7, 2rem);
	gap: 2px;
	margin-bottom: 0.35rem;
	justify-content: center;
}

.evst-date-picker__weekday {
	text-align: center;
	font-size: 0.65rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--tblr-secondary, #6b7280);
	padding: 0.2rem 0;
}

.evst-date-picker__grid {
	display: grid;
	grid-template-columns: repeat(7, 2rem);
	gap: 2px;
	justify-content: center;
}

.evst-date-picker__day {
	width: 2rem;
	height: 2rem;
	min-height: 2rem;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.8125rem;
	flex-shrink: 0;
}

.evst-date-picker__day.is-today:not(.is-selected) {
	color: var(--tblr-primary, #066fd1);
	font-weight: 600;
	box-shadow: inset 0 0 0 1px rgba(var(--tblr-primary-rgb, 6, 111, 209), 0.35);
}

.evst-date-picker__day.is-outside {
	opacity: 0.35;
	cursor: default;
}

.evst-date-picker__footer {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	margin-top: 0.5rem;
	padding-top: 0.5rem;
	border-top: 1px solid var(--tblr-border-color-translucent, rgba(0, 0, 0, 0.08));
}

.evst-date-picker__action {
	border: 0;
	background: transparent;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
	padding: 0.25rem 0.5rem;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--tblr-primary, #066fd1);
	border-radius: var(--tblr-border-radius, 4px);
	cursor: pointer;
}

.evst-date-picker__action:focus {
	outline: 0;
}

.evst-date-picker__action:focus-visible {
	box-shadow: 0 0 0 0.25rem rgba(var(--tblr-primary-rgb, 6, 111, 209), 0.25);
}

.evst-date-picker__action:hover {
	background: rgba(var(--tblr-primary-rgb, 6, 111, 209), 0.08);
}

.evst-date-picker__action[data-evst-date-action="clear"] {
	color: var(--tblr-secondary, #6b7280);
}

.evst-date-picker__action[data-evst-date-action="clear"]:hover {
	color: var(--tblr-danger, #d63939);
}

/* Modal / scrollable panels: keep picker above dialog content */
.evst-datetime-picker.is-open {
	z-index: 100001;
}

/* Gift registry confirmation modal uses an extreme overlay z-index. */
body.evst-grw-modal-open .evst-datetime-picker.is-open {
	z-index: calc(var(--evst-grw-modal-z-index, 2147483000) + 1);
}

/* Invitation/theme typography must not bleed into portal pickers. */
.evst-datetime-picker,
.evst-datetime-picker .evst-date-picker__title,
.evst-datetime-picker .evst-date-picker__weekday,
.evst-datetime-picker .evst-time-picker__label,
.evst-datetime-picker button {
	font-family: var(--evst-datetime-picker-font-family) !important;
}

body.evst-dashboard .evst-vendor-due-date-wrap,
body.evst-dashboard .evst-vendor-paid-at-wrap {
	max-width: 14rem;
}
