/* Gitz Product Options — frontend
   Scoped to .gpo-wrap; resets the few properties themes (UiCore / Elementor kits) like to restyle. */

.gpo-wrap {
	--gpo-accent: #005c53;
	--gpo-accent-soft: rgba(0, 92, 83, 0.08);
	--gpo-text: inherit;
	--gpo-muted: rgba(0, 0, 0, 0.56);
	--gpo-border: rgba(0, 0, 0, 0.14);
	--gpo-surface: #fff;
	--gpo-error: #c62828;
	--gpo-radius: 14px;
	--gpo-radius-sm: 10px;

	box-sizing: border-box;
	display: grid;
	gap: 14px;
	flex: 0 0 100%;
	width: 100%;
	max-width: 100%;
	margin: 6px 0 20px;
	clear: both;
	font-size: 15px;
	line-height: 1.4;
	color: var(--gpo-text);
	text-align: left;
}

@supports (background: color-mix(in srgb, red 10%, white)) {
	.gpo-wrap {
		--gpo-accent-soft: color-mix(in srgb, var(--gpo-accent) 9%, transparent);
	}
}

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

/* Let flex-based add-to-cart forms wrap our block onto its own row. */
form.cart:has(> .gpo-wrap),
.woocommerce-variation-add-to-cart:has(> .gpo-wrap) {
	flex-wrap: wrap;
}

/* ------------------------------------------------------------------ Group card */

.gpo-wrap .gpo-group {
	position: relative;
	padding: 16px;
	border: 1px solid var(--gpo-border);
	border-radius: var(--gpo-radius);
	background: var(--gpo-surface);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gpo-wrap .gpo-group.has-error {
	border-color: var(--gpo-error);
	box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
}

.gpo-wrap .gpo-group__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 12px;
	margin: 0 0 12px;
}

.gpo-wrap .gpo-group__title {
	font-weight: 700;
	font-size: 16px;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
}

.gpo-wrap .gpo-group__meta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--gpo-muted);
}

.gpo-wrap .gpo-group__hint:empty {
	display: none;
}

.gpo-wrap .gpo-badge {
	display: inline-block;
	padding: 3px 9px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.05);
	font-size: 11px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--gpo-muted);
}

.gpo-wrap .gpo-badge--required {
	background: var(--gpo-accent-soft);
	color: var(--gpo-accent);
}

.gpo-wrap .gpo-group__desc {
	margin: -4px 0 12px;
	font-size: 13px;
	color: var(--gpo-muted);
}

.gpo-wrap .gpo-group__error {
	margin: 10px 0 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--gpo-error);
}

.gpo-wrap [hidden] {
	display: none !important;
}

/* ------------------------------------------------------------ Radio / checkbox tiles */

.gpo-wrap .gpo-choices {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 8px;
}

.gpo-wrap .gpo-choice {
	position: relative;
	display: block;
	margin: 0;
	padding: 0;
	cursor: pointer;
	font-weight: inherit;
	-webkit-tap-highlight-color: transparent;
}

