.sf-box-builder {
	--sf-ink: #211d1b;
	--sf-red: #b82612;
	--sf-gold: #a68949;
	--sf-sand: #dbcebd;
	--sf-slate: #2c3843;
	--sf-muted: #59534d;
	--sf-cream: #fcf9f4;
	--sf-line: rgba(44, 56, 67, 0.12);
	--sf-font-body: "Roboto", Arial, sans-serif;
	--sf-font-display: "Roboto", "Arial Narrow", Arial, sans-serif;
	background: #fff;
	border: 1px solid var(--sf-line);
	border-radius: 18px;
	box-shadow: 0 18px 45px rgba(44, 56, 67, 0.1);
	clear: both;
	color: var(--sf-ink);
	display: flex;
	flex-direction: column;
	font-family: var(--sf-font-body) !important;
	height: min(760px, calc(100vh - 48px));
	margin: 26px 0 32px;
	overflow: hidden;
	width: 100%;
}

.sf-box-builder button:focus-visible,
.sf-box-builder input:focus-visible {
	outline: 3px solid rgba(184, 38, 18, 0.28);
	outline-offset: 2px;
}

.sf-box-builder__header {
	align-items: center;
	background: linear-gradient(135deg, #fcf9f4 0%, #fff 100%);
	border-bottom: 1px solid var(--sf-line);
	color: var(--sf-ink);
	display: grid;
	flex: 0 0 auto;
	gap: 22px;
	grid-template-columns: 1fr auto;
	padding: 24px clamp(22px, 3vw, 34px);
}

.sf-box-builder__eyebrow {
	color: var(--sf-red);
	font-family: var(--sf-font-body) !important;
	font-size: 16px !important;
	font-weight: 700 !important;
	letter-spacing: 0.13em !important;
	margin: 0 0 8px;
	text-transform: uppercase;
}

.sf-box-builder__header h2 {
	color: var(--sf-ink);
	font-family: var(--sf-font-display) !important;
	font-size: clamp(26px, 3vw, 34px) !important;
	font-weight: 600 !important;
	line-height: 1.05 !important;
	margin: 0 0 12px;
}

.sf-box-builder__header p:last-child {
	color: var(--sf-muted);
	font-family: var(--sf-font-body) !important;
	font-size: 14px !important;
	line-height: 1.55;
	margin: 0;
	max-width: 700px;
}

.sf-box-builder__progress {
	align-items: center;
	background: var(--sf-slate);
	border: 1px solid var(--sf-slate);
	border-radius: 12px;
	color: #fff;
	display: flex;
	flex-direction: row;
	gap: 8px;
	height: auto;
	justify-content: center;
	min-width: 0;
	padding: 12px 16px;
	white-space: nowrap;
}

.sf-box-builder__progress strong {
	font-family: var(--sf-font-display) !important;
	font-size: 18px;
	font-weight: 600;
	line-height: 1;
}

.sf-box-builder__progress span:last-child {
	font-size: 18px;
	letter-spacing: 0.08em;
	margin-top: 0;
	text-transform: uppercase;
}

.sf-box-builder__slots {
	background: #fff;
	border-bottom: 1px solid var(--sf-line);
	display: grid;
	flex: 0 0 auto;
	gap: 10px;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	padding: 12px clamp(18px, 2vw, 24px);
}

.sf-box-builder__edit-notice {
	align-items: center;
	background: rgba(166, 137, 73, 0.14);
	border-bottom: 1px solid rgba(166, 137, 73, 0.28);
	color: var(--sf-ink);
	display: flex;
	flex: 0 0 auto;
	font-size: 12px;
	gap: 8px;
	padding: 9px clamp(18px, 2vw, 24px);
}

.sf-box-builder__edit-notice strong {
	color: var(--sf-red);
	font-size: 12px;
}

.sf-box-builder__edit-notice span {
	color: var(--sf-muted);
}

.sf-box-slot {
	align-items: center;
	appearance: none;
	background: var(--sf-cream);
	border: 1px dashed rgba(166, 137, 73, 0.5);
	border-radius: 10px;
	box-shadow: none;
	color: var(--sf-ink);
	display: grid;
	font-family: var(--sf-font-body) !important;
	gap: 9px;
	grid-template-columns: 26px minmax(0, 1fr) 20px;
	min-height: 54px;
	padding: 8px 9px;
	text-align: left;
	width: 100%;
}

.sf-box-slot:disabled {
	cursor: default;
	opacity: 1;
}

.sf-box-slot.is-filled {
	background: rgba(219, 206, 189, 0.34);
	border-color: var(--sf-gold);
	border-style: solid;
	cursor: pointer;
}

.sf-box-slot__number {
	align-items: center;
	background: var(--sf-sand);
	border-radius: 50%;
	color: rgba(37, 29, 21, 0.7);
	display: flex;
	font-size: 11px;
	font-weight: 800;
	height: 26px;
	justify-content: center;
	width: 26px;
}

.sf-box-slot.is-filled .sf-box-slot__number {
	background: var(--sf-gold);
	color: var(--sf-ink);
}

.sf-box-slot__copy {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.sf-box-slot__copy small {
	color: rgba(37, 29, 21, 0.5);
	font-size: 8px !important;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.2;
	text-transform: uppercase;
}

.sf-box-slot__copy strong {
	font-family: var(--sf-font-display) !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	line-height: 1.15;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sf-box-slot__remove {
	color: var(--sf-red);
	font-size: 19px;
	font-weight: 400;
	line-height: 1;
	opacity: 0;
	text-align: center;
}

.sf-box-slot.is-filled .sf-box-slot__remove {
	opacity: 1;
}

.sf-box-builder__toolbar {
	align-items: center;
	background: var(--sf-cream);
	border-bottom: 1px solid var(--sf-line);
	display: grid;
	flex: 0 0 auto;
	gap: 24px;
	grid-template-columns: minmax(240px, 1fr) auto;
	padding: 13px clamp(18px, 2vw, 24px);
}

.sf-box-builder__toolbar input[type="search"] {
	background: #fff;
	border: 1px solid var(--sf-line);
	border-radius: 999px;
	box-shadow: none;
	font-family: var(--sf-font-body) !important;
	font-size: 14px !important;
	height: 42px;
	margin: 0;
	max-width: 520px;
	padding: 0 20px;
	width: 100%;
}

.sf-box-builder__toolbar p {
	color: var(--sf-muted);
	font-size: 12px;
	font-weight: 700;
	margin: 0;
}

.sf-box-builder.is-complete .sf-box-builder__toolbar p {
	color: var(--sf-red);
}

.sf-box-builder__grid {
	display: grid;
	flex: 1 1 auto;
	gap: 1px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	min-height: 0;
	overflow: auto;
	overscroll-behavior: contain;
	scrollbar-color: rgba(166, 137, 73, 0.65) transparent;
	scrollbar-width: thin;
}

.sf-box-builder__grid[hidden] {
	display: none;
}

.sf-box-card {
	background: transparent;
	border-bottom: 1px solid var(--sf-line);
	border-right: 1px solid var(--sf-line);
	min-width: 0;
	position: relative;
	transition: background 0.18s ease, box-shadow 0.18s ease;
}

.sf-box-card.is-selected {
	background: rgba(219, 206, 189, 0.22);
	box-shadow: inset 0 0 0 2px var(--sf-gold);
}

.sf-box-card.is-selected::before {
	background: var(--sf-slate);
	color: #fff;
	content: "In your box";
	font-size: 9px;
	font-weight: 800;
	letter-spacing: 0.06em;
	padding: 5px 8px;
	position: absolute;
	right: 10px;
	text-transform: uppercase;
	top: 10px;
	z-index: 2;
}

.sf-box-card__add {
	align-items: center;
	appearance: none;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: inherit;
	cursor: pointer;
	display: grid;
	font-family: var(--sf-font-body) !important;
	gap: 12px;
	grid-template-columns: 118px minmax(0, 1fr);
	padding: 11px 14px;
	text-align: left;
	width: 100%;
}

.sf-box-card__add:disabled {
	cursor: not-allowed;
	opacity: 0.7;
}

.sf-box-card.is-selected .sf-box-card__add:disabled {
	opacity: 1;
}

.sf-box-card__image {
	background: transparent;
	display: block;
	height: 88px;
	overflow: hidden;
	padding: 5px;
	position: relative;
}

.sf-box-card__image img {
	height: 100%;
	object-fit: contain;
	width: 100%;
}

.sf-box-card__add:not(:disabled):hover .sf-box-card__image img {
	transform: none;
}

.sf-box-card__quantity {
	align-items: center;
	background: var(--sf-red);
	border: 3px solid #fff;
	border-radius: 999px;
	color: #fff;
	display: flex;
	font-size: 14px;
	font-weight: 800;
	height: 36px;
	justify-content: center;
	position: absolute;
	left: 7px;
	right: auto;
	top: 7px;
	width: 36px;
}

.sf-box-card__quantity[hidden] {
	display: none;
}

.sf-box-card__content {
	display: flex;
	flex-direction: column;
	min-height: 88px;
	padding-top: 1px;
}

.sf-box-card__content strong {
	font-family: var(--sf-font-display) !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	line-height: 1.2;
}

.sf-box-card__content small {
	color: var(--sf-muted);
	font-family: var(--sf-font-body) !important;
	font-size: 12px !important;
	letter-spacing: 0.04em;
	margin-top: 5px;
	text-transform: uppercase;
}

.sf-box-card__price {
	color: var(--sf-red);
	font-family: var(--sf-font-body) !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	margin-top: auto;
	padding-top: 7px;
}

.sf-box-card__price del {
	color: var(--sf-muted);
	font-size: 12px;
	font-weight: 600;
	margin-right: 5px;
	opacity: 0.82;
}

.sf-box-card__price ins {
	background: transparent;
	color: var(--sf-red);
	font-weight: 800;
	text-decoration: none;
}

.sf-box-card__controls {
	align-items: center;
	background: var(--sf-slate);
	bottom: 10px;
	color: #fff;
	display: grid;
	grid-template-columns: 36px 36px 36px;
	position: absolute;
	right: 10px;
	z-index: 3;
}

.sf-box-builder__empty {
	align-items: center;
	background: #fff;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	justify-content: center;
	min-height: 180px;
	padding: 32px;
	text-align: center;
}

.sf-box-builder__empty[hidden] {
	display: none;
}

.sf-box-builder__empty strong {
	font-family: var(--sf-font-display) !important;
	font-size: 20px;
	font-weight: 600;
}

.sf-box-builder__empty span {
	color: var(--sf-muted);
	font-size: 13px;
	margin-top: 5px;
}

.sf-box-card__controls[hidden] {
	display: none;
}

.sf-box-card__controls button {
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: #fff;
	cursor: pointer;
	font-size: 20px;
	height: 36px;
	line-height: 1;
	padding: 0;
}

.sf-box-card__controls button:disabled {
	cursor: not-allowed;
	opacity: 0.45;
}

.sf-box-card__controls span {
	font-size: 12px;
	font-weight: 800;
	text-align: center;
}

.sf-box-builder__summary {
	align-items: center;
	background: var(--sf-slate);
	border-top: 1px solid var(--sf-line);
	display: flex;
	flex: 0 0 auto;
	gap: 20px;
	justify-content: space-between;
	padding: 14px clamp(18px, 2vw, 24px);
	box-shadow: 0 -8px 22px rgba(44, 56, 67, 0.16);
	color: #fff;
	z-index: 5;
}

.sf-box-builder__summary-content {
	align-items: center;
	display: grid;
	gap: 18px;
	grid-template-columns: auto minmax(0, 1fr);
	min-width: 0;
}

.sf-box-builder__total {
	display: flex;
	flex-direction: column;
	white-space: nowrap;
}

.sf-box-builder__total span {
	color: rgba(255, 255, 255, 0.68);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.sf-box-builder__total strong {
	font-family: var(--sf-font-display) !important;
	font-size: 21px;
	font-weight: 600;
	line-height: 1.2;
	margin-top: 4px;
}

.sf-box-builder__summary-content p {
	color: rgba(255, 255, 255, 0.72);
	font-family: var(--sf-font-body) !important;
	font-size: 12px !important;
	line-height: 1.35;
	margin: 0;
	max-width: 430px;
}

.sf-box-builder__submit.button {
	background: var(--sf-red);
	border: 0;
	border-radius: 999px;
	box-shadow: none;
	color: #fff;
	flex: 0 0 auto;
	font-family: var(--sf-font-display) !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	letter-spacing: 0.02em;
	min-height: 46px;
	padding: 0 24px;
}

.sf-box-builder__submit.button:hover,
.sf-box-builder__submit.button:focus {
	background: #941f0f;
	color: #fff;
}

.sf-box-builder__submit.button:disabled {
	background: var(--sf-sand);
	color: var(--sf-ink);
	cursor: not-allowed;
	opacity: 1;
}

.sf-box-form > .e-atc-qty-button-holder,
.sf-box-form > .quantity,
.sf-box-form > .single_add_to_cart_button {
	display: none !important;
}

@media (max-width: 900px) {
	.sf-box-builder__slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sf-box-builder__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sf-box-card__add { grid-template-columns: 124px minmax(0, 1fr); }
}

@media (max-width: 600px) {
	.sf-box-builder { height: auto; max-height: none; overflow: visible; }
	.sf-box-builder__header { grid-template-columns: 1fr; }
	.sf-box-builder__edit-notice { align-items: flex-start; flex-direction: column; gap: 2px; }
	.sf-box-builder__slots { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 11px; }
	.sf-box-slot { flex: 0 0 190px; }
	.sf-box-builder__progress { flex-direction: row; gap: 8px; height: auto; min-width: 0; padding: 11px 14px; width: max-content; }
	.sf-box-builder__progress span:last-child { margin-top: 0; }
	.sf-box-builder__toolbar { grid-template-columns: 1fr; gap: 10px; }
	.sf-box-builder__grid { flex: none; grid-template-columns: 1fr; max-height: none; overflow: visible; }
	.sf-box-card__add { display: grid; gap: 12px; grid-template-columns: 108px minmax(0, 1fr); }
	.sf-box-card__image { height: 108px; }
	.sf-box-card__content { min-height: 108px; padding-top: 2px; }
	.sf-box-builder__summary { align-items: stretch; bottom: 0; flex-direction: column; gap: 10px; position: sticky; }
	.sf-box-builder__summary-content { grid-template-columns: auto minmax(0, 1fr); }
	.sf-box-builder__summary-content p { max-height: 34px; overflow: hidden; }
	.sf-box-builder__submit.button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.sf-box-card { transition: none; }
}
