/*
 * Kosár (14 · Kosár) + a pénztár és a köszönőoldal közös elemei (.tf-wc-*):
 * lépés sáv, összesítő kártya, címke–érték sorok, végösszeg, tételsorok, mobil tapadó sáv, WC értesítések.
 * A pénztár és a köszönőoldal is betölti (inc/woocommerce.php: tofolia_page_assets).
 * Méretek: design px = PDF egység / 0,75.
 */

/* ---------- Oldal keret ---------- */
:is(.tf-page-cart, .tf-page-checkout, .tf-page-thankyou) .tf-page-shell {
	padding-top: var(--s-6);
}

@media (min-width: 1200px) {
	.tf-page-cart .tf-page-shell {
		padding-top: 23px;
	}
}

/* ---------- Lépés sáv: 1 · Kosár — 2 · Pénztár — 3 · Fizetés (Barion) ---------- */
.tf-wc-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 0;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tf-wc-steps__item {
	display: flex;
	align-items: center;
}

.tf-wc-steps__item + .tf-wc-steps__item::before {
	content: "";
	width: 12px;
	height: 2px;
	margin: 0 4px;
	border-radius: 1px;
	background: var(--c-sky-300);
}

.tf-wc-steps__item.is-current::before {
	background: var(--c-blue);
}

.tf-wc-steps__chip {
	display: inline-flex;
	gap: 4px;
	align-items: center;
	min-height: 32px;
	padding: 4px 11px;
	border-radius: var(--r-pill);
	background: var(--c-sky-100);
	color: var(--c-blue-ink);
	font-size: var(--fs-3xs);
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
}

a.tf-wc-steps__chip:hover {
	background: var(--c-sky-300);
	color: var(--c-navy);
}

.tf-wc-steps__item.is-current .tf-wc-steps__chip {
	background: var(--c-navy);
	color: #fff;
}

@media (max-width: 439.98px) {
	.tf-wc-steps__extra {
		display: none;
	}
}

@media (min-width: 400px) {
	.tf-wc-steps__chip {
		font-size: var(--fs-2xs);
	}
}

@media (min-width: 640px) {
	.tf-wc-steps__item + .tf-wc-steps__item::before {
		width: 40px;
		margin: 0 10px;
	}

	.tf-wc-steps__chip {
		padding-inline: 16px;
		font-size: var(--fs-xs);
	}
}

/* ---------- Összesítő kártya (kosár, pénztár) ---------- */
.tf-wc-card {
	padding: var(--s-6) var(--s-5);
	border-radius: var(--r-lg);
	background: #fff;
	box-shadow: 0 10px 40px rgba(8, 41, 52, 0.08), 0 0 0 1px rgba(8, 41, 52, 0.03);
}

.tf-wc-card__title {
	margin-bottom: 14px;
	font-size: 1.5rem;
	line-height: 1.2;
}

.tf-wc-card__cta {
	margin-top: 15px;
}

.tf-wc-card__cta .tf-btn,
.tf-wc-card__cta .button {
	font-size: 1.0625rem;
}

.tf-wc-card__note {
	margin-top: 12px;
	color: var(--c-muted);
	font-size: var(--fs-2xs);
	line-height: 1.45;
	text-align: center;
}

@media (min-width: 640px) {
	.tf-wc-card {
		padding: 28px 28px 30px;
	}
}

/* Címke – érték sorok (dl) */
.tf-wc-rows {
	display: grid;
	gap: 8px;
	margin: 0;
}

.tf-wc-rows__row {
	display: flex;
	gap: var(--s-4);
	align-items: baseline;
	justify-content: space-between;
	font-size: var(--fs-sm);
	line-height: 1.45;
}

.tf-wc-rows dt {
	color: var(--c-muted);
}

.tf-wc-rows dd {
	margin: 0;
	color: var(--c-ink);
	font-weight: 700;
	text-align: right;
	white-space: nowrap;
}

.tf-wc-rows__code {
	display: inline-block;
	padding: 0 8px;
	border-radius: var(--r-pill);
	background: var(--c-sky-100);
	color: var(--c-blue-ink);
	font-size: var(--fs-3xs);
	font-weight: 600;
	text-transform: uppercase;
}

.tf-wc-rows__remove {
	display: inline-grid;
	place-items: center;
	width: 24px;
	height: 24px;
	margin-left: 4px;
	border-radius: 50%;
	color: var(--c-muted);
	vertical-align: middle;
}

.tf-wc-rows__remove .tf-icon {
	width: 14px;
	height: 14px;
}

.tf-wc-rows__remove:hover {
	background: var(--c-sky-100);
	color: var(--c-navy);
}

