/* =========================================================
   Angela Luna Site Polish: mobile menu (phones and tablets, up to 980px)
   Replaces Divi's "Select Page" dropdown with a slim header bar and a
   slide-in panel. Fonts and colours follow the site: Josefin Sans,
   IvyPresto, Lato, logo teal and the burnt-orange buttons.
   ========================================================= */

.alp-mm-btn,
.alp-mm,
.alp-mm-scrim { display: none; }

@media (max-width: 980px) {

	:root {
		--alp-teal: #148C94;
		--alp-teal-soft: rgba(24, 160, 168, .10);
		--alp-ink: #494949;
		--alp-rust: #C7622B;
		--alp-paper: #F9F9F9;
		--alp-line: rgba(73, 73, 73, .12);
		--alp-bar: 68px;
		--alp-ease: cubic-bezier(.22, .8, .24, 1);
	}

	/* ---------- Header bar: logo left, cart + menu button right ---------- */
	html body #main-header {
		position: fixed !important;
		top: 0;
		left: 0;
		right: 0;
		height: var(--alp-bar);
		padding: 0 !important;
		background: var(--alp-paper) !important;
		box-shadow: 0 1px 0 var(--alp-line);
		transition: box-shadow .25s ease;
		z-index: 99990;
	}
	html body.admin-bar #main-header { top: 46px; }
	html.alp-scrolled body #main-header { box-shadow: 0 6px 24px rgba(0, 0, 0, .07); }

	html body #main-header .et_menu_container {
		width: 90% !important;
		height: 100%;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
	html body #main-header .logo_container {
		position: static !important;
		width: auto !important;
		height: 100% !important;
		display: flex;
		align-items: center;
		text-align: left !important;
	}
	html body #main-header .logo_helper { display: none; }
	html body #main-header .logo_container { flex: none; }
	html body #main-header #logo,
	html body #main-header #logo img {
		max-width: none !important;
		max-height: 44px !important;
		width: auto !important;
		height: 44px !important;
		margin: 0 !important;
		display: block;
	}
	html body #main-header #et-top-navigation {
		float: none !important;
		flex: 1;
		padding: 0 !important;
		display: flex;
		align-items: center;
		justify-content: flex-end;
		gap: 4px;
	}
	/* Divi's dropdown hides only once the new menu is built, so no script = old menu still works */
	html.alp-mm-ready body #main-header #et_mobile_nav_menu,
	html body #main-header #top-menu-nav { display: none !important; }

	html body #main-header .et-cart-info {
		display: flex !important;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin: 0 !important;
		color: var(--alp-ink) !important;
		font-size: 20px;
	}
	html body #main-header .et-cart-info span::before { margin: 0 !important; }

	/* page content starts below the bar (Divi's own offset is replaced) */
	html body #page-container {
		padding-top: var(--alp-bar) !important;
		margin-top: 0 !important;
	}

	/* ---------- Menu button: three lines that become an X ---------- */
	.alp-mm-btn {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		gap: 6px;
		width: 44px;
		height: 44px;
		margin-right: -10px;
		padding: 0;
		border: 0;
		background: none;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
		touch-action: manipulation;
	}
	.alp-mm-btn span {
		display: block;
		width: 24px;
		height: 2px;
		border-radius: 2px;
		background: var(--alp-ink);
		transition: transform .28s var(--alp-ease), opacity .2s ease, width .28s var(--alp-ease);
	}
	.alp-mm-btn span:nth-child(2) { width: 16px; align-self: flex-end; margin-right: 10px; }
	html.alp-mm-open .alp-mm-btn span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
	html.alp-mm-open .alp-mm-btn span:nth-child(2) { opacity: 0; width: 0; }
	html.alp-mm-open .alp-mm-btn span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
	.alp-mm-btn:focus-visible,
	.alp-mm :focus-visible {
		outline: 2px solid var(--alp-teal);
		outline-offset: 2px;
		border-radius: 4px;
	}

	/* ---------- Panel ---------- */
	.alp-mm-scrim {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(30, 40, 42, .38);
		opacity: 0;
		visibility: hidden;
		transition: opacity .3s ease, visibility 0s linear .3s;
		z-index: 99991;
	}
	.alp-mm {
		display: flex;
		flex-direction: column;
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		width: min(100%, 420px);
		background: var(--alp-paper);
		box-shadow: -12px 0 40px rgba(0, 0, 0, .12);
		transform: translate3d(100%, 0, 0);
		visibility: hidden;
		transition: transform .34s var(--alp-ease), visibility 0s linear .34s;
		z-index: 99992;
		overscroll-behavior: contain;
		font-family: 'Josefin Sans', Helvetica, Arial, Lucida, sans-serif;
		color: var(--alp-ink);
	}
	html.alp-mm-open .alp-mm-scrim {
		opacity: 1;
		visibility: visible;
		transition: opacity .3s ease;
	}
	html.alp-mm-open .alp-mm {
		transform: translate3d(0, 0, 0);
		visibility: visible;
		transition: transform .34s var(--alp-ease);
	}
	html.alp-mm-open,
	html.alp-mm-open body { overflow: hidden !important; }
	/* the floating language picker would sit on top of the panel's footer */
	html.alp-mm-open .gtranslate_wrapper { visibility: hidden !important; }
	html body.admin-bar .alp-mm { top: 46px; }

	.alp-mm-head {
		flex: none;
		display: flex;
		align-items: center;
		justify-content: space-between;
		height: var(--alp-bar);
		padding: 0 5% 0 24px;
		border-bottom: 1px solid var(--alp-line);
	}
	.alp-mm-head img { height: 40px; width: auto; display: block; }
	.alp-mm-close {
		position: relative;
		width: 44px;
		height: 44px;
		margin-right: -10px;
		border: 0;
		background: none;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
	}
	.alp-mm-close::before,
	.alp-mm-close::after {
		content: '';
		position: absolute;
		top: 21px;
		left: 10px;
		width: 24px;
		height: 2px;
		border-radius: 2px;
		background: var(--alp-ink);
		transform: rotate(45deg);
	}
	.alp-mm-close::after { transform: rotate(-45deg); }

	.alp-mm-body {
		flex: 1;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		padding: 10px 0 24px;
	}
	.alp-mm-list,
	.alp-mm-sub { list-style: none; margin: 0; padding: 0; }
	/* store pages add a bottom margin to every list item */
	html body .alp-mm li { margin: 0 !important; padding: 0 !important; }

	/* top-level items: staggered in as the panel opens */
	.alp-mm-list > li {
		border-bottom: 1px solid var(--alp-line);
		opacity: 0;
		transform: translate3d(14px, 0, 0);
		transition: opacity .3s ease, transform .4s var(--alp-ease);
		transition-delay: 0s;
	}
	html.alp-mm-open .alp-mm-list > li {
		opacity: 1;
		transform: none;
		transition-delay: calc(60ms + var(--i, 0) * 28ms);
	}

	.alp-mm-row { display: flex; align-items: stretch; }
	.alp-mm-link,
	.alp-mm-toggle {
		display: flex;
		align-items: center;
		min-height: 56px;
		padding: 4px 24px 0;
		font-family: inherit;
		font-size: 15px;
		font-weight: 600;
		letter-spacing: 2.5px;
		text-transform: uppercase;
		line-height: 1.3;
		color: var(--alp-ink) !important;
		text-decoration: none;
		background: none;
		border: 0;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
		transition: color .2s ease, background-color .2s ease;
	}
	.alp-mm-link { flex: 1; }
	.alp-mm-toggle.alp-mm-whole { flex: 1; justify-content: space-between; text-align: left; padding-right: 22px; }
	.alp-mm-whole .alp-mm-chev { margin-right: 0; }
	.alp-mm-toggle.alp-mm-chev-only {
		flex: none;
		width: 58px;
		padding: 0;
		justify-content: center;
		border-left: 1px solid var(--alp-line);
	}
	.alp-mm-link:active,
	.alp-mm-toggle:active { background: var(--alp-teal-soft); }

	.alp-mm-chev {
		width: 10px;
		height: 10px;
		margin: -4px 4px 0 12px;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: rotate(45deg);
		transition: transform .3s var(--alp-ease);
		flex: none;
	}
	.alp-mm-chev-only .alp-mm-chev { margin: -4px 0 0; }
	.alp-mm-item.is-open > .alp-mm-row .alp-mm-chev { transform: translateY(4px) rotate(-135deg); }
	.alp-mm-item.is-open > .alp-mm-row :is(.alp-mm-toggle, .alp-mm-link) { color: var(--alp-teal) !important; }

	/* current page: small teal dot */
	.alp-mm-item.is-current > .alp-mm-row .alp-mm-link,
	.alp-mm-sub a.is-current { color: var(--alp-teal) !important; }
	.alp-mm-item.is-current > .alp-mm-row .alp-mm-link::before,
	.alp-mm-sub a.is-current::before {
		content: '';
		width: 6px;
		height: 6px;
		margin: -3px 10px 0 -16px;
		border-radius: 50%;
		background: var(--alp-teal);
		flex: none;
	}

	/* sub-menus open with a height animation that needs no measuring */
	.alp-mm-drawer {
		display: grid;
		grid-template-rows: 0fr;
		transition: grid-template-rows .32s var(--alp-ease);
	}
	.alp-mm-item.is-open > .alp-mm-drawer { grid-template-rows: 1fr; }
	.alp-mm-drawer > .alp-mm-sub { min-height: 0; overflow: hidden; }
	.alp-mm-sub {
		margin: 0 24px;
		border-left: 2px solid rgba(24, 160, 168, .35);
	}
	.alp-mm-item.is-open .alp-mm-sub { margin-bottom: 14px; }
	.alp-mm-sub a {
		display: flex;
		align-items: center;
		min-height: 46px;
		padding: 2px 0 2px 20px;
		font-family: 'Lato', Helvetica, Arial, Lucida, sans-serif;
		font-size: 17px;
		font-weight: 500;
		letter-spacing: 0;
		text-transform: none;
		color: var(--alp-ink) !important;
		text-decoration: none;
		-webkit-tap-highlight-color: transparent;
		transition: color .2s ease, background-color .2s ease;
	}
	.alp-mm-sub a:active { background: var(--alp-teal-soft); }
	.alp-mm-sub a.is-current::before { margin-left: -24px; margin-right: 12px; }

	/* footer of the panel: booking button + phone */
	.alp-mm-foot {
		flex: none;
		padding: 18px 24px calc(18px + env(safe-area-inset-bottom));
		border-top: 1px solid var(--alp-line);
		background: #FFFFFF;
		text-align: center;
	}
	.alp-mm-foot .alp-mm-tag {
		margin: 0 0 12px;
		padding: 0;
		font-family: 'ivypresto-display', Georgia, serif;
		font-size: 21px;
		font-weight: 100;
		line-height: 1.25;
		color: var(--alp-ink);
	}
	html body .alp-mm-foot a.alp-mm-book {
		display: block;
		width: 100%;
		box-sizing: border-box;
		background: var(--alp-rust);
		color: #FFFFFF !important;
		font-family: 'Josefin Sans', Helvetica, Arial, Lucida, sans-serif;
		font-size: 15px;
		font-weight: 500;
		letter-spacing: 3px;
		line-height: 1.7em;
		text-transform: uppercase;
		text-decoration: none;
		padding: 14px 20px 10px;
		transition: background-color .2s ease, transform .2s ease;
	}
	html body .alp-mm-foot a.alp-mm-book:active { background: #B4561F; transform: scale(.98); }
	.alp-mm-foot .alp-mm-phone {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		margin-top: 12px;
		min-height: 36px;
		font-size: 15px;
		font-weight: 600;
		letter-spacing: 1.5px;
		color: var(--alp-teal) !important;
		text-decoration: none;
	}
	.alp-mm-phone svg { width: 16px; height: 16px; flex: none; }
}

@media (max-width: 980px) and (prefers-reduced-motion: reduce) {
	.alp-mm,
	.alp-mm-scrim,
	.alp-mm-list > li,
	.alp-mm-drawer,
	.alp-mm-chev,
	.alp-mm-btn span { transition: none !important; }
	.alp-mm-list > li { opacity: 1; transform: none; }
}
