/**
 * BX Množstevní karty
 */

.bxtc-wrapper {
	--bxtc-radius: 12px;
	--bxtc-border: #e2e5ea;
	--bxtc-muted: #6b7280;
	--bxtc-bar-base: #9ca3af;

	clear: both;
	margin: 22px 0;
	background: #f7f8fa;
	border-radius: calc(var(--bxtc-radius) + 4px);
	padding: 14px;
	box-sizing: border-box;
}

.bxtc-title {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 12px;
	color: #1f2937;
}

/* Kontejner karet – přebíjí výchozí styl mateřského pluginu. */
.tiered-pricing-options.bxtc-cards {
	display: flex !important;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 10px;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.tiered-pricing-options.bxtc-cards::-webkit-scrollbar {
	height: 4px;
}

.tiered-pricing-options.bxtc-cards::-webkit-scrollbar-thumb {
	background: #d7dae0;
	border-radius: 4px;
}

/* Karta */
.tiered-pricing-options.bxtc-cards .bxtc-card {
	position: relative;
	display: flex !important;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	flex: 1 1 0;
	min-width: 104px;
	margin: 0 0 4px !important;
	padding: 12px 8px 0 !important;
	background: #fff;
	border: 2px solid var(--bxtc-border) !important;
	border-radius: var(--bxtc-radius) !important;
	overflow: hidden;
	cursor: pointer;
	text-align: center;
	transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.tiered-pricing-options.bxtc-cards .bxtc-card:hover {
	border-color: #c7ccd4 !important;
}

.tiered-pricing-options.bxtc-cards .bxtc-card:focus-visible {
	outline: 3px solid var(--bxtc-accent);
	outline-offset: 2px;
}

.tiered-pricing-options.bxtc-cards .bxtc-card.tiered-pricing--active {
	border-color: var(--bxtc-accent) !important;
	background: color-mix(in srgb, var(--bxtc-accent) 5%, #fff);
	box-shadow: 0 6px 16px rgba(15, 23, 42, .08);
}

/* Štítek se slevou */
.bxtc-cards .bxtc-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	background: var(--bxtc-badge);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	padding: 5px 8px;
	border-radius: 999px;
	white-space: nowrap;
}

.bxtc-cards .bxtc-ribbon {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 2;
	background: var(--bxtc-accent);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .02em;
	text-transform: uppercase;
	line-height: 1;
	padding: 5px 7px;
	border-radius: 999px;
}

/* Obrázky – oddělené dlaždice, aby byl počet kusů vidět na první pohled */
.bxtc-card__media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 104px;
	width: 100%;
	margin-bottom: 8px;
}

.bxtc-card__tile {
	position: relative;
	display: block;
	flex: 0 0 auto;
	box-sizing: border-box;
	background: #fff;
	border: 2px solid #fff;
	border-radius: 10px;
	box-shadow: 0 2px 6px rgba(15, 23, 42, .18);
	overflow: hidden;
}

.bxtc-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
	box-shadow: none;
	margin: 0;
}

.bxtc-card__media--1 .bxtc-card__tile {
	width: 88px;
	height: 88px;
}

.bxtc-card__media--2 .bxtc-card__tile {
	width: 72px;
	height: 72px;
	margin-left: -14px;
}

.bxtc-card__media--3 .bxtc-card__tile {
	width: 62px;
	height: 62px;
	margin-left: -16px;
}

.bxtc-card__media--4 .bxtc-card__tile,
.bxtc-card__media--5 .bxtc-card__tile {
	width: 54px;
	height: 54px;
	margin-left: -18px;
}

.bxtc-card__media .bxtc-card__tile:first-child {
	margin-left: 0;
}

/* Kolečko s počtem kusů přes štos obrázků */
.bxtc-card__count {
	position: absolute;
	right: 4px;
	bottom: 0;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	padding: 0 7px;
	border-radius: 999px;
	background: var(--bxtc-count);
	color: #1f2937;
	font-size: 15px;
	font-weight: 800;
	line-height: 1;
	box-shadow: 0 2px 6px rgba(15, 23, 42, .22);
}

/* Množství a ceny */
.bxtc-card__qty {
	font-size: 22px;
	font-weight: 700;
	line-height: 1.1;
	color: #111827;
	margin-bottom: 4px;
}

.bxtc-card__price {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 3px;
	flex-wrap: wrap;
	line-height: 1.2;
}

.bxtc-card__price-now,
.bxtc-card__price-now .woocommerce-Price-amount {
	font-size: 16px;
	font-weight: 700;
	color: #111827;
}

.bxtc-card--discounted .bxtc-card__price-now,
.bxtc-card--discounted .bxtc-card__price-now .woocommerce-Price-amount {
	color: var(--bxtc-accent);
}

.bxtc-card__price-unit {
	font-size: 12px;
	font-weight: 500;
	color: var(--bxtc-muted);
}

.bxtc-card__price-old {
	font-size: 12px;
	color: var(--bxtc-muted);
	margin-top: 2px;
}

.bxtc-card__price-old del,
.bxtc-card__price-old .woocommerce-Price-amount {
	color: var(--bxtc-muted);
	text-decoration: line-through;
}