/* Súly szerinti szállítási tipp */
.tf-wc-hint {
	margin-top: 12px;
	padding: 12px 14px;
	border-radius: var(--r-md);
	background: var(--c-sky-100);
	color: var(--c-blue-ink);
	font-size: var(--fs-xs);
	line-height: 1.45;
}

.tf-wc-hint strong {
	font-weight: 700;
}

/* Fizetendő */
.tf-wc-total {
	margin-top: 13px;
	padding-top: 14px;
	border-top: 1px solid var(--c-line);
}

.tf-wc-total__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0 var(--s-4);
	align-items: baseline;
	justify-content: space-between;
}

.tf-wc-total__label {
	color: var(--c-ink);
	font-size: var(--fs-body);
	font-weight: 600;
}

.tf-wc-total__amount {
	color: var(--c-navy);
	font-family: var(--f-head);
	font-size: clamp(2rem, 1.6rem + 1.2vw, 2.5rem);
	font-weight: 700;
	line-height: 1.15;
	white-space: nowrap;
}

.tf-wc-total__vat {
	margin-top: 2px;
	color: var(--c-muted);
	font-size: var(--fs-2xs);
	text-align: right;
}

/* ---------- Tételsor kis képpel (pénztár összesítő, köszönőoldal) ---------- */
.tf-wc-lines {
	display: grid;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tf-wc-line {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr) auto;
	gap: 12px;
	align-items: center;
}

.tf-wc-line__img {
	width: 56px;
	height: 56px;
	border-radius: var(--r-sm);
	background: var(--c-surface);
	object-fit: cover;
}

.tf-wc-line__body {
	display: grid;
	min-width: 0;
}

.tf-wc-line__title {
	color: var(--c-ink);
	font-size: var(--fs-sm);
	font-weight: 700;
	line-height: 1.35;
}

.tf-wc-line__qty {
	color: var(--c-muted);
	font-weight: 600;
}

.tf-wc-line__meta {
	color: var(--c-muted);
	font-size: var(--fs-3xs);
	line-height: 1.4;
}

.tf-wc-line__price {
	color: var(--c-ink);
	font-size: var(--fs-sm);
	font-weight: 700;
	white-space: nowrap;
}

/* ---------- Mobil tapadó sáv (Fizetendő + gomb) ---------- */
.tf-wc-bar {
	position: fixed;
	right: 12px;
	bottom: 12px;
	left: 12px;
	z-index: 40;
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	padding: 12px 12px 12px 20px;
	border-radius: var(--r-lg);
	background: var(--c-navy);
	box-shadow: var(--sh-float);
	transform: translateY(0);
	transition: transform 200ms var(--ease), opacity 200ms var(--ease);
}

.tf-wc-bar.is-off {
	opacity: 0;
	pointer-events: none;
	transform: translateY(calc(100% + 24px));
}

.tf-wc-bar__sum {
	display: grid;
	min-width: 0;
}

.tf-wc-bar__label {
	color: var(--c-sky-300);
	font-size: var(--fs-2xs);
	line-height: 1.3;
}

.tf-wc-bar__label a,
.tf-wc-bar__label button {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: none;
}

.tf-wc-bar__total {
	color: #fff;
	font-family: var(--f-head);
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
}

.tf-wc-bar__btn {
	flex: none;
	min-height: 48px;
	padding-inline: 20px;
	font-size: var(--fs-body);
}

@media (min-width: 960px) {
	.tf-wc-bar {
		display: none;
	}
}

/* ---------- WooCommerce értesítések a kosár/pénztár oldalakon ---------- */
:is(.tf-cart, .tf-co, .tf-ty) :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) {
	margin: 0 0 var(--s-4);
	padding: 12px 18px;
	font-size: var(--fs-sm);
	line-height: 1.5;
}

:is(.tf-cart, .tf-co, .tf-ty) .woocommerce-message {
	background: var(--c-success-bg);
	color: var(--c-success);
}

:is(.tf-cart, .tf-co, .tf-ty) :is(.woocommerce-message, .woocommerce-info) a:not(.button) {
	margin-left: auto;
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

/* „Visszavonás?” link a törlés után */
.tf-cart .woocommerce-message .restore-item {
	white-space: nowrap;
}

/* ================================================================
 * Kosár oldal
 * ================================================================ */
.tf-cart__title-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	align-items: center;
}

.tf-cart__title {
	font-size: clamp(2.25rem, 1.8rem + 1.6vw, 3rem);
	line-height: 1.08;
}

.tf-cart__count {
	display: inline-flex;
	align-items: center;
	min-height: 31px;
	padding: 3px 15px;
	border-radius: var(--r-pill);
	background: var(--c-sky-100);
	color: var(--c-blue-ink);
	font-size: var(--fs-body);
	font-weight: 600;
	line-height: 1.2;
}

