/*
 * Príslušenstvo so zľavou za balíček v buy-boxe telefónu (A/B test doplnkov, varianty F / G / H).
 * Markup: assets/js/bundle-offer.js. Variant: <html data-ab-doplnky>.
 */

/* Vo variantoch so zľavou blok nahrádza dnešné riadky doplnkov (skryté hneď z <head>, bez bliknutia). */
html[data-ab-doplnky="F"] .services:has(#bundle-root) > .service[data-addon],
html[data-ab-doplnky="G"] .services:has(#bundle-root) > .service[data-addon],
html[data-ab-doplnky="H"] .services:has(#bundle-root) > .service[data-addon] {
	display: none;
}

.bundle {
	--b-brand: var(--nd-c-brand);
	--b-tint: var(--secondary, #efebf3);
	--b-line: var(--secondary-light, #d9cfe2);
	--b-cta: var(--nd-c-cta);
	--b-on: var(--accent-ultra-light, #faffe6);
	--b-head: var(--nd-c-head);
	--b-ink: var(--nd-c-ink);
	--b-muted: var(--nd-c-muted);
	--b-hot: var(--coupon-accent, #d80001);
	--b-hot-bg: var(--coupon-bg, #fff2f2);
	--b-r: var(--radius-xxl, 10px);
	min-width: 0;
	margin: 4px 0 6px;
	font-size: 14px;
	line-height: 1.45;
	color: var(--b-ink);
}

.bundle:empty {
	display: none;
}

.bundle *,
.bundle *::before,
.bundle *::after {
	box-sizing: border-box;
}

.bundle button {
	font: inherit;
	cursor: pointer;
}

.bundle-head {
	margin: 14px 0 8px;
	padding-top: 12px;
	border-top: 1px solid var(--b-line);
	font-size: 14px;
	font-weight: 700;
	color: var(--b-head);
}

/* telefón je už v košíku – zmeny výberu sa potvrdia tlačidlom */
.bundle-cartline {
	margin: 8px 0 0;
	padding: 8px 12px;
	border-radius: 10px;
	background: var(--b-tint);
	color: var(--b-head);
	font-size: 13px;
	font-weight: 600;
}

.bundle-cartline.is-done {
	background: var(--b-on);
	color: var(--nd-c-ok, #667f01);
}

.bundle-cartline.is-dirty {
	display: grid;
	gap: 8px;
	padding: 10px 12px;
	border: 1.5px solid var(--b-brand);
	background: #fff;
	font-weight: 400;
}

.bundle-cartline.is-dirty p {
	margin: 0;
}

.bundle-cartline-err {
	color: var(--b-hot);
	font-weight: 600;
}

.bundle-cartline-btns {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.bundle-cartline-apply,
.bundle-cartline-reset {
	min-height: 40px;
	padding: 0 16px;
	border-radius: 8px;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.bundle-cartline-apply {
	flex: 1 1 auto;
	border: 0;
	background: var(--b-cta);
	color: var(--nd-c-cta-ink, #fff);
}

.bundle-cartline-reset {
	border: 1.5px solid var(--b-line);
	background: #fff;
	color: var(--b-head);
}

/* rámik s kupónom */
.bundle-box {
	padding: 12px;
	border: 1.5px dashed var(--b-hot);
	border-radius: 14px;
	background: #fff;
}

.bundle-box--flat {
	margin-top: 8px;
	border-style: solid;
	border-color: var(--b-line);
}

/* pruh s najvyššou zľavou */
.bundle-hero {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: -12px -12px 12px;
	padding: 10px 12px;
	border-radius: 12px 12px 0 0;
	background: var(--b-hot);
	color: #fff;
}

.bundle-head + .bundle-hero {
	margin: 0 0 4px;
	border-radius: 12px;
}

.bundle-hero-amt {
	flex: 0 0 auto;
	display: flex;
	align-items: baseline;
	gap: 3px;
	padding: 4px 12px;
	border: 2px dashed rgba(255, 255, 255, .7);
	border-radius: 10px;
	font-size: 30px;
	font-weight: 900;
	line-height: 1;
	letter-spacing: -.02em;
	white-space: nowrap;
}

.bundle-hero-amt small {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0;
}

.bundle-hero-t {
	min-width: 0;
	font-size: 13px;
	line-height: 1.35;
}

.bundle-hero-t b {
	display: block;
	font-size: 16px;
}

/* F – ukazovateľ 1·2·3 */
.bundle-meter {
	position: relative;
	display: grid;
	grid-template-columns: repeat(var(--n), 1fr);
	margin: 0 0 8px;
	padding: 4px 0 2px;
	text-align: center;
}

.bundle-meter::before {
	content: "";
	position: absolute;
	top: 11px;
	left: calc(50% / var(--n));
	right: calc(50% / var(--n));
	height: 3px;
	border-radius: 3px;
	background: var(--b-line);
}

.bundle-step {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1px;
	font-size: 13px;
	color: var(--b-muted);
}

.bundle-step i {
	width: 17px;
	height: 17px;
	margin-bottom: 3px;
	border: 3px solid var(--b-line);
	border-radius: 50%;
	background: #fff;
}

.bundle-step b {
	display: inline-block;
	margin-top: 2px;
	padding: 2px 9px;
	border-radius: 999px;
	background: var(--b-tint);
	font-size: 17px;
	font-weight: 900;
	color: var(--b-head);
}

.bundle-step.is-on i {
	border-color: var(--b-cta);
	background: var(--b-cta);
}

.bundle-step.is-on b {
	background: var(--b-hot-bg);
	color: var(--b-hot);
}

.bundle-step.is-cur b {
	background: var(--b-hot);
	color: #fff;
}

/* riadok druhu: kus + iné kusy */
.bundle-slot {
	padding: 6px 0;
	border-top: 1px dashed var(--b-line);
}

.bundle-slot-main {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	text-align: left;
}

.bundle-slot.is-on .bundle-name {
	font-weight: 600;
}

.bundle-cb {
	flex: 0 0 18px;
	display: grid;
	place-items: center;
	width: 18px;
	height: 18px;
	border: 1.5px solid #c9d4db;
	border-radius: 5px;
	background: #fff;
}

.bundle-slot.is-on .bundle-cb {
	border-color: var(--b-cta);
	background: var(--b-cta);
}

.bundle-slot.is-on .bundle-cb::after {
	content: "";
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: translateY(-1px) rotate(45deg);
}

.bundle-img {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	border-radius: 8px;
	background: #fff;
	object-fit: contain;
}

.bundle-img--ph {
	display: inline-block;
	background: var(--b-tint);
}

.bundle-name {
	flex: 1;
	min-width: 0;
	font-size: 13.5px;
	line-height: 1.3;
	color: var(--b-head);
}

.bundle-name small {
	display: block;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: var(--b-muted);
}

.bundle-name small em {
	font-style: normal;
	letter-spacing: 0;
	text-transform: none;
	color: var(--b-brand);
}

.bundle-price {
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
	color: var(--b-head);
}

.bundle-old {
	display: block;
	font-size: 13px;
	font-weight: 400;
	text-align: right;
	color: var(--b-muted);
}

.bundle-swatches {
	display: flex;
	gap: 5px;
	width: 0;
	min-width: calc(100% - 28px);
	margin: 6px 0 0 28px;
	overflow-x: auto;
	scrollbar-width: none;
}

.bundle-sw {
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	padding: 2px;
	border: 1.5px solid var(--b-line);
	border-radius: 8px;
	background: #fff;
}

.bundle-sw.is-on {
	border-color: var(--b-brand);
}

.bundle-swimg {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* G – sady */
.bundle-sets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 8px;
	padding-top: 10px;
}

.bundle-set {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	min-width: 0;
	padding: 14px 12px 12px;
	border: 1.5px solid var(--b-line);
	border-radius: 14px;
	background: #fff;
	color: var(--b-head);
	text-align: left;
}

.bundle-set:hover {
	border-color: var(--b-brand);
}

.bundle-set.is-on {
	border-color: var(--b-cta);
	background: var(--b-on);
	box-shadow: 0 0 0 1px var(--b-cta) inset;
}

.bundle-tag {
	position: absolute;
	top: -9px;
	left: 10px;
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--b-hot);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.6;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: #fff;
}

.bundle-set-imgs {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 4px;
	max-width: 100%;
	margin-bottom: 6px;
}

.bundle-setimg {
	flex: 0 1 44px;
	width: 44px;
	min-width: 0;
	height: 44px;
	object-fit: contain;
}

.bundle-plus {
	font-size: 18px;
	font-weight: 300;
	color: var(--b-muted);
}

.bundle-set > b {
	font-size: 15px;
}

.bundle-set > small {
	font-size: 13px;
	color: var(--b-muted);
}

.bundle-set-p {
	margin-top: 6px;
	font-size: 13px;
}

.bundle-set-p s {
	color: var(--b-muted);
}

.bundle-set-p b {
	font-size: 17px;
	color: var(--b-head);
}

.bundle-save {
	display: inline-block;
	margin-top: 4px;
	padding: 3px 10px;
	border-radius: 8px;
	background: var(--b-hot);
	font-size: 16px;
	font-weight: 900;
	color: #fff;
}

.bundle-set-cta {
	width: 100%;
	margin-top: 8px;
	padding: 7px;
	border: 1.5px solid var(--b-brand);
	border-radius: var(--b-r);
	font-size: 13px;
	font-weight: 700;
	text-align: center;
	color: var(--b-brand);
}

.bundle-set.is-on .bundle-set-cta {
	border-color: var(--b-cta);
	background: var(--b-cta);
	color: #fff;
}

.bundle-link {
	display: inline-block;
	margin-top: 8px;
	padding: 0;
	border: 0;
	background: none;
	font-size: 13px;
	font-weight: 600;
	text-decoration: underline;
	color: var(--b-brand);
}

/* H – dve oddelené zľavy */
.bundle-hsec + .bundle-hsec {
	margin-top: 10px;
}

.bundle-hsec.is-won {
	border-style: solid;
	background: var(--b-hot-bg);
}

.bundle-hsec-h {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
	font-size: 13px;
	line-height: 1.3;
	color: var(--b-ink);
}

.bundle-hsec-h b {
	display: block;
	font-size: 15px;
	color: var(--b-head);
}

.bundle-ticket {
	position: relative;
	flex: 0 0 auto;
	padding: 6px 12px;
	border-radius: 6px;
	background: var(--b-hot);
	font-size: 20px;
	font-weight: 900;
	letter-spacing: .03em;
	white-space: nowrap;
	color: #fff;
}

.bundle-ticket::before,
.bundle-ticket::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 8px;
	height: 8px;
	margin-top: -4px;
	border-radius: 50%;
	background: #fff;
}

.bundle-ticket::before {
	left: -4px;
}

.bundle-ticket::after {
	right: -4px;
}

.bundle-third {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
	margin-bottom: 4px;
}

.bundle-tcard {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 8px 4px;
	border: 1.5px solid var(--b-line);
	border-radius: 12px;
	background: #fff;
	font-size: 13px;
	color: var(--b-head);
}

.bundle-tcard:hover {
	border-color: var(--b-brand);
}

.bundle-tcard.is-on {
	border-color: var(--b-cta);
	background: var(--b-on);
}

.bundle-tcard small {
	color: var(--b-muted);
}

.bundle-timg {
	width: 44px;
	height: 44px;
	object-fit: contain;
}

/* súhrn: príslušenstvo (súčet → po zľave) + spolu s telefónom */
.bundle-total {
	margin-top: 10px;
	padding: 9px 12px;
	border-radius: var(--b-r);
	background: var(--b-tint);
	font-weight: 600;
	color: var(--b-head);
}

.bundle-total-acc,
.bundle-total-all {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
}

.bundle-total-acc {
	align-items: center;
	margin-bottom: 6px;
	padding-bottom: 6px;
	border-bottom: 1px solid var(--b-line);
	font-size: 15px;
}

.bundle-total-acc small {
	font-size: 13px;
	font-weight: 400;
	white-space: nowrap;
	color: var(--b-ink);
}

.bundle-total-acc > span:last-child {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
}

.bundle-total-acc s {
	font-size: 16px;
	font-weight: 600;
	text-decoration-thickness: 2px;
	color: var(--b-muted);
}

.bundle-total-acc b {
	font-size: 21px;
	font-weight: 900;
	white-space: nowrap;
	color: var(--b-hot);
}

.bundle-tsave {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 999px;
	background: var(--b-hot);
	font-size: 14px;
	font-style: normal;
	font-weight: 800;
	white-space: nowrap;
	color: #fff;
}

.bundle-total-all b {
	font-size: 17px;
	white-space: nowrap;
	color: var(--b-brand);
}

@media (max-width: 480px) {
	.bundle-hero-amt {
		padding: 3px 8px;
		font-size: 24px;
	}

	/* tretí kus: vodorovne posuvný pás, ktorý nesmie roztiahnuť stĺpec buy-boxu */
	.bundle-third {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: 104px;
		min-width: 0;
		padding-bottom: 4px;
		overflow-x: auto;
		contain: inline-size;
		scroll-snap-type: x mandatory;
	}

	.bundle-tcard {
		scroll-snap-align: start;
	}

	.bundle-set-imgs .bundle-plus {
		font-size: 14px;
	}

	.bundle-setimg {
		width: 34px;
		height: 34px;
	}
}
