/**
 * ebs-core — Gemeinsame Schnellansicht (Quick-View) + Hover-Warenkorb.
 *
 * Gilt für ALLE Produktkacheln:
 * - eigenes Karussell  (.ebs-newprod__card)
 * - WooCommerce-Grids  (.wc-block-product: Shop, Kategorie, ähnliche Produkte)
 *
 * Verhalten wie im Design-Prototyp:
 * - „In den Warenkorb" standardmäßig verborgen → erscheint beim Hover als
 *   Overlay unten auf dem Bild (ruhigeres Kachelbild).
 * - Klick aufs Bild öffnet die Schnellansicht; das Bild darin führt zur
 *   Produktseite.
 */

/* =========================================================================
   Hover-Warenkorb bei WooCommerce-Kacheln (.wc-block-product)
   Grid-Stacking: Bild und Button teilen sich dieselbe Zelle (Zeile 1),
   Button unten ausgerichtet → Overlay ohne DOM-Umbau (AJAX bleibt intakt).
   ========================================================================= */
.wc-block-product {
	position: relative;
	display: grid;
	grid-template-columns: 100%;
}
.wc-block-product > * {
	grid-column: 1;
	min-width: 0;
}
.wc-block-product > .wp-block-woocommerce-product-image,
.wc-block-product > .wc-block-components-product-image {
	grid-row: 1;
}
.wc-block-product > .wp-block-woocommerce-product-button,
.wc-block-product > .wc-block-components-product-button {
	grid-row: 1;                 /* dieselbe Zelle wie das Bild → Overlay */
	align-self: end;             /* unten am Bild */
	justify-self: stretch;
	z-index: 3;
	margin: 12px;
	opacity: 0;
	transform: translateY(8px);
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
}
.wc-block-product:hover > .wp-block-woocommerce-product-button,
.wc-block-product:hover > .wc-block-components-product-button,
.wc-block-product:focus-within > .wp-block-woocommerce-product-button,
.wc-block-product:focus-within > .wc-block-components-product-button {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}
/* Overlay-Button überall als volle dunkle Pille (unabhängig vom Theme-Kontext). */
.wc-block-product > .wc-block-components-product-button { align-items: stretch; }
.wc-block-product > .wc-block-components-product-button .wp-block-button__link,
.wc-block-product > .wc-block-components-product-button .wc-block-components-product-button__button {
	width: 100%;
	text-align: center;
	background: var(--wp--preset--color--ink, #2c2823);
	color: var(--wp--preset--color--paper, #f6f2ec);
	border: 1px solid var(--wp--preset--color--ink, #2c2823);
	border-radius: var(--wp--custom--radius--btn, 999px);
	padding: 0.7em 1.2em;
	font-weight: 600;
}
.wc-block-product > .wc-block-components-product-button .wp-block-button__link:hover,
.wc-block-product > .wc-block-components-product-button .wc-block-components-product-button__button:hover {
	background: var(--wp--preset--color--accent-deep, #6a4d33);
	border-color: var(--wp--preset--color--accent-deep, #6a4d33);
}
/* Kartenfuß der WooCommerce-Kacheln (Shop, Kategorie, Ähnliche): eine Zeile am
   unteren Rand — „Produktinformation" links, Preis rechts. Der Fuß ist unten
   verankert, dadurch sitzen Zeile und Preis kartenübergreifend bündig. */
.ebs-tile-foot {
	margin-top: auto;
	display: flex;
	flex-wrap: wrap; /* lange Preise (Gutschein-Spannen) brechen sauber um */
	align-items: center;
	justify-content: space-between;
	gap: 0.5em 1em;
	margin-bottom: 0.7em;
}
.ebs-tile-foot--center { justify-content: center; }
/* !important gegen die Inline-Margins aus den Block-Attributen (Theme-Template
   und WooCommerce-Pattern „Ähnliche Produkte" geben eigene Abstände mit). */
.ebs-tile-foot .wp-block-woocommerce-product-price {
	margin: 0 0 0 auto !important; /* bleibt rechts, auch wenn die Zeile umbricht */
	text-align: right;
}
.ebs-tile-foot--center .wp-block-woocommerce-product-price { margin: 0 !important; }

/* „Produktinformation": gleiche Optik wie im Karussell — Kontur statt
   Vollfläche, damit der dunkle Warenkorb-Button die Hauptaktion bleibt. */
.ebs-tile-info {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	margin: 0;
	padding: 0.45em 0.95em;
	border: 1px solid var(--wp--preset--color--line, #d9d3ca);
	border-radius: var(--wp--custom--radius--btn, 999px);
	color: var(--wp--preset--color--ink-soft, #615b52);
	font-size: 0.8rem;
	line-height: 1.2;
	text-decoration: none;
	transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.ebs-tile-info:hover,
.ebs-tile-info:focus-visible {
	background: var(--wp--preset--color--ink, #2c2823);
	border-color: var(--wp--preset--color--ink, #2c2823);
	color: var(--wp--preset--color--paper, #f6f2ec);
}

/* Der Bild-Link soll klar klickbar wirken (öffnet Schnellansicht). */
.wc-block-product .wp-block-woocommerce-product-image a,
.wc-block-product .wc-block-components-product-image a {
	cursor: pointer;
}

/* =========================================================================
   Schnellansicht (Quick-View) — einmal pro Seite, per JS befüllt
   ========================================================================= */
.ebs-qv[hidden] { display: none; }
.ebs-qv {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(16px, 4vw, 48px);
}
.ebs-qv__backdrop {
	position: absolute;
	inset: 0;
	background: color-mix(in srgb, var(--wp--preset--color--ink, #2c2823) 60%, transparent);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	animation: ebs-qv-fade 0.2s ease;
}
.ebs-qv__panel {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: 1.05fr 1fr;
	width: min(1000px, 100%);
	max-height: min(88vh, 760px);
	background: var(--wp--preset--color--card, #fcfaf7);
	border-radius: var(--wp--custom--radius--card, 18px);
	overflow: hidden;
	box-shadow: 0 30px 80px -20px rgba(42, 40, 35, 0.5);
	animation: ebs-qv-pop 0.24s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.ebs-qv.is-loading .ebs-qv__panel { min-height: 320px; }
.ebs-qv__media {
	display: block;
	position: relative;
	background: var(--wp--preset--color--accent-soft, #efe6d8);
	min-height: 320px;
	cursor: pointer;
}
.ebs-qv__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.ebs-qv__info {
	position: relative;
	padding: clamp(24px, 3.5vw, 44px);
	overflow-y: auto;
	display: flex;
	flex-direction: column;
}
.ebs-qv__close {
	position: absolute;
	top: 16px;
	right: 16px;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 999px;
	background: color-mix(in srgb, var(--wp--preset--color--paper, #f6f2ec) 70%, transparent);
	color: var(--wp--preset--color--ink, #2c2823);
	cursor: pointer;
	transition: background 0.15s;
}
.ebs-qv__close:hover { background: var(--wp--preset--color--accent-soft, #efe6d8); }
.ebs-qv__eyebrow {
	font-family: var(--wp--preset--font-family--mono, monospace);
	font-size: var(--wp--preset--font-size--eyebrow, 0.72rem);
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-soft, #615b52);
	margin: 0 0 0.7em;
}
.ebs-qv__title {
	font-size: var(--wp--preset--font-size--x-large, 2rem);
	line-height: 1.05;
	letter-spacing: -0.02em;
	margin: 0 0 0.5em;
}
.ebs-qv__price {
	font-size: var(--wp--preset--font-size--large, 1.5rem);
	margin: 0 0 0.2em;
}
.ebs-qv__price .ebs-price-suffix { display: none; }
.ebs-qv__sub {
	font-size: var(--wp--preset--font-size--small, 0.85rem);
	color: var(--wp--preset--color--ink-soft, #615b52);
	margin: 0 0 1.2em;
}
.ebs-qv__desc {
	line-height: 1.6;
	color: var(--wp--preset--color--ink-soft, #615b52);
	margin: 0 0 1.6em;
}
.ebs-qv__cart {
	display: block;
	text-align: center;
	background: var(--wp--preset--color--ink, #2c2823);
	color: var(--wp--preset--color--paper, #f6f2ec);
	border: 1px solid var(--wp--preset--color--ink, #2c2823);
	border-radius: var(--wp--custom--radius--btn, 999px);
	padding: 0.9em 1.4em;
	font-size: 0.95rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.ebs-qv__cart:hover {
	background: var(--wp--preset--color--accent-deep, #6a4d33);
	border-color: var(--wp--preset--color--accent-deep, #6a4d33);
	color: var(--wp--preset--color--paper, #f6f2ec);
	transform: translateY(-1px);
}
/* „Produktinformation": Weg zur vollständigen Produktseite. Bisher führte nur der
   Klick aufs Bild dorthin — das ist als einziger Hinweis zu unauffällig.
   Kontur-Button, damit „In den Warenkorb" die Hauptaktion bleibt. */
.ebs-qv__more {
	display: block;
	margin-top: 0.6em;
	padding: 0.75em 1.4em;
	border: 1px solid var(--wp--preset--color--line, #d9d3ca);
	border-radius: var(--wp--custom--radius--btn, 999px);
	color: var(--wp--preset--color--ink-soft, #615b52);
	font-size: 0.9rem;
	text-align: center;
	text-decoration: none;
	transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.ebs-qv__more:hover,
.ebs-qv__more:focus-visible {
	background: var(--wp--preset--color--accent-soft, #efe6d8);
	border-color: var(--wp--preset--color--accent, #a6794e);
	color: var(--wp--preset--color--ink, #2c2823);
}

.ebs-qv__rule {
	border: none;
	border-top: 1px solid var(--wp--preset--color--line, #d9d3ca);
	margin: 1.6em 0;
}
.ebs-qv__usp {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.7em;
}
.ebs-qv__usp li {
	display: flex;
	align-items: center;
	gap: 0.7em;
	font-size: var(--wp--preset--font-size--small, 0.85rem);
	color: var(--wp--preset--color--ink, #2c2823);
}
.ebs-qv__usp svg {
	flex: none;
	color: var(--wp--preset--color--accent, #a6794e);
}
.ebs-qv__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border: none;
	border-radius: 999px;
	background: var(--wp--preset--color--card, #fcfaf7);
	color: var(--wp--preset--color--ink, #2c2823);
	cursor: pointer;
	box-shadow: 0 8px 24px -8px rgba(42, 40, 35, 0.5);
	transition: transform 0.15s, background 0.15s;
}
.ebs-qv__prev { left: clamp(8px, 3vw, 40px); }
.ebs-qv__next { right: clamp(8px, 3vw, 40px); }
.ebs-qv__arrow:hover { background: var(--wp--preset--color--accent-soft, #efe6d8); }
.ebs-qv__prev:hover { transform: translateY(-50%) translateX(-2px); }
.ebs-qv__next:hover { transform: translateY(-50%) translateX(2px); }

@keyframes ebs-qv-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ebs-qv-pop {
	from { opacity: 0; transform: translateY(12px) scale(0.98); }
	to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.ebs-qv__backdrop,
	.ebs-qv__panel { animation: none; }
	.wc-block-product > .wc-block-components-product-button { transition: opacity 0.01s; }
}

/* Modal responsiv: unter 760px gestapelt (Bild oben, Infos unten). */
@media (max-width: 760px) {
	/* Panel oben verankern → Bildoberkante liegt deterministisch bei ~12px,
	   damit die Blätter-Pfeile zuverlässig auf dem Bild sitzen. */
	.ebs-qv { align-items: flex-start; }
	.ebs-qv__panel {
		grid-template-columns: 1fr;
		max-height: 92vh;
		width: min(460px, 100%);
		margin-top: 12px;
	}
	.ebs-qv__media { aspect-ratio: 4 / 3; min-height: 0; }
	/* Pfeile über dem Bild statt mittig über den Textspalten (Bild ist ≥216px hoch). */
	.ebs-qv__arrow { width: 44px; height: 44px; top: 80px; transform: none; }
	.ebs-qv__prev { left: 6px; }
	.ebs-qv__next { right: 6px; }
	.ebs-qv__arrow:hover { transform: none; }
}