.tf-cart__head .tf-wc-steps {
	margin-top: 24px;
}

.tf-cart__notices {
	margin-top: var(--s-6);
}

.tf-cart__notices:not(:has(.woocommerce-message, .woocommerce-info, .woocommerce-error)) {
	margin-top: 0;
}

.tf-cart__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--s-7);
	align-items: start;
	margin-top: var(--s-6);
}

.tf-cart__notices:has(.woocommerce-message, .woocommerce-info, .woocommerce-error) + .tf-cart__layout {
	margin-top: 0;
}

@media (min-width: 960px) {
	.tf-cart__layout {
		grid-template-columns: minmax(0, 1fr) 360px;
		gap: 32px;
		margin-top: 32px;
	}

	.tf-cart__aside {
		position: sticky;
		top: var(--s-6);
	}
}

@media (min-width: 1200px) {
	.tf-cart__layout {
		grid-template-columns: minmax(0, 1fr) 419px;
		column-gap: 42px;
	}
}

/* Blokkolás AJAX frissítés alatt (a WC jQuery blockUI-ja mellé) */
.tf-cart__form.processing,
.tf-cart-totals.processing {
	opacity: 0.6;
	transition: opacity var(--t-fast) var(--ease);
}

/* ---------- Tételsorok ---------- */
.tf-cart__items {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 15px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tf-cart-item {
	display: grid;
	grid-template-areas:
		"thumb info info"
		"qty qty end";
	grid-template-columns: 72px minmax(0, 1fr) auto;
	gap: 14px 14px;
	align-items: center;
	padding: 12px;
	border-radius: var(--r-lg);
	background: var(--c-surface);
}

.tf-cart-item__thumb {
	grid-area: thumb;
	align-self: start;
}

.tf-cart-item__thumb a {
	display: block;
}

.tf-cart-item__img {
	display: block;
	width: 72px;
	height: 72px;
	border-radius: var(--r-sm);
	background: var(--c-sky-100);
	object-fit: cover;
}

.tf-cart-item__info {
	grid-area: info;
	display: grid;
	gap: 2px;
	min-width: 0;
}

.tf-cart-item__title {
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.3;
	text-wrap: pretty;
}

.tf-cart-item__title a {
	color: inherit;
	text-decoration: none;
}

.tf-cart-item__title a:hover {
	color: var(--c-blue-strong);
}

.tf-cart-item__meta {
	color: var(--c-muted);
	font-size: var(--fs-xs);
	line-height: 1.5;
}

.tf-cart-item__action {
	justify-self: start;
	color: var(--c-blue-strong);
	font-size: var(--fs-xs);
	font-weight: 600;
	line-height: 1.5;
	text-decoration: none;
}

.tf-cart-item__action:hover {
	color: var(--c-navy);
	text-decoration: underline;
}

.tf-cart-item__qty {
	grid-area: qty;
}

.tf-cart-item__end {
	grid-area: end;
	display: grid;
	gap: 4px;
	justify-items: end;
	text-align: right;
}

.tf-cart-item__price {
	color: var(--c-navy);
	font-family: var(--f-head);
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
}

.tf-cart-item__remove a {
	color: var(--c-muted);
	font-size: var(--fs-2xs);
	text-decoration: none;
}

.tf-cart-item__remove a:hover {
	color: var(--c-error);
	text-decoration: underline;
}

/* Léptető a design szerint: fehér pill, 44 px magas */
.tf-cart-stepper {
	gap: 2px;
	min-height: 44px;
	padding: 5px;
}

.tf-cart-stepper .tf-stepper__btn {
	color: var(--c-blue-strong);
}

.tf-cart-stepper input.tf-stepper__input {
	width: 2.6em;
	font-size: var(--fs-body);
}

.tf-cart-stepper.has-unit input.tf-stepper__input {
	width: 2.2em;
	text-align: right;
}

.tf-cart-stepper.has-unit .tf-stepper__unit {
	margin-left: 0;
	padding-right: 2px;
	font-size: var(--fs-body);
}

.tf-cart-stepper.has-unit {
	gap: 0;
}

.tf-cart-stepper.has-unit input.tf-stepper__input {
	margin-right: 3px;
}

/* Billentyűzetes fókusz a mennyiség mezőn (a közös léptető a mezőn nem jelöli) */
.tf-cart-stepper:has(.tf-stepper__input:focus-visible) {
	box-shadow: var(--sh-focus);
}

/* JS nélkül a +/− gombok nem működnek: a helyük megmarad, a mező és a „Kosár frissítése” gomb marad */
html:not(.tf-js) .tf-cart-stepper .tf-stepper__btn {
	visibility: hidden;
}

/* Fóliához kötött geotextília: a mennyiség nem szerkeszthető */
.tf-cart-stepper.is-locked {
	cursor: default;
}

.tf-cart-stepper.is-locked .tf-stepper__btn {
	color: var(--c-control);
}

.tf-cart-stepper__value {
	display: inline-grid;
	place-items: center;
	min-width: 2.6em;
	color: var(--c-ink);
	font-weight: 600;
}

/* Alsó sor: vissza link, kupon, frissítés gomb */
.tf-cart__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-4);
	align-items: center;
	justify-content: space-between;
	margin-top: var(--s-6);
}