/* Spodní pruh */
.bxtc-card__bar {
	width: calc(100% + 16px);
	/* auto nahoře drží pruh u spodní hrany, i když má karta míň obsahu
	   (základní hladina nemá přeškrtnutou cenu). */
	margin: auto -8px 0;
	padding: 8px 6px;
	border-radius: 0 0 calc(var(--bxtc-radius) - 2px) calc(var(--bxtc-radius) - 2px);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	color: #fff;
	background: var(--bxtc-bar-base);
}

.bxtc-card__bar--save {
	background: var(--bxtc-accent);
}

/* Skryté prvky pro JS mateřského pluginu */
.bxtc-card__hidden-total {
	display: none !important;
}

/* Souhrn pod kartami */
.bxtc-summary {
	margin: 12px 0 0;
	font-size: 14px;
	font-weight: 600;
	color: #1f2937;
}

.bxtc-summary--large {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
	padding: 14px 12px;
	background: #fff;
	border: 2px solid var(--bxtc-accent);
	border-radius: var(--bxtc-radius);
	font-size: 19px;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
}

.bxtc-summary__total {
	color: var(--bxtc-accent);
	font-size: 1.15em;
	font-weight: 800;
	white-space: nowrap;
}

.bxtc-summary__total .woocommerce-Price-amount {
	color: inherit;
	font-weight: inherit;
}

.bxtc-summary:empty {
	display: none;
}

/* Mobil */
@media (max-width: 480px) {
	.bxtc-wrapper {
		padding: 12px 10px;
	}

	.tiered-pricing-options.bxtc-cards {
		gap: 8px;
	}

	.tiered-pricing-options.bxtc-cards .bxtc-card {
		min-width: 96px;
		padding: 10px 6px 0 !important;
	}

	.bxtc-card__media {
		height: 82px;
	}

	.bxtc-card__media--1 .bxtc-card__tile {
		width: 70px;
		height: 70px;
	}

	.bxtc-card__media--2 .bxtc-card__tile {
		width: 58px;
		height: 58px;
		margin-left: -12px;
	}

	.bxtc-card__media--3 .bxtc-card__tile {
		width: 50px;
		height: 50px;
		margin-left: -14px;
	}

	.bxtc-card__media--4 .bxtc-card__tile,
	.bxtc-card__media--5 .bxtc-card__tile {
		width: 44px;
		height: 44px;
		margin-left: -16px;
	}

	.bxtc-card__count {
		min-width: 28px;
		height: 28px;
		font-size: 13px;
		right: 2px;
	}

	.bxtc-summary--large {
		font-size: 17px;
		padding: 12px 10px;
	}

	.bxtc-card__qty {
		font-size: 19px;
	}

	.bxtc-card__price-now,
	.bxtc-card__price-now .woocommerce-Price-amount {
		font-size: 14px;
	}

	.bxtc-card__bar {
		width: calc(100% + 12px);
		margin: auto -6px 0;
		font-size: 12px;
		padding: 7px 4px;
	}

	.bxtc-cards .bxtc-badge {
		font-size: 11px;
		padding: 4px 6px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tiered-pricing-options.bxtc-cards .bxtc-card {
		transition: none;
	}
}

/* ==========================================================================
   Množstevní hladiny v košíku
   ========================================================================== */

.bxtc-cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 8px 0 0;
	font-size: 13px;
	line-height: 1.3;
}

.bxtc-cart.is-loading {
	opacity: 0.5;
	pointer-events: none;
}

.bxtc-cart__label {
	color: #6b7280;
}

.bxtc-cart__tiers {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 6px;
}

.bxtc-cart__tier {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	padding: 5px 10px;
	border: 1px solid #dfe3e8;
	border-radius: 7px;
	background: #fff;
	color: #1c1c1c;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.25;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.bxtc-cart__tier:hover {
	border-color: #b9c2ca;
	background: #fafbfc;
}

.bxtc-cart__tier.is-active {
	border-color: var(--bxtc-accent, #3bb54a);
	background: #f4fbf6;
	color: var(--bxtc-accent, #3bb54a);
	cursor: default;
}

.bxtc-cart__qty {
	font-weight: 700;
}

.bxtc-cart__price {
	font-weight: 600;
}

.bxtc-cart__price .woocommerce-Price-amount {
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
}

.bxtc-cart__unit {
	margin-left: 1px;
	font-size: 11px;
	font-weight: 500;
	opacity: 0.7;
}

.bxtc-cart__save {
	color: var(--bxtc-accent, #3bb54a);
	font-size: 12px;
	font-weight: 700;
}

.bxtc-cart__tier.is-active .bxtc-cart__save {
	display: none;
}

.bxtc-mini {
	display: block;
	margin-top: 3px;
	color: #6b7280;
	font-size: 12px;
	line-height: 1.3;
}

@media (max-width: 600px) {
	.bxtc-cart {
		gap: 5px;
	}

	.bxtc-cart__label {
		flex: 1 1 100%;
		font-size: 12.5px;
	}

	/* Na úzké obrazovce z dlaždic uděláme řádky, ať se nelámou uvnitř. */
	.bxtc-cart__tiers {
		flex-direction: column;
		width: 100%;
		gap: 5px;
	}

	.bxtc-cart__tier {
		width: 100%;
		justify-content: space-between;
		padding: 7px 10px;
		font-size: 12.5px;
	}

	/* Sloupec s položkou bývá na mobilu úzký – úsporu vypustíme,
	   ať se řádek nezalamuje do tří sloupců. */
	.bxtc-cart__save {
		display: none;
	}
}
