/*
 * Mobile-only quote blocks (FactoryPlans). Same file as on the Ford and Chrysler sites.
 *   Home: resources/views/index.blade.php (with mobile-home.css after it)
 * EVERY rule lives inside the max-width query below, so tablet (>=768px)
 * and desktop rendering are unchanged.
 *
 * Blocks are marked up with .m-tool inside a .m-flow container. On mobile .m-flow is
 * one flex column; wrappers marked .m-contents are flattened (display:contents) and
 * the blocks are ordered with the .m-o-* classes.
 */
@media (max-width: 767.98px) {

	/* ---------- utilities ---------- */
	/* scoped to the blocks; the global .m-hide (header/footer/home) is in mobile-home.css */
	.m-flow .m-hide { display: none !important; }

	/* the form-group selector beats the col-* width rule below (these labels also carry col-md-*) */
	.m-sr,
	.m-flow .m-tool label.m-sr,
	.m-flow .m-tool .form-group > label.m-sr {
		position: absolute !important;
		width: 1px !important;
		height: 1px !important;
		padding: 0 !important;
		margin: -1px !important;
		overflow: hidden !important;
		clip: rect(0, 0, 0, 0) !important;
		white-space: nowrap !important;
		border: 0 !important;
	}

	/* ---------- flatten + reorder ---------- */
	.m-flow {
		display: flex !important;
		flex-direction: column !important;
		flex-wrap: nowrap !important;
		margin: 0 !important;
	}
	.m-contents { display: contents !important; }
	.m-contents > * { order: 90; }

	.m-flow .m-o-1 { order: 1; }   /* Quick Quote             */
	.m-flow .m-o-2 { order: 2; }   /* Review Quote            */
	.m-flow .m-o-3 { order: 3; }   /* Document Upload         */
	.m-flow .m-o-4 { order: 4; }   /* Cancellation Request    */
	.m-flow .m-o-5 { order: 5; }   /* Custom Quote Request    */
	.m-flow .m-o-6 { order: 6; }   /* Contact Form            */
	.m-flow .m-o-7 { order: 7; }   /* Available by Phone      */
	.m-flow .m-o-8 { order: 8; }   /* FAQ                     */

	.m-flow .m-tool,
	.m-flow .m-article {
		width: 100% !important;
		max-width: 100% !important;
		flex: 0 0 auto !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		padding-left: 0 !important;
		padding-right: 0 !important;
	}

	/* cancel Bootstrap row/column gutters inside the cards */
	.m-flow .m-tool .row,
	.m-flow .m-tool form > .row {
		margin-left: 0 !important;
		margin-right: 0 !important;
	}
	.m-flow .m-tool [class*="col-"] {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}

	/* ---------- tool cards ---------- */
	.m-flow .m-tool .featured-box,
	.m-flow .featured-box.m-tool {
		margin: 0 0 12px !important;
		min-height: 0 !important;
		border: 1px solid #e1e5ea !important;
		border-radius: 6px !important;
		background: #f5f6f7 !important;
		box-shadow: none !important;
		text-align: left !important;
	}
	.m-flow .m-tool .featured-box .box-content,
	.m-flow .featured-box.m-tool > .box-content {
		border-top: 0 !important;
		padding: 14px 14px 12px !important;
		min-height: 0 !important;
		text-align: left !important;
	}
	.m-flow .m-tool-primary .featured-box {
		border: 2px solid #0099e6 !important;
		background: #fff !important;
	}

	.m-flow .m-title {
		display: flex !important;
		align-items: center;
		gap: 8px;
		margin: 0 0 10px !important;
		padding: 0 !important;
		font-size: 17px !important;
		font-weight: 600 !important;
		line-height: 1.3 !important;
		letter-spacing: 0 !important;
		text-transform: none !important;
		color: #0088cc !important;
		text-align: left !important;
	}
	.m-flow .m-title .sub-itle { display: none !important; }

	.m-flow .m-note,
	.m-flow .m-tool .m-note i {
		display: block;
		margin: 8px 0 0 !important;
		font-size: 12.5px !important;
		font-weight: 400 !important;
		font-style: normal !important;
		color: #666 !important;
		line-height: 1.45;
	}

	/* ---------- form controls ---------- */
	/* no display override here: some groups are hidden inline (VIN, Mileage) or collapsed (phone hours) */
	.m-flow .m-tool .form-group {
		margin: 0 0 8px !important;
	}
	.m-flow .m-tool .form-group > [class*="col-"] {
		width: 100% !important;
		max-width: 100% !important;
		flex: none !important;
		padding: 0 !important;
	}
	.m-flow .m-tool .control-label {
		display: block;
		width: 100%;
		max-width: 100%;
		padding: 0 !important;
		margin: 0 0 2px;
		text-align: left !important;
		font-size: 12.5px;
		color: #555;
	}
	.m-flow .m-tool .form-control {
		height: 44px;
		font-size: 16px; /* 16px stops iOS zoom-on-focus */
		border: 1px solid #cfd6dd;
		border-radius: 4px;
		background-color: #fff;
	}
	.m-flow .m-tool textarea.form-control { height: auto; min-height: 84px; }
	.m-flow #divcontactForm { margin: 0 !important; }
	.m-flow .m-tool-contact .form-group > div { font-size: 12px; color: #777; }

	/* Custom quote: Year + Make side by side */
	.m-flow .m-tool-custom #Panel1 {
		display: grid;
		grid-template-columns: 1fr 1fr;
		column-gap: 8px;
	}
	.m-flow .m-tool-custom #Panel1 > .form-group:last-child { grid-column: 1 / -1; }

	/* ---------- buttons: full width, >=48px tap targets ---------- */
	.m-flow .m-tool .btn,
	.m-flow .m-tool input[type="submit"] {
		display: flex !important;
		align-items: center;
		justify-content: center;
		width: 100% !important;
		min-height: 48px;
		margin: 6px 0 0 !important;
		padding: 10px 16px !important;
		border-radius: 4px !important;
		border: 2px solid #0099e6 !important;
		background: #0099e6 !important;
		color: #fff !important;
		font-size: 16px !important;
		font-weight: 600 !important;
		text-transform: none !important;
		box-shadow: none !important;
	}
	/* secondary (outlined) actions, as in the client mock (overridden by mobile-home-polish.css) */
	.m-flow .m-o-2 .btn, .m-flow .m-o-2 input[type="submit"],
	.m-flow .m-o-4 .btn,
	.m-flow .m-o-5 input[type="submit"] {
		background: #fff !important;
		color: #0088cc !important;
	}

	/* ---------- Available by Phone ---------- */
	.m-call-btn {
		display: flex !important;
		align-items: center;
		justify-content: center;
		min-height: 48px;
		border-radius: 4px;
		background: #0099e6;
		color: #fff !important;
		font-size: 16px;
		font-weight: 700;
		text-decoration: none !important;
	}
	/* section stays open and centred */
	.m-flow .m-tool-phone .box-content,
	.m-flow .m-tool-phone .m-phone-details,
	.m-flow .m-tool-phone .m-phone-details * { text-align: center !important; }
	.m-flow .m-tool-phone .m-title { justify-content: center; }
	.m-flow .m-tool-phone .m-phone-details { margin: 12px 0 0 !important; font-size: 13px; }
}
