.fd3d { --fd3d-accent: #1f6feb; --fd3d-border: #d9dde3; --fd3d-muted: #5f6670; --fd3d-bg: #f6f7f9; font-size: 16px; line-height: 1.5; }
.fd3d *, .fd3d *::before, .fd3d *::after { box-sizing: border-box; }

.fd3d-btn { display: inline-block; background: var(--fd3d-accent); color: #fff !important; border: 0; border-radius: 6px; padding: .65em 1.2em; font-weight: 600; text-decoration: none !important; cursor: pointer; font-size: 1rem; }
.fd3d-btn:hover { filter: brightness(1.08); }
.fd3d-btn:disabled { opacity: .5; cursor: not-allowed; }
.fd3d-btn-ghost { background: transparent; color: var(--fd3d-accent) !important; border: 2px solid var(--fd3d-accent); }
.fd3d-btn-order { font-size: 1.1rem; padding: .85em 1.6em; margin-top: .5em; }
.fd3d-link { background: none; border: 0; color: var(--fd3d-muted); text-decoration: underline; cursor: pointer; padding: 0; font-size: .95em; }

.fd3d-shopbar { display: flex; flex-wrap: wrap; gap: .6em; justify-content: space-between; margin-bottom: 1.2em; }
.fd3d-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.2em; }
.fd3d-card { border: 1px solid var(--fd3d-border); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; background: #fff; }
.fd3d-card-img { display: block; aspect-ratio: 4/3; background: var(--fd3d-bg); }
.fd3d-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fd3d-noimg { display: flex; height: 100%; align-items: center; justify-content: center; font-size: 2rem; color: #b0b6bf; font-weight: 700; }
.fd3d-card-body { padding: 1em; display: flex; flex-direction: column; gap: .4em; flex: 1; }
.fd3d-card-body h3 { margin: 0; font-size: 1.1rem; }
.fd3d-card-body p { margin: 0; color: var(--fd3d-muted); font-size: .95em; }

.fd3d-price { font-size: 1.35rem; font-weight: 700; }
.fd3d-tax, .fd3d-delivery, .fd3d-hint { display: block; font-size: .85em; color: var(--fd3d-muted); }
.fd3d-add { display: flex; flex-wrap: wrap; gap: .5em; align-items: flex-end; margin-top: .6em; }
.fd3d-add label { display: flex; flex-direction: column; font-size: .85em; color: var(--fd3d-muted); }
.fd3d-add input[type=number] { width: 4.5em; }
.fd3d-added { font-size: .9em; color: #1a7f37; width: 100%; }
.fd3d-soldout { color: #b32d2e; font-weight: 600; }
.fd3d-specs { display: grid; grid-template-columns: max-content 1fr; gap: .3em 1em; margin: 1em 0; }
.fd3d-specs dt { font-weight: 600; } .fd3d-specs dd { margin: 0; }
.fd3d-safety { margin-top: 1em; border: 1px solid var(--fd3d-border); border-radius: 8px; padding: .6em 1em; }
.fd3d-safety summary { cursor: pointer; font-weight: 600; }

.fd3d fieldset { border: 1px solid var(--fd3d-border); border-radius: 10px; padding: 1em 1.2em; margin: 0 0 1.2em; }
.fd3d legend { font-weight: 700; padding: 0 .4em; }
.fd3d-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 1em; }
.fd3d-field { margin: 0 0 .9em; }
.fd3d-field label { display: block; font-weight: 600; font-size: .92em; margin-bottom: .25em; }
.fd3d input[type=text], .fd3d input[type=email], .fd3d input[type=tel], .fd3d input[type=number], .fd3d select, .fd3d textarea { width: 100%; padding: .55em .7em; border: 1px solid var(--fd3d-border); border-radius: 6px; font: inherit; background: #fff; }
.fd3d-add input[type=number] { width: 4.5em; }
.fd3d-radio, .fd3d-check { display: flex; gap: .55em; align-items: flex-start; margin: .35em 0; cursor: pointer; }
.fd3d-radio input, .fd3d-check input { margin-top: .3em; flex: none; }
.fd3d-check { font-size: .95em; }
.fd3d-legal { margin: 1em 0; }
.fd3d-notice { background: #fff8e6; border-left: 4px solid #d4a017; padding: .7em 1em; margin-bottom: .8em; border-radius: 4px; }
.fd3d-drop { border: 2px dashed var(--fd3d-border); border-radius: 10px; padding: 1em; margin-bottom: 1em; background: var(--fd3d-bg); }
.fd3d-drop label { font-weight: 600; display: block; margin-bottom: .4em; }
.fd3d-matinfo { display: block; color: var(--fd3d-muted); margin-top: .3em; }

.fd3d-cart { width: 100%; border-collapse: collapse; font-size: .95em; }
.fd3d-cart th, .fd3d-cart td { padding: .5em .4em; border-bottom: 1px solid var(--fd3d-border); text-align: left; vertical-align: top; }
.fd3d-cart .r { text-align: right; }
.fd3d-cart input[type=number] { width: 4.5em; }
.fd3d-cart tfoot td { border: 0; }
.fd3d-cart .fd3d-total td { font-weight: 700; font-size: 1.1em; border-top: 2px solid #222; }

.fd3d-error { background: #fdecea; border-left: 4px solid #b32d2e; padding: .6em 1em; margin-bottom: 1em; border-radius: 4px; }
.fd3d-error ul { margin: 0; padding-left: 1.2em; }
.fd3d-success { background: #eaf6ec; border-left: 4px solid #1a7f37; padding: 1em 1.2em; border-radius: 6px; }
.fd3d-success h2 { margin-top: 0; }
.fd3d-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.fd3d-decline { margin-top: 1.2em; }
.fd3d-legaltext h3 { margin-top: 1.4em; }

/* Widerrufsbutton – ständig sichtbar & hervorgehoben (§ 356a BGB) */
.fd3d-withdraw-fab { position: fixed; bottom: 16px; z-index: 9999; background: #b32d2e; color: #fff !important; font: 600 15px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; padding: 11px 16px; border-radius: 999px; box-shadow: 0 3px 12px rgba(0,0,0,.25); text-decoration: none !important; }
.fd3d-withdraw-fab:hover, .fd3d-withdraw-fab:focus { background: #8f1f20; outline: 3px solid #fff; outline-offset: 2px; }
.fd3d-withdraw-fab.fd3d-right { right: 16px; } .fd3d-withdraw-fab.fd3d-left { left: 16px; }
@media print { .fd3d-withdraw-fab { display: none; } }

/* Bildergalerie Fertigteil */
.fd3d-gallery { margin-bottom: 1.2em; }
.fd3d-gallery-main img { width: 100%; max-height: 520px; object-fit: contain; background: var(--fd3d-bg); border-radius: 10px; display: block; }
.fd3d-gallery-thumbs { display: flex; flex-wrap: wrap; gap: .5em; margin-top: .6em; }
.fd3d-gallery-thumbs button { border: 2px solid transparent; padding: 0; border-radius: 6px; overflow: hidden; background: none; cursor: pointer; width: 72px; height: 72px; }
.fd3d-gallery-thumbs button.is-active { border-color: var(--fd3d-accent); }
.fd3d-gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Warenkorb-Icon rechts */
.fd3d-cart-fab { position: fixed; right: 16px; top: 50%; transform: translateY(-50%); z-index: 9998; width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--fd3d-accent, #1f6feb); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.25); padding: 0; }
.fd3d-cart-fab[hidden] { display: none; }
.fd3d-cart-fab:hover, .fd3d-cart-fab:focus-visible { filter: brightness(1.1); outline: 3px solid #fff; outline-offset: 2px; }
.fd3d-cart-fab.is-empty { opacity: .85; }
.fd3d-cart-fab .fd3d-badge { position: absolute; top: -4px; right: -4px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: #e5484d; color: #fff; font: 700 13px/24px system-ui, -apple-system, Segoe UI, Roboto, sans-serif; text-align: center; box-shadow: 0 0 0 2px #fff; }
.fd3d-cart-fab.is-empty .fd3d-badge { background: #6b7280; }
.fd3d-cart-fab.fd3d-bump { animation: fd3d-bump .5s ease; }
@keyframes fd3d-bump { 0% { transform: translateY(-50%) scale(1); } 30% { transform: translateY(-50%) scale(1.22); } 60% { transform: translateY(-50%) scale(.94); } 100% { transform: translateY(-50%) scale(1); } }

/* Mini-Warenkorb (Schublade von rechts) */
.fd3d-drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 10000; opacity: 0; transition: opacity .25s; }
.fd3d-drawer-backdrop.is-open { opacity: 1; }
.fd3d-drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(380px, 100vw); background: #fff; color: #222; z-index: 10001; display: flex; flex-direction: column; box-shadow: -6px 0 24px rgba(0,0,0,.2); transform: translateX(100%); transition: transform .25s ease; }
.fd3d-drawer.is-open { transform: translateX(0); }
.fd3d-drawer[hidden], .fd3d-drawer-backdrop[hidden] { display: none; }
.fd3d-drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--fd3d-border); font-size: 1.1rem; }
.fd3d-drawer-x { background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer; color: #555; padding: 0 4px; }
.fd3d-drawer-body { flex: 1; overflow-y: auto; padding: 12px 18px; }
.fd3d-drawer-foot { border-top: 1px solid var(--fd3d-border); padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.fd3d-drawer-foot[hidden] { display: none; }
.fd3d-drawer-foot .fd3d-btn { text-align: center; }
.fd3d-drawer-sum { display: flex; justify-content: space-between; font-size: 1.05rem; }
.fd3d-drawer-empty { color: var(--fd3d-muted); margin-top: 1em; }
.fd3d-mini { list-style: none; margin: 0; padding: 0; }
.fd3d-mini li { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--fd3d-border); }
.fd3d-mini img, .fd3d-mini-noimg { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; display: flex; align-items: center; justify-content: center; background: var(--fd3d-bg); color: #b0b6bf; font-weight: 700; }
.fd3d-mini-info a { color: inherit; text-decoration: none; font-weight: 600; }
.fd3d-mini-info small { display: block; color: var(--fd3d-muted); }
.fd3d-mini-qty { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.fd3d-mini-qty button[data-fd3d-inc], .fd3d-mini-qty button[data-fd3d-dec] { width: 26px; height: 26px; border: 1px solid var(--fd3d-border); background: #fff; border-radius: 6px; cursor: pointer; line-height: 1; }
.fd3d-mini-qty span { min-width: 1.5em; text-align: center; }
.fd3d-mini-qty .fd3d-link { margin-left: 6px; font-size: .85em; }
.fd3d-mini-price { white-space: nowrap; }
@media (max-width: 600px) { .fd3d-cart-fab { width: 50px; height: 50px; top: auto; bottom: 76px; transform: none; } .fd3d-cart-fab.fd3d-bump { animation: none; } }
@media print { .fd3d-cart-fab, .fd3d-drawer, .fd3d-drawer-backdrop { display: none !important; } }

.fd3d-file-msg { margin: .4em 0 0; font-size: .92em; font-weight: 600; }
.fd3d-file-msg.is-ok { color: #1a7f37; } .fd3d-file-msg.is-error { color: #b32d2e; }

.fd3d .fd3d-invalid, .fd3d input.fd3d-invalid { border-color: #b32d2e !important; box-shadow: 0 0 0 2px rgba(179,45,46,.2); }
.fd3d-check.fd3d-invalid { color: #b32d2e; border-radius: 6px; padding: 4px; }
.fd3d-form-msg { background: #fdecea; border-left: 4px solid #b32d2e; padding: .6em 1em; border-radius: 4px; font-weight: 600; }
.fd3d-drop .fd3d-file-msg.is-ok[data-fd3d-pending] { margin: 0 0 .6em; }
