.qbscb-wrapper {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.qbscb-wrapper.qbscb-full-width .qbscb-buttons-row,
.qbscb-wrapper.qbscb-full-width .qbscb-controls-row {
	width: 100%;
}

.qbscb-wrapper.qbscb-full-width .qbscb-btn {
	flex: 1 1 0;
}

.qbscb-controls-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
}

.qbscb-buy-now-position-below .qbscb-controls-row {
	flex-direction: column;
	align-items: stretch;
}

.qbscb-qty-wrap {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid #d8d8d8;
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
}

.qbscb-qty-btn {
	background: #f5f5f5;
	border: none;
	width: 34px;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	color: #333;
}

.qbscb-qty-btn:hover {
	background: #ebebeb;
}

.qbscb-qty {
	width: 110px;
	border: none;
	text-align: center;
	-moz-appearance: textfield;
	appearance: textfield;
	font-size: 14px;
}

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

.qbscb-buttons-row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.qbscb-buy-now-position-left .qbscb-buttons-row {
	flex-direction: row-reverse;
}

.qbscb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: none;
	cursor: pointer;
	padding: 12px 22px;
	font-weight: 600;
	border-radius: 6px;
	transition: background-color 0.2s ease, opacity 0.2s ease;
	white-space: nowrap;
}

.qbscb-btn--add-to-cart {
	background: #2f8f3d;
	color: #fff;
}

.qbscb-btn--add-to-cart:hover {
	background: #267233;
}

.qbscb-btn--buy-now {
	background: #ef7f1a;
	color: #fff;
}

.qbscb-btn--buy-now:hover {
	background: #d76e0f;
}

.qbscb-btn:disabled,
.qbscb-btn.qbscb-loading {
	opacity: 0.6;
	cursor: not-allowed;
}

.qbscb-btn__icon svg,
.qbscb-btn__icon i {
	display: inline-block;
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.qbscb-variations {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 4px;
}

.qbscb-variation-label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
	font-size: 13px;
}

.qbscb-variation-value {
	padding: 8px 10px;
	border: 1px solid #d8d8d8;
	border-radius: 6px;
	min-width: 160px;
}

.qbscb-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.qbscb-swatch {
	border: 1px solid #d8d8d8;
	background: #fff;
	padding: 6px 14px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.qbscb-swatch--active {
	border-color: #2f8f3d;
	background: #eaf6ec;
	font-weight: 600;
}

.qbscb-feedback {
	font-size: 13px;
	min-height: 18px;
}

.qbscb-feedback--success {
	color: #2f8f3d;
}

.qbscb-feedback--error {
	color: #c0392b;
}

.qbscb-feedback--info {
	color: #666;
}

.qbscb-out-of-stock {
	color: #c0392b;
	font-weight: 600;
	font-size: 14px;
}

/* ---------- Popup ---------- */

body.qbscb-popup-open {
	overflow: hidden;
}

.qbscb-popup-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.6);
	z-index: 999999;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
}

.qbscb-popup-overlay--active {
	display: flex;
}

.qbscb-popup {
	position: relative;
	background: #ffffff;
	border-radius: 12px;
	padding: 28px;
	max-width: 420px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	box-sizing: border-box;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.qbscb-popup--two-column {
	max-width: 640px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 28px;
	align-items: start;
}

.qbscb-popup--stacked,
.qbscb-popup--no-image {
	max-width: 420px;
}

.qbscb-popup-close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: transparent;
	border: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #888;
	padding: 4px;
	z-index: 2;
}

.qbscb-popup-close:hover {
	color: #333;
}

/* Legacy single-image markup (kept for old saved widgets). */
.qbscb-popup-image {
	width: 100%;
	height: auto;
	border-radius: 8px;
	margin-bottom: 14px;
	display: block;
}

.qbscb-popup-gallery {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.qbscb-popup-main-image {
	width: 100%;
	border-radius: 8px;
	overflow: hidden;
	background: #f5f5f5;
}

.qbscb-popup-main-image img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
	aspect-ratio: 1 / 1;
}

.qbscb-popup-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.qbscb-popup-thumb {
	width: 56px;
	height: 56px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 6px;
	overflow: hidden;
	cursor: pointer;
	background: #f5f5f5;
	box-sizing: border-box;
	flex-shrink: 0;
}

.qbscb-popup-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.qbscb-popup-thumb--active {
	border-color: #2f6fed;
}

.qbscb-popup-details {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.qbscb-popup--no-image .qbscb-popup-details,
.qbscb-popup--stacked .qbscb-popup-details {
	grid-column: auto;
}

.qbscb-popup-category {
	font-size: 13px;
	color: #d6336c;
	margin: 0 0 6px;
}

.qbscb-popup-category a {
	color: inherit;
	text-decoration: none;
}

.qbscb-popup-title {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
}

.qbscb-popup-price {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 12px;
}

.qbscb-popup-price del {
	opacity: 0.6;
	font-weight: 400;
	font-size: 0.85em;
}

.qbscb-popup-stock {
	font-size: 13px;
	margin: 0 0 12px;
}

.qbscb-popup-stock p {
	margin: 0;
}

.qbscb-popup-stock .in-stock {
	color: #2f8f3d;
}

.qbscb-popup-stock .out-of-stock {
	color: #c0392b;
}

.qbscb-popup-description {
	font-size: 14px;
	line-height: 1.6;
	color: #555;
	margin: 0 0 16px;
}

.qbscb-popup-heading {
	margin: 0 0 16px;
	color: #666;
	font-size: 14px;
}

.qbscb-popup .qbscb-variations {
	margin-bottom: 18px;
}

.qbscb-popup-controls-row {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: 6px;
}

.qbscb-popup-buttons-row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.qbscb-popup-buttons-row .qbscb-btn {
	flex: 1 1 0;
}

.qbscb-popup-feedback {
	font-size: 13px;
	min-height: 18px;
	margin-top: 10px;
}

.qbscb-editor-notice {
	padding: 14px 16px;
	background: #fff8e1;
	border: 1px dashed #e0b400;
	border-radius: 6px;
	font-size: 13px;
	color: #6b5900;
}

@media ( max-width: 640px ) {
	.qbscb-popup--two-column {
		grid-template-columns: 1fr;
		max-width: 420px;
	}
}
