.wbif-field {
	margin: 14px 0;
}

.wbif-field__title {
	font-weight: 600;
	margin-bottom: 8px;
	font-size: 1em;
}

.wbif-field__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 12px;
}

.wbif-item {
	border: 1px solid #e3e3e3;
	border-radius: 8px;
	padding: 8px;
	text-align: center;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	background: #fff;
}

.wbif-item.wbif-active {
	border-color: #1a1a1a;
	box-shadow: 0 0 0 1px #1a1a1a;
}

.wbif-item__media {
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 6px;
	margin-bottom: 6px;
	background: #f6f6f6;
}

.wbif-item__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wbif-item__label {
	font-size: 0.85em;
	line-height: 1.3;
	margin-bottom: 8px;
	min-height: 2.2em;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
}

.wbif-item__price {
	font-size: 0.85em;
	color: #2c7a2c;
	font-weight: 600;
}

.wbif-item__qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid #d5d5d5;
	border-radius: 999px;
	overflow: hidden;
}

.wbif-item__qty button {
	width: 30px;
	height: 30px;
	line-height: 1;
	border: 0;
	background: #f2f2f2;
	cursor: pointer;
	font-size: 16px;
	color: #222;
	padding: 0;
	margin: 0;
}

.wbif-item__qty button:hover {
	background: #e6e6e6;
}

.wbif-qty-input {
	width: 38px !important;
	text-align: center;
	border: 0 !important;
	background: transparent !important;
	font-size: 14px;
	padding: 0 !important;
	margin: 0 !important;
	box-shadow: none !important;
	-moz-appearance: textfield;
}

.wbif-qty-input::-webkit-outer-spin-button,
.wbif-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.wbif-field__status {
	margin-top: 8px;
	font-size: 0.88em;
	min-height: 1.2em;
}

.wbif-status--error {
	color: #b00020;
}

.wbif-status--ok {
	color: #2c7a2c;
}

.wbif-shake {
	animation: wbif-shake 0.4s;
}

@keyframes wbif-shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-4px); }
	75% { transform: translateX(4px); }
}

.single_add_to_cart_button.wbif-disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Idle / disabled-until-selected state */
.wbif-field--disabled {
	opacity: 0.55;
	position: relative;
}

.wbif-field--disabled .wbif-field__grid {
	pointer-events: none;
	filter: grayscale(0.35);
}

.wbif-field--disabled .wbif-item__qty button {
	cursor: not-allowed;
}

.wbif-field__status {
	font-style: normal;
}

tr.wbif-row > td {
	padding: 6px 0;
}

/* ------------------------------------------------------------------ */
/* Theme resilience: themes often style all <button> elements (color,  */
/* background, border, fully-rounded). Force our component look so the  */
/* live field matches the admin preview. Per-field user styles use the */
/* same !important at higher specificity, so they still win.           */
/* ------------------------------------------------------------------ */
.wbif-field .wbif-item__qty {
	display: inline-flex !important;
	align-items: center !important;
	border: 1px solid #d5d5d5 !important;
	border-radius: 999px !important;
	overflow: hidden !important;
	background: #fff !important;
}

.wbif-field .wbif-item__qty button {
	width: 30px !important;
	height: 30px !important;
	min-width: 0 !important;
	line-height: 1 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: #f2f2f2 !important;
	color: #222 !important;
	box-shadow: none !important;
	cursor: pointer !important;
	font-size: 16px !important;
	font-weight: 400 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

.wbif-field .wbif-item__qty button:hover {
	background: #e6e6e6 !important;
}

.wbif-field .wbif-item__qty .wbif-qty-input {
	width: 38px !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	text-align: center !important;
	padding: 0 !important;
	margin: 0 !important;
	min-height: 0 !important;
	height: auto !important;
}

.wbif-field .wbif-item__media {
	border-radius: 6px !important;
	overflow: hidden !important;
}

.wbif-field .wbif-item__media img {
	border-radius: 0 !important;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	max-width: none !important;
}
