/* Force the cart form to wrap when our section is present,
   so quantity + button appear below (not beside) the customizations. */
#qodef-woo-page.qodef--single form.cart:not(.variations_form):has(.vergoo-customizations) {
	flex-wrap: wrap;
}

.vergoo-customizations {
	border-top: 1px solid #000;
	flex: 0 0 100%;
	margin: 0 0 24px;
	padding: 16px 0 0;
}

.vergoo-customizations__summary {
	display: grid;
	gap: 4px;
	margin-bottom: 14px;
}

.vergoo-customizations__summary strong {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	line-height: 1.3;
	text-transform: uppercase;
}

.vergoo-customizations__summary span,
.vergoo-customizations__total {
	color: #4b5563;
	font-size: 13px;
	line-height: 1.4;
}

.vergoo-customizations__items {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.vergoo-customization-card {
	align-items: flex-start;
	cursor: pointer;
	display: grid;
	gap: 10px;
	grid-template-columns: 20px 72px 1fr;
	margin: 0;
	padding: 10px;
	transition: background-color 160ms ease;
}

.vergoo-customization-card:hover {
	background: #f5f5f5;
}

.vergoo-customization-card:has(input:checked) {
	background: #f5f5f5;
}

.vergoo-customization-card input[type="checkbox"] {
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
	border: 1.5px solid rgba(0, 0, 0, 0.25);
	border-radius: 50%;
	cursor: pointer;
	flex-shrink: 0;
	height: 16px;
	margin-top: 4px;
	position: relative;
	transition: background-color 160ms ease, border-color 160ms ease;
	width: 16px;
}

.vergoo-customization-card input[type="checkbox"]:checked {
	background-color: #111827;
	border-color: #111827;
}

.vergoo-customization-card input[type="checkbox"]:checked::after {
	border: 1.5px solid #fff;
	border-left: none;
	border-top: none;
	content: '';
	height: 6px;
	left: 50%;
	position: absolute;
	top: 42%;
	transform: translate(-50%, -50%) rotate(45deg);
	width: 3.5px;
}

.vergoo-customization-card__media {
	background: #f3f4f6;
	display: block;
	height: 72px;
	position: relative;
	width: 72px;
}

.vergoo-customization-card__media--zoomable {
	cursor: zoom-in;
}

.vergoo-customization-card__media--zoomable::after {
	align-items: center;
	background: rgba(17, 24, 39, 0.72);
	border-radius: 999px;
	bottom: 5px;
	color: #fff;
	content: "+";
	display: flex;
	font-size: 16px;
	font-weight: 600;
	height: 20px;
	justify-content: center;
	line-height: 1;
	position: absolute;
	right: 5px;
	width: 20px;
}

.vergoo-customization-card__media img {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.vergoo-customization-card__body {
	display: grid;
	gap: 4px;
	min-width: 0;
}

.vergoo-customization-card__title {
	color: #111827;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.vergoo-customization-card__description {
	color: #4b5563;
	font-size: 13px;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

.vergoo-customizations__total {
	margin-top: 12px;
	min-height: 20px;
}

.vergoo-customizations__total.is-active {
	color: #111827;
	font-weight: 600;
}

.vergoo-lightbox-open {
	overflow: hidden;
}

.vergoo-lightbox {
	align-items: center;
	display: none;
	inset: 0;
	justify-content: center;
	padding: 24px;
	position: fixed;
	z-index: 999999;
}

.vergoo-lightbox.is-open {
	display: flex;
}

.vergoo-lightbox__backdrop {
	background: rgba(17, 24, 39, 0.78);
	inset: 0;
	position: absolute;
}

.vergoo-lightbox__dialog {
	background: #fff;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
	display: flex;
	flex-direction: column;
	max-height: min(760px, 88vh);
	max-width: min(920px, 92vw);
	padding: 14px;
	position: relative;
	width: max-content;
}

.vergoo-lightbox__close {
	align-items: center;
	background: #111827;
	border: 0;
	color: #fff;
	cursor: pointer;
	display: flex;
	font-size: 26px;
	height: 36px;
	justify-content: center;
	line-height: 1;
	padding: 0;
	position: absolute;
	right: -12px;
	top: -12px;
	width: 36px;
	z-index: 1;
}

.vergoo-lightbox__link {
	display: block;
	flex: 1;
	min-height: 0;
	overflow: hidden;
}

.vergoo-lightbox__image {
	display: block;
	height: 100%;
	max-height: 100%;
	max-width: calc(92vw - 28px);
	object-fit: contain;
	width: auto;
}

.vergoo-lightbox__title {
	color: #111827;
	flex-shrink: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	margin-top: 10px;
	text-align: center;
}

@media (max-width: 520px) {
	.vergoo-customization-card {
		grid-template-columns: 20px 64px 1fr;
	}

	.vergoo-customization-card__media {
		height: 64px;
		width: 64px;
	}

	.vergoo-lightbox {
		padding: 14px;
	}

	.vergoo-lightbox__dialog {
		padding: 10px;
	}

	.vergoo-lightbox__close {
		right: 0;
		top: 0;
	}
}

/* ── Related Products ──────────────────────────────────────────── */

.vergoo-related-products {
	border-top: 1px solid #000;
	margin: 0 0 24px;
	padding: 16px 0 0;
}

.vergoo-related-products__heading {
	margin-bottom: 16px;
}

.vergoo-related-products__heading strong {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	line-height: 1.3;
	text-transform: uppercase;
}

/* Grid */
.vergoo-related-products__list {
	align-items: start;
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(2, 1fr);
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (max-width: 480px) {
	.vergoo-related-products__list {
		grid-template-columns: 1fr;
	}
}

/* Card */
.vergoo-related-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.vergoo-related-card--out-of-stock {
	opacity: 0.55;
}

/* Thumbnail */
.vergoo-related-card__thumb {
	aspect-ratio: 1;
	background: #f3f4f6;
	display: block;
	overflow: hidden;
}

.vergoo-related-card__thumb img {
	display: block !important;
	height: 100% !important;
	object-fit: cover !important;
	width: 100% !important;
}

/* Form */
.vergoo-related-card__form {
	display: flex;
	flex-direction: column;
	margin: 0;
}

/* Body */
.vergoo-related-card__body {
	display: flex;
	flex-direction: column;
	gap: 5px;
	padding: 10px 12px 0;
}

/* Name */
.vergoo-related-card__name {
	color: #111827 !important;
	display: block !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
	overflow-wrap: anywhere;
	text-decoration: none !important;
}

.vergoo-related-card__name:hover {
	text-decoration: underline !important;
}

/* Price */
.vergoo-related-card__price {
	font-size: 13px;
}

.vergoo-related-card__price del {
	color: #9ca3af;
	font-size: 11px;
	margin-right: 3px;
}

.vergoo-related-card__price ins {
	color: #111827;
	font-weight: 700;
	text-decoration: none;
}

/* Variations */
.vergoo-related-card__attrs {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 6px;
}

.vergoo-attr-row {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.vergoo-attr-row label {
	color: #6b7280;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.vergoo-attr-row select {
	font-size: 12px;
	padding: 4px 24px 4px 8px;
	width: 100%;
}

/* Out of stock badge */
.vergoo-related-card__out-of-stock {
	color: #dc2626;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.06em;
	margin-top: 4px;
	text-transform: uppercase;
}

/* Footer — button pinned to bottom */
.vergoo-related-card__footer {
	padding: 10px 12px 12px;
}

.vergoo-related-card__footer .button {
	background-color: #000 !important;
	border-color: transparent !important;
	box-sizing: border-box !important;
	color: #fff !important;
	justify-content: center;
	transition: color 0.2s ease-out, background-color 0.2s ease-out, border-color 0.2s ease-out !important;
	width: 100% !important;
}

/* hover handled by theme's button[type=submit]:hover rule */

/* Discount note */
.vergoo-related-products__note {
	border-top: 1px solid rgba(0, 0, 0, 0.07);
	color: #9ca3af;
	font-size: 11px;
	line-height: 1.4;
	margin-bottom: 0;
	margin-top: 16px;
	padding-top: 12px;
}
