/* CBW Christbaum-Konfigurator */
.cbw-tk { --tk-red: #a30505; --tk-red-d: #7d0404; --tk-line: #e4e0da; --tk-soft: #f8f5f0; --tk-text: #222; --tk-muted: #666; color: var(--tk-text); margin: 0 0 40px; }
.cbw-tk *, .cbw-tk *::before, .cbw-tk *::after { box-sizing: border-box; }
.cbw-tk button { font: inherit; letter-spacing: 0; text-transform: none; }
.cbw-tk-loading { height: 70vh; border-radius: 10px; background: linear-gradient(90deg, #f3efe9, #faf7f3, #f3efe9); background-size: 200% 100%; animation: cbw-tk-shimmer 1.4s infinite linear; }
@keyframes cbw-tk-shimmer { to { background-position: -200% 0; } }
.cbw-tk-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cbw-tk-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 36px; align-items: start; }

/* ---------- stage */
.cbw-tk-stage { position: sticky; top: 130px; } /* below Astra's sticky header */
.admin-bar .cbw-tk-stage { top: 162px; }
.cbw-tk-stage-in { background: radial-gradient(ellipse at 50% 35%, #fffaf2 0%, #f4ece0 60%, #eadfcf 100%); border: 1px solid var(--tk-line); border-radius: 12px; padding: 12px 12px 10px; }
.cbw-tk-viewbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.cbw-tk-viewlabel { font-size: 14px; color: var(--tk-muted); }
.cbw-tk-canvas { position: relative; aspect-ratio: 600 / 820; max-height: calc(100vh - 230px); margin: 0 auto; }
.cbw-tk-canvas .cbw-tk-svg { display: block; width: 100%; height: 100%; }
.cbw-tk-canvas.is-3d { cursor: grab; touch-action: pan-y; }
.cbw-tk-canvas.is-3d:active { cursor: grabbing; }
.cbw-tk-canvas canvas { display: block; width: 100% !important; height: 100% !important; border-radius: 8px; }
.cbw-tk-3d-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; color: var(--tk-muted); }
.cbw-tk-3d-hint { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); margin: 0; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.85); font-size: 12px; color: #555; pointer-events: none; white-space: nowrap; }
.cbw-tk-scale { margin: 6px 4px 0; font-size: 12px; color: #7a7068; text-align: center; line-height: 1.4; }
.cbw-tk-svg .tk-o { animation: cbw-tk-pop .35s ease-out both; animation-delay: var(--d); }
@keyframes cbw-tk-pop { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .cbw-tk-svg .tk-o { animation: none; } .cbw-tk-loading { animation: none; } }

/* ---------- segmented / tabs */
.cbw-tk-seg { display: inline-flex; background: #fff; border: 1px solid #d6d0c8; border-radius: 999px; padding: 3px; }
.cbw-tk-seg button { border: 0 !important; background: transparent !important; color: #444 !important; padding: 6px 14px !important; border-radius: 999px !important; font-size: 14px !important; line-height: 1.2 !important; cursor: pointer; min-height: 34px; }
.cbw-tk-seg button.is-on { background: var(--tk-red) !important; color: #fff !important; }
.cbw-tk-seg button:focus-visible, .cbw-tk button:focus-visible, .cbw-tk a:focus-visible, .cbw-tk-dlg button:focus-visible, .cbw-tk-dlg a:focus-visible, .cbw-tk-dlg input:focus-visible { outline: 2px solid var(--tk-red); outline-offset: 2px; }

/* ---------- panel */
.cbw-tk-step { margin: 0 0 30px; }
.cbw-tk-step h2 { display: flex; align-items: center; gap: 10px; font-size: 22px; line-height: 1.25; margin: 0 0 14px; }
.cbw-tk-step h2 span { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--tk-red); color: #fff; font-size: 15px; font-weight: 700; }
.cbw-tk-hint { margin: 0 0 10px; color: var(--tk-muted); font-size: 14px; }

.cbw-tk-sizes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.cbw-tk-sizes button { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-height: 112px; padding: 10px 4px 9px !important; border: 1px solid #d6d0c8 !important; border-radius: 10px !important; background: #fff !important; color: #2b5a3a !important; cursor: pointer; line-height: 1.2 !important; transition: border-color .15s, box-shadow .15s; }
.cbw-tk-sizes button svg { width: auto; }
.cbw-tk-sizes strong { color: var(--tk-text); font-size: 15px; }
.cbw-tk-sizes small { color: var(--tk-muted); font-size: 11.5px; text-align: center; }
.cbw-tk-sizes button:hover { border-color: #a99f93 !important; }
.cbw-tk-sizes button.is-on { border-color: var(--tk-red) !important; box-shadow: 0 0 0 1px var(--tk-red) inset; background: #fff8f6 !important; }

.cbw-tk-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--tk-line); margin: 0 0 16px; }
.cbw-tk-tabs button { border: 0 !important; border-bottom: 3px solid transparent !important; background: none !important; color: #555 !important; padding: 8px 16px !important; font-size: 15px !important; cursor: pointer; margin-bottom: -1px; border-radius: 0 !important; line-height: 1.3 !important; }
.cbw-tk-tabs button.is-on { color: var(--tk-red) !important; border-bottom-color: var(--tk-red) !important; font-weight: 600; }

.cbw-tk-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cbw-tk-presets button { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; text-align: left; padding: 12px !important; border: 1px solid #d6d0c8 !important; border-radius: 10px !important; background: #fff !important; color: var(--tk-text) !important; cursor: pointer; line-height: 1.3 !important; }
.cbw-tk-presets button:hover { border-color: #a99f93 !important; }
.cbw-tk-presets button.is-on { border-color: var(--tk-red) !important; box-shadow: 0 0 0 1px var(--tk-red) inset; background: #fff8f6 !important; }
.cbw-tk-presets strong { font-size: 15px; align-self: center; }
.cbw-tk-presets small { grid-column: 1 / 3; color: var(--tk-muted); font-size: 13px; margin-top: 4px; }
.cbw-tk-sw { display: inline-flex; align-self: center; }
.cbw-tk-sw i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); margin-right: -5px; }

.cbw-tk-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.cbw-tk-chips button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px 7px 8px !important; border: 1px solid #d0cac2 !important; border-radius: 999px !important; background: #fff !important; color: #333 !important; font-size: 14px !important; line-height: 1.2 !important; cursor: pointer; min-height: 38px; }
.cbw-tk-chips button i { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); flex: 0 0 auto; }
.cbw-tk-chips button.is-on { border-color: var(--tk-red) !important; box-shadow: 0 0 0 1px var(--tk-red) inset; }
.cbw-tk-chips em { font-style: normal; font-size: 11px; padding: 2px 6px; border-radius: 999px; background: var(--tk-red); color: #fff; }
.cbw-tk-chips--sm button { padding: 5px !important; min-height: 34px; }
.cbw-tk-chips--sm button:first-child { padding: 5px 12px !important; }

.cbw-tk-segrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 12px; }
.cbw-tk-segrow > span { min-width: 90px; font-size: 14px; color: #444; }
.cbw-tk-opts { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.cbw-tk-toggle { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; margin: 0; }
.cbw-tk-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cbw-tk-toggle span { position: relative; flex: 0 0 auto; width: 42px; height: 24px; border-radius: 999px; background: #c9c2b9; transition: background .15s; }
.cbw-tk-toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.cbw-tk-toggle input:checked + span { background: var(--tk-red); }
.cbw-tk-toggle input:checked + span::after { transform: translateX(18px); }
.cbw-tk-toggle input:focus-visible + span { outline: 2px solid var(--tk-red); outline-offset: 2px; }

/* ---------- list */
.cbw-tk-s3head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-bottom: 14px; }
.cbw-tk-s3head h2 { margin: 0; }
.cbw-tk-link { border: 0 !important; background: none !important; color: var(--tk-red) !important; padding: 6px 0 !important; text-decoration: underline; text-underline-offset: 2px; font-size: 15px !important; cursor: pointer; line-height: 1.3 !important; }
.cbw-tk-notes:empty { display: none; }
.cbw-tk-note { margin: 0 0 8px; padding: 10px 12px; background: #fff7e6; border: 1px solid #f0d9a8; border-radius: 6px; font-size: 14px; line-height: 1.45; }
.cbw-tk-note span { color: #a46a00; font-weight: 700; margin-right: 2px; }
.cbw-tk-list h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: #6b625a; margin: 18px 0 6px; }
.cbw-tk-lines { list-style: none; margin: 0 !important; padding: 0; }
.cbw-tk-line { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--tk-line); }
.cbw-tk-thumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; display: block; }
.cbw-tk-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; color: var(--tk-muted); line-height: 1.35; }
.cbw-tk-info a { color: var(--tk-text); font-size: 15px; text-decoration: none; hyphens: auto; }
.cbw-tk-info a:hover { color: var(--tk-red); }
.cbw-tk-info b { color: #444; font-weight: 600; }
.cbw-tk-badge { align-self: flex-start; margin-top: 2px; padding: 1px 8px; border-radius: 999px; background: #fff1d6; color: #7a4d00; font-size: 12px; }
.cbw-tk-low { color: #b54708; font-size: 12px; }
.cbw-tk-qty { display: inline-flex; align-items: center; border: 1px solid #d0cac2; border-radius: 6px; overflow: hidden; }
.cbw-tk-qty button { width: 34px; height: 36px; padding: 0 !important; border: 0 !important; background: #fff !important; color: #333 !important; font-size: 18px !important; cursor: pointer; line-height: 1 !important; border-radius: 0 !important; }
.cbw-tk-qty button:hover:not(:disabled) { background: var(--tk-soft) !important; }
.cbw-tk-qty button:disabled { color: #bbb !important; cursor: not-allowed; }
.cbw-tk-qty output { min-width: 28px; text-align: center; font-weight: 600; }
.cbw-tk-price { min-width: 78px; text-align: right; font-weight: 600; white-space: nowrap; }
.cbw-tk-price small { display: block; font-weight: 400; font-size: 12px; color: var(--tk-muted); }
.cbw-tk-acts { display: flex; align-items: center; gap: 2px; }
.cbw-tk-acts button { border: 0 !important; background: none !important; color: var(--tk-red) !important; cursor: pointer; padding: 6px 6px !important; font-size: 14px !important; line-height: 1.2 !important; text-decoration: underline; text-underline-offset: 2px; }
.cbw-tk-acts [data-act="remove"] { color: #777 !important; font-size: 22px !important; text-decoration: none; width: 36px; height: 36px; }
.cbw-tk-acts [data-act="remove"]:hover { color: var(--tk-red) !important; }
.cbw-tk-empty { color: var(--tk-muted); }
.cbw-tk-addbtn { margin: 14px 0 0; width: 100%; padding: 12px !important; border: 1px dashed #b9b0a5 !important; border-radius: 8px !important; background: #fff !important; color: #444 !important; font-size: 15px !important; cursor: pointer; line-height: 1.2 !important; }
.cbw-tk-addbtn:hover { border-color: var(--tk-red) !important; color: var(--tk-red) !important; }

/* ---------- summary */
.cbw-tk-sum { margin-top: 22px; padding: 18px; border-radius: 12px; background: var(--tk-soft); border: 1px solid var(--tk-line); }
.cbw-tk-meter > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; }
.cbw-tk-meter b { font-size: 16px; }
.cbw-tk-meter b small { font-weight: 400; color: var(--tk-muted); }
.cbw-tk-meter > small { display: block; font-size: 13px; color: var(--tk-muted); margin-top: 4px; }
.cbw-tk-meter-bar { display: block; height: 8px; border-radius: 999px; background: #e6ded3; margin-top: 6px; overflow: hidden; }
.cbw-tk-meter-bar i { display: block; height: 100%; background: linear-gradient(90deg, #2f7d3b, #4b9a55); border-radius: 999px; transition: width .3s; }
.cbw-tk-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; padding-top: 14px; border-top: 1px solid #e3dbd0; }
.cbw-tk-total span { font-size: 16px; }
.cbw-tk-total strong { font-size: 26px; }
.cbw-tk-tax { margin: 2px 0 14px; font-size: 13px; color: var(--tk-muted); text-align: right; }
.cbw-tk-tax b { color: #1f6b2a; }
.cbw-tk-btn, .cbw-tk-btn2 { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px !important; border-radius: 6px !important; font-size: 16px !important; font-weight: 600; text-decoration: none !important; cursor: pointer; line-height: 1.2 !important; }
.cbw-tk-btn { border: 0 !important; background: var(--tk-red) !important; color: #fff !important; }
.cbw-tk-btn:hover { background: var(--tk-red-d) !important; }
.cbw-tk-btn:disabled { opacity: .5; cursor: not-allowed; }
.cbw-tk-btn2 { border: 1px solid var(--tk-red) !important; background: #fff !important; color: var(--tk-red) !important; }
.cbw-tk-btn2:hover { background: #fff3f1 !important; }
.cbw-tk-cta { width: 100%; }
.cbw-tk-share { display: block; margin: 10px auto 0; font-size: 14px !important; }
.cbw-tk-done { padding: 12px 14px; border-radius: 8px; background: #edf6ee; border: 1px solid #b9dcbd; }
.cbw-tk-done p { margin: 0 0 8px; color: #1f5f2a; font-weight: 600; }
.cbw-tk-done ul { margin: 0 0 10px 18px; font-size: 13px; color: #6b4b00; }
.cbw-tk-done-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- mobile bar */
.cbw-tk-bar { display: none; }

/* ---------- dialog */
html.cbw-tk-modal { overflow: hidden; }
.cbw-tk-dlg { width: min(720px, calc(100vw - 24px)); max-height: min(86vh, 900px); padding: 0; border: 0; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--tk-text); }
.cbw-tk-dlg::backdrop { background: rgba(0,0,0,.45); }
.cbw-tk-dlg-in { position: relative; padding: 22px 22px 18px; max-height: min(86vh, 900px); overflow-y: auto; }
.cbw-tk-dlg h2 { font-size: 21px; margin: 0 44px 10px 0; line-height: 1.3; }
.cbw-tk-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0 !important; background: none !important; color: #444 !important; font-size: 28px !important; line-height: 1 !important; padding: 0 !important; cursor: pointer; }
.cbw-tk-cards { list-style: none; margin: 0 !important; padding: 0; }
.cbw-tk-cards li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--tk-line); }
.cbw-tk-cards img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; display: block; }
.cbw-tk-cards div { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; color: var(--tk-muted); }
.cbw-tk-cards a { color: var(--tk-text); font-size: 15px; text-decoration: none; hyphens: auto; }
.cbw-tk-cards .cbw-tk-btn2 { min-height: 40px; padding: 0 14px !important; font-size: 14px !important; }
.cbw-tk-tabs--sm { flex-wrap: wrap; }
.cbw-tk-tabs--sm button { padding: 7px 10px !important; font-size: 14px !important; }
.cbw-tk-addf input[type=search] { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #c9c2b9; border-radius: 6px; margin: 0 0 10px; font-size: 15px; }

.cbw-tk-toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 100001; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 8px; background: #222; color: #fff; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }

/* ---------- responsive */
@media (max-width: 1100px) {
	.cbw-tk-sizes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.cbw-tk-sizes button { min-height: 96px; }
}
@media (max-width: 900px) {
	.cbw-tk-grid { grid-template-columns: 1fr; gap: 20px; }
	.cbw-tk-stage { position: static; }
	.cbw-tk-canvas { max-height: 62vh; }
	.cbw-tk-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--tk-line); box-shadow: 0 -4px 16px rgba(0,0,0,.08); transform: translateY(110%); transition: transform .2s; }
	.cbw-tk-bar.is-on { transform: none; }
	.cbw-tk-bar div { display: flex; flex-direction: column; line-height: 1.2; }
	.cbw-tk-bar strong { font-size: 18px; }
	.cbw-tk-bar span { font-size: 12px; color: var(--tk-muted); }
	.cbw-tk-bar button { min-height: 46px; padding: 0 18px !important; border: 0 !important; border-radius: 6px !important; background: var(--tk-red) !important; color: #fff !important; font-weight: 600; font-size: 15px !important; }
}
@media (max-width: 600px) {
	.cbw-tk-step h2 { font-size: 20px; }
	.cbw-tk-presets { grid-template-columns: 1fr; }
	.cbw-tk-presets small { display: none; }
	.cbw-tk-presets button.is-on small { display: block; }
	.cbw-tk-sizes { gap: 6px; }
	.cbw-tk-sizes small { font-size: 11px; }
	/* line: thumb | info (full) / qty price acts */
	.cbw-tk-line { grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-areas: "img info info" "img qty price" "img acts acts"; gap: 6px 10px; }
	.cbw-tk-thumb { grid-area: img; align-self: start; }
	.cbw-tk-thumb img { width: 56px; height: 56px; }
	.cbw-tk-info { grid-area: info; }
	.cbw-tk-qty { grid-area: qty; justify-self: start; }
	.cbw-tk-price { grid-area: price; }
	.cbw-tk-acts { grid-area: acts; justify-content: flex-start; margin-left: -6px; }
	.cbw-tk-acts [data-act="remove"] { font-size: 14px !important; width: auto; height: auto; text-decoration: underline; color: #666 !important; }
	.cbw-tk-acts [data-act="remove"]::before { content: "Entfernen"; }
	.cbw-tk-acts [data-act="remove"] { font-size: 0 !important; }
	.cbw-tk-acts [data-act="remove"]::before { font-size: 14px; }
	.cbw-tk-dlg { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 14px 14px 0 0; }
	.cbw-tk-dlg-in { max-height: 92vh; padding: 18px 16px 16px; }
	.cbw-tk-total strong { font-size: 22px; }
	.cbw-tk-done-acts { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
	.cbw-tk-sizes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cbw-tk-segrow > span { min-width: 0; flex-basis: 100%; }
	.cbw-tk-seg button { padding: 6px 10px !important; }
}

/* 3D-only stage (since 1.1.0) */
.cbw-tk-3dtag { font-size: 13px; color: #5a4636; background: rgba(255,255,255,.75); border: 1px solid #e3d6c2; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.cbw-tk-3dtag[hidden] { display: none; }
