/* ─── Root ─── */
.dtp-wrap {
	position: relative;
}

/* ─── Input Container ─── */
.dtp-input-container {
	position: relative;
	display: flex;
	align-items: center;
	border: 1.5px solid #e2e5ea;
	border-radius: 8px;
	background: #fff;
	transition: border-color 180ms ease, box-shadow 180ms ease;
	overflow: hidden;
}

.dtp-input-container:hover {
	border-color: #c5cad3;
}

.dtp-input-container--focused {
	border-color: #f96332;
	box-shadow: 0 0 0 3px rgba(249, 99, 50, 0.1);
}

.dtp-input-container--disabled {
	background: #f6f7f9;
	opacity: 0.6;
	pointer-events: none;
}

.dtp-input-field {
	flex: 1;
	font-size: 14px;
	color: #1a1d23;
	border: none;
	outline: none;
	background: transparent;
	padding: 8px 12px;
	min-width: 0;
	cursor: pointer;
}

.dtp-input-field:focus {
	cursor: text;
}

.dtp-input-field::placeholder {
	color: #9ca3af;
}

.dtp-icon-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	border: none;
	background: transparent;
	color: #6b7280;
	cursor: pointer;
	transition: color 180ms ease;
}

.dtp-icon-btn:hover {
	color: #f96332;
}

.dtp-icon-btn svg {
	width: 18px;
	height: 18px;
}

.dtp-clear-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	margin-right: 4px;
	border-radius: 50%;
	border: none;
	background: transparent;
	color: #9ca3af;
	cursor: pointer;
	transition: all 180ms ease;
	flex-shrink: 0;
}

.dtp-clear-btn:hover {
	background: #fee2e2;
	color: #e03131;
}

.dtp-clear-btn svg {
	width: 14px;
	height: 14px;
}

/* ─── Dropdown ─── */
.dtp-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 1050;
	margin-top: 4px;
	background: #fff;
	border: 1px solid #e2e5ea;
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
	user-select: none;
	display: flex;
	flex-direction: column;
}

.dtp-dropdown--inline {
	position: relative;
	top: auto;
	left: auto;
	margin-top: 0;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.dtp-dropdown--up {
	top: auto;
	bottom: 100%;
	margin-top: 0;
	margin-bottom: 4px;
}

/* ─── Body (calendar left, time right) ─── */
.dtp-body {
	display: flex;
	padding: 14px;
}

.dtp-calendar-section {
	flex: 1;
	min-width: 0;
	width: 270px;
}

/* ─── Calendar Header ─── */
.dtp-cal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.dtp-cal-title {
	font-size: 15px;
	font-weight: 600;
	color: #1a1d23;
	cursor: pointer;
	padding: 4px 10px;
	border-radius: 6px;
	border: none;
	background: none;
	transition: background 180ms ease;
}

.dtp-cal-title:hover {
	background: #f6f7f9;
}

.dtp-cal-title--static {
	cursor: default;
}

.dtp-cal-title--static:hover {
	background: none;
}

.dtp-cal-nav {
	display: flex;
	gap: 2px;
}

.dtp-cal-nav-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 6px;
	border: none;
	background: transparent;
	color: #6b7280;
	cursor: pointer;
	transition: all 180ms ease;
}

.dtp-cal-nav-btn:hover {
	background: #f6f7f9;
	color: #1a1d23;
}

.dtp-cal-nav-btn svg {
	width: 16px;
	height: 16px;
}

/* ─── Weekday Headers ─── */
.dtp-cal-weekdays {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	margin-bottom: 4px;
}

.dtp-cal-weekday {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #9ca3af;
	text-align: center;
	padding: 4px 0;
}

/* ─── Day Grid ─── */
.dtp-cal-days {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
}

.dtp-cal-day {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1;
	border-radius: 50%;
	border: none;
	background: transparent;
	font-size: 13px;
	font-weight: 400;
	color: #1a1d23;
	cursor: pointer;
	transition: all 180ms ease;
	position: relative;
}

.dtp-cal-day:hover:not(.dtp-cal-day--disabled):not(.dtp-cal-day--selected) {
	background: #f6f7f9;
}

.dtp-cal-day--other {
	color: #9ca3af;
	opacity: 0.4;
}

.dtp-cal-day--today:not(.dtp-cal-day--selected) {
	font-weight: 600;
	color: #f96332;
}

.dtp-cal-day--today:not(.dtp-cal-day--selected)::after {
	content: '';
	position: absolute;
	bottom: 3px;
	left: 50%;
	transform: translateX(-50%);
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: #f96332;
}

.dtp-cal-day--selected {
	background: #f96332 !important;
	color: white !important;
	font-weight: 600;
}

.dtp-cal-day--disabled {
	opacity: 0.25;
	cursor: not-allowed;
}

/* ─── Hidden Dropdown Selects (month/year) ─── */
.dtp-cal-selectors {
	display: flex;
	align-items: center;
	gap: 2px;
}

