/* Namensherz – Produktseite */

.nh-vorschau-bereich { position: relative; }
.nh-vorschau {
	position: relative;
	aspect-ratio: 1 / 1;
	width: 100%;
	border-radius: 12px;
	overflow: hidden;
	/* bewusst nicht weiß: ein weißes Herz muss sich abheben */
	background: radial-gradient(circle at 50% 40%, #e9e4de 0%, #d8d1c9 75%, #cbc3ba 100%);
}
/* Hintergrundbild je Ausführung (gerendert in Blender, Kamera passt exakt zur 3D-Vorschau).
   Sofort sichtbar (data-nh-variante kommt schon aus dem HTML), das Herz erscheint darüber, sobald es geladen ist. */
.nh-vorschau::before {
	content: ""; position: absolute; inset: 0;
	background: center / cover no-repeat;
	transition: background-image .4s ease;
}
.nh-vorschau[data-nh-variante="ohne"]::before  { background-image: url(../img/hintergrund_ohne.webp); }
.nh-vorschau[data-nh-variante="licht"]::before { background-image: url(../img/hintergrund_licht.webp); }
/* Herz 2: eigene Hintergrundbilder (Robin, 18.10.2026; Kamera wie in der Vorschau, RAND 1.3) – spezifischer als die
   Herz-1-Regeln, damit Herz 2 nie das Herz-1-Bild bekommt. Neu rendern: blender-hintergrund/namensherz_hintergrund_herz2.py */
.nh-vorschau[data-nh-form="herz2"][data-nh-variante="ohne"]::before  { background-image: url(../img/hintergrund_herz2_ohne.webp); }
.nh-vorschau[data-nh-form="herz2"][data-nh-variante="licht"]::before { background-image: url(../img/hintergrund_herz2_licht.webp); }
.nh-vorschau canvas { position: absolute; inset: 0; z-index: 1; }
.nh-vorschau .nh-lade {
	z-index: 2;
	position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
	padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.85);
	font-size: 14px; white-space: nowrap;
}
.nh-vorschau.nh-bereit .nh-lade { display: none; }

/* ---------- Zoom (nh-vorschau.js) ----------
   Das Hintergrundbild zoomt im Gleichlauf mit der 3D-Kamera: scale(z) translate(-Ausschnittsanfang). */