.gpo-wrap .gpo-choice input {
	position: absolute;
	top: 0;
	left: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.gpo-wrap .gpo-choice__box {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
	min-height: 52px;
	height: 100%;
	padding: 10px 12px 10px 42px;
	border: 1.5px solid var(--gpo-border);
	border-radius: var(--gpo-radius-sm);
	background: var(--gpo-surface);
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

/* Indicator: circle (radio) or rounded square (checkbox). */
.gpo-wrap .gpo-choice__box::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 14px;
	width: 18px;
	height: 18px;
	margin-top: -9px;
	border: 1.5px solid rgba(0, 0, 0, 0.32);
	border-radius: 50%;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.gpo-wrap .gpo-group--checkbox .gpo-choice__box::before {
	border-radius: 5px;
}

.gpo-wrap .gpo-choice__text {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
}

.gpo-wrap .gpo-choice__price {
	font-size: 13px;
	font-weight: 600;
	color: var(--gpo-accent);
}

.gpo-wrap .gpo-choice__price:empty {
	display: none;
}

.gpo-wrap .gpo-choice:hover .gpo-choice__box {
	border-color: rgba(0, 0, 0, 0.3);
}

.gpo-wrap .gpo-choice input:checked + .gpo-choice__box {
	border-color: var(--gpo-accent);
	background: var(--gpo-accent-soft);
}

.gpo-wrap .gpo-group--radio .gpo-choice input:checked + .gpo-choice__box::before {
	border-color: var(--gpo-accent);
	box-shadow: inset 0 0 0 4px #fff;
	background: var(--gpo-accent);
}

.gpo-wrap .gpo-group--checkbox .gpo-choice input:checked + .gpo-choice__box::before {
	border-color: var(--gpo-accent);
	background: var(--gpo-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.gpo-wrap .gpo-choice input:focus-visible + .gpo-choice__box {
	outline: 2px solid var(--gpo-accent);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ Dropdowns */

.gpo-wrap .gpo-select-list {
	display: grid;
	gap: 8px;
}

.gpo-wrap .gpo-select-row {
	display: flex;
	gap: 8px;
	align-items: stretch;
}

.gpo-wrap select.gpo-select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	height: 48px;
	margin: 0;
	padding: 0 42px 0 14px;
	border: 1.5px solid var(--gpo-border);
	border-radius: var(--gpo-radius-sm);
	background: var(--gpo-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23555' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E") right 14px center / 14px no-repeat;
	box-shadow: none;
	font: inherit;
	font-size: 15px;
	line-height: normal;
	color: inherit;
	cursor: pointer;
	transition: border-color 0.15s ease;
}

.gpo-wrap select.gpo-select:hover {
	border-color: rgba(0, 0, 0, 0.3);
}

.gpo-wrap select.gpo-select:focus {
	outline: none;
	border-color: var(--gpo-accent);
	box-shadow: 0 0 0 3px var(--gpo-accent-soft);
}

/* Themes (UiCore, Elementor kits, Twenty Twenty-One…) style every <button> with very
   specific selectors, so the few visual properties of our two small buttons are locked. */
.gpo-wrap .gpo-row-remove,
.gpo-wrap .gpo-add {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	box-shadow: none !important;
	font-family: inherit;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-decoration: none !important;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.gpo-wrap .gpo-row-remove {
	flex: 0 0 48px;
	width: 48px !important;
	height: 48px !important;
	min-height: 0 !important;
	padding: 0 !important;
	border: 1.5px solid var(--gpo-border) !important;
	border-radius: var(--gpo-radius-sm) !important;
	background: var(--gpo-surface) !important;
	font-size: 22px !important;
	line-height: 1 !important;
	color: var(--gpo-muted) !important;
}

.gpo-wrap .gpo-row-remove:hover,
.gpo-wrap .gpo-row-remove:focus-visible {
	border-color: var(--gpo-error) !important;
	color: var(--gpo-error) !important;
	background: var(--gpo-surface) !important;
}

.gpo-wrap .gpo-add {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	width: auto !important;
	min-height: 0 !important;
	margin-top: 10px;
	padding: 8px 14px !important;
	border: 1.5px dashed var(--gpo-border) !important;
	border-radius: 999px !important;
	background: transparent !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	color: var(--gpo-accent) !important;
}

.gpo-wrap .gpo-add:hover,
.gpo-wrap .gpo-add:focus-visible {
	border-color: var(--gpo-accent) !important;
	background: var(--gpo-accent-soft) !important;
	color: var(--gpo-accent) !important;
}

.gpo-wrap .gpo-add span {
	font-size: 17px;
	line-height: 1;
}

/* ------------------------------------------------------------------ Summary */

.gpo-wrap .gpo-summary {
	display: grid;
	gap: 6px;
	padding: 14px 16px;
	border-radius: var(--gpo-radius);
	background: var(--gpo-accent-soft);
}

.gpo-wrap .gpo-summary__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	font-size: 14px;
	color: var(--gpo-muted);
}

.gpo-wrap .gpo-summary__row strong {
	font-weight: 700;
	color: var(--gpo-accent);
	font-variant-numeric: tabular-nums;
}

.gpo-wrap .gpo-summary__row--total {
	padding-top: 6px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	font-size: 16px;
	color: inherit;
}

.gpo-wrap .gpo-summary__row--total strong {
	font-size: 20px;
}

/* ------------------------------------------------------------------ Small screens */

@media (max-width: 480px) {
	.gpo-wrap {
		gap: 12px;
	}

	.gpo-wrap .gpo-group {
		padding: 14px 12px;
	}

	.gpo-wrap .gpo-choices {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.gpo-wrap .gpo-choice__box {
		padding-left: 38px;
	}

	.gpo-wrap .gpo-choice__box::before {
		left: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gpo-wrap *,
	.gpo-wrap *::before {
		transition: none !important;
	}
}