.dtp-select-wrapper {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.dtp-select-display {
	font-size: 15px;
	font-weight: 600;
	color: #1a1d23;
	cursor: pointer;
	padding: 4px 6px;
	border-radius: 6px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	transition: background 180ms ease;
}

.dtp-select-display:hover {
	background: #f6f7f9;
}

.dtp-select-arrow {
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
	display: inline-block;
	opacity: 0.4;
}

.dtp-select-native {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 100%;
	opacity: 0.001;
	cursor: pointer;
	border: none;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
}

/* ─── Month/Year Grid ─── */
.dtp-grid-view {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
	padding: 4px 0;
}

.dtp-grid-cell {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px 8px;
	border-radius: 6px;
	border: none;
	background: transparent;
	font-size: 13px;
	font-weight: 400;
	color: #1a1d23;
	cursor: pointer;
	transition: all 180ms ease;
}

.dtp-grid-cell:hover {
	background: #f6f7f9;
}

.dtp-grid-cell--selected {
	background: #f96332 !important;
	color: white !important;
	font-weight: 600;
}

.dtp-grid-cell--current {
	font-weight: 600;
	color: #f96332;
}

/* ─── Time Panel (desktop — right side) ─── */
.dtp-time-panel {
	display: flex;
	flex-direction: column;
	border-left: 1px solid #e2e5ea;
	margin-left: 14px;
	padding-left: 14px;
	min-width: 100px;
}

.dtp-time-panel-header {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #9ca3af;
	text-align: center;
	margin-bottom: 6px;
}

.dtp-time-columns {
	display: flex;
	gap: 4px;
	align-items: flex-start;
	flex: 1;
	min-height: 0;
}

.dtp-time-scroll {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.dtp-time-column-header {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	color: #b0b5bd;
	text-align: center;
	padding-bottom: 4px;
}

.dtp-time-scroll-list {
	height: 210px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #d1d5db transparent;
}

.dtp-time-scroll-list::-webkit-scrollbar {
	width: 4px;
}

.dtp-time-scroll-list::-webkit-scrollbar-track {
	background: transparent;
}

.dtp-time-scroll-list::-webkit-scrollbar-thumb {
	background: #d1d5db;
	border-radius: 2px;
}

.dtp-time-scroll-item {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 30px;
	font-size: 14px;
	cursor: pointer;
	border-radius: 6px;
	color: #6b7280;
	border: none;
	background: transparent;
	width: 100%;
	transition: all 120ms ease;
}

.dtp-time-scroll-item:hover:not(.dtp-time-scroll-item--selected) {
	background: #f0f1f3;
	color: #1a1d23;
}

.dtp-time-scroll-item--selected {
	background: #f96332 !important;
	color: white !important;
	font-weight: 600;
}

.dtp-time-colon {
	font-size: 16px;
	font-weight: 700;
	color: #b0b5bd;
	align-self: center;
	padding-top: 18px;
	line-height: 1;
}

/* ─── Time Mobile (range sliders — below calendar) ─── */
.dtp-time-mobile {
	display: none;
	flex-direction: column;
	gap: 6px;
	padding-top: 10px;
	border-top: 1px solid #e2e5ea;
	margin-top: 10px;
}

.dtp-time-mobile-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.dtp-time-mobile-label {
	font-size: 12px;
	font-weight: 500;
	color: #6b7280;
	width: 28px;
	flex-shrink: 0;
}

.dtp-time-mobile-slider {
	flex: 1;
	accent-color: #f96332;
	height: 20px;
}

.dtp-time-mobile-value {
	font-size: 14px;
	font-weight: 600;
	color: #1a1d23;
	width: 28px;
	text-align: center;
	flex-shrink: 0;
}

/* ─── Footer ─── */
.dtp-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-top: 1px solid #e2e5ea;
	padding: 10px 14px;
}

.dtp-footer-btn {
	font-size: 13px;
	font-weight: 500;
	padding: 5px 12px;
	border-radius: 6px;
	border: none;
	cursor: pointer;
	transition: all 180ms ease;
}

.dtp-footer-btn--ghost {
	background: transparent;
	color: #6b7280;
}

.dtp-footer-btn--ghost:hover {
	background: #f6f7f9;
	color: #1a1d23;
}

.dtp-footer-right {
	display: flex;
	align-items: center;
	gap: 8px;
}

.dtp-footer-btn--clear {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: #e03131;
}

.dtp-footer-btn--clear:hover {
	background: #fee2e2;
	color: #e03131;
}

.dtp-footer-clear-icon {
	display: inline-flex;
	width: 14px;
	height: 14px;
}

.dtp-footer-clear-icon svg {
	width: 14px;
	height: 14px;
}

/* ─── Mobile Modal ─── */
.dtp-modal-body {
	padding: 0 !important;
}

.dtp-modal-body .dtp-body {
	padding: 14px;
}

.dtp-modal-body .dtp-footer {
	border-top: 1px solid #e2e5ea;
	padding: 10px 14px;
}

.dtp-modal-body .dtp-calendar-section {
	width: auto;
}

/* Drag handle has position:absolute + padding-bottom:55px that blocks clicks on
   the modal header X button and the calendar dropdowns beneath it.
   Let clicks pass through the padding area while keeping the bar itself grabbable. */
.modal-bottom-sheet:has(.dtp-modal-body) .drag-handle {
	pointer-events: none;
}

.modal-bottom-sheet:has(.dtp-modal-body) .drag-handle .handle-bar {
	pointer-events: auto;
}

/* ─── Mobile Responsive ─── */
@media (max-width: 768px) {
	.dtp-time-panel {
		display: none !important;
	}

	.dtp-time-mobile {
		display: flex !important;
	}

	.dtp-calendar-section {
		width: auto;
	}

	.dtp-dropdown {
		min-width: 280px;
		max-width: calc(100vw - 16px);
		overflow-x: hidden;
	}

	/* Override parent overflow:hidden that clips the dropdown */
	.frm-flex-container.frm-flex-mobilefw:has(.dtp-wrap) {
		overflow: visible;
	}
}
