.spw-detail {
	--spw-accent: #a9835f;
	--spw-visible-thumbs: 5;
	display: grid;
	grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
	gap: 48px;
	align-items: start;
	width: 100%;
	box-sizing: border-box;
}
.spw-detail * {
	box-sizing: border-box;
}

/* Gallery */
.spw-detail__gallery {
	display: flex;
	gap: 16px;
	width: 100%;
	min-width: 0;
}
.spw-detail[data-thumb-position="left"] .spw-detail__gallery {
	flex-direction: row;
}
.spw-detail[data-thumb-position="bottom"] .spw-detail__gallery {
	flex-direction: column-reverse;
}

.spw-detail__thumbs {
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 0 0 68px;
	/* cap visible height to N thumbnails (64px + 10px gap each), then scroll */
	max-height: calc((64px * var(--spw-visible-thumbs)) + (10px * (var(--spw-visible-thumbs) - 1)));
	overflow-y: auto;
	overflow-x: hidden;
	padding-right: 4px;
	scrollbar-width: thin;
	scrollbar-color: #d8cfc2 transparent;
}
.spw-detail__thumbs::-webkit-scrollbar {
	width: 5px;
}
.spw-detail__thumbs::-webkit-scrollbar-thumb {
	background: #d8cfc2;
	border-radius: 4px;
}
.spw-detail[data-thumb-position="bottom"] .spw-detail__thumbs {
	flex-direction: row;
	flex: 0 0 auto;
	max-height: none;
	overflow-x: auto;
	overflow-y: hidden;
	padding-bottom: 6px;
	padding-right: 0;
}

.spw-detail__thumb {
	width: 64px;
	height: 64px;
	border: 2px solid transparent;
	border-radius: 8px;
	overflow: hidden;
	padding: 0;
	cursor: pointer;
	background: #f6f2ec;
	flex-shrink: 0;
	transition: border-color .2s;
}
.spw-detail__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.spw-detail__thumb.is-active,
.spw-detail__thumb:hover {
	border-color: var(--spw-accent);
}

.spw-detail__main-image {
	flex: 1;
	min-width: 0;
	border-radius: 14px;
	overflow: hidden;
	background: #f6f2ec;
	align-self: flex-start;
}
.spw-detail__main-image img {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: block;
	transition: opacity .2s ease;
}

/* Info column */
.spw-detail__info {
	min-width: 0;
	width: 100%;
}
.spw-detail__title {
	font-size: 30px;
	line-height: 1.2;
	margin: 0 0 14px;
}
.spw-detail__price {
	font-size: 22px;
	font-weight: 600;
	color: var(--spw-accent);
	margin-bottom: 18px;
}
.spw-detail__price del {
	opacity: .5;
	font-weight: 400;
	margin-right: 8px;
}
.spw-detail__price ins {
	text-decoration: none;
}
.spw-detail__short-desc {
	margin-bottom: 26px;
	line-height: 1.7;
	color: #555;
}
.spw-detail__short-desc p:last-child {
	margin-bottom: 0;
}

/* Variation attributes */
.spw-attribute {
	margin-bottom: 22px;
}
.spw-attribute__label {
	display: block;
	font-weight: 600;
	margin-bottom: 10px;
	text-transform: uppercase;
	font-size: 12px;
	letter-spacing: .06em;
	color: #333;
}
.spw-attribute__options.is-swatch {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}
.spw-swatch {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 2px solid #e2ddd5;
	cursor: pointer;
	padding: 3px;
	background-color: #fff !important;
	background-image: none !important;
	transition: border-color .2s, transform .15s;
}
.spw-swatch:hover,
.spw-swatch:focus,
.spw-swatch:active {
	background-color: #fff !important;
	background-image: none !important;
}
.spw-swatch:hover {
	transform: scale(1.06);
}
.spw-swatch__dot {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: var(--swatch-color);
	box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.spw-swatch.is-selected {
	border-color: var(--spw-accent);
}

.spw-select {
	padding: 11px 14px;
	border-radius: 8px;
	border: 1px solid #ddd;
	min-width: 220px;
	font-size: 14px;
	background: #fff;
}

/* Quantity */
.spw-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid #ddd;
	border-radius: 8px;
	margin: 0 0 18px;
	overflow: hidden;
}
.spw-qty__btn {
	width: 40px;
	height: 42px;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 18px;
	color: #444;
}
.spw-qty__btn:hover {
	background: #f6f2ec;
}
.spw-qty__input {
	width: 48px;
	height: 42px;
	text-align: center;
	border: none;
	border-left: 1px solid #eee;
	border-right: 1px solid #eee;
	font-size: 14px;
}
.spw-qty__input::-webkit-outer-spin-button,
.spw-qty__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Add to cart */
.spw-add-to-cart {
	display: block;
	width: 100%;
	max-width: 340px;
	padding: 15px 24px;
	background: var(--spw-accent);
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .02em;
	cursor: pointer;
	transition: opacity .2s, transform .1s;
}
.spw-add-to-cart:hover:not(:disabled) {
	opacity: .9;
}
.spw-add-to-cart:active:not(:disabled) {
	transform: scale(.99);
}
.spw-add-to-cart:disabled {
	opacity: .45;
	cursor: not-allowed;
}
.spw-add-to-cart.is-loading {
	opacity: .7;
}

.spw-detail__msg {
	margin-top: 10px;
	font-size: 13px;
}
.spw-detail__msg.is-error {
	color: #b3272e;
}
.spw-detail__msg.is-success {
	color: #3a5a40;
}

/* Responsive: tablet - still 2 columns, just tighter */
@media (max-width: 991px) {
	.spw-detail {
		grid-template-columns: minmax(0, 46%) minmax(0, 1fr);
		gap: 30px;
	}
	.spw-detail__title {
		font-size: 26px;
	}
	.spw-detail__thumb {
		width: 52px;
		height: 52px;
	}
	.spw-detail__thumbs {
		flex: 0 0 52px;
		max-height: calc((52px * var(--spw-visible-thumbs)) + (8px * (var(--spw-visible-thumbs) - 1)));
	}
}

/* Responsive: mobile - stack to a single column */
@media (max-width: 767px) {
	.spw-detail {
		grid-template-columns: 1fr;
		gap: 22px;
	}
	.spw-detail__gallery {
		flex-direction: column !important;
	}
	.spw-detail__thumbs {
		flex-direction: row !important;
		max-height: none;
		overflow-x: auto;
		overflow-y: hidden;
		order: 2;
		padding-top: 4px;
		padding-right: 0;
	}
	.spw-detail__thumb {
		width: 56px;
		height: 56px;
	}
	.spw-detail__main-image {
		order: 1;
	}
	.spw-detail__title {
		font-size: 22px;
	}
	.spw-detail__price {
		font-size: 19px;
	}
	.spw-add-to-cart {
		max-width: 100%;
	}
	.spw-select {
		width: 100%;
		min-width: 0;
	}
}
