/**
 * Address widget styles.
 *
 * Neutral by design: the widget inherits the theme's type and sits inside the
 * existing Elementor drawer, so it should read as part of the shop, not as a
 * bolted-on plugin. Only the accent colour is opinionated, and it is a token.
 */

/**
 * Theme reset for our buttons (see mmr-wolt-modal.css for the why): the
 * theme's generic button rule ties with a single class, so ours are doubled.
 */
.mmr-wolt__submit.mmr-wolt__submit,
.mmr-wolt__tab.mmr-wolt__tab,
.mmr-wolt__store.mmr-wolt__store,
.mmr-wolt__link.mmr-wolt__link {
	min-height: 0;
	height: auto;
	vertical-align: baseline;
	text-decoration: none;
	text-shadow: none;
	font-style: normal;
	font-family: inherit;
	outline: none;
	gap: 0;
	justify-content: flex-start;
	transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.mmr-wolt {
	--mmr-wolt-accent: #ee7b10;
	--mmr-wolt-ink: #1a1a1a;
	--mmr-wolt-muted: #6b6b6b;
	--mmr-wolt-line: #dcdcdc;
	--mmr-wolt-bg: #ffffff;
	--mmr-wolt-ok: #1e7a3c;
	--mmr-wolt-err: #b3261e;
	--mmr-wolt-radius: 8px;

	color: var(--mmr-wolt-ink);
	font-size: 15px;
	line-height: 1.45;
	text-align: left;
}

.mmr-wolt *,
.mmr-wolt *::before,
.mmr-wolt *::after {
	box-sizing: border-box;
}

/**
 * Theme reset.
 *
 * The shop's own product layout ships `label { margin-bottom: -20px !important }`
 * as page CSS, which drags any label up underneath the field that follows it.
 * An !important declaration can only be answered by another one, so these few
 * properties use it. Everything is scoped inside .mmr-wolt, so the rest of the
 * page keeps whatever the theme and the client's CSS decided.
 */
.mmr-wolt .mmr-wolt__field-label,
.mmr-wolt .mmr-wolt__label {
	position: static;
	margin: 0 0 6px !important;
	padding: 0;
	transform: none;
	float: none;
	width: auto;
	line-height: 1.35;
	letter-spacing: normal;
	text-transform: none;
	pointer-events: auto;
}

.mmr-wolt .mmr-wolt__label {
	margin: 0 !important;
}

.mmr-wolt .mmr-wolt__input {
	margin: 0;
	float: none;
}

.mmr-wolt .mmr-wolt__submit.mmr-wolt__submit,
.mmr-wolt .mmr-wolt__tab.mmr-wolt__tab,
.mmr-wolt .mmr-wolt__store.mmr-wolt__store,
.mmr-wolt .mmr-wolt__link.mmr-wolt__link {
	text-transform: none;
	letter-spacing: normal;
	line-height: normal;
	box-shadow: none;
}

/**
 * The widget sets `hidden` on rows it has nothing to put in. A class further
 * down gives those rows `display: flex`, and an author-origin display always
 * beats the user-agent `[hidden] { display: none }`, so without this rule an
 * empty "Παράδοση στη διεύθυνση" line stays on screen for pickup customers.
 */
.mmr-wolt [hidden],
.mmr-wolt-status[hidden] {
	display: none !important;
}

/* Resolved state ---------------------------------------------------------- */

.mmr-wolt__resolved {
	background: var(--mmr-wolt-bg);
	border: 1px solid var(--mmr-wolt-line);
	border-radius: var(--mmr-wolt-radius);
	padding: 14px 16px;
}

.mmr-wolt__resolved-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 4px 0;
}

.mmr-wolt__label {
	color: var(--mmr-wolt-muted);
	font-size: 13px;
	flex: 0 0 auto;
}

.mmr-wolt__address,
.mmr-wolt__branch,
.mmr-wolt__fee {
	text-align: right;
	font-weight: 600;
	word-break: break-word;
}

.mmr-wolt__hint {
	margin: 8px 0 0;
	font-size: 13px;
	color: var(--mmr-wolt-accent);
}

.mmr-wolt__link.mmr-wolt__link {
	appearance: none;
	background: none;
	border: 0;
	padding: 8px 0 0;
	margin: 0;
	color: var(--mmr-wolt-accent);
	font-size: 13px;
	text-decoration: underline;
	cursor: pointer;
}

.mmr-wolt__link.mmr-wolt__link:hover,
.mmr-wolt__link.mmr-wolt__link:focus-visible {
	color: var(--mmr-wolt-ink);
}

/* Tabs -------------------------------------------------------------------- */

