/* SarvTheme product-bundle.css — built from modules. Edit modules + run npm run build */

/* --- product-bundle.css --- */
/**
 * Product Bundle — theme-aligned styles + selectable items.
 */

.st-bundle {
	--st-bundle-border: var(--st-product-border, var(--st-border, #e5e7eb));
	--st-bundle-text: var(--st-product-text, var(--st-text, #111827));
	--st-bundle-muted: var(--st-product-muted, #6b7280);
	--st-bundle-surface: var(--st-product-surface, var(--st-surface, #f8f9fa));
	--st-bundle-radius: var(--st-product-radius, var(--st-radius-md, 12px));
	--st-bundle-radius-sm: var(--st-product-radius-sm, var(--st-radius-sm, 8px));
	--st-bundle-primary: var(--st-color-primary, #0d6efd);
	--st-bundle-gap: var(--st-product-space-md, 16px);

	margin: var(--st-product-space-xl, 32px) 0;
	padding: var(--st-product-space-lg, 24px);
	color: var(--st-bundle-text);
	background: var(--st-bundle-surface);
	border: 1px solid var(--st-bundle-border);
	border-radius: var(--st-bundle-radius);
}

.st-bundle__header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--st-product-space-sm, 10px);
	margin-bottom: var(--st-bundle-gap);
}

.st-bundle__title {
	margin: 0;
	font-size: var(--st-product-section-title-size, 1.05rem);
	font-weight: 700;
	line-height: 1.4;
}

.st-bundle__toolbar {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.85rem;
}

.st-bundle__link {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--st-bundle-primary);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.st-bundle__link:hover {
	text-decoration: underline;
}

.st-bundle__toolbar-sep {
	color: var(--st-bundle-muted);
}

.st-bundle__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--st-product-space-sm, 10px);
}

.st-bundle__item {
	margin: 0;
}

.st-bundle__label {
	display: flex;
	align-items: center;
	gap: var(--st-product-space-sm, 10px);
	width: 100%;
	margin: 0;
	padding: var(--st-product-space-sm, 10px) var(--st-product-space-md, 16px);
	background: #fff;
	border: 1px solid var(--st-bundle-border);
	border-radius: var(--st-bundle-radius-sm);
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.st-bundle__item:not(.is-disabled) .st-bundle__label:hover {
	border-color: color-mix(in srgb, var(--st-bundle-primary) 45%, var(--st-bundle-border));
}

.st-bundle__item:has(.st-bundle__checkbox:checked) .st-bundle__label {
	border-color: var(--st-bundle-primary);
	box-shadow: 0 0 0 1px var(--st-bundle-primary);
}

.st-bundle__item.is-disabled .st-bundle__label {
	opacity: 0.55;
	cursor: not-allowed;
}

.st-bundle__check {
	position: relative;
	flex: 0 0 auto;
	display: inline-flex;
}

.st-bundle__checkbox {
	position: absolute;
	inset: 0;
	opacity: 0;
	margin: 0;
	cursor: inherit;
}

.st-bundle__check-box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border: 1.5px solid var(--st-bundle-border);
	border-radius: 6px;
	background: #fff;
	color: transparent;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.st-bundle__checkbox:checked + .st-bundle__check-box {
	background: var(--st-bundle-primary);
	border-color: var(--st-bundle-primary);
	color: #fff;
}

.st-bundle__checkbox:focus-visible + .st-bundle__check-box {
	outline: 2px solid color-mix(in srgb, var(--st-bundle-primary) 40%, transparent);
	outline-offset: 2px;
}

.st-bundle__thumb {
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: var(--st-bundle-radius-sm);
	background: var(--st-bundle-surface);
}

.st-bundle__thumb--empty {
	display: block;
	border: 1px dashed var(--st-bundle-border);
}

.st-bundle__meta {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.st-bundle__name {
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.45;
}

.st-bundle__qty {
	font-size: 0.8rem;
	color: var(--st-bundle-muted);
}

.st-bundle__price {
	flex: 0 0 auto;
	font-size: 0.95rem;
	font-weight: 700;
	white-space: nowrap;
}

.st-bundle__footer {
	display: flex;
	flex-direction: column;
	gap: var(--st-bundle-gap);
	margin-top: var(--st-bundle-gap);
	padding-top: var(--st-bundle-gap);
	border-top: 1px solid var(--st-bundle-border);
}

.st-bundle__totals {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
}

.st-bundle__row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	font-size: 0.92rem;
}

.st-bundle__row--muted,
.st-bundle__row--discount {
	color: var(--st-bundle-muted);
	font-size: 0.85rem;
}

.st-bundle__row--total {
	font-size: 1rem;
}

.st-bundle__row--total strong {
	font-size: 1.1rem;
	color: var(--st-bundle-primary);
}

.st-bundle__savings {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	color: var(--st-product-in-stock, #16a34a);
	font-size: 0.9rem;
	font-weight: 600;
}

.st-bundle__btn {
	width: 100%;
	min-height: var(--st-control-height, 44px);
	padding: 14px 20px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	border-radius: var(--st-bundle-radius-sm);
}

.st-bundle__btn.is-loading,
.st-bundle__btn[disabled] {
	opacity: 0.55;
	pointer-events: none;
}

@media (max-width: 575px) {
	.st-bundle {
		padding: var(--st-product-space-md, 16px);
	}

	.st-bundle__label {
		flex-wrap: wrap;
	}

	.st-bundle__price {
		margin-inline-start: auto;
	}
}
