/**
 * Front-end styles for the Opgroengeluk keuzehulp (Stap 1–12).
 *
 * Brand tokens come from the client brand sheet:
 * green #003D32, cream #EEE8DF, ink #252525, muted #6B6B68.
 *
 * @package Opgroengeluk_Keuzehulp
 */

.ogk {
	--ogk-green: #003d32;
	--ogk-cream: #eee8df;
	--ogk-white: #ffffff;
	--ogk-ink: #252525;
	--ogk-muted: #6b6b68;
	--ogk-neutral: #f1f0eb;
	--ogk-radius: 24px;
	box-sizing: border-box;
	max-width: 960px;
	width: 100%;
	margin: 0 auto;
	padding: 28px 20px 56px;
	color: var(--ogk-ink);
	background: var(--ogk-white);
	font-family: Montserrat, "Avenir Next", Arial, sans-serif;
	container-type: inline-size;
	container-name: ogk;
}

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

.ogk__header {
	text-align: center;
	margin-bottom: 36px;
}

.ogk__brand {
	background: var(--ogk-green);
	border-radius: 28px;
	padding: 22px 20px;
	margin-bottom: 32px;
}

/*
 * Logo sits on the green brand bar. !important beats Elementor widget CSS
 * that otherwise shrinks or hides the image.
 */
.ogk__brand img.ogk__logo {
	display: block !important;
	height: 58px !important;
	width: auto !important;
	max-width: 88% !important;
	margin: 0 auto;
	opacity: 1 !important;
}

.ogk__kicker {
	margin: 0 0 10px;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--ogk-green);
}

.ogk__progress {
	margin: 0 0 18px;
}

.ogk__progress-track {
	display: block;
	height: 4px;
	margin: 0 auto 14px;
	max-width: 220px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--ogk-cream);
}

.ogk__progress-bar {
	display: block;
	width: 8%;
	height: 100%;
	background: var(--ogk-green);
	transition: width 0.25s ease;
}

.ogk__title {
	margin: 0 0 12px;
	font-size: clamp(1.7rem, 4.4vw, 2.5rem);
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1.2;
	color: var(--ogk-ink);
}

.ogk__lead {
	margin: 0 auto;
	max-width: 36rem;
	color: var(--ogk-muted);
	line-height: 1.6;
	font-size: 0.98rem;
	font-weight: 400;
}

.ogk__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}

/*
 * Cards are <button> elements. WoodMart/Elementor set `button { display:flex }`
 * which lays photo, thumbs and text in a row. Force a stacked card.
 */
.ogk button.ogk__card {
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
	justify-content: flex-start !important;
	gap: 0 !important;
	width: 100% !important;
	max-width: none !important;
	height: auto !important;
	margin: 0;
	padding: 0 !important;
	overflow: hidden;
	border: 1px solid transparent;
	border-radius: var(--ogk-radius);
	background: var(--ogk-neutral);
	color: inherit;
	text-align: left;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	line-height: inherit;
	touch-action: manipulation;
}

.ogk button.ogk__card:hover,
.ogk button.ogk__card.is-selected {
	border-color: var(--ogk-green);
	background: var(--ogk-white);
}

.ogk__card.is-selected {
	box-shadow: 0 0 0 2px var(--ogk-green);
}

.ogk__photo {
	display: block;
	width: 100% !important;
	flex: 0 0 auto;
	min-width: 0;
	height: 210px;
	overflow: hidden;
	background: var(--ogk-cream);
}

/*
 * Real <img> tags survive Elementor/WoodMart sanitizing and lazy-load CSS.
 * Inline background-image on empty spans is stripped on this staging site.
 */
.ogk img.ogk__photo-img,
.ogk img.ogk__thumb-img,
.ogk img.ogk__logo {
	opacity: 1 !important;
	visibility: visible !important;
	max-width: none !important;
}

.ogk img.ogk__photo-img {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	object-position: center center;
}

.ogk__thumbs {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	align-items: stretch;
	width: 100%;
	gap: 8px;
	padding: 12px 12px 0;
}

.ogk__thumb {
	flex: 1;
	height: 46px;
	overflow: hidden;
	border-radius: 12px;
	background: var(--ogk-cream);
	opacity: 0.5;
}

.ogk img.ogk__thumb-img {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
}

.ogk__thumb.is-active {
	opacity: 1;
	box-shadow: inset 0 0 0 2px var(--ogk-green);
}

.ogk__plain-media {
	display: grid;
	place-items: center;
	min-height: 180px;
	background: var(--ogk-cream);
}

.ogk__plain-media img {
	width: 108px;
	height: 108px;
	object-fit: contain;
}

.ogk__body {
	display: grid;
	width: 100%;
	min-width: 0;
	gap: 6px;
	padding: 18px 20px 22px;
}

.ogk__body strong {
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--ogk-ink);
}

.ogk__body span {
	color: var(--ogk-muted);
	font-size: 0.92rem;
	line-height: 1.5;
}

.ogk__grid[hidden],
.ogk__done[hidden] {
	display: none !important;
}

.ogk__notice {
	padding: 16px 18px;
	margin: 0 0 18px;
	border-radius: 18px;
	background: var(--ogk-cream);
	color: var(--ogk-ink);
	line-height: 1.5;
}

.ogk__footer {
	display: grid;
	gap: 12px;
	margin-top: 28px;
}

.ogk__cta,
.ogk__ghost {
	width: 100%;
	border-radius: 999px;
	padding: 16px 22px;
	font-family: inherit;
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
}

