/* ==========================================================================
   Sanimax – "Buy More, Save More" quantity options (single product page)
   Loaded before custom.css, so selectors are scoped with enough specificity.
   ========================================================================== */

.sanimax-bundles {
	--sb-gold: #e6af5d;
	--sb-gold-strong: #d99a2b;
	--sb-gold-soft: #fdf6ea;
	--sb-ink: #332f2c;
	--sb-muted: #7a7470;
	--sb-line: #efe3cf;
	--sb-red: #e0212e;
	--sb-radius: 12px;

	width: 100%;
	clear: both;
	margin: 1.2em 0 1.4em;
	font-family: var(--likh, "Poppins", sans-serif);
	color: var(--sb-ink);
}

/* Heading with gold rules on both sides */
.sanimax-bundles__heading {
	display: flex;
	align-items: center;
	gap: 0.9em;
	margin-bottom: 1em;
	font-size: 1em;
	font-weight: 500;
	letter-spacing: 0.3px;
	color: var(--sb-ink);
	white-space: nowrap;
}

.sanimax-bundles__heading::before,
.sanimax-bundles__heading::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--sb-gold));
}

.sanimax-bundles__heading::after {
	background: linear-gradient(90deg, var(--sb-gold), transparent);
}

.sanimax-bundles__list {
	display: flex;
	flex-direction: column;
	gap: 0.85em;
}

