/* efan's delivery date popup (cart & checkout) and the checkout's
   "Delivery Date & Time" box. Calendar colours come from the shared
   flatpickr theme in efans-blocks.css. */

html.efans-dm-open {
	overflow: hidden;
}

.efans-dm {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-family: var(--efans-font-body);
}
.efans-dm[hidden] {
	display: none;
}
.efans-dm__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(45, 26, 14, 0.45);
}
.efans-dm__panel {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 560px;
	max-height: 100%;
	overflow-y: auto;
	padding: 32px 32px 28px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
	color: #333;
	/* title, "Check Delivery" box, date field, button — spaced like form.cart */
	display: flex;
	flex-direction: column;
	gap: 20px;
}
.efans-dm .efans-dm__close,
.efans-dm .efans-dm__close:hover,
.efans-dm .efans-dm__close:focus,
.efans-dm .efans-dm__close:active {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 36px;
	height: 36px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
	outline: none;
	color: #9f8a54 !important;
	font-size: 28px;
	line-height: 36px;
	cursor: pointer;
}
.efans-dm .efans-dm__close:hover {
	color: #8a7647 !important;
}

/* The "Check Delivery" box and the date field reuse the product page's
   classes (pincode-check.css, efans-blocks.css). */
.efans-dm__title {
	margin: 0;
	padding-right: 32px;
	font-family: var(--efans-font-head);
	font-size: 28px;
	font-weight: 400;
	line-height: 1.2;
	color: #9f8a54;
}
.efans-dm .efans-product-extra__title {
	margin: 0 0 8px;
	font-family: var(--efans-font-body);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.4;
	color: #000;
}
/* The calendar opens in place under the date field (flatpickr's static
   mode), pushing the button down, instead of floating past the popup */
.efans-dm .efans-datepicker-wrap {
	display: block;
}
.efans-dm .flatpickr-wrapper {
	display: block;
	width: 100%;
}
.efans-dm .efans-datepicker-chevron {
	top: 15px;
}
.efans-dm .flatpickr-calendar.static {
	position: relative;
	top: 0;
	margin-top: 2px;
	box-shadow: none;
}
.efans-dm .flatpickr-calendar.static:not(.open) {
	display: none;
}
.efans-dm .flatpickr-calendar.static::before,
.efans-dm .flatpickr-calendar.static::after {
	display: none;
}

/* Waiting for the PIN code */
.efans-dm .efans-datepicker-input:disabled {
	background: #faf8f5;
	cursor: not-allowed;
}
.efans-dm .efans-datepicker-input:disabled + .efans-datepicker-chevron {
	opacity: 0.4;
	cursor: not-allowed;
}

.efans-dm__msg {
	margin: -8px 0 0;
	font-size: 13px;
	line-height: 1.5;
	color: #555;
}
.efans-dm__msg:empty {
	display: none;
}
.efans-dm__msg.is-error {
	color: #b3261e;
}

/* Same as the cart's Proceed to Checkout; every state pinned so the theme's
   button hover / focus colours never show through */
.efans-dm .efans-dm__confirm,
.efans-dm .efans-dm__confirm:hover,
.efans-dm .efans-dm__confirm:focus,
.efans-dm .efans-dm__confirm:active {
	display: block;
	width: 100%;
	max-width: 500px;
	min-height: 0;
	margin: 0;
	padding: 15px 20px;
	border: 0 !important;
	border-radius: 0;
	background: #9f8a54 !important;
	box-shadow: none !important;
	outline: none;
	color: #fff !important;
	font-family: var(--efans-font-body);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	cursor: pointer;
}
.efans-dm .efans-dm__confirm:hover {
	background: #8a7647 !important;
}
.efans-dm .efans-dm__confirm:focus-visible {
	outline: 2px solid #9f8a54;
	outline-offset: 2px;
}
.efans-dm .efans-dm__confirm:disabled {
	opacity: 0.6;
	cursor: wait;
}

@media (max-width: 600px) {
	.efans-dm__panel {
		padding: 28px 16px 20px;
	}
	.efans-dm__title {
		font-size: 24px;
	}
}

/* Checkout: the chosen date & time, first section of the form column. The
   heading uses the checkout's own step title classes; the field matches the
   checkout inputs, and Change matches "Add coupons". */
.efans-dm-summary {
	margin: 0 0 32px;
	font-family: var(--efans-font-body);
}
.efans-dm-summary .wc-block-components-checkout-step__heading {
	margin: 0 0 16px;
}
.efans-dm-summary__field {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 62px;
	box-sizing: border-box;
	padding: 10px 16px 10px 12px;
	border: 1px solid #e0d8cf;
	background: #fff;
}
.efans-dm-summary.is-missing .efans-dm-summary__field {
	border-color: #9f8a54;
}
.efans-dm-summary__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.efans-dm-summary__label {
	font-size: 13px;
	line-height: 1.4;
	color: #444;
}
.efans-dm-summary__value {
	font-size: 16px;
	line-height: 1.4;
	color: #111;
}
.efans-dm-summary.is-missing .efans-dm-summary__value {
	color: #9f8a54;
}
.efans-dm-summary .efans-dm-summary__change,
.efans-dm-summary .efans-dm-summary__change:hover,
.efans-dm-summary .efans-dm-summary__change:focus,
.efans-dm-summary .efans-dm-summary__change:active {
	flex-shrink: 0;
	min-height: 0;
	margin: 0;
	padding: 4px 0;
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
	outline: none;
	color: #9f8a54 !important;
	font-family: var(--efans-font-body);
	font-size: 15px;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
.efans-dm-summary .efans-dm-summary__change:hover {
	color: #8a7647 !important;
}
.efans-dm-summary .efans-dm-summary__change:focus-visible {
	outline: 2px solid #9f8a54;
	outline-offset: 2px;
}
