/* =============================================================================
   Phone header and menu — Linen and Party Wear worlds
   -----------------------------------------------------------------------------
   Phones only (640px and below). Desktop and tablet keep their existing header.

   Header: one slim row — menu icon, wordmark, search and bag — instead of the
   wordmark sitting on its own line above the controls. The wishlist moves into
   the menu, where it has room for a label.

   Menu: left-aligned rows divided by hairlines, a search field at the top,
   Collections opening in place with a plus/minus, then a switch between the
   three Ecoleas worlds, wishlist and social links.

   Selectors start at `body.ec-overlay-nav .ec-header` (set in
   ecoleas_overlay_nav_body_class()) so they outrank the per-world 860px rules
   in linen.css and partywear.css without !important.
   ============================================================================= */

/* The extra menu rows and the icon exist in the markup at every width; they
   are only shown by the phone layer below. */
.ec-nav__extras,
.ec-navtoggle__icon { display: none; }

@media (max-width: 640px) {

	/* --- Header row ------------------------------------------------------ */

	body.ec-overlay-nav .ec-header .ec-header__inner {
		grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
		grid-template-rows: auto;
		align-items: center;
		gap: 0 8px;
		min-height: 60px;
		padding-block: 6px;
	}

	body.ec-overlay-nav .ec-header .ec-navtoggle {
		grid-column: 1;
		grid-row: 1;
		justify-self: start;
		justify-content: center;
		width: 44px;
		min-width: 44px;
		height: 44px;
		margin-left: -10px;
		padding: 0;
	}

	body.ec-overlay-nav .ec-header .ec-brand {
		grid-column: 2;
		grid-row: 1;
		justify-self: center;
		margin: 0;
	}

	body.ec-overlay-nav .ec-header .ec-brand__mark { width: 128px; }

	body.ec-overlay-nav .ec-header .ec-actions {
		grid-column: 3;
		grid-row: 1;
		justify-self: end;
		gap: 0;
		margin-right: -10px;
	}

	body.ec-overlay-nav .ec-header .ec-actions [data-store-trigger="wishlist"] { display: none; }

	/* Three-line menu icon; the word stays for screen readers. */
	body.ec-overlay-nav .ec-header .ec-navtoggle__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	body.ec-overlay-nav .ec-header .ec-navtoggle__icon {
		position: relative;
		display: block;
		width: 22px;
		height: 1.5px;
		background: currentColor;
	}

	body.ec-overlay-nav .ec-header .ec-navtoggle__icon::before,
	body.ec-overlay-nav .ec-header .ec-navtoggle__icon::after {
		content: '';
		position: absolute;
		left: 0;
		width: 22px;
		height: 1.5px;
		background: currentColor;
	}

	body.ec-overlay-nav .ec-header .ec-navtoggle__icon::before { top: -7px; }
	body.ec-overlay-nav .ec-header .ec-navtoggle__icon::after { top: 7px; width: 14px; }

	/* --- Menu ------------------------------------------------------------ */

	body.ec-overlay-nav .ec-header .ec-nav[data-nav] {
		justify-content: flex-start;
		padding: 76px 20px 32px;
		color: #34342e;
		text-align: left;
	}

	body.ec-overlay-nav .ec-header .ec-nav[data-nav] > .ec-nav__item {
		border-bottom: 1px solid rgba(52, 52, 46, .14);
	}

	body.ec-overlay-nav .ec-header .ec-nav[data-nav] .ec-nav__link {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		min-height: 58px;
		padding: 0;
		color: #34342e;
		font-size: 16px;
		letter-spacing: .18em;
		line-height: 1.3;
		text-align: left;
		opacity: 1;
	}

	/* The current page is marked with a short rule under its label rather than
	   the centred underline, which also fixes Party Wear's cream-on-cream Home. */
	body.ec-overlay-nav .ec-header .ec-nav[data-nav] .ec-nav__link::after { display: none; }

	body.ec-overlay-nav .ec-header .ec-nav[data-nav] a.ec-nav__link[aria-current="page"] {
		text-decoration: underline;
		text-decoration-thickness: 1px;
		text-underline-offset: 7px;
	}

	/* Collections: a plus that becomes a minus while its categories are open. */
	body.ec-overlay-nav .ec-header .ec-nav[data-nav] button.ec-nav__link::after {
		content: '';
		position: static;
		display: block;
		flex: 0 0 auto;
		width: 12px;
		height: 12px;
		margin: 0;
		border: 0;
		background:
			linear-gradient(currentColor, currentColor) center / 12px 1.5px no-repeat,
			linear-gradient(currentColor, currentColor) center / 1.5px 12px no-repeat;
		transform: none;
	}

	body.ec-overlay-nav .ec-header .ec-nav[data-nav] button.ec-nav__link[aria-expanded="true"]::after {
		background: linear-gradient(currentColor, currentColor) center / 12px 1.5px no-repeat;
	}

	body.ec-overlay-nav .ec-header .ec-nav[data-nav] .ec-mega {
		gap: 18px;
		padding: 2px 0 20px 2px;
		border: 0;
		border-radius: 0;
		background: none;
		box-shadow: none;
		text-align: left;
	}

	body.ec-overlay-nav .ec-header .ec-nav[data-nav] .ec-mega__col {
		gap: 0;
		text-align: left;
	}

	body.ec-overlay-nav .ec-header .ec-nav[data-nav] :is(.ec-mega__title, .ec-mega__link) {
		justify-content: flex-start;
		min-height: 40px;
		color: #34342e;
		text-align: left;
	}

	body.ec-overlay-nav .ec-header .ec-nav[data-nav] .ec-mega__title {
		min-height: 32px;
		color: #7a746a;
		font-size: 12px;
		letter-spacing: .16em;
		text-transform: uppercase;
	}

	body.ec-overlay-nav .ec-header .ec-nav[data-nav] .ec-mega__link {
		font-size: 15px;
		letter-spacing: .02em;
		text-transform: none;
	}

	/* --- Menu extras ----------------------------------------------------- */

	body.ec-overlay-nav .ec-header .ec-nav[data-nav] > .ec-nav__extras {
		display: block;
		list-style: none;
		text-align: left;
	}

	/* Search sits above the links. */
	body.ec-overlay-nav .ec-header .ec-nav[data-nav] > .ec-nav__extras--search {
		order: -1;
		margin-bottom: 10px;
	}

	body.ec-overlay-nav .ec-header .ec-nav .ec-nav__search {
		display: flex;
		align-items: center;
		gap: 10px;
		min-height: 46px;
		padding: 0 14px;
		border: 1px solid rgba(52, 52, 46, .24);
		border-radius: 4px;
		color: #7a746a;
		font-size: 14px;
		letter-spacing: .02em;
		text-decoration: none;
	}

	body.ec-overlay-nav .ec-header .ec-nav .ec-nav__extras-title {
		margin: 30px 0 12px;
		color: #7a746a;
		font-size: 12px;
		letter-spacing: .16em;
		text-transform: uppercase;
	}

	body.ec-overlay-nav .ec-header .ec-nav .ec-nav__worlds {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 10px;
		margin: 0;
		padding: 0;
		list-style: none;
	}

	body.ec-overlay-nav .ec-header .ec-nav .ec-nav__world {
		display: flex;
		flex-direction: column;
		gap: 8px;
		color: #34342e;
		font-size: 12px;
		letter-spacing: .04em;
		line-height: 1.3;
		text-decoration: none;
	}

	body.ec-overlay-nav .ec-header .ec-nav .ec-nav__world img {
		display: block;
		width: 100%;
		aspect-ratio: 3 / 4;
		object-fit: cover;
		border-radius: 6px;
		background: #ece6da;
	}

	body.ec-overlay-nav .ec-header .ec-nav .ec-nav__world.is-current img {
		outline: 1px solid #34342e;
		outline-offset: 2px;
	}

	body.ec-overlay-nav .ec-header .ec-nav .ec-nav__extras-foot {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		margin-top: 28px;
		padding-top: 18px;
		border-top: 1px solid rgba(52, 52, 46, .14);
	}

	body.ec-overlay-nav .ec-header .ec-nav .ec-nav__wishlist {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		min-height: 44px;
		color: #34342e;
		font-size: 14px;
		text-decoration: none;
	}

	/* Social icons reuse the footer markup; the heading is dropped here. */
	body.ec-overlay-nav .ec-header .ec-nav .ec-footer__socialrow { gap: 0; }
	body.ec-overlay-nav .ec-header .ec-nav .ec-footer__socialrow .ec-footer__title { display: none; }

	body.ec-overlay-nav .ec-header .ec-nav .ec-footer__socialicons {
		flex-wrap: nowrap;
		gap: 4px;
	}

	body.ec-overlay-nav .ec-header .ec-nav .ec-social-link {
		width: 40px;
		height: 44px;
		margin: 0;
		color: #34342e;
	}
}

/* Small phones (320–360px): a narrower wordmark and 40px icon targets keep
   the logo clear of the search icon. */
@media (max-width: 360px) {
	body.ec-overlay-nav .ec-header .ec-brand__mark { width: 104px; }

	body.ec-overlay-nav .ec-header .ec-actions .ec-action {
		width: 40px;
		min-width: 40px;
	}
}
