/*
 * Quick Order Form for WooCommerce — front-end styles
 * Enqueued by woo-custom-quick-order-form.php wherever the
 * [quick_order_form] shortcode renders.
 *
 * Colors are custom properties so a theme can override them on .p-qof.
 * --p-qof-accent is set per section from the category's Quick Order color.
 */

.p-qof {
	--p-qof-text: #0a4458;
	--p-qof-muted: rgba(0, 0, 0, 0.5);
	--p-qof-border: #ccc;
	--p-qof-button: #ffc107;
	--p-qof-button-hover: #e0a800;
	--p-qof-button-text: #0a4458;
	--p-qof-accent: #19988b;
	color: var(--p-qof-text);
	line-height: 1.5;
}

.p-qof *,
.p-qof *::before,
.p-qof *::after { box-sizing: border-box; }

/* Heading, intro and jump links */

.p-qof-heading {
	margin: 24px 0;
	color: var(--p-qof-text);
	font-size: 2rem;
	font-weight: 400;
	line-height: 1.2;
	text-align: center;
	text-transform: uppercase;
}

.p-qof-intro { margin: 24px 0; color: var(--p-qof-muted); font-weight: 500; line-height: 1.8; }
.p-qof-intro p { margin: 0 0 16px; }

.p-qof-nav {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 8px 16px;
	margin: 16px 0;
	text-align: center;
}

.p-qof-nav-link,
.p-qof-nav-link:visited {
	padding: 4px;
	color: var(--p-qof-text);
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
}

.p-qof-nav-link:hover,
.p-qof-nav-link:focus { color: var(--p-qof-text); text-decoration: underline; }

/* Section header bar */

.p-qof-section { scroll-margin-top: 24px; }

.p-qof-bar {
	display: flex;
	align-items: stretch;
	min-height: 72px;
	background: var(--p-qof-accent);
}

.p-qof .p-qof-bar-title {
	flex: 1 1 auto;
	align-self: center;
	margin: 0;
	padding: 12px 15px;
	color: #fff;
	font-size: 1.5rem;
	font-weight: 500;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: normal;
}

.p-qof .p-qof-submit {
	flex: 0 0 16.6667%;
	min-width: 160px;
	margin: 0;
	padding: 12px;
	border: 1px solid var(--p-qof-button);
	border-radius: 0;
	background: var(--p-qof-button);
	box-shadow: none;
	color: var(--p-qof-button-text);
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.5;
	letter-spacing: 2px;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.p-qof .p-qof-submit:hover,
.p-qof .p-qof-submit:focus {
	border-color: var(--p-qof-button-hover);
	background: var(--p-qof-button-hover);
	color: var(--p-qof-button-text);
}

.p-qof .p-qof-submit:focus-visible { outline: 2px solid var(--p-qof-button-text); outline-offset: -4px; }

.p-qof-section--footer { margin-top: 16px; }
.p-qof-section--footer[hidden] { display: none; }

/* Product table: description | unit price | price | qty (6/2/2/2) */

.p-qof-product { margin: 16px 0 48px; }

.p-qof-row {
	display: grid;
	grid-template-columns: minmax(0, 8fr) minmax(0, 2fr) minmax(0, 2fr);
	grid-template-areas: "desc price qty";
	align-items: center;
}

.p-qof--has-unit .p-qof-row {
	grid-template-columns: minmax(0, 6fr) minmax(0, 2fr) minmax(0, 2fr) minmax(0, 2fr);
	grid-template-areas: "desc unit price qty";
}

.p-qof-col { min-width: 0; padding: 0 15px; }
.p-qof-col-desc { grid-area: desc; }
.p-qof-col-unit { grid-area: unit; display: none; }
.p-qof-col-price { grid-area: price; }
.p-qof-col-qty { grid-area: qty; }
.p-qof--has-unit .p-qof-col-unit { display: block; }

.p-qof-row--title .p-qof-col { color: var(--p-qof-text); font-size: 1.2rem; font-weight: 500; line-height: 1.25; }

.p-qof-product-title,
.p-qof-product-title:visited { color: var(--p-qof-text); font-weight: 600; text-decoration: none; }
.p-qof-product-title:hover,
.p-qof-product-title:focus { color: var(--p-qof-text); text-decoration: underline; }

.p-qof-row--item {
	padding: 16px 0;
	border-bottom: 1px solid var(--p-qof-border);
	color: var(--p-qof-muted);
	font-weight: 500;
}

.p-qof-row--item .p-qof-col-price del { opacity: 0.7; }
.p-qof-row--item .p-qof-col-price ins { text-decoration: none; }

.p-qof .p-qof-qty {
	display: block;
	width: 100%;
	max-width: 130px;
	height: 38px;
	margin: 0;
	padding: 6px 12px;
	border: 1px solid #333;
	border-radius: 0;
	background: #fff;
	box-shadow: none;
	color: #333;
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.5;
}

.p-qof .p-qof-qty:focus { border-color: var(--p-qof-accent); outline: 2px solid var(--p-qof-accent); outline-offset: 0; }

.p-qof-oos { color: var(--p-qof-muted); }

/* Mobile: description full width, figures in three columns below */

@media (max-width: 767px) {
	.p-qof-bar { min-height: 64px; }
	.p-qof .p-qof-bar-title { font-size: 1.2rem; }
	.p-qof .p-qof-submit { flex-basis: 33.3333%; min-width: 0; padding: 12px 6px; letter-spacing: 1px; }

	.p-qof-row,
	.p-qof--has-unit .p-qof-row {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		grid-template-areas:
			"desc desc desc"
			"price qty qty";
		row-gap: 8px;
	}

	.p-qof--has-unit .p-qof-row { grid-template-areas: "desc desc desc" "unit price qty"; }

	.p-qof-row--title .p-qof-col-unit,
	.p-qof-row--title .p-qof-col-price,
	.p-qof-row--title .p-qof-col-qty,
	.p-qof--has-unit .p-qof-row--title .p-qof-col-unit { display: none; }
}
