/*
 * WpDevArt: Estimated Delivery Date for WooCommerce
 * Storefront styles. Everything is scoped to the plugin's own classes and
 * uses the theme's font, so nothing leaks into the theme.
 */

.wpdevart-edd,
.wpdevart-edd-order-line {
	--wpdevart-edd-text: inherit;
	--wpdevart-edd-bg: #f3f3f3;
	--wpdevart-edd-accent: #3f3f3f;
	--wpdevart-edd-radius: 6px;
}

/* Inside a product link (product lists of many themes) the text would take
   the link color: use a neutral text color there. :where() keeps this
   weaker than the merchant's own colors. */
:where(a) .wpdevart-edd {
	--wpdevart-edd-text: #3f3f3f;
}

.wpdevart-edd {
	display: flex;
	/* The icon sits on the middle of the first line of text, however tall
	   that line is (countdown circles or cards make it taller). */
	align-items: baseline;
	gap: 0.6em;
	margin: 0.9em 0;
	color: var(--wpdevart-edd-text);
	font-size: 0.95em;
	line-height: 1.45;
	box-sizing: border-box;
}

.wpdevart-edd[hidden] {
	display: none !important;
}

/* With the storefront script on its way, a line keeps its place but stays
   invisible until it shows the live text (no placeholder flash). */
.wpdevart-edd-js .wpdevart-edd:not(.is-ready) {
	visibility: hidden;
}

.wpdevart-edd__icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	width: 1.5em;
	height: 1.5em;
	color: var(--wpdevart-edd-accent);
}

/* An empty text box in the middle of the icon gives the icon a text
   baseline there: lined up with the first line's baseline, the icon's
   middle meets the middle of that line's text. */
.wpdevart-edd:not(.wpdevart-edd--loop) > .wpdevart-edd__icon::before {
	content: "\200b";
	flex: 0 0 0;
	width: 0;
	overflow: hidden;
}

.wpdevart-edd__icon svg {
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
}

.wpdevart-edd__body {
	display: flex;
	flex-direction: column;
	gap: 0.15em;
	min-width: 0;
}

.wpdevart-edd__text strong,
.wpdevart-edd__text b {
	font-weight: 600;
}

.wpdevart-edd__note {
	font-size: 0.88em;
	opacity: 0.8;
}

.wpdevart-edd__note[hidden] {
	display: none;
}

.wpdevart-edd__preview {
	font-size: 0.78em;
	opacity: 0.7;
	font-style: italic;
}

/* Styles */

.wpdevart-edd--style-box {
	padding: 0.7em 0.9em;
	background: var(--wpdevart-edd-bg);
	border-radius: var(--wpdevart-edd-radius);
}

.wpdevart-edd--style-badge {
	display: inline-flex;
	padding: 0.35em 0.8em;
	border: 1px solid var(--wpdevart-edd-accent);
	border-radius: 999px;
	font-size: 0.88em;
}

.wpdevart-edd--style-badge .wpdevart-edd__icon {
	width: 1.3em;
	height: 1.3em;
}

/* Product lists: one short line. */

/* A block line that follows the list's own text alignment (themes center
   product cards or not). */
.wpdevart-edd--loop,
.wpdevart-edd--loop.wpdevart-edd--style-badge {
	display: block;
	margin: 0.35em 0 0.5em;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
	font-size: 0.9em;
}

.wpdevart-edd--loop .wpdevart-edd__icon {
	display: inline-block;
	vertical-align: -0.32em;
	width: 1.4em;
	height: 1.4em;
	margin: 0 0.35em 0 0;
}

.wpdevart-edd--loop .wpdevart-edd__body {
	display: inline;
}

/* Countdown */

.wpdevart-edd__countdown {
	font-weight: 600;
	color: var(--wpdevart-edd-accent);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.wpdevart-edd__countdown--badge {
	display: inline-block;
	padding: 0 0.45em;
	border-radius: 4px;
	background: var(--wpdevart-edd-accent);
	color: #fff;
}

.wpdevart-edd__countdown--boxes {
	display: inline-flex;
	gap: 0.25em;
	vertical-align: middle;
}

.wpdevart-edd__unit {
	display: inline-flex;
	align-items: baseline;
	gap: 0.1em;
	padding: 0.05em 0.35em;
	border-radius: 4px;
	background: var(--wpdevart-edd-accent);
	color: #fff;
	line-height: 1.35;
}

.wpdevart-edd__unit b {
	font-weight: 700;
}

.wpdevart-edd__unit small {
	font-size: 0.75em;
	opacity: 0.9;
}

/* Cart and checkout: the whole-order line. */

.wpdevart-edd-order-line .wpdevart-edd-order-line__text {
	display: block;
}

.wpdevart-edd-order-line .wpdevart-edd__countdown {
	color: inherit;
}

.wpdevart-edd-shipping-date {
	display: block;
	font-size: 0.85em;
	opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
	.wpdevart-edd,
	.wpdevart-edd * {
		transition: none !important;
		animation: none !important;
	}
}
