/*
 * Komponenty, které nejdou popsat v theme.json.
 * Používají jen tokeny z theme.json (var(--wp--preset--…), var(--wp--custom--…)),
 * takže změna designu = hlavně úprava theme.json.
 *
 * Obecné styly, okno „Přidáno do košíku“, QR platba a posuvný pruh.
 * Hlavička a patička: chrome.css, stránky podle návrhu Zepter: zepter.css.
 */

/* ---------- Obecné ---------- */

:where(body) {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Formulářové prvky dědí písmo stránky (jinak by tlačítka a pole byla v systémovém Arialu). */
:where(button, input, select, textarea) {
	font: inherit;
	letter-spacing: inherit;
	color: inherit;
}

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

.wp-element-button,
.wp-block-button__link {
	transition: background-color var(--wp--custom--transition), color var(--wp--custom--transition), border-color var(--wp--custom--transition);
}

.eshop-main {
	padding-top: var(--wp--preset--spacing--40);
	padding-bottom: var(--wp--preset--spacing--70);
}

.eshop-main > * + * {
	margin-block-start: var(--wp--preset--spacing--40);
}

.eshop-main--home > * + * {
	margin-block-start: var(--wp--preset--spacing--60);
}

.eshop-main--home > .eshop-usp {
	margin-block-start: var(--wp--preset--spacing--40);
}

.eshop-kicker,
.eshop-kicker a {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--accent);
}

.eshop-kicker--on-dark {
	color: var(--wp--preset--color--accent-on-dark);
}

.eshop-lead {
	margin: 0;
	font-size: 1.1875rem;
	max-width: 36rem;
}

.eshop-strong-link {
	font-weight: 700;
}

.eshop-card,
.eshop-panel {
	background: var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--radius--card);
}

.eshop-card {
	padding: var(--wp--preset--spacing--40);
}

.eshop-panel {
	border-radius: var(--wp--custom--radius--panel);
	padding: clamp(1.5rem, 3vw, 2.5rem);
}

.eshop-section__head {
	margin-bottom: var(--wp--preset--spacing--40);
}

.eshop-section > h2,
.eshop-section__head h2,
.eshop-section__head p {
	margin: 0;
}

.eshop-section > h2 {
	margin-bottom: var(--wp--preset--spacing--40);
}

/* Varianty tlačítek: bílé na akcentu/tmavé, tmavé. */
.wp-block-button.is-style-on-accent .wp-block-button__link {
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--accent);
}

.wp-block-button.is-style-on-accent .wp-block-button__link:hover {
	background: var(--wp--preset--color--accent-soft);
	color: var(--wp--preset--color--accent-hover);
}

.wp-block-button.is-style-dark .wp-block-button__link {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--accent-contrast);
}

.wp-block-button.is-style-dark .wp-block-button__link:hover {
	background: #000;
}

.wp-block-button.is-style-outline .wp-block-button__link {
	padding-block: calc(0.9em - 2px);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--accent-soft);
	color: var(--wp--preset--color--accent-hover);
}

