/* ============================================================
   Jordan Cash Four Cars — MOBILE fixes. Loaded site-wide, LAST.
   Structure adapted (code only) from a prior sister-site child theme.
   ============================================================ */

/* Never let a replaced element push the page wider than the screen. */
img, svg, video, iframe, canvas, embed, object { max-width: 100%; }

/* Hamburger: hidden on desktop, shown < 1025px */
.jcfc-burger { display: none; }

/* =====================================================================
   TABLET + PHONE  (< 1025px)
   ===================================================================== */
@media (max-width: 1024px) {

	/* Hide the HFE desktop nav on mobile (it renders full desktop width
	   and would widen the page). The custom panel replaces it. */
	.jcfc-site-header .jcfc-hdr-nav,
	.jcfc-site-header .elementor-widget-navigation-menu { display: none !important; }

	/* Hide the header action buttons on mobile (sticky bar covers them). */
	.jcfc-site-header .jcfc-hdr-actions { display: none !important; }

	/* Show the custom hamburger at the right of the header */
	.jcfc-burger {
		display: inline-flex; flex-direction: column; justify-content: center; gap: 4px;
		width: 44px; height: 44px; padding: 0 10px; border: 0; background: transparent; cursor: pointer;
		margin-left: auto;
	}
	.jcfc-burger span { display: block; height: 2px; width: 24px; background: var(--jcfc-navy); border-radius: 2px; }
	.jcfc-burger:focus-visible { outline: 2px solid var(--jcfc-navy); outline-offset: 2px; border-radius: 6px; }

	.jcfc-site-header.e-con > .e-con-inner {
		padding-left: 16px !important; padding-right: 16px !important;
		min-height: 64px; justify-content: space-between;
	}
	.jcfc-hdr-logo a { font-size: 18px !important; white-space: nowrap; }

	/* Containers never exceed the screen */
	.e-con > .e-con-inner { max-width: 100% !important; }
	.e-con.e-parent > .e-con-inner { padding-left: 24px !important; padding-right: 24px !important; }

	/* Stack 2-column rows (text first) */
	.jcfc-2col { flex-direction: column !important; }
	.jcfc-2col > .e-con { width: 100% !important; max-width: 100% !important; flex: 1 1 100% !important; }

	/* Cards: 2 per row on tablet */
	.jcfc-grid > .e-con { max-width: calc(50% - 12px) !important; flex: 1 1 calc(50% - 12px) !important; }
}

/* ===== Off-canvas mobile menu panel ===== */
#jcfc-mnav-overlay { position: fixed; inset: 0; background: rgba(8,27,51,.5); z-index: 100000; opacity: 0; transition: opacity .25s ease; }
body.jcfc-mnav-open #jcfc-mnav-overlay { opacity: 1; }

.jcfc-mnav {
	position: fixed; top: 0; right: 0; bottom: 0; width: min(88vw, 360px);
	background: #fff; z-index: 100001; box-shadow: -8px 0 30px rgba(0,0,0,.25);
	transform: translateX(100%); transition: transform .25s ease;
	display: flex; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
/* When closed (hidden attribute set), fully remove from layout + tab order
   so aria-hidden content holds no focusable descendants (a11y). */
.jcfc-mnav[hidden], #jcfc-mnav-overlay[hidden] { display: none !important; }
body.jcfc-mnav-open .jcfc-mnav { transform: translateX(0); }
body.jcfc-mnav-open { overflow: hidden; }

.jcfc-mnav-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--jcfc-border); }
.jcfc-mnav-title { font-family: var(--jcfc-font-head); font-weight: 800; color: var(--jcfc-primary); font-size: 17px; }
/* Sprint 26 — navy logo at top of the slide-out panel, 180px wide, linked to home. */
.jcfc-mnav-logo { display: inline-flex; line-height: 0; }
.jcfc-mnav-logo-img { width: 180px; height: auto; display: block; }
.jcfc-mnav-close { width: 44px; height: 44px; border: 0 !important; background: transparent !important; font-size: 30px; line-height: 1; color: var(--jcfc-primary) !important; cursor: pointer; border-radius: 8px; }
.jcfc-mnav-close:hover { background: var(--jcfc-light) !important; }
.jcfc-mnav-close:focus-visible { outline: 2px solid var(--jcfc-primary); outline-offset: 2px; }

