/* GCL Pairings: "Completes the install" + "Other options" (product page) and the cart add-ons block. */
.gcl-pw {
	--pw-ink: var(--ink, #0F172A);
	--pw-soft: var(--ink-soft, #334155);
	--pw-muted: var(--muted, #64748B);
	--pw-line: var(--line, #E2E8F0);
	--pw-surface: var(--surface, #F8FAFC);
	--pw-accent: var(--accent, #15803D);
	--pw-accent-strong: var(--accent-strong, #166534);
	--pw-accent-tint: var(--accent-tint, #F0FDF4);
	--pw-caution: var(--caution, #B45309);
	--pw-caution-tint: var(--caution-tint, #FFFBEB);
	--pw-r: var(--r-panel, 16px);
	--pw-rc: var(--r-control, 12px);
}
.gcl-pw *, .gcl-pw *::before, .gcl-pw *::after { box-sizing: border-box; }
.gcl-pw ul { margin: 0; padding: 0; list-style: none; }
.gcl-pw p { margin: 0; }

.gcl-pair-group + .gcl-pair-group { margin-top: 32px; }
.gcl-pair-group__label {
	display: inline-flex; align-items: center; gap: 8px; margin: 0 0 8px !important;
	font-size: 13px !important; line-height: 1.2 !important; font-weight: 700; letter-spacing: .04em; text-transform: uppercase !important;
	color: var(--pw-muted);
}
.gcl-pair-group--required .gcl-pair-group__label { color: var(--pw-accent-strong); }
.gcl-pair-group--check .gcl-pair-group__label { color: var(--pw-caution); }
.gcl-pair-group__intro { max-width: 68ch; margin-bottom: 16px !important; color: var(--pw-soft); font-size: 15px; line-height: 1.6; }

.gcl-pairs { display: grid; gap: 10px; }
.gcl-pair {
	display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px 14px; align-items: start;
	padding: 14px; border: 1px solid var(--pw-line); border-radius: var(--pw-rc); background: #FFFFFF;
}
.gcl-pair-group--required .gcl-pair { border-left: 3px solid var(--pw-accent); }
.gcl-pair-group--check .gcl-pair { border-left: 3px solid var(--pw-caution); }
.gcl-pair__img { display: block; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--pw-surface); }
.gcl-pair__img img, .gcl-pair__thumb { display: block; width: 100%; height: 100%; object-fit: contain; }
.gcl-pair__body { min-width: 0; }
.gcl-pw a.gcl-pair__name {
	display: block; color: var(--pw-ink); font-weight: 600; font-size: 15px; line-height: 1.4; text-decoration: none;
	overflow-wrap: anywhere;
}
.gcl-pw a.gcl-pair__name:hover { color: var(--pw-accent); text-decoration: underline; }
.gcl-pair__why { margin-top: 4px !important; font-size: 14px; line-height: 1.55; color: var(--pw-soft); }
.gcl-pair__kit { margin-top: 8px !important; padding: 8px 10px; font-size: 13.5px; line-height: 1.5; color: var(--pw-soft); background: var(--pw-surface); border-radius: 8px; }
.gcl-pair__kit .amount { font-weight: 600; color: var(--pw-ink); }
.gcl-pair__buy { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gcl-pair__price { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; font-size: 16px; color: var(--pw-ink); white-space: nowrap; }
.gcl-pw a.gcl-pair__btn {
	display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
	border-radius: var(--pw-rc); background: var(--pw-accent); color: #FFFFFF; font-weight: 600; font-size: 15px;
	text-decoration: none; white-space: nowrap; transition: background-color .15s ease;
}
.gcl-pw a.gcl-pair__btn:hover { background: var(--pw-accent-strong); color: #FFFFFF; }
.gcl-pw a.gcl-pair__btn--ghost { background: transparent; color: var(--pw-accent); box-shadow: inset 0 0 0 1px var(--pw-line); }
.gcl-pw a.gcl-pair__btn--ghost:hover { background: var(--pw-accent-tint); color: var(--pw-accent-strong); }

/* WooCommerce AJAX add states + the "View cart" link it inserts after the button. */
.gcl-pw a.gcl-pair__btn.loading { opacity: .6; pointer-events: none; }
.gcl-pw a.gcl-pair__btn.added { background: var(--pw-accent-strong); }
.gcl-pw a.gcl-pair__btn.added::before { content: "\2713"; margin-right: 6px; font-weight: 700; }
.gcl-pair__buy { flex-wrap: wrap; }
.gcl-pw a.added_to_cart {
	display: inline-block; min-height: 0 !important; padding: 0 !important; margin: 0 !important; border: 0 !important; box-shadow: none !important;
	background: none !important; color: var(--pw-accent) !important; font-size: 14px !important; font-weight: 600; line-height: 1.4;
	text-decoration: underline; text-underline-offset: 3px; white-space: nowrap;
}
.gcl-pw a.added_to_cart:hover { color: var(--pw-accent-strong) !important; }
@media (max-width: 639px) { .gcl-pw a.added_to_cart { flex-basis: 100%; text-align: right; } }

.gcl-pairs-more { margin-top: 10px; }
.gcl-pairs-more > summary {
	display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; cursor: pointer; list-style: none;
	border: 1px solid var(--pw-line); border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--pw-ink); background: #FFFFFF;
}
.gcl-pairs-more > summary::-webkit-details-marker { display: none; }
.gcl-pairs-more > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.gcl-pairs-more[open] > summary { margin-bottom: 10px; }
.gcl-pairs-more[open] > summary::after { transform: translateY(2px) rotate(-135deg); }

.gcl-pair-note { margin-top: 24px !important; font-size: 14px; color: var(--pw-muted); max-width: 72ch; }

@media (min-width: 640px) {
	.gcl-pair { grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; }
	.gcl-pair__img { width: 72px; height: 72px; }
	.gcl-pair__buy { grid-column: auto; flex-direction: column; align-items: flex-end; gap: 8px; }
}
@media (min-width: 1100px) {
	.gcl-sec--add-ons .gcl-pairs, .gcl-sec--options .gcl-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Lower "Completes the install": a short linked list, buying happens in the buy box. */
.gcl-pair-links { display: grid; gap: 0; border-top: 1px solid var(--pw-line); }
.gcl-pair-links li { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--pw-line); }
.gcl-pw .gcl-pair-links a { color: var(--pw-ink); font-size: 15px; line-height: 1.45; font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.gcl-pw .gcl-pair-links a:hover { color: var(--pw-accent); text-decoration: underline; }
.gcl-pair-links__price { flex: none; font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; font-weight: 600; color: var(--pw-soft); white-space: nowrap; }
.gcl-sec--add-ons .gcl-pair-group + .gcl-pair-group { margin-top: 24px; }

/* Buy box add-on picker */
.gcl-addons { display: grid; gap: 12px; margin: 4px 0 18px; }
.gcl-addons__label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--pw-ink); }
.gcl-addons__hint { font-weight: 500; color: var(--pw-muted); }
.gcl-pick__field { position: relative; }
.gcl-pick__btn {
	all: unset; box-sizing: border-box; width: 100%; min-height: 56px; display: flex; align-items: center; gap: 12px;
	padding: 7px 14px 7px 8px; border: 1px solid var(--pw-line); border-radius: var(--pw-rc); background: #FFFFFF; cursor: pointer;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.gcl-pick__btn:hover { border-color: #94A3B8; }
.gcl-pick__btn:focus-visible { outline: 2px solid var(--pw-accent); outline-offset: 2px; }
.gcl-pick.has-choice .gcl-pick__btn { border-color: var(--pw-accent); box-shadow: inset 0 0 0 1px var(--pw-accent); background: var(--pw-accent-tint); }
.gcl-pick__thumb { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; overflow: hidden; background: var(--pw-surface); }
.gcl-pick__thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gcl-pick__thumb--none::before { content: ""; width: 14px; height: 2px; border-radius: 2px; background: #CBD5E1; }
.gcl-pick__val { flex: 1; min-width: 0; font-size: 15px; line-height: 1.35; font-weight: 600; color: var(--pw-ink); }
.gcl-pick__price { flex: none; font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; font-weight: 600; color: var(--pw-ink); white-space: nowrap; }
.gcl-pick__chev { flex: none; color: var(--pw-muted); transition: transform .15s ease; }
.gcl-pick.is-open .gcl-pick__chev { transform: rotate(180deg); }
.gcl-pw .gcl-pick__list {
	position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); max-height: min(380px, 60vh); overflow-y: auto;
	margin: 0; padding: 6px; list-style: none; background: #FFFFFF; border: 1px solid var(--pw-line); border-radius: var(--pw-rc);
	box-shadow: 0 16px 40px rgba(15, 23, 42, .16); overscroll-behavior: contain;
}
.gcl-pick__list:focus { outline: none; }
.gcl-pick__opt { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 10px 8px 8px; border-radius: 8px; cursor: pointer; }
.gcl-pick__opt:hover, .gcl-pick__opt.is-active { background: var(--pw-surface); }
.gcl-pick__opt:focus { outline: none; }
.gcl-pick__opt:focus-visible { outline: 2px solid var(--pw-accent); outline-offset: -2px; }
.gcl-pick__opt[aria-selected="true"] { background: var(--pw-accent-tint); box-shadow: inset 3px 0 0 var(--pw-accent); }
.gcl-pick__txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.gcl-pick__name { font-size: 14.5px; line-height: 1.35; font-weight: 600; color: var(--pw-ink); overflow-wrap: anywhere; }
.gcl-pick__why { font-size: 12.5px; line-height: 1.45; color: var(--pw-muted); }
.gcl-pw .gcl-pick__note { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--pw-soft); }
.gcl-pick__note:empty { display: none; }
.gcl-addons__opts { display: grid; gap: 8px; }
.gcl-addon {
	all: unset; box-sizing: border-box; width: 100%; min-height: 52px; display: flex; align-items: center; gap: 12px;
	padding: 5px 14px 5px 12px; border: 1px dashed #CBD5E1; border-radius: var(--pw-rc); background: #FFFFFF; cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease;
}
.gcl-addon:hover { border-color: #94A3B8; }
.gcl-addon:focus-visible { outline: 2px solid var(--pw-accent); outline-offset: 2px; }
.gcl-addon[aria-pressed="true"] { border-style: solid; border-color: var(--pw-accent); background: var(--pw-accent-tint); }
.gcl-addon__box { flex: none; width: 20px; height: 20px; border: 2px solid #94A3B8; border-radius: 6px; background: #FFFFFF center / 14px no-repeat; }
.gcl-addon[aria-pressed="true"] .gcl-addon__box {
	border-color: var(--pw-accent); background-color: var(--pw-accent);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
.gcl-addon__name { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.35; font-weight: 600; color: var(--pw-ink); }
.gcl-pw .gcl-addons__foot { font-size: 13px; line-height: 1.5; color: var(--pw-muted); }
.gcl-pw .gcl-addons__foot a { color: var(--pw-accent); }

/* Cart */
.gcl-pairs-cart { margin: 28px 0 8px; padding: clamp(16px, 3vw, 24px); border: 1px solid var(--pw-line); border-radius: var(--pw-r); background: var(--pw-surface); }
.gcl-pw .gcl-pairs-cart__title { margin: 0 0 4px !important; font-size: 20px; line-height: 1.25; color: var(--pw-ink); }
.gcl-pairs-cart__item + .gcl-pairs-cart__item { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--pw-line); }
.gcl-pairs-cart__for { margin-bottom: 14px !important; font-size: 14px; color: var(--pw-muted); }
.gcl-pairs-cart__for a { color: var(--pw-ink); font-weight: 600; }
.gcl-pairs-cart .gcl-pair-group + .gcl-pair-group { margin-top: 20px; }

@media (prefers-reduced-motion: reduce) {
	.gcl-pw a.gcl-pair__btn, .gcl-pick__btn, .gcl-pick__chev, .gcl-addon { transition: none; }
}

/* v1.2.0: desktop, nothing runs wider than it needs. Buy box add-ons hug their longest row; the lower list keeps name and price close, with groups side by side when there is room. */
@media (min-width: 1000px) {
	.gcl-addons { width: fit-content; min-width: min(100%, 520px); max-width: 100%; }
	.gcl-sec--add-ons { container-type: inline-size; }
	.gcl-sec--add-ons .gcl-pair-group { max-width: 680px; }
	@container (min-width: 800px) {
		.gcl-sec--add-ons > .gcl-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 680px)); justify-content: start; align-items: start; gap: 24px 56px; }
		.gcl-sec--add-ons > .gcl-wrap > .gcl-sec__title { grid-column: 1 / -1; margin-bottom: 12px !important; }
		.gcl-sec--add-ons > .gcl-wrap > .gcl-pair-note { grid-column: 1 / -1; margin-top: 0 !important; }
		.gcl-sec--add-ons .gcl-pair-group { min-width: 0; margin-top: 0 !important; }
		.gcl-sec--add-ons .gcl-pair-group:only-of-type { grid-column: 1 / -1; }
	}
}
