/**
 * Gunbangkok 2D product configurator.
 * Every selector is namespaced with .gbk-configurator / .gbk-hidden-native so
 * nothing here can collide with Blocksy, Elementor or Extra Product Options.
 */

.gbk-configurator {
	--gbk-c-ink: #111518;
	--gbk-c-muted: #6b7379;
	--gbk-c-line: #e2e6e9;
	--gbk-c-soft: #f6f7f8;
	--gbk-c-accent: var(--theme-palette-color-1, #ff6310);

	margin: 0 0 24px;
	padding: 0;
	font-size: 15px;
	color: var(--gbk-c-ink);
}

.gbk-configurator[hidden] {
	display: none !important;
}

.gbk-configurator__title {
	margin: 0 0 12px;
	font-size: 18px;
	line-height: 1.3;
	font-weight: 600;
}

/* ---------------------------------------------------------------- preview */

.gbk-configurator__preview {
	margin: 0 0 18px;
}

.gbk-configurator__stage {
	position: relative;
	width: 100%;
	max-width: 420px;
	margin: 0 auto;
	aspect-ratio: 3 / 4;
	background: var(--gbk-c-soft);
	border: 1px solid var(--gbk-c-line);
	border-radius: 3px;
	overflow: hidden;
	touch-action: manipulation;
}

@supports not (aspect-ratio: 3 / 4) {
	.gbk-configurator__stage {
		height: 0;
		padding-bottom: 133%;
	}
}

.gbk-configurator__svg {
	display: block;
	width: 100%;
	height: 100%;
	transition: opacity .18s ease;
}

/* image mode: the photo the shop uploaded for this combination */
.gbk-configurator__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: var(--gbk-c-soft);
	transition: opacity .18s ease;
}

.gbk-configurator.is-loading .gbk-configurator__image,
.gbk-configurator.is-error .gbk-configurator__image {
	opacity: .35;
}

/* left-hand carry = the same holster mirrored */
.gbk-configurator__image.is-mirrored {
	transform: scaleX(-1);
}

.gbk-configurator.is-loading .gbk-configurator__svg,
.gbk-configurator.is-error .gbk-configurator__svg {
	opacity: .35;
}