.jcfc-mnav-list, .jcfc-mnav-list .sub-menu { list-style: none; margin: 0; padding: 0; }
.jcfc-mnav-list .menu-item { border-bottom: 1px solid #eef1f6; position: relative; }
.jcfc-mnav-list .menu-item > a {
	display: flex; align-items: center; min-height: 48px; padding: 12px 16px;
	color: var(--jcfc-primary); font-weight: 600; font-size: 17px; text-decoration: none;
}
.jcfc-mnav-list .menu-item > a:hover, .jcfc-mnav-list .menu-item > a:focus { color: var(--jcfc-secondary); background: var(--jcfc-light); }

/* submenu expander (+ / −) */
.jcfc-mnav-expander { position: absolute; top: 2px; right: 4px; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; }
.jcfc-mnav-plus, .jcfc-mnav-plus::before { content: ""; position: absolute; background: var(--jcfc-primary); }
.jcfc-mnav-plus { top: 50%; left: 50%; width: 14px; height: 2px; transform: translate(-50%, -50%); }
.jcfc-mnav-plus::before { top: 0; left: 50%; width: 2px; height: 14px; transform: translate(-50%, -6px); transition: opacity .2s ease; }
.jcfc-sub-open > .jcfc-mnav-expander .jcfc-mnav-plus::before { opacity: 0; }
.jcfc-mnav-expander:focus-visible { outline: 2px solid var(--jcfc-primary); outline-offset: -4px; }

.jcfc-mnav-list .sub-menu { display: none; background: #f7f9fc; }
.jcfc-mnav-list .jcfc-sub-open > .sub-menu { display: block; }
.jcfc-mnav-list .sub-menu .menu-item > a { padding-left: 32px; font-weight: 500; font-size: 16px; }

.jcfc-mnav-cta { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-top: 1px solid var(--jcfc-border); }
.jcfc-mnav-btn { display: flex; align-items: center; justify-content: center; min-height: 50px; border-radius: 10px; font-weight: 700; font-size: 16px; text-decoration: none; }
.jcfc-mnav-btn-gold    { background: var(--jcfc-accent); color: var(--jcfc-primary); }
.jcfc-mnav-btn-outline { background: transparent; color: var(--jcfc-primary); border: 2px solid var(--jcfc-primary); }

/* =====================================================================
   PHONES  (<= 767px)
   ===================================================================== */
@media (max-width: 767px) {
	.e-con.e-parent > .e-con-inner { padding-left: 16px !important; padding-right: 16px !important; }

	/* Cards 1 per row */
	.jcfc-grid > .e-con { max-width: 100% !important; flex: 1 1 100% !important; }

	/* Stack footer columns */
	.jcfc-footer-cols > .e-con-inner { flex-direction: column !important; }
	.jcfc-footer-col { width: 100% !important; max-width: 100% !important; }

	/* Typography */
	.elementor-widget-heading h1.elementor-heading-title { font-size: 32px !important; line-height: 1.2 !important; }
	.elementor-widget-heading h2.elementor-heading-title { font-size: 26px !important; line-height: 1.25 !important; }
	.elementor-widget-heading h3.elementor-heading-title { font-size: 20px !important; line-height: 1.3 !important; }
	* { overflow-wrap: anywhere; }

	/* CTA strip stacks + centers */
	.jcfc-cta-strip > .e-con-inner { flex-direction: column !important; text-align: center; gap: 16px; }

	/* Footer bottom clearance for the sticky bar */
	.jcfc-site-footer.e-con { padding-bottom: 86px !important; }
}

/* =====================================================================
   STICKY BOTTOM BAR  (phones only, <= 767px)
   Two equal buttons: Call Now (navy) | Get Offer (gold).
   ===================================================================== */
@media (max-width: 767px) {
	#jcfc-sticky-bar {
		position: fixed; left: 0; bottom: 0; width: 100%;
		box-sizing: border-box; height: 56px; display: flex; z-index: 9998;
		padding-bottom: env(safe-area-inset-bottom, 0px);
		box-shadow: 0 -4px 16px rgba(0,0,0,.18);
	}
	#jcfc-sticky-bar a {
		flex: 1; min-height: 56px; box-sizing: border-box;
		display: flex; align-items: center; justify-content: center;
		font-size: 16px; font-weight: 700; text-decoration: none;
	}
	#jcfc-sticky-bar .jcfc-bar-call  { background: var(--jcfc-primary); color: #fff; }
	#jcfc-sticky-bar .jcfc-bar-offer { background: var(--jcfc-accent); color: var(--jcfc-primary); }

	/* Body clearance so the bar never covers footer text */
	body:not(.page-slug-get-offer):not(.page-slug-thank-you) { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }

	/* Hidden on get-offer, thank-you, and while the menu is open */
	body.page-slug-get-offer #jcfc-sticky-bar,
	body.page-slug-thank-you #jcfc-sticky-bar,
	body.jcfc-mnav-open #jcfc-sticky-bar { display: none !important; }
	body.page-slug-get-offer, body.page-slug-thank-you { padding-bottom: 0 !important; }
}

/* Desktop: sticky bar is mobile-only */
@media (min-width: 768px) { #jcfc-sticky-bar { display: none; } }

/* Desktop: the off-canvas panel + overlay must not exist in layout
   (base rules give .jcfc-mnav display:flex, which would otherwise
   defeat the HTML hidden attribute and add horizontal scroll). */
@media (min-width: 1025px) {
	#jcfc-mnav, #jcfc-mnav-overlay { display: none !important; }
}