/* Seznam s fajfkami (hero panel). */
.eshop-checklist {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.eshop-checklist li {
	position: relative;
	padding-left: 1.75rem;
}

.eshop-checklist li::before {
	content: "";
	position: absolute;
	left: 0.3rem;
	top: 0.3em;
	width: 0.45rem;
	height: 0.8rem;
	border: solid currentColor;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.eshop-checklist--on-accent {
	color: var(--wp--preset--color--on-accent-muted);
}

/* ---------- Stránky, košík, pokladna ---------- */

.eshop-page {
	padding-block: clamp(1.75rem, 4vw, 3rem);
}

.eshop-page > .wp-block-post-title {
	margin-top: 0;
}

/* Informační stránky (Časté dotazy, Návody, O nás…): nadpisy, kontakty a otázky ve stylu webu. */
.eshop-page > .wp-block-post-title {
	font-size: clamp(1.875rem, 3.1vw, 2.75rem);
	line-height: 1.1;
}

.eshop-page .wp-block-post-content > h2 {
	margin: 2.5rem 0 0.75rem;
	font-size: 1.5rem;
	line-height: 1.15;
}

.eshop-page .wp-block-post-content > :is(p, ul, ol) {
	color: var(--wp--preset--color--muted-strong);
}

.eshop-page .eshop-lead {
	color: var(--wp--preset--color--contrast);
}

.eshop-contact-details {
	display: grid;
	grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
	gap: 0;
	max-width: 560px;
	margin: 1rem 0 0;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 16px;
	background: var(--wp--preset--color--base);
}

.eshop-contact-details dt,
.eshop-contact-details dd {
	margin: 0;
	padding: 13px 20px;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.eshop-contact-details dt {
	color: var(--wp--preset--color--muted);
}

.eshop-contact-details dt:last-of-type,
.eshop-contact-details dd:last-of-type {
	border-bottom: 0;
}

.zi-faq {
	margin: 0;
	border-bottom: 1px solid var(--wp--preset--color--border-strong);
}

.zi-faq summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 56px;
	padding: 10px 0;
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
	list-style: none;
	cursor: pointer;
}

.zi-faq summary::-webkit-details-marker {
	display: none;
}

.zi-faq summary::after {
	content: "+";
	flex-shrink: 0;
	color: var(--wp--preset--color--muted);
	font-weight: 400;
}

.zi-faq[open] summary::after {
	content: "−";
}

.zi-faq > :not(summary) {
	margin: 0 0 16px;
	color: var(--wp--preset--color--muted-strong);
}

.eshop-page:has(.wc-block-review-list-item__item, .wc-block-components-review-list-item__item) .zi-noreviews {
	display: none;
}

.eshop-cart,
.eshop-checkout {
	padding: clamp(1rem, 3vw, 2rem);
}

.wc-block-components-button:not(.is-link) {
	border-radius: var(--wp--custom--radius--button);
}

.wc-block-components-text-input input,
.wc-block-components-combobox .wc-block-components-combobox-control input,
.wc-block-components-textarea {
	border-radius: var(--wp--custom--radius--field) !important;
}

.wc-block-components-radio-control__option,
.wc-block-components-radio-control-accordion-option {
	border-radius: var(--wp--custom--radius--button);
}

.wc-block-components-totals-item__value,
.wc-block-components-product-price__value {
	font-variant-numeric: tabular-nums;
}

/* Výrobek bez ceny: „Cena na dotaz“ menší než částka. */
.zd-price__now.zd-price__ask {
	font-size: 28px;
}

.zc-price__now.zc-price__ask {
	font-size: 1rem;
	color: var(--wp--preset--color--muted-strong);
}

/* Prázdný košík (obsah: scripts/lib/pages.php). */
.wp-block-woocommerce-empty-cart-block {
	max-width: 36rem;
	margin-inline: auto;
	padding-block: var(--wp--preset--spacing--50);
	text-align: center;
}

.eshop-empty-cart__title {
	margin: 0 0 var(--wp--preset--spacing--20);
	font-size: var(--wp--preset--font-size--x-large);
}

.eshop-empty-cart__text {
	margin: 0 0 var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--muted);
}

.eshop-empty-cart__actions {
	justify-content: center;
}

/* ---------- Potvrzení objednávky + QR platba ---------- */

.eshop-order-confirmation > .alignwide {
	max-width: 960px !important;
}

.wc-block-order-confirmation-summary-list {
	flex-wrap: wrap;
	row-gap: var(--wp--preset--spacing--20);
}

.eshop-order-confirmation .wc-block-order-confirmation-status {
	margin-bottom: var(--wp--preset--spacing--30);
}

.wc-block-order-confirmation-additional-information .wc-bacs-bank-details-heading,
.eshop-qr-payment__title {
	font-size: var(--wp--preset--font-size--large);
}

.eshop-qr-payment {
	margin-block: var(--wp--preset--spacing--40);
	padding: var(--wp--preset--spacing--40);
	border-radius: var(--wp--custom--radius--panel);
	background: var(--wp--preset--color--surface);
}

.eshop-qr-payment__title {
	margin-top: 0;
}

.eshop-qr-payment__body {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--40);
	align-items: center;
}

.eshop-qr-payment__code svg {
	display: block;
	width: 200px;
	height: 200px;
	/* Malé zaoblení: kulatý ořez (radius tlačítka) usekl rohové značky QR a kód nešel načíst. */
	border-radius: 8px;
}

.eshop-qr-payment__text {
	flex: 1 1 16rem;
	margin: 0;
}

/* ---------- Okno „Přidáno do košíku“ (návrh M-Pridano): na mobilu spodní panel, na počítači okno uprostřed ---------- */

.eshop-added {
	/* border-box: jinak se k šířce přičetl padding a okno bylo na mobilu širší než obrazovka. */
	box-sizing: border-box;
	width: min(440px, calc(100vw - 2rem));
	max-width: calc(100vw - 2rem);
	padding: 24px;
	border: 0;
	border-radius: 22px;
	box-shadow: 0 24px 60px rgba(22, 25, 28, 0.25);
	color: var(--wp--preset--color--contrast);
}

.eshop-added::backdrop {
	background: rgba(22, 25, 28, 0.45);
}

.eshop-added__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: none;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.eshop-added__title {
	margin: 0 0 16px;
	padding-right: 40px;
	color: var(--wp--preset--color--success);
	font-family: var(--wp--preset--font-family--body);
	font-size: 1.0625rem;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.55;
}

.eshop-added__title::before {
	content: "✓";
	margin-right: 10px;
}

.eshop-added__product {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin-bottom: 16px;
}

.eshop-added__product img {
	flex-shrink: 0;
	width: 72px;
	height: 72px;
	object-fit: contain;
	border-radius: 12px;
	background: var(--wp--preset--color--surface);
	mix-blend-mode: multiply;
}

