/* Orbital Quote PDF: spec-sheet configurator. Loaded only on product pages with the setting on (body.oqp-spec).
   Draws section cards on WooCommerce Composite Products' own markup: a category pseudo-component
   (.is-component-category) is the card's header, the components after it are its rows. Nothing is moved. */

body.oqp-spec form.composite_form {
	container: oqp-config / inline-size;
	--oqp-ink: #1f2a30;
	--oqp-text: #222222;
	--oqp-muted: #5b6770;
	--oqp-card: #dfe5e8;
	--oqp-row: #edf1f3;
	--oqp-head: #f6f8f9;
	--oqp-field: #b8c2c7;
}

/* ---------- Jump bar ---------- */
body.oqp-spec form.composite_form .oqp-spec-jump {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 20px;
}
body.oqp-spec form.composite_form .oqp-spec-jump a.oqp-spec-chip {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 14px;
	box-sizing: border-box;
	border: 1px solid #cfd8dc;
	border-radius: 999px;
	background: #ffffff;
	color: var(--oqp-ink);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
	text-decoration: none;
}
body.oqp-spec form.composite_form .oqp-spec-jump a.oqp-spec-chip:hover { border-color: #7c8a91; color: var(--oqp-ink); }
body.oqp-spec form.composite_form .oqp-spec-jump a.oqp-spec-chip[aria-current="true"] {
	background: var(--oqp-ink);
	border-color: var(--oqp-ink);
	color: #ffffff;
}

/* ---------- Every component: part of a card ---------- */
body.oqp-spec form.composite_form .composite_component {
	margin: 0 !important;
	box-sizing: border-box;
	background: #ffffff;
	border-left: 1px solid var(--oqp-card);
	border-right: 1px solid var(--oqp-card);
}

/* ---------- Section header (category pseudo-component) ---------- */
body.oqp-spec form.composite_form .composite_component.is-component-category {
	display: flex !important;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 12px;
	margin-top: 20px !important;
	padding: 18px 20px !important;
	background: var(--oqp-head);
	border-top: 1px solid var(--oqp-card);
	border-bottom: 1px solid #e3e8ea;
	border-radius: 6px 6px 0 0;
	scroll-margin-top: 90px;
}
body.oqp-spec form.composite_form .oqp-spec-jump + .composite_component.is-component-category,
body.oqp-spec form.composite_form > .composite_component.is-component-category:first-child {
	margin-top: 0 !important;
}
body.oqp-spec form.composite_form .is-component-category h4.apollin_component_category_title {
	width: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: none !important;
	box-shadow: none !important;
	font-size: 20px !important;
	font-weight: 500 !important;
	line-height: 1.3 !important;
	letter-spacing: 0 !important;
	text-align: left !important;
	text-transform: lowercase !important;
	color: var(--oqp-ink) !important;
}
body.oqp-spec form.composite_form .is-component-category h4.apollin_component_category_title::first-letter { text-transform: uppercase; }
body.oqp-spec form.composite_form .oqp-spec-meta { font-size: 13px; line-height: 1.4; color: var(--oqp-muted); }

/* ---------- Rows: label left, choice right ---------- */
body.oqp-spec form.composite_form .composite_component:not(.is-component-category) {
	display: flex !important;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 18px;
	padding: 14px 20px !important;
	border-top: 1px solid var(--oqp-row);
}
body.oqp-spec form.composite_form .is-component-category + .composite_component { border-top: 0; }

/* Last row of a section closes the card. */
body.oqp-spec form.composite_form .composite_component:not(.is-component-category):has(+ .is-component-category),
body.oqp-spec form.composite_form .composite_component.last:not(.is-component-category) {
	border-bottom: 1px solid var(--oqp-card);
	border-radius: 0 0 6px 6px;
}

/* Label column */
body.oqp-spec form.composite_form .composite_component .component_title_wrapper {
	flex: 0 1 140px;
	min-width: 120px;
	margin: 0 !important;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
}
body.oqp-spec form.composite_form .composite_component h2.component_title {
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	font-size: 15px !important;
	font-weight: 500 !important;
	line-height: 1.35 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	text-align: left !important;
	color: var(--oqp-ink) !important;
}
body.oqp-spec form.composite_form .composite_component h2.component_title img {
	width: 14px !important;
	height: 14px !important;
	margin-left: 4px;
	vertical-align: -2px;
}
body.oqp-spec form.composite_form button.oqp-photos-link {
	min-height: 24px;
	margin: 0;
	padding: 2px 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: #0073a8;
	font-family: inherit;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	text-decoration: underline;
	cursor: pointer;
}
body.oqp-spec form.composite_form button.oqp-photos-link:hover { color: #005a84; background: none; }
/* Shown only when the selected option has photos. */
body.oqp-spec form.composite_form .composite_component:not(:has(.gallery-product a)) .oqp-photos-link { display: none; }

/* Choice column */
body.oqp-spec form.composite_form .composite_component .component_inner {
	flex: 1 1 320px;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
}
body.oqp-spec form.composite_form .composite_component .component_selections {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0 !important;
	padding: 0 !important;
}
body.oqp-spec form.composite_form .composite_component .component_section_title { display: none !important; }
body.oqp-spec form.composite_form .composite_component .component_options {
	flex: 1 1 260px;
	min-width: 0;
	margin: 0 !important;
}
body.oqp-spec form.composite_form .composite_component .component_options_inner,
body.oqp-spec form.composite_form .composite_component .component_options_select_wrapper { margin: 0 !important; padding: 0 !important; }
body.oqp-spec form.composite_form .composite_component .component_content {
	flex: 0 0 auto;
	margin: 0 !important;
	padding: 0 !important;
}
/* Component photos move behind "View photos". */
body.oqp-spec form.composite_form .composite_component .composited_product_images { display: none !important; }

body.oqp-spec form.composite_form select.component_options_select {
	width: 100% !important;
	max-width: 100% !important;
	height: 44px !important;
	box-sizing: border-box !important;
	margin: 0 !important;
	padding: 0 10px !important;
	border: 1px solid var(--oqp-field) !important;
	border-radius: 4px !important;
	background-color: #ffffff;
	font-family: inherit;
	font-size: 15px !important;
	line-height: 1.2 !important;
	color: var(--oqp-ink);
}

/* Fixed parts: the name, then an "Included" tag. */
body.oqp-spec form.composite_form .composite_component.static .component_options_select_wrapper {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
body.oqp-spec form.composite_form .composite_component.static .component_options_select_wrapper h6 {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 15px !important;
	font-weight: 400 !important;
	line-height: 1.4 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	color: var(--oqp-text) !important;
}
body.oqp-spec form.composite_form .composite_component.static .component_options_select_wrapper::after {
	content: "Included";
	flex: none;
	padding: 4px 10px 4px 26px;
	border-radius: 999px;
	background: #eef6ef no-repeat 9px center / 12px 12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232c6a37' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
	color: #2c6a37;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.3;
}

/* Component quantity (e.g. several monitors): −/+ stepper beside the choice. */
body.oqp-spec form.composite_form .composite_component .component_content .quantity_button,
body.oqp-spec form.composite_form .composite_component .component_content .quantity {
	display: flex;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
}
body.oqp-spec form.composite_form .oqp-cstep {
	display: flex;
	align-items: center;
	height: 44px;
	box-sizing: border-box;
	border: 1px solid var(--oqp-field);
	border-radius: 4px;
	background: #ffffff;
}
body.oqp-spec form.composite_form .oqp-cstep button.oqp-cstep-btn {
	width: 44px;
	height: 42px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: transparent;
	color: var(--oqp-text);
	font-family: inherit;
	font-size: 18px;
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
}
body.oqp-spec form.composite_form .oqp-cstep button.oqp-cstep-btn:hover { background: #f3f6f7; color: var(--oqp-text); }
body.oqp-spec form.composite_form .oqp-cstep input.qty {
	width: 34px !important;
	height: 42px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
	text-align: center;
	font-family: inherit;
	font-size: 15px !important;
	color: var(--oqp-text);
	-moz-appearance: textfield;
	appearance: textfield;
}
body.oqp-spec form.composite_form .oqp-cstep input.qty::-webkit-outer-spin-button,
body.oqp-spec form.composite_form .oqp-cstep input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Screen-reader label on component quantity fields stays visually hidden. */
body.oqp-spec form.composite_form .composite_component .component_content .quantity label {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
}

/* Room between the last card and the price / Add to cart block. */
body.oqp-spec form.composite_form .composite_data { margin-top: 20px; }

/* Narrow options column (half-width window, tablet, phone): label above the choice, so long option
   names are not cut short. */
@container oqp-config (max-width: 600px) {
	body.oqp-spec form.composite_form .composite_component .component_title_wrapper {
		flex: 1 1 100%;
		min-width: 0;
		flex-direction: row;
		align-items: baseline;
		justify-content: space-between;
		gap: 12px;
	}
	body.oqp-spec form.composite_form .composite_component .component_inner { flex: 1 1 100%; }
}

/* ---------- Phones ---------- */
@media (max-width: 767px) {
	body.oqp-spec form.composite_form .oqp-spec-jump {
		flex-wrap: nowrap;
		overflow-x: auto;
		margin-right: -16px;
		padding-right: 16px;
		scrollbar-width: none;
	}
	body.oqp-spec form.composite_form .composite_component.is-component-category { padding: 14px 16px !important; }
	body.oqp-spec form.composite_form .composite_component:not(.is-component-category) { padding: 12px 16px !important; }
}
