.custom-box-page {
	padding-bottom: 48px;
}

.custom-box-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
	gap: 28px;
	align-items: start;
}

.custom-box-builder {
	background: var(--sc-custom-box-builder-v1-root-bg, var(--primary-background-color));
	border: 1px solid var(--sc-custom-box-builder-v1-root-border, color-mix(in srgb, var(--primary-brand-color) 12%, transparent));
	border-radius: 20px;
	padding: 24px;
	box-shadow: 0 10px 30px color-mix(in srgb, var(--primary-brand-color) 8%, transparent);
}

.custom-box-builder-header {
	margin-bottom: 24px;
}

.custom-box-builder-title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 8px;
	font-size: 24px;
	color: var(--sc-custom-box-builder-v1-title-text, var(--primary-text-color));
}

.custom-box-builder-title i {
	color: var(--sc-custom-box-builder-v1-title-icon-text, var(--primary-brand-color));
}

.custom-box-builder-subtitle {
	margin: 0;
	color: var(--sc-custom-box-builder-v1-subtitle-text, var(--secondary-text-color));
}

.custom-box-slot + .custom-box-slot {
	margin-top: 28px;
	padding-top: 28px;
	border-top: 1px solid var(--sc-custom-box-builder-v1-custom-box-slot-border-top, color-mix(in srgb, var(--primary-brand-color) 10%, transparent));
}

.custom-box-slot-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}

.custom-box-slot-heading {
	display: flex;
	align-items: center;
	gap: 14px;
}

.custom-box-slot-number {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--sc-custom-box-builder-v1-custom-box-slot-number-bg, var(--primary-brand-color));
	color: var(--sc-custom-box-builder-v1-custom-box-slot-number-text, var(--primary-text-color));
	font-weight: 700;
	flex-shrink: 0;
}

.custom-box-slot-name {
	margin: 0 0 4px;
	font-size: 18px;
	color: var(--sc-custom-box-builder-v1-custom-box-slot-name-text, var(--primary-text-color));
}

.custom-box-slot-meta {
	margin: 0;
	font-size: 14px;
	color: var(--sc-custom-box-builder-v1-custom-box-slot-meta-text, var(--secondary-text-color));
}

.custom-box-slot-progress-text {
	font-size: 14px;
	font-weight: 700;
	color: var(--sc-custom-box-builder-v1-custom-box-slot-progress-text-text, var(--primary-brand-color));
}

.custom-box-product-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 14px;
}

.custom-box-product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
	padding: 12px;
	border: 2px solid var(--sc-custom-box-builder-v1-custom-box-product-card-border, color-mix(in srgb, var(--primary-brand-color) 12%, transparent));
	border-radius: 16px;
	background: var(--sc-custom-box-builder-v1-custom-box-product-card-bg, var(--secondary-background-color));
	cursor: pointer;
	transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
	text-align: center;
}

.custom-box-product-card:hover:not(:disabled) {
	border-color: var(--sc-custom-box-builder-v1-custom-box-product-card-hover-border, var(--primary-brand-color));
	transform: translateY(-2px);
	box-shadow: 0 8px 20px color-mix(in srgb, var(--primary-brand-color) 12%, transparent);
}

.custom-box-product-card.is-selected {
	border-color: var(--sc-custom-box-builder-v1-custom-box-product-card-is-selected-border, var(--primary-brand-color));
	background: var(--sc-custom-box-builder-v1-custom-box-product-card-is-selected-bg, color-mix(in srgb, var(--primary-brand-color) 8%, var(--secondary-background-color)));
}

.custom-box-product-card.is-out-of-stock,
.custom-box-product-card:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.custom-box-product-check {
	position: absolute;
	top: 10px;
	inset-inline-end: 10px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--sc-custom-box-builder-v1-custom-box-product-check-bg, var(--primary-brand-color));
	color: var(--sc-custom-box-builder-v1-custom-box-product-check-text, var(--primary-text-color));
	display: none;
	place-items: center;
	font-size: 12px;
}

.custom-box-product-card.is-selected .custom-box-product-check {
	display: grid;
}

