/* Boxenshop – Grußkarte */
@font-face { font-family: "BxG Schreibschrift"; src: url("../fonts/DancingScript.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "BxG Handschrift"; src: url("../fonts/GreatVibes-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "BxG Klassisch"; src: url("../fonts/LibreBaskerville.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "BxG Modern"; src: url("../fonts/Poppins-Medium.ttf") format("truetype"); font-display: swap; }

/* Kasten auf der Produktseite (wie die Gravur) */
.bxg-product { background: #fff; border: 1px solid var(--bx-cream-dark, #e4ddd2); border-radius: 12px; padding: .75rem .85rem; margin: 0 0 1rem; }
.bxg-product.bxg-on { border: 2px solid var(--bx-green, #5c7f4f); }
.bxg-toggle { display: flex; align-items: center; gap: .6rem; cursor: pointer; user-select: none; font-weight: 600; }
.bxg-toggle:focus-visible { outline: 2px solid var(--bx-green, #5c7f4f); outline-offset: 3px; border-radius: 6px; }
.bxg-box { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--bx-brown-soft, #6b5d4a); display: grid; place-items: center; color: #fff; font-size: .8rem; }
.bxg-on .bxg-box { background: var(--bx-green, #5c7f4f); border-color: var(--bx-green, #5c7f4f); }
.bxg-box::after { content: "✓"; opacity: 0; }
.bxg-on .bxg-box::after { opacity: 1; }
.bxg-price { margin-left: auto; color: var(--bx-green, #5c7f4f); white-space: nowrap; }
.bxg-sub { font-size: .8rem; color: var(--bx-brown-soft, #6b5d4a); margin: .2rem 0 0 calc(22px + .6rem); }
.bxg-body { margin-top: .85rem; display: grid; gap: .55rem; }

/* Karte */
.bxg-flip { perspective: 900px; width: 100%; max-width: 340px; justify-self: center; }
.bxg-card { position: relative; width: 100%; transform-style: preserve-3d; transition: transform .6s; cursor: pointer; }
.bxg-card.bxg-show-back { transform: rotateY(180deg); }
.bxg-face { --bxg-card: #1c1c1e; --bxg-etch: #d9d4c7; position: absolute; inset: 0; border-radius: 9px; -webkit-backface-visibility: hidden; backface-visibility: hidden; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--bxg-card) 82%, #fff) 0%, var(--bxg-card) 48%, color-mix(in srgb, var(--bxg-card) 88%, #fff) 72%, color-mix(in srgb, var(--bxg-card) 85%, #000) 100%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .3), inset 0 0 0 1px rgba(255, 255, 255, .1); }
.bxg-face::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 3px); pointer-events: none; }
.bxg-back { transform: rotateY(180deg); }
/* Verdeckte Seite selbst ausblenden (bei 90° der Drehung): Safari zeigt sonst trotz backface-visibility
   die Rückseite spiegelverkehrt über der Vorderseite */
.bxg-front { transition: visibility 0s .3s; }
.bxg-back { visibility: hidden; transition: visibility 0s .3s; }
.bxg-card.bxg-show-back .bxg-front { visibility: hidden; }
.bxg-card.bxg-show-back .bxg-back { visibility: visible; }
.bxg-motif { position: absolute; left: 14%; top: 12%; width: 72%; height: 76%; background: var(--bxg-etch); -webkit-mask: no-repeat center / contain; mask: no-repeat center / contain; }
.bxg-text, .bxg-text svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.bxg-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--bxg-etch); opacity: .45; font-size: .85rem; }
/* Vorder- und Rückseite nebeneinander (Bestellung im Admin) */
.bxg-flip.bxg-both { perspective: none; max-width: 560px; }
.bxg-both .bxg-card { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; aspect-ratio: auto !important; transform: none; cursor: default; }
.bxg-both .bxg-face { position: relative; transform: none; aspect-ratio: var(--bxg-ratio, 85 / 54); }
.bxg-flip.bxg-both .bxg-card .bxg-face { visibility: visible; transition: none; }

.bxg-turn { justify-self: center; border: 0; background: none; color: var(--bx-green, #5c7f4f); font-weight: 600; font-size: .85rem; padding: .15rem .5rem; }
.bxg-label { font-size: .8rem; font-weight: 600; color: var(--bx-brown-soft, #6b5d4a); margin-top: .2rem; }
.bxg-motifs { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.bxg-motifs button { aspect-ratio: 85 / 54; border-radius: 6px; border: 2px solid transparent; background: #1c1c1e; padding: 0; position: relative; }
.bxg-motifs button i { position: absolute; inset: 14%; background: #d9d4c7; -webkit-mask: no-repeat center / contain; mask: no-repeat center / contain; }
.bxg-motifs button[aria-pressed="true"] { border-color: var(--bx-green, #5c7f4f); box-shadow: inset 0 0 0 2px #fff; }
.bxg-colors, .bxg-fonts { display: flex; flex-wrap: wrap; gap: .4rem; }
.bxg-colors button, .bxg-fonts button { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--bx-cream-dark, #e4ddd2); background: #fff; border-radius: 999px; padding: .3rem .8rem; color: var(--bx-brown, #2d2419); }
.bxg-fonts button { font-size: 1rem; }
.bxg-colors i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid; }
.bxg-colors button[aria-pressed="true"], .bxg-fonts button[aria-pressed="true"] { border-color: var(--bx-green, #5c7f4f); box-shadow: inset 0 0 0 1px var(--bx-green, #5c7f4f); }
.bxg-count { font-size: .75rem; color: var(--bx-brown-soft, #6b5d4a); text-align: right; margin-top: -.3rem; }
.bxg-hint { font-size: .75rem; color: var(--bx-brown-soft, #6b5d4a); }
.bxg-motifs button:focus-visible, .bxg-colors button:focus-visible, .bxg-fonts button:focus-visible, .bxg-turn:focus-visible { outline: 2px solid var(--bx-green, #5c7f4f); outline-offset: 2px; }

/* Kasse */
.bxg-checkout { background: #fff; border: 1px solid var(--bx-cream-dark, #e4ddd2); border-radius: 12px; padding: .9rem 1rem; margin-bottom: 1rem; display: grid; gap: .5rem; }
.bxg-checkout h3 { font-size: 1rem; margin: 0; }
.bxg-checkout p { margin: 0; font-size: .9rem; }
.bxg-checkout .bxg-inside { color: var(--bx-green, #5c7f4f); font-weight: 600; }
#bxg-modal .modal-body { display: grid; gap: .55rem; }

@media (prefers-reduced-motion: reduce) { .bxg-card, .bxg-face { transition: none; } }

/* Testmodus (nur sichtbar mit Testlink, solange das Modul aus ist) */
.bxg-testbadge { background: #8a5a00; color: #fff; border-radius: 8px; padding: 5px 10px; margin-bottom: 8px; font-size: .78rem; font-weight: 600; }
.bxg-testbadge a { color: #fff; text-decoration: underline; }

/* Eine Karte pro Bestellung */
.bxg-note .bxg-toggle { cursor: default; }
.bxg-note .bxg-box { background: var(--bx-green, #5c7f4f); border-color: var(--bx-green, #5c7f4f); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.bxg-note a { font-weight: 600; }
.bxg-cart-fixed { font-size: .85rem; color: var(--bx-brown-soft, #6b5d4a); }