.tf-cart__back {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	color: var(--c-blue-strong);
	font-weight: 600;
	text-decoration: none;
}

.tf-cart__back .tf-icon {
	width: 18px;
	height: 18px;
	transition: transform var(--t-fast) var(--ease);
}

.tf-cart__back:hover {
	color: var(--c-navy);
}

.tf-cart__back:hover .tf-icon {
	transform: translateX(-3px);
}

.tf-cart__coupon {
	display: flex;
	flex-wrap: nowrap;
	gap: 8px 10px;
	align-items: center;
	width: 100%;
}

.tf-cart__coupon-input {
	flex: 1 1 160px;
	width: auto;
	min-width: 0;
	border-radius: var(--r-pill);
	padding-inline: 18px;
}

.tf-cart__coupon-btn {
	flex: none;
	min-height: 48px;
	padding-inline: 24px;
	color: var(--c-navy);
	font-size: var(--fs-body);
	font-weight: 700;
}

.tf-cart__coupon:has(.coupon-error-notice) {
	flex-wrap: wrap;
}

.tf-cart__coupon .coupon-error-notice {
	flex-basis: 100%;
	padding-left: 18px;
	color: var(--c-error);
	font-size: var(--fs-2xs);
	font-weight: 500;
}

#coupon_code.has-error {
	border-color: var(--c-error);
	background: var(--c-bg);
}

/* JS-sel az AJAX frissít, a gomb csak JS nélkül kell */
.tf-js .tf-cart__update {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

@media (min-width: 640px) {
	.tf-cart-item {
		grid-template-areas: "thumb info qty end";
		grid-template-columns: 112px minmax(0, 1fr) auto minmax(104px, auto);
		gap: 20px;
	}

	.tf-cart-item__img {
		width: 112px;
		height: 96px;
		border-radius: 12px;
	}

	.tf-cart-item__thumb {
		align-self: center;
	}

	.tf-cart__coupon {
		width: auto;
	}

	.tf-cart__coupon-input {
		flex: 0 1 240px;
		width: 240px;
	}
}

@media (min-width: 1200px) {
	.tf-cart-item {
		grid-template-columns: 140px minmax(0, 1fr) auto 128px;
		column-gap: 24px;
		padding: 16px;
	}

	.tf-cart-item__img {
		width: 140px;
		height: 120px;
	}

	.tf-cart-item__title {
		font-size: 1.3125rem;
	}

	.tf-cart-item__info {
		gap: 3px;
	}

	.tf-cart-item__title + .tf-cart-item__meta {
		margin-top: 2px;
	}

	.tf-cart-item__price {
		font-size: 1.375rem;
	}

	.tf-cart-item__end {
		gap: 6px;
	}
}

/* ---------- Üres kosár ---------- */
.tf-cart--empty .tf-cart__head {
	margin-bottom: var(--s-6);
}

.tf-cart-empty {
	padding: var(--s-7) var(--s-6);
	border-radius: var(--r-lg);
	background: var(--c-surface);
}

.tf-cart-empty__body {
	display: grid;
	gap: var(--s-3);
	justify-items: start;
	max-width: 620px;
}

.tf-cart-empty__icon {
	display: inline-grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #fff;
	color: var(--c-blue-strong);
}

.tf-cart-empty__icon .tf-icon {
	width: 26px;
	height: 26px;
}

.tf-cart-empty__title {
	margin-top: var(--s-2);
	font-size: var(--fs-h4);
}

.tf-cart-empty__text {
	color: var(--c-muted);
	font-size: var(--fs-lead);
}

.tf-cart-empty__actions {
	margin-top: var(--s-3);
}

@media (min-width: 960px) {
	.tf-cart-empty {
		padding: var(--s-9) 56px;
	}
}

/* Mobilon a tapadó sáv ne takarja el az oldal alját */
@media (max-width: 959.98px) {
	.tf-page-cart .tf-cart,
	.tf-page-checkout .tf-co {
		padding-bottom: 0;
	}

	.tf-page-cart:has(.tf-wc-bar:not([hidden])) .tf-footer,
	.tf-page-checkout:has(.tf-wc-bar:not([hidden])) .tf-footer {
		padding-bottom: 96px;
	}
}
