/* ==========================================================================
   Bentley's Holiday Homes — Mobile & Tablet Header / Navigation
   --------------------------------------------------------------------------
   A self-contained, premium mobile + tablet navigation experience.
   Scope: ALL rules live behind @media (max-width:1024px). The new chrome is
   display:none by default, so the approved desktop header (>=1025px) is never
   touched by this file.

   Brand: orange #E96300 · teal #1C8A8C · light #FAF8F6 · ink #303030
   ========================================================================== */

/* The mobile-only chrome stays hidden on desktop/laptop. */
.m-utilitybar,
.m-header-actions,
.m-drawer,
.m-drawer-overlay { display: none; }

@media (max-width: 1024px) {

	/* ---- Local design tokens ------------------------------------------- */
	.site-header {
		--m-orange: #e96300;
		--m-orange-dk: #c94f00;
		--m-teal: #1c8a8c;
		--m-light: #faf8f6;
		--m-ink: #303030;
	}

	/* =====================================================================
	   1. Sticky shell — utility bar + main bar travel together
	   ===================================================================== */
	.site-header {
		position: -webkit-sticky;
		position: sticky;
		top: 0;
		z-index: 99990;
		background: #fff !important;
		box-shadow: 0 6px 22px rgba(16, 14, 13, .08);
		transition: box-shadow .3s ease;
	}
	body.m-scrolled .site-header { box-shadow: 0 10px 30px rgba(16, 14, 13, .16); }

	/* =====================================================================
	   2. Top utility bar (slim, brand orange)
	   ===================================================================== */
	.m-utilitybar {
		display: block;
		background: linear-gradient(90deg, var(--m-orange) 0%, var(--m-orange-dk) 100%);
		color: #fff;
		font-size: 13px;
		line-height: 1;
		overflow: hidden;
		max-height: 44px;
		transition: max-height .3s ease, opacity .3s ease, padding .3s ease;
	}
	.m-utilitybar .container {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px 22px;
		flex-wrap: wrap;
		min-height: 38px;
		padding: 0 18px;
	}
	.m-util-item {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		color: #fff;
		font-weight: 500;
		letter-spacing: .2px;
		white-space: nowrap;
		transition: opacity .2s ease;
	}
	.m-util-item:hover,
	.m-util-item:focus { color: #fff; opacity: .85; }
	.m-util-item i { font-size: 12px; opacity: .9; }

	/* Tuck the utility bar away once the user starts scrolling — keeps the
	   sticky header compact without losing the brand colour on the main bar. */
	body.m-scrolled .m-utilitybar {
		max-height: 0;
		opacity: 0;
	}

	/* =====================================================================
	   3. Main header bar — logo (left) + actions (right)
	   ===================================================================== */
	.navigation_bar { box-shadow: none; }
	.navigation_bar > .container {
		display: flex !important;
		align-items: center;
		justify-content: space-between;
		gap: 14px;
		text-align: left;
		min-height: 76px;
		padding: 0 18px;
		transition: min-height .3s ease;
	}
	body.m-scrolled .navigation_bar > .container { min-height: 64px; }

	/* Logo — larger and more prominent than before */
	.navigation_bar .logo {
		float: none;
		margin: 0;
		padding: 0;
		background: transparent;
		display: flex;
		align-items: center;
	}
	.navigation_bar .logo:after { display: none; }
	.navigation_bar .logo .site-logo img,
	.navigation_bar .logo img.custom-logo {
		display: block;
		width: auto;
		max-height: 60px;
		margin: 0;
		transition: max-height .3s ease;
	}
	body.m-scrolled .navigation_bar .logo .site-logo img,
	body.m-scrolled .navigation_bar .logo img.custom-logo { max-height: 48px; }

	/* Hide every desktop nav affordance on mobile/tablet */
	.navigation_bar .sitenav,
	.navigation_bar .header-contact,
	.navigation_bar .toggle,
	.site-header .sd-menu-search { display: none !important; }

	/* ---- Right-hand actions: tablet CTA + hamburger -------------------- */
	.m-header-actions {
		display: flex;
		align-items: center;
		gap: 12px;
	}

	/* Tablet-only primary CTA (hidden on phones — CTA lives in the drawer) */
	.m-header-cta {
		display: none;
		align-items: center;
		justify-content: center;
		padding: 11px 22px;
		border-radius: 999px;
		background: var(--m-orange);
		color: #fff;
		font-size: 14px;
		font-weight: 700;
		letter-spacing: .02em;
		box-shadow: 0 8px 18px rgba(233, 99, 0, .32);
		transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
	}
	.m-header-cta:hover,
	.m-header-cta:focus {
		color: #fff;
		background: var(--m-orange-dk);
		transform: translateY(-2px);
		box-shadow: 0 12px 24px rgba(233, 99, 0, .42);
	}

	/* ---- Modern hamburger button -------------------------------------- */
	.m-nav-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 48px;
		height: 48px;
		padding: 0;
		border: 0;
		border-radius: 14px;
		background: var(--m-orange);
		box-shadow: 0 8px 18px rgba(233, 99, 0, .34);
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
		transition: transform .25s ease, box-shadow .25s ease, background .25s ease, border-radius .3s ease;
	}
	.m-nav-toggle:hover,
	.m-nav-toggle:focus-visible {
		background: var(--m-orange-dk);
		transform: translateY(-2px);
		box-shadow: 0 12px 24px rgba(233, 99, 0, .46);
	}
	.m-nav-toggle:active { transform: translateY(0) scale(.96); }
	.m-nav-toggle:focus-visible { outline: 3px solid rgba(28, 138, 140, .6); outline-offset: 2px; }

	.m-nav-toggle-box {
		position: relative;
		display: block;
		width: 22px;
		height: 16px;
	}
	.m-nav-toggle-inner,
	.m-nav-toggle-inner::before,
	.m-nav-toggle-inner::after {
		position: absolute;
		left: 0;
		width: 22px;
		height: 2.5px;
		border-radius: 3px;
		background: #fff;
		transition: transform .3s cubic-bezier(.2, .7, .25, 1), top .3s ease, opacity .2s ease;
	}
	.m-nav-toggle-inner { top: 50%; transform: translateY(-50%); }
	.m-nav-toggle-inner::before { content: ""; top: -7px; }
	.m-nav-toggle-inner::after  { content: ""; top: 7px; }

	/* Animate into an X while the drawer is open */
	body.m-nav-open .m-nav-toggle { border-radius: 50%; }
	body.m-nav-open .m-nav-toggle-inner { background: transparent; }
	body.m-nav-open .m-nav-toggle-inner::before { top: 0; transform: rotate(45deg); }
	body.m-nav-open .m-nav-toggle-inner::after  { top: 0; transform: rotate(-45deg); }

	/* =====================================================================
	   4. Off-canvas drawer + overlay
	   ===================================================================== */
	.m-drawer-overlay {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 99995;
		background: rgba(16, 14, 13, .5);
		backdrop-filter: blur(2px);
		-webkit-backdrop-filter: blur(2px);
		opacity: 0;
		pointer-events: none;
		transition: opacity .35s ease;
	}
	body.m-nav-open .m-drawer-overlay { opacity: 1; pointer-events: auto; }

	.m-drawer {
		display: flex;
		flex-direction: column;
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: 99996;
		width: 86%;
		max-width: 380px;
		background: var(--m-light);
		box-shadow: -18px 0 50px rgba(16, 14, 13, .22);
		transform: translateX(100%);
		visibility: hidden;
		transition: transform .38s cubic-bezier(.2, .7, .25, 1), visibility .38s ease;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
	}
	body.m-nav-open .m-drawer { transform: translateX(0); visibility: visible; }

	/* Drawer header: logo + close */
	.m-drawer-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 18px 20px;
		border-bottom: 1px solid rgba(48, 48, 48, .08);
		background: #fff;
	}
	.m-drawer-logo img { display: block; width: auto; max-height: 52px; }
	.m-drawer-close {
		position: relative;
		width: 42px;
		height: 42px;
		border: 0;
		border-radius: 12px;
		background: #f1ece8;
		cursor: pointer;
		flex: 0 0 auto;
		transition: background .25s ease, transform .25s ease;
	}
	.m-drawer-close:hover { background: #e7ded8; transform: rotate(90deg); }
	.m-drawer-close:focus-visible { outline: 3px solid rgba(28, 138, 140, .6); outline-offset: 2px; }
	.m-drawer-close span {
		position: absolute;
		top: 50%;
		left: 50%;
		width: 18px;
		height: 2.5px;
		border-radius: 3px;
		background: var(--m-ink);
	}
	.m-drawer-close span:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
	.m-drawer-close span:nth-child(2) { transform: translate(-50%, -50%) rotate(-45deg); }

	/* ---- Drawer navigation -------------------------------------------- */
	.m-drawer-nav { padding: 10px 14px 4px; }
	.m-drawer-nav .m-menu,
	.m-drawer-nav .m-menu ul { list-style: none; margin: 0; padding: 0; }
	.m-drawer-nav .m-menu li { position: relative; border-bottom: 1px solid rgba(48, 48, 48, .07); }
	.m-drawer-nav .m-menu > li:last-child { border-bottom: 0; }

	.m-drawer-nav .m-menu a {
		display: block;
		padding: 15px 14px;
		font-size: 16.5px;
		font-weight: 600;
		letter-spacing: .2px;
		color: var(--m-ink);
		border-radius: 10px;
		transition: color .2s ease, background .2s ease, padding-left .2s ease;
	}
	.m-drawer-nav .m-menu a:hover,
	.m-drawer-nav .m-menu a:focus { color: var(--m-orange); background: rgba(233, 99, 0, .07); padding-left: 20px; }
	.m-drawer-nav .m-menu .current-menu-item > a,
	.m-drawer-nav .m-menu .current_page_item > a,
	.m-drawer-nav .m-menu .current-menu-ancestor > a,
	.m-drawer-nav .m-menu .current-menu-parent > a {
		color: var(--m-orange);
		background: rgba(233, 99, 0, .09);
	}

	/* ---- Accordion sub-menus (Properties / Local Area) ---------------- */
	.m-drawer-nav .menu-item-has-children > a {
		position: relative;
		padding-right: 46px;
	}
	.m-drawer-nav .menu-item-has-children > a::after {
		content: "";
		position: absolute;
		top: 50%;
		right: 18px;
		width: 9px;
		height: 9px;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: translateY(-65%) rotate(45deg);
		opacity: .7;
		transition: transform .3s ease;
	}
	.m-drawer-nav .menu-item-has-children.m-open > a::after {
		transform: translateY(-35%) rotate(-135deg);
	}
	/* Collapsed by default; smooth height reveal via inline max-height (JS) */
	.m-drawer-nav .sub-menu {
		max-height: 0;
		overflow: hidden;
		padding-left: 8px;
		transition: max-height .35s ease;
	}
	.m-drawer-nav .sub-menu a {
		font-size: 15px;
		font-weight: 500;
		color: #5a5a5a;
		padding: 12px 14px;
	}
	.m-drawer-nav .sub-menu li { border-bottom: 1px solid rgba(48, 48, 48, .05); }
	.m-drawer-nav .sub-menu li:last-child { border-bottom: 0; }
	.m-drawer-nav .sub-menu a::before {
		content: "";
		display: inline-block;
		width: 6px;
		height: 6px;
		margin-right: 10px;
		border-radius: 50%;
		background: var(--m-teal);
		vertical-align: middle;
		opacity: .65;
	}

	/* ---- Book Now CTA inside the drawer ------------------------------- */
	.m-drawer-book {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 10px;
		margin: 18px 18px 6px;
		padding: 16px 24px;
		border-radius: 14px;
		background: linear-gradient(135deg, #ff7a18 0%, var(--m-orange) 55%, var(--m-orange-dk) 100%);
		color: #fff;
		font-size: 16px;
		font-weight: 700;
		letter-spacing: .02em;
		box-shadow: 0 12px 26px rgba(233, 99, 0, .38);
		transition: transform .25s ease, box-shadow .25s ease;
	}
	.m-drawer-book:hover,
	.m-drawer-book:focus { color: #fff; transform: translateY(-2px); box-shadow: 0 16px 32px rgba(233, 99, 0, .5); }
	.m-drawer-book i { font-size: 15px; }

	/* ---- Drawer contact + social -------------------------------------- */
	.m-drawer-contact {
		display: flex;
		flex-direction: column;
		gap: 4px;
		margin-top: auto;
		padding: 16px 22px 6px;
	}
	.m-drawer-contact a {
		display: inline-flex;
		align-items: center;
		gap: 11px;
		padding: 7px 0;
		font-size: 14.5px;
		font-weight: 600;
		color: var(--m-ink);
		transition: color .2s ease;
	}
	.m-drawer-contact a:hover { color: var(--m-orange); }
	.m-drawer-contact i { width: 18px; text-align: center; color: var(--m-orange); }

	.m-drawer-social {
		display: flex;
		gap: 12px;
		padding: 8px 22px 26px;
	}
	.m-drawer-social a {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		border-radius: 50%;
		background: #fff;
		border: 1px solid rgba(48, 48, 48, .12);
		color: var(--m-teal);
		font-size: 15px;
		transition: background .25s ease, color .25s ease, transform .25s ease, border-color .25s ease;
	}
	.m-drawer-social a:hover,
	.m-drawer-social a:focus {
		background: var(--m-orange);
		border-color: var(--m-orange);
		color: #fff;
		transform: translateY(-3px);
	}

	/* Lock the page behind the drawer */
	body.m-nav-open { overflow: hidden; }
}

/* =====================================================================
   5. Tablet refinements (768–1024px) — hybrid layout with more room
   ===================================================================== */
@media (min-width: 768px) and (max-width: 1024px) {
	.navigation_bar > .container { min-height: 88px; padding: 0 30px; }
	body.m-scrolled .navigation_bar > .container { min-height: 72px; }
	.navigation_bar .logo .site-logo img,
	.navigation_bar .logo img.custom-logo { max-height: 68px; }
	body.m-scrolled .navigation_bar .logo .site-logo img,
	body.m-scrolled .navigation_bar .logo img.custom-logo { max-height: 56px; }
	.m-utilitybar .container { justify-content: flex-end; padding: 0 30px; }

	/* Surface the primary CTA next to the menu icon on tablet */
	.m-header-cta { display: inline-flex; }

	.m-drawer { max-width: 420px; width: 60%; }
}

/* =====================================================================
   6. Honour reduced-motion preferences
   ===================================================================== */
@media (max-width: 1024px) {
	@media (prefers-reduced-motion: reduce) {
		.m-drawer,
		.m-drawer-overlay,
		.m-utilitybar,
		.m-nav-toggle,
		.m-nav-toggle-inner,
		.m-nav-toggle-inner::before,
		.m-nav-toggle-inner::after,
		.m-drawer-nav .sub-menu,
		.navigation_bar > .container,
		.navigation_bar .logo img { transition: none !important; }
	}
}
