/* Kainer GmbH configurator — Industrial brand styling (graphite/amber, blue dropped),
   mobile-first, no overflow (§7.8b). Consumes the brand tokens (brand-tokens.css),
   which mirror the site SSOT (tokens.css). Reads as kainer's own surface. */
@import './brand-tokens.css';

:root { --ga-radius: var(--radius-md); }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font-sans); color: var(--color-text); background: var(--color-bg); -webkit-font-smoothing: antialiased; }

/* Header — graphite, kainer-led. */
.ga-header { background: var(--gradient-midnight); color: var(--white); padding: 1rem 1.25rem; box-shadow: var(--shadow-md); }
.ga-brand { display: flex; flex-direction: column; gap: .15rem; max-width: 1280px; margin: 0 auto; }
.ga-brand__mfr { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; letter-spacing: .01em; line-height: 1.1; }
.ga-brand__partner { display: block; font-size: .82rem; font-weight: 400; color: rgba(255,255,255,.82); }

/* Mobile-first: stacked. Desktop: stage + side panel. */
.ga-main { display: flex; flex-direction: column; gap: 1.25rem; padding: 1.25rem; max-width: 1280px; margin: 0 auto; }
@media (min-width: 900px) { .ga-main { flex-direction: row; align-items: flex-start; } }