.nh-vorschau::before {
	transform-origin: 0 0;
	transform: scale(var(--nh-zoom, 1)) translate(var(--nh-zoom-x, 0%), var(--nh-zoom-y, 0%));
	will-change: transform;
}
.nh-vorschau.nh-zoombar { touch-action: pan-y; cursor: zoom-in; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.nh-vorschau.nh-zoombar.nh-gezoomt { touch-action: none; cursor: grab; }
.nh-vorschau.nh-zoombar.nh-zieht { cursor: grabbing; }
.nh-vorschau.nh-zoombar:focus-visible { outline: 2px solid #2271b1; outline-offset: 3px; }

.nh-zoom-knoepfe {
	position: absolute; right: 12px; bottom: 12px; z-index: 4;
	display: flex; flex-direction: column; overflow: hidden;
	border-radius: 12px; background: rgba(255,255,255,.88);
	box-shadow: 0 2px 10px rgba(0,0,0,.18);
	-webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.nh-zoom-knoepfe .nh-zoom-knopf {
	all: unset; box-sizing: border-box;
	width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
	font: 600 22px/1 system-ui, sans-serif; color: #2b2320; cursor: pointer;
	transition: background .15s, opacity .15s;
}
.nh-zoom-knoepfe .nh-zoom-knopf + .nh-zoom-knopf { border-top: 1px solid rgba(43,35,32,.12); }
.nh-zoom-knoepfe .nh-zoom-knopf:hover:not(:disabled) { background: rgba(43,35,32,.08); }
.nh-zoom-knoepfe .nh-zoom-knopf:focus-visible { outline: 2px solid #2271b1; outline-offset: -2px; }
.nh-zoom-knoepfe .nh-zoom-knopf:disabled { opacity: .3; cursor: default; }
.nh-zoom-knoepfe .nh-zoom-reset { font-size: 18px; }
.nh-zoom-knoepfe:not(.nh-gezoomt) .nh-zoom-reset { display: none; } /* „ganzes Herz“ nur, wenn gezoomt */
.nh-vorschau-bereich[hidden] .nh-zoom-knoepfe { display: none; }
/* Knopf „Rückseite“ (unten links): dreht das Herz und zeigt das SchichtKunst-Logo */
.nh-rueckseite-knopf {
	all: unset; box-sizing: border-box;
	position: absolute; left: 12px; bottom: 12px; z-index: 4;
	display: flex; align-items: center; gap: 4px; height: 36px; padding: 0 14px;
	border-radius: 999px; background: rgba(255,255,255,.88);
	box-shadow: 0 2px 10px rgba(0,0,0,.18);
	-webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
	font: 600 14px/1 system-ui, sans-serif; color: #2b2320; cursor: pointer; transition: background .15s;
}
/* Theme-Regeln für Knöpfe (am Handy/Vollbild z. B. weiße Schrift, transparenter Hintergrund) dürfen ihn nicht leeren */
button.nh-rueckseite-knopf, button.nh-rueckseite-knopf:hover, button.nh-rueckseite-knopf:focus, button.nh-rueckseite-knopf:active {
	width: auto !important; min-width: 0 !important; min-height: 0 !important; margin: 0 !important;
	background: rgba(255,255,255,.92) !important; color: #2b2320 !important; -webkit-text-fill-color: #2b2320 !important;
	font: 600 14px/1 system-ui, sans-serif !important; text-transform: none !important; letter-spacing: 0 !important;
	text-indent: 0 !important; opacity: 1 !important; visibility: visible !important; border: 0 !important;
}
.nh-rueckseite-knopf:hover { background: #fff; }
.nh-rueckseite-knopf:focus-visible { outline: 2px solid #2271b1; outline-offset: 2px; }
.nh-vorschau-bereich[hidden] .nh-rueckseite-knopf { display: none; }

.nh-zoom-hinweis {
	position: absolute; left: 50%; top: 50%; z-index: 3;
	transform: translate(-50%, -50%);
	max-width: 85%; padding: 10px 16px; border-radius: 999px;
	background: rgba(30,24,22,.78); color: #fff; font-size: 15px; text-align: center;
	pointer-events: none; opacity: 0; transition: opacity .25s;
}
.nh-zoom-hinweis.nh-sichtbar { opacity: 1; }

/* Handy: größere Tippflächen, Knöpfe etwas vom Rand weg */
@media (pointer: coarse) {
	.nh-zoom-knoepfe { right: 10px; bottom: 10px; }
	.nh-rueckseite-knopf { left: 10px; bottom: 10px; height: 44px; }
	.nh-zoom-knoepfe .nh-zoom-knopf { width: 44px; height: 44px; }
}

.nh-felder { margin: 0 0 1.25em; width: 100%; }
.nh-feld label { display: block; font-weight: 600; margin-bottom: 4px; }
.nh-feld input[type="text"] { width: 100%; font-size: 18px; padding: 10px 12px; box-sizing: border-box; }
.nh-feld input[aria-invalid="true"] { border-color: #b00020; }
.nh-meldung { display: block; min-height: 1.4em; margin-top: 4px; color: #b00020; font-size: 14px; }

.nh-farbwahl { border: 0; padding: 0; margin: 12px 0 0; min-width: 0; }
.nh-farbwahl legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.nh-farbwahl .nh-farbname { font-weight: 400; }
.nh-farbfeld { position: relative; display: inline-block; margin: 0 8px 8px 0; cursor: pointer; }
.nh-farbfeld input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nh-farbfeld span:not(.screen-reader-text) {
	display: block; width: 38px; height: 38px; border-radius: 50%;
	border: 1px solid rgba(0,0,0,.25);
	box-shadow: inset 0 0 0 3px #fff;
	transition: box-shadow .15s, transform .15s;
}
.nh-farbfeld:hover span:not(.screen-reader-text) { transform: scale(1.06); }
.nh-farbfeld input:checked + span { box-shadow: inset 0 0 0 3px #fff, 0 0 0 2px #222; }
.nh-farbfeld input:focus-visible + span { outline: 2px solid #2271b1; outline-offset: 3px; }

/* STL-Test-Knopf (nur Shop-Verwaltung) */
.nh-stl-test { margin-top: 14px; padding: 10px 12px; border: 1px dashed #b5a99c; border-radius: 8px; background: #faf7f3; }
.nh-stl-hinweis { margin: 0 0 6px; font-size: 13px; opacity: .75; }
.nh-stl-status { display: block; margin-top: 6px; font-size: 13px; }

form.cart button[type="submit"].nh-gesperrt { opacity: .5; cursor: not-allowed; }
form.cart button[type="submit"].loading { opacity: .7; cursor: progress; }

/* Untertitel unter dem Produktnamen (Namenserklärung) */
.nh-untertitel{margin:-.4em 0 1em;font-style:italic;opacity:.75;font-size:.95em}


/* Schritt „<Produkt> gestalten“ (wie „LUNA gestalten“): bis zum Klick nur der Knopf */
form.cart.nh-zu #nh-felder,
form.cart.nh-zu .quantity,
form.cart.nh-zu .single_add_to_cart_button { display: none !important; }
.nh-vorschau-bereich[hidden] { display: none !important; }
/* Nach dem Öffnen ersetzt die 3D-Vorschau die Produktbilder */
body.nh-offen .rtwpvg-images,
body.nh-offen .woocommerce-product-gallery:not(.nh-vorschau-bereich) { display: none !important; }
/* Optik wie der Warenkorb-Button bzw. .sk-gate-btn der Lampen */
.nh-tor {
	display: block;
	text-align: center;
	width: 100% !important;
	margin: 0 !important;
	padding: 17px 24px !important;
	height: auto !important;
	line-height: 1.3 !important;
	font-size: 17px !important;
	font-weight: 600 !important;
	letter-spacing: .02em;
	color: #fff !important;
	background: var(--sk-braun, #2b2320) !important;
	border: 0 !important;
	border-radius: 999px !important;
	box-shadow: 0 4px 14px rgba(43, 35, 32, .2);
	cursor: pointer;
	transition: transform .15s, background .2s;
}
.nh-tor:hover { transform: translateY(-2px); background: #3d322c !important; }
.nh-tor.disabled { opacity: .35; box-shadow: none; transform: none; cursor: not-allowed !important; }

/* Vorschau als erstes Bild der Produktgalerie bzw. oben im Vollbild am Handy (includes/galerie-vorschau) */
.sk-gv-folie .nh-vorschau-bereich { position: absolute; inset: 0; width: 100% !important; margin: 0 !important; float: none !important; }
.sk-gv-folie .nh-vorschau { width: 100%; height: 100%; border-radius: 0; }
/* Vollbild: quadratisch über die ganze Breite (kein Rand links und rechts), oben und unten etwas Hintergrund abgeschnitten – das Herz bleibt ganz im Bild */
.sk-gv-app-vorschau .nh-vorschau-bereich { position: absolute; top: 50%; left: 0; transform: translateY(-50%); width: 100% !important; height: auto; aspect-ratio: 1 / 1; margin: 0 !important; float: none !important; }
.sk-gv-app-vorschau .nh-vorschau { width: 100%; height: 100%; border-radius: 0; }
/* Zoom-Knöpfe im sichtbaren Teil halten (das Quadrat ist oben und unten etwas abgeschnitten) */
.sk-gv-app-vorschau .nh-zoom-knoepfe { bottom: calc(12px + max(0px, (100vw - clamp(200px, 40vh, 380px)) / 2)); }
.sk-gv-app-vorschau .nh-rueckseite-knopf { bottom: calc(12px + max(0px, (100vw - clamp(200px, 40vh, 380px)) / 2)); }
/* PC: Nach „<Produkt> gestalten“ läuft die Galerie (mit der Vorschau vorn) beim Scrollen mit, vorher nicht.
   Das Zusätzliche CSS der Seite setzt html, body { overflow-x: hidden } – damit greift sticky nicht; clip schneidet
   genauso ab, ohne Scroll-Container (wie beim Lampen-Konfigurator). */
html:has(> body.nh-gestaltet), body.nh-gestaltet { overflow-x: clip !important; }
@media (min-width: 768px) {
	body.nh-gestaltet .rtwpvg-images, body.nh-gestaltet div.product .woocommerce-product-gallery { position: sticky; top: var(--sk-kopf, 110px); align-self: flex-start; z-index: 2; }
}