/* Colours driven from JS via CSS custom properties on the <svg>. */
.gbk-configurator__svg .gbk-fill-kydex {
	fill: var(--gbk-kydex, #8d949b);
}

.gbk-configurator__svg .gbk-edge {
	fill: none;
	stroke: var(--gbk-kydex-shade, #444);
	stroke-width: 3;
	stroke-linejoin: round;
	opacity: .75;
}

.gbk-configurator__svg .gbk-edge--soft {
	stroke-width: 2;
	opacity: .35;
}

.gbk-configurator__svg .gbk-fill-hardware {
	fill: var(--gbk-hardware, #b9bec4);
}

.gbk-configurator__svg .gbk-fill-clip {
	fill: var(--gbk-clip, #2b2f33);
}

.gbk-configurator__svg .gbk-fill-modwing {
	fill: var(--gbk-modwing, #2b2f33);
}

.gbk-configurator__svg .gbk-fill-lining {
	fill: #6b4a2f;
	opacity: .85;
}

.gbk-configurator__svg .gbk-eyelet-hole {
	fill: #0d1114;
	opacity: .55;
}

.gbk-configurator__svg .gbk-part-shadow {
	fill: #000;
	opacity: .22;
}

.gbk-configurator__svg .gbk-slot {
	fill: #0d1114;
	opacity: .55;
}

/* loading / error overlay */

.gbk-configurator__state {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: rgba(255, 255, 255, .72);
	font-size: 14px;
	color: var(--gbk-c-muted);
	text-align: center;
	padding: 12px;
}

.gbk-configurator__state[hidden] {
	display: none;
}

.gbk-configurator__spinner {
	width: 22px;
	height: 22px;
	border: 2px solid var(--gbk-c-line);
	border-top-color: var(--gbk-c-accent);
	border-radius: 50%;
	animation: gbk-spin .8s linear infinite;
}

.gbk-configurator.is-error .gbk-configurator__spinner,
.gbk-configurator.is-hint .gbk-configurator__spinner {
	display: none;
}

.gbk-configurator.is-hint .gbk-configurator__svg {
	opacity: .25;
}

@keyframes gbk-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.gbk-configurator__spinner { animation: none; }
	.gbk-configurator__svg { transition: none; }
}

.gbk-configurator__retry {
	border: 1px solid var(--gbk-c-line);
	background: #fff;
	border-radius: 3px;
	min-height: 36px;
	padding: 0 14px;
	cursor: pointer;
	font: inherit;
}

/* view switch */

.gbk-configurator__views {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin: 12px 0 6px;
}

.gbk-configurator__view {
	min-height: 40px;
	padding: 0 18px;
	border: 1px solid var(--gbk-c-line);
	background: #fff;
	border-radius: 3px;
	font: inherit;
	line-height: 1;
	cursor: pointer;
	color: var(--gbk-c-ink);
}

.gbk-configurator__view[aria-pressed="true"] {
	background: var(--gbk-c-ink);
	border-color: var(--gbk-c-ink);
	color: #fff;
}

.gbk-configurator__note {
	margin: 0;
	text-align: center;
	font-size: 12px;
	color: var(--gbk-c-muted);
}

/* --------------------------------------------------------------- controls */

.gbk-configurator__group {
	margin: 0 0 16px;
}

.gbk-configurator__group[hidden] {
	display: none;
}

.gbk-configurator__group-head {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin: 0 0 8px;
}

.gbk-configurator__group-label {
	font-weight: 600;
	font-size: 14px;
}

.gbk-configurator__group-value {
	font-size: 13px;
	color: var(--gbk-c-muted);
}

.gbk-configurator__choices {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.gbk-configurator__choice {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--gbk-c-line);
	border-radius: 3px;
	background: #fff;
	font: inherit;
	font-size: 14px;
	line-height: 1.2;
	color: var(--gbk-c-ink);
	cursor: pointer;
	touch-action: manipulation;
}

.gbk-configurator__choice.is-selected {
	border-color: var(--gbk-c-ink);
	box-shadow: inset 0 0 0 1px var(--gbk-c-ink);
	font-weight: 600;
}

.gbk-configurator__choice:disabled {
	opacity: .38;
	cursor: not-allowed;
}

.gbk-configurator__choice:focus-visible {
	outline: 2px solid var(--gbk-c-accent);
	outline-offset: 2px;
}

.gbk-configurator__choice--swatch {
	padding-left: 10px;
}

.gbk-configurator__swatch {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, .18);
	flex: 0 0 auto;
}

.gbk-configurator__swatch.is-pattern {
	background-size: 12px 12px !important;
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
}

.gbk-configurator__select {
	min-height: 44px;
	width: 100%;
	max-width: 320px;
	padding: 0 10px;
	border: 1px solid var(--gbk-c-line);
	border-radius: 3px;
	background: #fff;
	font: inherit;
}

.gbk-configurator__group-note {
	margin: 6px 0 0;
	font-size: 12px;
	color: var(--gbk-c-muted);
}

/* ---------------------------------------------------------------- summary */

.gbk-configurator__summary {
	border: 1px solid var(--gbk-c-line);
	border-radius: 3px;
	padding: 12px 14px;
	background: var(--gbk-c-soft);
}

.gbk-configurator__summary[hidden] {
	display: none;
}

.gbk-configurator__summary-title {
	margin: 0 0 8px;
	font-size: 14px;
	font-weight: 600;
}

.gbk-configurator__summary dl {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 4px 12px;
	margin: 0;
	font-size: 13px;
}

.gbk-configurator__summary dt {
	margin: 0;
	color: var(--gbk-c-muted);
}

.gbk-configurator__summary dd {
	margin: 0;
	text-align: right;
	font-weight: 500;
}

.gbk-configurator__price {
	margin: 10px 0 0;
	padding-top: 10px;
	border-top: 1px solid var(--gbk-c-line);
	font-size: 15px;
	font-weight: 600;
}

.gbk-configurator__price[hidden] {
	display: none;
}

/* ------------------------------- preview in the product image column ---- */

.gbk-configurator--gallery {
	margin: 0;
}

.gbk-configurator--gallery .gbk-configurator__preview {
	margin: 0;
}

.gbk-configurator--gallery .gbk-configurator__stage {
	max-width: 100%;
	aspect-ratio: 4 / 5;
	background: var(--gbk-c-soft);
}

@supports not (aspect-ratio: 4 / 5) {
	.gbk-configurator--gallery .gbk-configurator__stage {
		height: 0;
		padding-bottom: 125%;
	}
}

@media (max-width: 767px) {
	.gbk-configurator--gallery .gbk-configurator__stage {
		aspect-ratio: 3 / 4;
	}
}

/* the preview sits inside the gallery box and replaces its content */
.gbk-gallery-replaced > *:not(.gbk-configurator) {
	display: none !important;
}

/* when the real photo gallery is kept below the preview */
.gbk-configurator--with-gallery {
	margin-bottom: 14px;
}

/* the theme's gallery / native rows the configurator replaces */

.gbk-hidden-native {
	display: none !important;
}

/* ------------------------------------------------------------ desktop up */

@media (min-width: 768px) {
	.gbk-configurator__stage {
		max-width: 100%;
	}

	.gbk-configurator__title {
		font-size: 20px;
	}
}

/* ------------------------------------------------- save / share the look */

.gbk-configurator__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0 0 8px;
}

.gbk-configurator__action {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 0 16px;
	border: 1px solid var(--gbk-c-line);
	border-radius: 3px;
	background: #fff;
	color: var(--gbk-c-ink);
	font: inherit;
	line-height: 1;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}

.gbk-configurator__action:hover,
.gbk-configurator__action:focus-visible {
	background: var(--gbk-c-soft);
	border-color: var(--gbk-c-ink);
}

.gbk-configurator__action span {
	font-size: 15px;
	line-height: 1;
}

.gbk-configurator__action-msg {
	flex-basis: 100%;
	text-align: center;
	font-size: 12px;
	color: var(--gbk-c-muted);
	min-height: 16px;
}

@media (max-width: 480px) {
	.gbk-configurator__action {
		flex: 1 1 auto;
		justify-content: center;
	}
}

/* ------------------------------------ keep the preview in sight on scroll */

/*
 * Desktop: the image column stays where it is while the options column
 * scrolls. The theme lays the two columns out as flex items, so sticky works
 * on the gallery box itself; the top offset clears the theme's sticky header
 * (measured in JS as --gbk-header-bottom).
 */
.gbk-gallery-replaced.gbk-gallery-pinned {
	position: sticky;
	top: calc(var(--gbk-header-bottom, 0px) + 16px);
	align-self: flex-start;
	z-index: 2;
}

/* never taller than the screen, or the bottom of the picture is unreachable */
.gbk-gallery-pinned .gbk-configurator__stage {
	max-height: var(--gbk-stage-max, calc(100vh - var(--gbk-header-bottom, 0px) - 180px));
	min-height: 280px;
}

/*
 * Phone: the picture sits above the options. Once it has scrolled away a
 * small copy floats in the top-right corner so every colour change is seen
 * immediately; tapping it scrolls back to the full preview.
 */
.gbk-mini {
	position: fixed;
	top: calc(var(--gbk-header-bottom, 0px) + 8px);
	right: 8px;
	z-index: 9990;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: clamp(104px, 36vw, 160px);
	margin: 0;
	padding: 4px 4px 0;
	border: 1px solid #e2e6e9;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 6px 20px rgba(17, 21, 24, .18);
	color: #111518;
	font: inherit;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	animation: gbk-mini-in .18s ease-out;
}

.gbk-mini[hidden] {
	display: none !important;
}

.gbk-mini__img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background: #fff;
	border-radius: 4px;
	transition: opacity .18s ease;
}

.gbk-mini__img[hidden] {
	visibility: hidden;
	display: block !important;
}

.gbk-mini__img.is-mirrored {
	transform: scaleX(-1);
}

.gbk-mini__label {
	display: block;
	padding: 4px 0 5px;
	font-size: 11px;
	line-height: 1.2;
	text-align: center;
	color: #6b7379;
}

.gbk-mini__spinner {
	display: none;
	position: absolute;
	top: calc(50% - 22px);
	left: calc(50% - 12px);
	width: 24px;
	height: 24px;
	border: 2px solid #e2e6e9;
	border-top-color: var(--theme-palette-color-1, #ff6310);
	border-radius: 50%;
	animation: gbk-spin .8s linear infinite;
}

.gbk-mini.is-loading .gbk-mini__spinner {
	display: block;
}

.gbk-mini.is-loading .gbk-mini__img {
	opacity: .35;
}

.gbk-mini.is-updated {
	animation: gbk-mini-pulse .7s ease-out;
}

@keyframes gbk-mini-in {
	from { opacity: 0; transform: translateY(-6px); }
	to { opacity: 1; transform: none; }
}

@keyframes gbk-mini-pulse {
	0% { box-shadow: 0 0 0 0 rgba(255, 99, 16, .55), 0 6px 20px rgba(17, 21, 24, .18); }
	100% { box-shadow: 0 0 0 10px rgba(255, 99, 16, 0), 0 6px 20px rgba(17, 21, 24, .18); }
}

@media (prefers-reduced-motion: reduce) {
	.gbk-mini,
	.gbk-mini.is-updated { animation: none; }
	.gbk-mini__spinner { animation: none; }
}

@media print {
	.gbk-mini { display: none !important; }
}

/* ------------------------------- save / share as icons on the picture ---- */

/*
 * Standard pattern for a product image: the actions sit in the top-right
 * corner of the picture itself, as icons, instead of a row of labelled
 * buttons underneath.
 */
.gbk-configurator__tools {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	display: flex;
	gap: 8px;
}

.gbk-configurator__tools[hidden] {
	display: none !important;
}

.gbk-configurator__tool {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid rgba(17, 21, 24, .08);
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	color: var(--gbk-c-ink);
	box-shadow: 0 2px 8px rgba(17, 21, 24, .16);
	cursor: pointer;
	transition: background .15s ease, transform .15s ease, color .15s ease;
	-webkit-tap-highlight-color: transparent;
}

.gbk-configurator__tool:hover,
.gbk-configurator__tool:focus-visible {
	background: #fff;
	color: var(--gbk-c-accent);
	transform: translateY(-1px);
}

.gbk-configurator__tool:active {
	transform: none;
}

.gbk-configurator__tool svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* the little "saved / link copied" line, over the bottom of the picture */
.gbk-configurator__stage .gbk-configurator__action-msg {
	position: absolute;
	left: 50%;
	bottom: 10px;
	transform: translateX(-50%);
	max-width: 90%;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(17, 21, 24, .82);
	color: #fff;
	font-size: 12px;
	line-height: 1.4;
	text-align: center;
	pointer-events: none;
}

.gbk-configurator__stage .gbk-configurator__action-msg:empty {
	display: none;
}

/* the picture invites a click */
.gbk-configurator__image {
	cursor: zoom-in;
}

.gbk-configurator__note {
	margin: 10px 0 0;
	font-size: 12px;
	line-height: 1.5;
	color: var(--gbk-c-muted);
	text-align: center;
}

@media (max-width: 480px) {
	.gbk-configurator__tool {
		width: 34px;
		height: 34px;
	}

	.gbk-configurator__tool svg {
		width: 18px;
		height: 18px;
	}
}

/* ------------------------------------------- full screen view of the image */

.gbk-zoom {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(17, 21, 24, .92);
	cursor: zoom-out;
	animation: gbk-zoom-in .15s ease-out;
}

.gbk-zoom[hidden] {
	display: none !important;
}

.gbk-zoom__img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 4px;
	background: #fff;
	cursor: default;
}

.gbk-zoom__img.is-mirrored {
	transform: scaleX(-1);
}

.gbk-zoom__close {
	position: absolute;
	top: 16px;
	right: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	cursor: pointer;
	transition: background .15s ease;
}

.gbk-zoom__close:hover,
.gbk-zoom__close:focus-visible {
	background: rgba(255, 255, 255, .28);
}

.gbk-zoom__close svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

/* the page behind must not scroll while the picture is open */
html.gbk-zoom-open,
html.gbk-zoom-open body {
	overflow: hidden !important;
}

@keyframes gbk-zoom-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.gbk-zoom { animation: none; }
	.gbk-configurator__tool { transition: none; }
}