.eshop-added__name {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.eshop-added__name strong {
	font-weight: 700;
	line-height: 1.4;
}

.eshop-added__name span {
	color: var(--wp--preset--color--muted);
	font-size: 0.9375rem;
}

.eshop-added__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 16px;
}

.eshop-added__actions .zs-btn {
	align-self: stretch;
	font-family: inherit;
	font-size: 1.0625rem;
}

.eshop-added__actions .zs-btn--lg {
	font-size: 1.125rem;
}

/* Větší okno na počítači: tlačítka vedle sebe, pod nimi „Zákazníci často dokupují“. */
@media (min-width: 861px) {
	.eshop-added {
		width: min(760px, calc(100vw - 4rem));
		max-height: calc(100vh - 4rem);
		padding: 32px;
	}

	.eshop-added__product img {
		width: 96px;
		height: 96px;
	}

	.eshop-added__actions {
		flex-direction: row-reverse;
	}

	.eshop-added__actions .zs-btn {
		flex: 1;
	}
}

.eshop-added__xsell {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--wp--preset--color--border);
}

.eshop-added__xsell-title {
	margin: 0 0 14px;
	font-family: var(--wp--preset--font-family--body);
	font-size: 1.0625rem;
	font-weight: 700;
	letter-spacing: 0;
}

.eshop-added__xsell-list {
	display: grid;
	grid-auto-columns: calc((100% - 3 * 14px) / 4);
	grid-auto-flow: column;
	gap: 14px;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	list-style: none;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
}

.eshop-added__xsell-list > li {
	min-width: 0;
	scroll-snap-align: start;
}

.eshop-added__xsell-list .zc__title {
	font-size: 0.9375rem;
}

@media (max-width: 860px) {
	.eshop-added {
		max-height: 92vh;
	}

	/* Na mobilu skoro dvě karty široké jako ve výpisu (užší by štítek akce zajel pod košík), zbytek se posune do strany. */
	.eshop-added__xsell-list {
		grid-auto-columns: 50%;
		margin-inline: -16px;
		padding-inline: 16px;
		scroll-padding-inline: 16px;
	}
}

@media (max-width: 860px) {
	.eshop-added {
		inset: auto 0 0;
		width: 100%;
		max-width: none;
		margin: 0;
		padding: 28px 16px calc(16px + env(safe-area-inset-bottom, 0px));
		border-radius: 22px 22px 0 0;
		box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.25);
	}

	/* Úchyt nahoře místo křížku (zavře se i klepnutím mimo panel nebo tlačítkem Pokračovat v nákupu). */
	.eshop-added::before {
		content: "";
		position: absolute;
		top: 10px;
		left: 50%;
		width: 44px;
		height: 4px;
		border-radius: 4px;
		background: var(--wp--preset--color--border-strong);
		transform: translateX(-50%);
	}

	.eshop-added__close {
		top: 14px;
		right: 6px;
	}
}

/* Ukazatel dopravy zdarma (okno i košík). */
.eshop-freeship {
	padding: 14px 16px;
	border-radius: 12px;
	background: var(--wp--preset--color--surface);
	font-size: 0.9375rem;
}

.eshop-freeship__text {
	margin: 0;
}

.eshop-freeship__text strong {
	font-weight: 700;
}

.eshop-freeship__bar {
	height: 6px;
	margin-top: 0.6rem;
	border-radius: 999px;
	background: rgba(46, 107, 79, 0.15);
	overflow: hidden;
}

.eshop-freeship__bar span {
	display: block;
	height: 100%;
	background: var(--wp--preset--color--success);
	border-radius: inherit;
	transition: width 300ms ease;
}

/* ---------- Posuvný pruh důvěry ---------- */

.eshop-trust {
	display: flex;
	overflow: hidden;
	padding-block: 1.1rem;
	border-block: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--surface);
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.eshop-trust__track {
	display: flex;
	flex: none;
	gap: 3rem;
	margin: 0;
	padding: 0 1.5rem;
	list-style: none;
	font-size: clamp(1rem, 1.6vw, 1.25rem);
	font-weight: 700;
	white-space: nowrap;
	animation: eshop-marquee 40s linear infinite;
}

.eshop-trust__track li::before {
	content: "✦";
	margin-right: 1rem;
	color: var(--wp--preset--color--accent);
}

@keyframes eshop-marquee {
	to {
		transform: translateX(-100%);
	}
}

.eshop-trust:hover .eshop-trust__track {
	animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
	.eshop-trust__track {
		animation: none;
	}

	.eshop-trust__track[aria-hidden="true"] {
		display: none;
	}

	.eshop-trust {
		justify-content: center;
		flex-wrap: wrap;
	}

	.eshop-trust__track {
		flex-wrap: wrap;
		justify-content: center;
		gap: 0.5rem 2rem;
		white-space: normal;
	}
}