.ga-stage { position: relative; flex: 1 1 auto; min-width: 0; background: var(--neutral-100); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
/* Tidy placeholder while the 3D scene loads — never a blank/black box. */
.ga-3d-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  background: linear-gradient(160deg, #f3f2f0 0%, #e8e6e3 100%); color: var(--midnight-600); text-align: center; pointer-events: none; }
.ga-3d-placeholder.is-hidden { display: none; }
.ga-3d-placeholder__mark { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; letter-spacing: .01em; }
.ga-3d-placeholder__note { font-size: .85rem; color: var(--neutral-600); }
/* Loading spinner shown during the cold asset load (industrial palette, no blue). The whole
   placeholder is removed via .is-hidden when loadModel resolves, taking the spinner with it. */
.ga-3d-placeholder__spinner { width: 30px; height: 30px; margin: .2rem 0; border-radius: 50%;
  border: 3px solid rgba(58, 63, 68, .2); border-top-color: var(--midnight-600, #3a3f44);
  animation: ga-spin .9s linear infinite; }
@keyframes ga-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ga-3d-placeholder__spinner { animation: none; } }
#ga-canvas { display: block; width: 100%; height: 52vh; }
@media (min-width: 900px) { #ga-canvas { height: 70vh; } }
.ga-price-badge { position: absolute; left: 1rem; bottom: 1rem; background: var(--midnight-600); color: var(--white);
  padding: .55rem 1rem; border-radius: var(--radius-pill); font-weight: 700; font-size: 1.02rem; box-shadow: var(--shadow-md); }
.ga-price-badge #ga-price { color: var(--gold-400); }

.ga-panel { flex: 0 0 380px; max-width: 100%; min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 900px) { .ga-panel { max-height: 70vh; overflow-y: auto; padding-right: .25rem; } }

.ga-step { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1rem; background: var(--white); box-shadow: var(--shadow); }
.ga-step__title { margin: 0 0 .6rem; font-size: 1.02rem; font-weight: 600; color: var(--color-heading); }
.ga-opt { margin-bottom: .7rem; }
.ga-opt__label { display: block; font-size: .8rem; color: var(--neutral-600); margin-bottom: .3rem; }
.ga-opt__values { display: flex; flex-wrap: wrap; gap: .4rem; }
.ga-opt__num { width: 100%; padding: .5rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font: inherit; color: var(--color-heading); }
.ga-opt__num:focus { outline: 2px solid var(--gold-400); outline-offset: 1px; border-color: var(--gold-400); }

.ga-val { padding: .4rem .7rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--white); cursor: pointer; font-size: .85rem; color: var(--color-heading); transition: border-color var(--duration-base) var(--ease-out), background var(--duration-base) var(--ease-out); }
.ga-val:hover { border-color: var(--midnight-500); }
.ga-val.is-selected { border-color: var(--midnight-600); background: var(--midnight-600); color: var(--white); font-weight: 600; }
.ga-val:disabled { opacity: .35; cursor: not-allowed; }
.ga-val.is-invalid { opacity: .5; } /* advisory: still selectable — picking it cascade-repairs the dependents */
.ga-val--swatch { width: 34px; height: 34px; padding: 0; border-radius: 50%; }
.ga-val--swatch.is-selected { outline: 3px solid var(--gold-400); outline-offset: 2px; background: var(--white); }

/* Side-elements sub-configurator. flex-wrap + min-width:0 keep it within the mobile width (§7.8 no-overflow). */
.ga-sides { display: flex; flex-direction: column; gap: .5rem; }
.ga-side { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: .5rem; background: var(--neutral-100); }
.ga-side__type { flex: 1 1 8rem; min-width: 0; padding: .45rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font: inherit; background: var(--white); color: var(--color-heading); }
.ga-side__dim { flex: 1 1 5rem; min-width: 0; padding: .45rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font: inherit; }
.ga-side__remove { flex: 0 0 auto; border: 1px solid var(--color-border); background: var(--white); border-radius: var(--radius-sm); padding: .3rem .6rem; cursor: pointer; line-height: 1; color: var(--neutral-600); }
.ga-side__remove:hover { border-color: var(--error); color: var(--error); }
.ga-side__add { align-self: flex-start; background: var(--midnight-600); color: var(--white); border: 0; border-radius: var(--radius-sm); padding: .55rem .9rem; font-weight: 600; cursor: pointer; }
.ga-side__add:hover { background: var(--midnight-500); }

/* Anfragen lead form — amber CTA. */
.ga-anfragen { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1.1rem; background: var(--white); display: flex; flex-direction: column; gap: .55rem; box-shadow: var(--shadow); }
.ga-anfragen h3 { margin: 0 0 .3rem; font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; color: var(--color-heading); }
.ga-anfragen input, .ga-anfragen textarea { padding: .6rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font: inherit; width: 100%; color: var(--color-heading); }
.ga-anfragen input:focus, .ga-anfragen textarea:focus { outline: 2px solid var(--gold-400); outline-offset: 1px; border-color: var(--gold-400); }
.ga-submit { background: var(--gold-400); color: var(--midnight-800); border: 0; border-radius: var(--radius-sm); padding: .75rem; font-weight: 700; font-size: 1rem; cursor: pointer; transition: background var(--duration-base) var(--ease-out); }
.ga-submit:hover { background: var(--gold-500); }
.ga-anfragen__status { font-size: .85rem; margin: .25rem 0 0; min-height: 1.1em; color: var(--neutral-600); }

.ga-footer { padding: 1.25rem; text-align: center; font-size: .8rem; color: var(--neutral-600); border-top: 1px solid var(--color-border); margin-top: 1rem; background: var(--neutral-100); }

/* 3D debug panel (Ivan-facing, toggleable) — graphite chrome, monospace data. */
#ga-debug-toggle { position: fixed; right: 12px; bottom: 12px; z-index: 60; background: var(--midnight-600); color: var(--white);
  border: 1px solid var(--midnight-500); border-radius: var(--radius-pill); padding: .5rem .9rem; font: 600 .8rem var(--font-sans); cursor: pointer; box-shadow: var(--shadow-md); }
#ga-debug-toggle:hover { background: var(--midnight-500); }
#ga-debug-panel { position: fixed; right: 12px; bottom: 56px; z-index: 60; width: min(560px, calc(100vw - 24px)); max-height: 70vh; overflow: auto;
  background: var(--white); color: var(--neutral-800); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: .75rem; font: .72rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ga-debug__head { font-weight: 700; margin-bottom: .4rem; color: var(--midnight-600); }
.ga-debug__ok { color: var(--success); margin: .2rem 0 .5rem; }
.ga-debug__err { color: var(--error); margin: .2rem 0 .5rem; }
.ga-debug__tbl { width: 100%; border-collapse: collapse; }
.ga-debug__tbl th, .ga-debug__tbl td { text-align: left; padding: .15rem .35rem; border-bottom: 1px solid var(--neutral-200); white-space: nowrap; }
.ga-debug__tbl th { position: sticky; top: 0; background: var(--neutral-100); }
.ga-debug--ghost td { background: #fdeaea; color: var(--error); }
.ga-debug--hidden td { color: #9b958c; }

/* Dimensions slider + live part counts (#9624) — over the 3D stage, bottom-right (clears the price badge). */
.ga-dims { position: absolute; right: 1rem; bottom: 1rem; left: auto; width: min(340px, calc(100% - 2rem));
  background: color-mix(in srgb, var(--midnight-600) 92%, transparent); color: var(--white);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: .7rem .85rem; backdrop-filter: blur(4px); font-size: .85rem; z-index: 2; }
.ga-dims__title { font-weight: 700; letter-spacing: .02em; margin-bottom: .5rem; color: var(--white); }
.ga-dim { display: grid; grid-template-columns: 3.4rem 1fr 3.6rem; align-items: center; gap: .55rem; margin: .35rem 0; }
.ga-dim__label { color: var(--midnight-200); }
.ga-dim__range { width: 100%; accent-color: var(--gold-400); cursor: pointer; height: 1.1rem; }
.ga-dim__val { text-align: right; font-variant-numeric: tabular-nums; color: var(--white); }
.ga-counts { margin-top: .55rem; padding-top: .5rem; border-top: 1px solid color-mix(in srgb, var(--white) 18%, transparent);
  color: var(--gold-400); font-weight: 700; font-variant-numeric: tabular-nums; min-height: 1.1em; }
@media (max-width: 720px) {
  .ga-dims { left: 1rem; right: 1rem; width: auto; bottom: .75rem; }
  .ga-price-badge { bottom: auto; top: 1rem; }
}