/* Card */
.sanimax-bundle {
	position: relative;
	border: 1.5px solid var(--sb-line);
	border-radius: var(--sb-radius);
	background: #faf9f7;
	transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.sanimax-bundle:not(.is-disabled):hover {
	border-color: var(--sb-gold);
	box-shadow: 0 6px 18px rgba(230, 175, 93, 0.14);
	transform: translateY(-1px);
}

.sanimax-bundle.is-selected {
	border-color: var(--sb-gold);
	background: var(--sb-gold-soft);
	box-shadow: 0 0 0 1px var(--sb-gold), 0 8px 22px rgba(230, 175, 93, 0.18);
}

.sanimax-bundle.is-disabled {
	opacity: 0.45;
	filter: grayscale(0.4);
}

.sanimax-bundle__main {
	display: flex;
	align-items: center;
	gap: 0.95em;
	margin: 0;
	padding: 1.05em 1.1em;
	cursor: pointer;
	user-select: none;
}

.sanimax-bundle.is-disabled .sanimax-bundle__main {
	cursor: not-allowed;
}

/* Visually hidden native radio (kept for keyboard + screen readers) */
.sanimax-bundle__radio {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	border: 0;
	opacity: 0;
}

/* Custom radio */
.sanimax-bundle__check {
	position: relative;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border: 2px solid #e7d3b1;
	border-radius: 50%;
	background: #fff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sanimax-bundle__check::after {
	content: "";
	position: absolute;
	inset: 3px;
	border-radius: 50%;
	background: var(--sb-gold);
	transform: scale(0);
	transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sanimax-bundle.is-selected .sanimax-bundle__check {
	border-color: var(--sb-gold-strong);
	box-shadow: 0 0 0 4px rgba(230, 175, 93, 0.18);
}

.sanimax-bundle.is-selected .sanimax-bundle__check::after {
	transform: scale(1);
}

.sanimax-bundle__radio:focus-visible + .sanimax-bundle__check {
	outline: 2px solid var(--sb-ink);
	outline-offset: 2px;
}

/* Texts */
.sanimax-bundle__info {
	display: flex;
	flex-direction: column;
	gap: 0.3em;
	flex: 1 1 auto;
	min-width: 0;
}

.sanimax-bundle__title {
	font-size: 0.98em;
	font-weight: 500;
	line-height: 1.3;
	color: var(--sb-ink);
}

.sanimax-bundle__save {
	font-size: 0.74em;
	line-height: 1.3;
	color: var(--sb-muted);
}

.sanimax-bundle.is-selected .sanimax-bundle__save {
	color: #a36a12;
}

.sanimax-bundle__prices {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.2em;
	flex: 0 0 auto;
	text-align: right;
}

.sanimax-bundle__price {
	font-size: 1em;
	font-weight: 600;
	color: var(--sb-ink);
	white-space: nowrap;
}

.sanimax-bundle__regular {
	font-size: 0.74em;
	color: #a19a95;
	white-space: nowrap;
}

.sanimax-bundle__regular[hidden] {
	display: none;
}

/* "Most Popular" badge */
.sanimax-bundle__badge {
	position: absolute;
	top: 0;
	right: 1em;
	transform: translateY(-50%);
	z-index: 1;
	padding: 0.32em 0.75em;
	border-radius: 4px;
	background: linear-gradient(135deg, #f0323f, var(--sb-red));
	box-shadow: 0 4px 10px rgba(224, 33, 46, 0.3);
	color: #fff;
	font-size: 0.64em;
	font-weight: 700;
	letter-spacing: 0.6px;
	line-height: 1.2;
	text-transform: uppercase;
	pointer-events: none;
}

.sanimax-bundle--popular {
	margin-top: 0.4em;
}

/* "Buy More" quantity stepper – expands only when that option is selected */
.sanimax-bundle__stepper {
	display: grid;
	grid-template-columns: auto auto 1fr;
	align-items: center;
	gap: 0.8em;
	max-height: 0;
	padding: 0 1.1em 0 calc(1.1em + 22px + 0.95em);
	overflow: hidden;
	opacity: 0;
	transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
}

.sanimax-bundle--custom.is-selected .sanimax-bundle__stepper {
	max-height: 90px;
	padding-bottom: 1em;
	opacity: 1;
}

.sanimax-bundle__stepper-label {
	font-size: 0.78em;
	font-weight: 500;
	color: var(--sb-muted);
}

.sanimax-bundle__stepper-hint {
	font-size: 0.72em;
	color: var(--sb-muted);
}

.sanimax-bundle__stepper-control {
	display: inline-flex;
	align-items: center;
	border: 1.5px solid #e7d3b1;
	border-radius: 100px;
	background: #fff;
	overflow: hidden;
}

body .product .sanimax-bundles .sanimax-bundle__step {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--sb-ink);
	font-size: 1.1em;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

body .product .sanimax-bundles .sanimax-bundle__step:hover:not(:disabled) {
	background: var(--sb-gold-soft);
	color: var(--sb-gold-strong);
}

body .product .sanimax-bundles .sanimax-bundle__step:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

body .product .sanimax-bundles .sanimax-bundle__qty-input {
	width: 3.2em;
	height: 34px;
	margin: 0;
	padding: 0;
	border: 0;
	border-left: 1px solid #f0e4d0;
	border-right: 1px solid #f0e4d0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--sb-ink);
	font-family: inherit;
	font-size: 0.95em;
	font-weight: 600;
	text-align: center;
	outline: none;
	-moz-appearance: textfield;
	appearance: textfield;
}

body .product .sanimax-bundles .sanimax-bundle__qty-input::-webkit-outer-spin-button,
body .product .sanimax-bundles .sanimax-bundle__qty-input::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

body .product .sanimax-bundles .sanimax-bundle__qty-input:focus {
	background: var(--sb-gold-soft);
}

/* --------------------------------------------------------------------------
   Form integration: hide the native qty box, make Add to Cart full width
   -------------------------------------------------------------------------- */

/* Hide immediately (no flash) in browsers that support :has() … */
body .product form.cart:has(.sanimax-bundles) div.quantity {
	display: none !important;
}

/* … and via the class added by JS everywhere else. */
body .product form.cart.sanimax-has-bundle div.quantity {
	display: none !important;
}

body .product .summary form.cart.sanimax-has-bundle .single_add_to_cart_button {
	float: none;
	width: 100%;
	margin: 0;
	padding-top: 1.05em;
	padding-bottom: 1.05em;
	border-radius: 10px;
	letter-spacing: 1px;
	text-transform: uppercase;
	font-weight: 500;
}

body .product .summary form.cart.sanimax-has-bundle .woocommerce-variation-add-to-cart,
body .product .summary form.cart.sanimax-has-bundle {
	display: block;
}

body .product .summary form.cart.sanimax-has-bundle::after {
	content: "";
	display: table;
	clear: both;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
	.sanimax-bundle__main {
		gap: 0.75em;
		padding: 0.95em 0.9em;
	}

	.sanimax-bundle__title {
		font-size: 0.92em;
	}

	.sanimax-bundle__price {
		font-size: 0.95em;
	}

	.sanimax-bundle__stepper {
		grid-template-columns: auto 1fr;
		padding-left: calc(0.9em + 22px + 0.75em);
		padding-right: 0.9em;
	}

	.sanimax-bundle__stepper-hint {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sanimax-bundle,
	.sanimax-bundle__check::after,
	.sanimax-bundle__stepper {
		transition: none;
	}
}