.mmr-wolt__tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 14px;
	border-bottom: 1px solid var(--mmr-wolt-line);
}

.mmr-wolt__tab.mmr-wolt__tab {
	appearance: none;
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
	padding: 8px 10px;
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--mmr-wolt-muted);
	cursor: pointer;
}

.mmr-wolt__tab.mmr-wolt__tab.is-active {
	color: var(--mmr-wolt-ink);
	border-bottom-color: var(--mmr-wolt-accent);
}

.mmr-wolt__pane {
	display: none;
}

.mmr-wolt__pane.is-active {
	display: block;
}

/* Input ------------------------------------------------------------------- */

.mmr-wolt__field-label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	color: var(--mmr-wolt-muted);
}

.mmr-wolt__input-wrap {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.mmr-wolt__input {
	flex: 1 1 200px;
	min-width: 0;
	height: 44px;
	padding: 0 12px;
	border: 1px solid var(--mmr-wolt-line);
	border-radius: var(--mmr-wolt-radius);
	font-size: 15px;
	background: var(--mmr-wolt-bg);
	color: var(--mmr-wolt-ink);
}

.mmr-wolt__input:focus-visible {
	outline: 2px solid var(--mmr-wolt-accent);
	outline-offset: 1px;
}

.mmr-wolt__submit.mmr-wolt__submit {
	flex: 0 0 auto;
	height: 44px;
	padding: 0 18px;
	border: 0;
	border-radius: var(--mmr-wolt-radius);
	background: var(--mmr-wolt-accent);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}

.mmr-wolt__submit.mmr-wolt__submit:hover,
.mmr-wolt__submit.mmr-wolt__submit:focus-visible {
	filter: brightness(0.94);
}

/* Messages ---------------------------------------------------------------- */

.mmr-wolt__message {
	margin: 10px 0 0;
	font-size: 13px;
	min-height: 1em;
}

.mmr-wolt__message.is-error {
	color: var(--mmr-wolt-err);
}

.mmr-wolt__message.is-warn {
	color: var(--mmr-wolt-accent);
}

.mmr-wolt__message.is-info {
	color: var(--mmr-wolt-muted);
}

/* Stores ------------------------------------------------------------------ */

.mmr-wolt__stores {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.mmr-wolt__store.mmr-wolt__store {
	display: block;
	width: 100%;
	text-align: left;
	background: var(--mmr-wolt-bg);
	border: 1px solid var(--mmr-wolt-line);
	border-radius: var(--mmr-wolt-radius);
	padding: 10px 12px;
	cursor: pointer;
}

.mmr-wolt__store.mmr-wolt__store:hover:not([disabled]),
.mmr-wolt__store.mmr-wolt__store:focus-visible:not([disabled]) {
	border-color: var(--mmr-wolt-accent);
}

.mmr-wolt__store.mmr-wolt__store[disabled] {
	opacity: 0.55;
	cursor: not-allowed;
}

.mmr-wolt__store-name {
	display: block;
	font-weight: 700;
	font-size: 14px;
}

.mmr-wolt__store-address {
	display: block;
	font-size: 12px;
	color: var(--mmr-wolt-muted);
}

.mmr-wolt__store-closed {
	display: inline-block;
	margin-top: 4px;
	font-size: 11px;
	color: var(--mmr-wolt-err);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* Alternatives ------------------------------------------------------------ */

.mmr-wolt__alternatives {
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px dashed var(--mmr-wolt-line);
}

.mmr-wolt__alt-title {
	margin: 0 0 6px;
	font-size: 12px;
	color: var(--mmr-wolt-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.mmr-wolt__alternatives ul {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 13px;
	display: grid;
	gap: 4px;
}

/* Status line ------------------------------------------------------------- */

.mmr-wolt-status {
	font-size: 15px;
}

.mmr-wolt-status__label {
	color: var(--mmr-wolt-muted, #6b6b6b);
}

.mmr-wolt-status.is-empty {
	color: #6b6b6b;
	font-size: 14px;
}

/* Google's autocomplete dropdown must clear the Elementor drawer. */
.pac-container {
	z-index: 100000 !important;
}

/* The drawer is narrow, so stack the input and the button there. */
@media (max-width: 420px) {
	.mmr-wolt__input-wrap {
		flex-direction: column;
	}

	/* In a column the flex basis is the HEIGHT: 200px of input, once. */
	.mmr-wolt__input {
		flex: 0 0 auto;
		width: 100%;
	}

	.mmr-wolt__submit.mmr-wolt__submit {
		width: 100%;
	}
}

/**
 * Google paints its own "something is wrong with your key" pattern onto any
 * input it has attached an Autocomplete to (class `gm-err-autocomplete`), which
 * turns our field into a wall of warning icons. We already tell the customer
 * what to do in plain Greek, so hide Google's version.
 */
.mmr-wolt .mmr-wolt__input.gm-err-autocomplete {
	background-image: none !important;
	background-color: var(--mmr-wolt-bg) !important;
}

/* The "no address, no shopping" line at the top of the panel. */
.mmr-wolt__gate {
	margin: 0 0 12px;
	padding: 10px 12px;
	border-left: 3px solid var(--mmr-wolt-accent);
	background: #fff7f0;
	font-size: 14px;
	line-height: 1.4;
}

/* Per-branch availability line on the product page (replaces [mmr_stock_msg]). */
.mmr-wolt-stock {
	font-size: 15px;
	line-height: 1.4;
}

.mmr-wolt-stock.is-ok {
	color: var(--mmr-wolt-ok, #1e7a3c);
}

.mmr-wolt-stock.is-no {
	color: var(--mmr-wolt-err, #b3261e);
}

.mmr-wolt-stock.is-no small {
	color: var(--mmr-wolt-muted, #6b6b6b);
	font-size: 13px;
}

.mmr-wolt-stock.is-empty {
	color: var(--mmr-wolt-muted, #6b6b6b);
	font-size: 14px;
}

/* Server-side typeahead (when the browser autocomplete is not available). */
.mmr-wolt__suggestions {
	list-style: none;
	margin: 4px 0 0;
	padding: 4px 0;
	border: 1px solid var(--mmr-wolt-line);
	border-radius: var(--mmr-wolt-radius);
	background: var(--mmr-wolt-bg);
	max-height: 260px;
	overflow-y: auto;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.mmr-wolt__suggestion {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	padding: 9px 12px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1.3;
}

.mmr-wolt__suggestion.is-active,
.mmr-wolt__suggestion:hover {
	background: #fff3e8;
}

.mmr-wolt__suggestion-main {
	font-weight: 600;
	color: var(--mmr-wolt-ink);
}

.mmr-wolt__suggestion-secondary {
	font-size: 12px;
	color: var(--mmr-wolt-muted);
}

/* Address as separate fields: street + number, postcode + area, details. */
.mmr-wolt__fields {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px 10px;
}

.mmr-wolt__field {
	min-width: 0;
}

.mmr-wolt__field--street {
	grid-column: span 2;
	position: relative;
}

/* The street suggestions float over the fields below instead of pushing
   the grid around. */
.mmr-wolt__field--street .mmr-wolt__suggestions {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 6;
	margin: 4px 0 0;
}

.mmr-wolt__field--city {
	grid-column: span 2;
}

.mmr-wolt__field--details {
	grid-column: 1 / -1;
}

.mmr-wolt__field .mmr-wolt__input {
	width: 100%;
}

.mmr-wolt__submit.mmr-wolt__submit--block {
	width: 100%;
	margin-top: 14px;
}

.mmr-wolt-result__details-line {
	margin: 2px 0 0;
	font-size: 13.5px;
	color: #6b7080;
}

.mmr-wolt-result__details-line[hidden] {
	display: none;
}

/* A fresh page on its way (another store, delivery switched to pickup or
   back): the page under it is out of date and says so at once, over all of
   it, until the next one arrives. On staging that took seconds with the old
   page on screen and nothing to say why (18/11). */
.mmr-wolt-reloading {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	background: rgba(255, 255, 255, 0.74);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	font-family: var(--wd-text-font, inherit);
	cursor: progress;
}

.mmr-wolt-reloading__box {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	max-width: 100%;
	padding: 14px 20px 14px 16px;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 1px 0 rgba(19, 35, 106, 0.06), 0 24px 60px -24px rgba(19, 35, 106, 0.45);
	color: var(--wd-alternative-color, rgb(19, 35, 106));
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	text-align: left;
}

.mmr-wolt-reloading__spinner {
	flex: 0 0 auto;
	box-sizing: border-box;
	width: 22px;
	height: 22px;
	border: 2.5px solid rgba(238, 123, 16, 0.22);
	border-top-color: var(--wd-primary-color, rgb(238, 123, 16));
	border-radius: 50%;
	animation: mmr-wolt-reloading-spin 0.8s linear infinite;
}

@keyframes mmr-wolt-reloading-spin {
	to {
		transform: rotate(360deg);
	}
}

/* No fade in: once the browser starts on the next page, WebKit stops
   moving it, and the notice stayed a faint ghost (WebKit, 18/11). It is
   there whole from the first frame. A loading sign keeps turning, slower
   for reduced motion. */
@media (prefers-reduced-motion: reduce) {
	.mmr-wolt-reloading__spinner {
		animation-duration: 2.4s;
	}
}