.ogk__cta {
	border: 0;
	background: var(--ogk-green);
	color: var(--ogk-cream);
}

.ogk__cta:hover {
	filter: brightness(1.08);
}

.ogk__cta:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.ogk__ghost {
	border: 1px solid var(--ogk-green);
	background: transparent;
	color: var(--ogk-green);
}

.ogk__ghost[hidden],
.ogk__cta[hidden] {
	display: none !important;
}

.ogk__footer:has(.ogk__cta[hidden]) .ogk__ghost {
	width: 100%;
}

.ogk__picked {
	min-height: 1.4em;
	margin: 14px 0 0;
	text-align: center;
	color: var(--ogk-green);
	font-size: 0.92rem;
	font-weight: 500;
}

@media (min-width: 720px) {
	.ogk {
		padding: 40px 28px 72px;
	}

	.ogk__footer:not(:has(.ogk__ghost[hidden])):not(:has(.ogk__cta[hidden])) {
		grid-template-columns: 160px 1fr;
	}
}

/*
 * Two columns when the widget itself is wide enough — not the viewport.
 * The staging page has a sidebar, so a 720px screen query was too early.
 */
@container ogk (min-width: 760px) {
	.ogk__grid {
		grid-template-columns: 1fr 1fr;
	}

	.ogk__card--plain {
		grid-column: 1 / -1;
	}

	.ogk__photo {
		height: 240px;
	}

	.ogk__choices,
	.ogk__packages {
		grid-template-columns: 1fr 1fr;
	}

	.ogk__fields {
		grid-template-columns: 1fr 1fr;
	}
}

.ogk__screen {
	min-height: 8rem;
}

.ogk__sub {
	margin: 28px 0 12px;
	font-size: 1rem;
	font-weight: 600;
	color: var(--ogk-ink);
}

.ogk__choices,
.ogk__packages {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}

.ogk button.ogk__choice,
.ogk button.ogk__package {
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-start !important;
	justify-content: flex-start !important;
	gap: 6px !important;
	width: 100% !important;
	max-width: none !important;
	height: auto !important;
	margin: 0;
	padding: 16px 18px !important;
	border: 1px solid transparent;
	border-radius: 18px;
	background: var(--ogk-neutral);
	color: inherit;
	text-align: left;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	line-height: inherit;
	font-family: inherit;
	touch-action: manipulation;
}

.ogk button.ogk__choice:hover,
.ogk button.ogk__choice.is-selected,
.ogk button.ogk__package:hover,
.ogk button.ogk__package.is-selected {
	border-color: var(--ogk-green);
	background: var(--ogk-white);
}

.ogk button.ogk__choice.is-selected,
.ogk button.ogk__package.is-selected {
	box-shadow: 0 0 0 2px var(--ogk-green);
}

.ogk__choice strong,
.ogk__package strong {
	font-size: 1rem;
	font-weight: 600;
	color: var(--ogk-ink);
}

.ogk__choice span,
.ogk__package span {
	color: var(--ogk-muted);
	font-size: 0.9rem;
	line-height: 1.5;
}

.ogk__package b {
	font-size: 1.2rem;
	color: var(--ogk-green);
}

.ogk__package em {
	font-style: normal;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ogk-green);
}

.ogk__fields {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
	margin-bottom: 16px;
}

.ogk__fields label {
	display: grid;
	gap: 8px;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--ogk-ink);
}

.ogk__fields input[type="number"] {
	width: 100%;
	padding: 14px 16px;
	border: 1px solid #ddd;
	border-radius: 14px;
	font-family: inherit;
	font-size: 1rem;
}

.ogk__check {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 8px 0 18px;
	font-size: 0.95rem;
	color: var(--ogk-ink);
	cursor: pointer;
}

.ogk__advice {
	margin-top: 24px;
}

.ogk__table {
	width: 100%;
	border-collapse: collapse;
	margin: 12px 0 16px;
}

.ogk__table th,
.ogk__table td {
	padding: 12px 8px;
	border-bottom: 1px solid var(--ogk-cream);
	text-align: left;
	font-size: 0.92rem;
	vertical-align: middle;
}

.ogk__table th {
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ogk-muted);
}

.ogk__qty {
	white-space: nowrap;
}

.ogk__qty button {
	width: 32px;
	height: 32px;
	margin: 0 6px;
	border: 1px solid var(--ogk-green);
	border-radius: 999px;
	background: var(--ogk-white);
	color: var(--ogk-green);
	font-size: 1rem;
	cursor: pointer;
}

.ogk__meta {
	margin: 0;
	color: var(--ogk-muted);
	font-size: 0.88rem;
	line-height: 1.5;
}

/*
 * Homepage Elementor sits in a ~645px constrained column, so style cards
 * stack. Shop is 960px with two columns. Open the wrapper to that width.
 */
.entry-content.is-layout-constrained > .elementor:has(.ogk),
.wp-block-post-content.is-layout-constrained > .elementor:has(.ogk) {
	max-width: 960px !important;
	width: 100%;
}

.elementor:has(.ogk) .e-con,
.elementor:has(.ogk) .elementor-element,
.elementor:has(.ogk) .elementor-widget,
.elementor:has(.ogk) .elementor-widget-shortcode,
.elementor:has(.ogk) .elementor-shortcode {
	max-width: none !important;
	width: 100%;
	overflow: visible !important;
}