.custom-box-product-image-wrap {
	aspect-ratio: 1;
	border-radius: 12px;
	overflow: hidden;
	background: var(--sc-custom-box-builder-v1-custom-box-product-image-wrap-bg, var(--primary-background-color));
}

.custom-box-product-image-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.custom-box-product-name {
	font-size: 14px;
	font-weight: 600;
	color: var(--sc-custom-box-builder-v1-custom-box-product-name-text, var(--primary-text-color));
	line-height: 1.35;
}

.custom-box-product-stock,
.custom-box-product-variant-hint {
	font-size: 12px;
	color: var(--sc-custom-box-builder-v1-custom-box-product-stock-text, var(--secondary-text-color));
}

.custom-box-variant-modal[hidden] {
	display: none;
}

.custom-box-variant-modal {
	position: fixed;
	inset: 0;
	z-index: 10050;
	display: grid;
	place-items: center;
	padding: 20px;
}

.custom-box-variant-modal-backdrop {
	position: absolute;
	inset: 0;
	background: var(--sc-custom-box-builder-v1-custom-box-variant-modal-backdrop-bg, rgba(0, 0, 0, 0.45));
}

.custom-box-variant-modal-dialog {
	position: relative;
	width: min(480px, 100%);
	max-height: 90vh;
	overflow: auto;
	background: var(--sc-custom-box-builder-v1-custom-box-variant-modal-dialog-bg, var(--primary-background-color));
	border-radius: 18px;
	padding: 24px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.custom-box-variant-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.custom-box-variant-modal-title {
	margin: 0;
	font-size: 20px;
	color: var(--sc-custom-box-builder-v1-custom-box-variant-modal-title-text, var(--primary-text-color));
}

.custom-box-variant-modal-close {
	border: 0;
	background: var(--sc-custom-box-builder-v1-custom-box-variant-modal-close-bg, transparent);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: var(--sc-custom-box-builder-v1-custom-box-variant-modal-close-text, var(--secondary-text-color));
}

.custom-box-variant-modal-product {
	margin: 0 0 16px;
	color: var(--sc-custom-box-builder-v1-custom-box-variant-modal-product-text, var(--secondary-text-color));
}

.custom-box-variant-options {
	display: grid;
	gap: 10px;
	margin-bottom: 16px;
}

.custom-box-variant-option {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 12px;
	padding: 12px 14px;
	border: 2px solid var(--sc-custom-box-builder-v1-custom-box-variant-option-border, color-mix(in srgb, var(--primary-brand-color) 12%, transparent));
	border-radius: 12px;
	background: var(--sc-custom-box-builder-v1-custom-box-variant-option-bg, var(--secondary-background-color));
	cursor: pointer;
	text-align: start;
}

.custom-box-variant-option.is-selected {
	border-color: var(--sc-custom-box-builder-v1-custom-box-variant-option-is-selected-border, var(--primary-brand-color));
	background: var(--sc-custom-box-builder-v1-custom-box-variant-option-is-selected-bg, color-mix(in srgb, var(--primary-brand-color) 8%, var(--secondary-background-color)));
}

.custom-box-variant-option:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.custom-box-variant-option-label {
	font-weight: 600;
	color: var(--sc-custom-box-builder-v1-custom-box-variant-option-label-text, var(--primary-text-color));
}

.custom-box-variant-option-stock {
	font-size: 13px;
	color: var(--sc-custom-box-builder-v1-custom-box-variant-option-stock-text, var(--secondary-text-color));
}

.custom-box-variant-confirm {
	width: 100%;
	border: 0;
	border-radius: 12px;
	padding: 14px 18px;
	background: var(--sc-custom-box-builder-v1-custom-box-variant-confirm-bg, var(--primary-brand-color));
	color: var(--sc-custom-box-builder-v1-custom-box-variant-confirm-text, var(--primary-text-color));
	font-weight: 700;
	cursor: pointer;
}

.custom-box-variant-confirm:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

@media (max-width: 992px) {
	.custom-box-layout {
		grid-template-columns: 1fr;
	}
}
