.fensterkonfigurator-embed {
  --fk-border: #e4e7ec;
  width: 100%;
  margin: 1.5rem 0;
}
.fensterkonfigurator-embed--wide {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.fensterkonfigurator-embed__stage-note {
  max-width: 1440px;
  margin: 0 auto 10px;
  padding: 10px 14px;
  border: 1px solid #f5c451;
  border-radius: 10px;
  background: #fff8e6;
  color: #694100;
  font-size: 13px;
  line-height: 1.4;
}
.fensterkonfigurator-embed__frame {
  display: block;
  width: 100%;
  height: min(var(--fensterkonfigurator-height, 900px), calc(100dvh - 20px));
  min-height: 720px;
  border: 0;
  background: #f5f7fb;
}
.fensterkonfigurator-embed__status {
  max-width: 1440px;
  margin: 8px auto 0;
  min-height: 1.4em;
  color: #475467;
  font-size: 12px;
}
@media (max-width: 820px) {
  .fensterkonfigurator-embed {
    margin-top: .75rem;
    margin-bottom: .75rem;
  }
  .fensterkonfigurator-embed__stage-note {
    margin-left: 10px;
    margin-right: 10px;
    font-size: 11px;
  }
  .fensterkonfigurator-embed__frame {
    height: calc(100dvh - 10px);
    min-height: 680px;
  }
}

/* Dedicated WordPress app shell: no theme chrome and no outer document scrolling. */
html:has(body.fensterkonfigurator-fullscreen-page) {
  margin: 0 !important;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body.fensterkonfigurator-fullscreen-page {
  margin: 0 !important;
  padding: 0 !important;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: #f5f7fb;
}
body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-app-shell,
body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-app-shell > p,
body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-embed {
  margin: 0 !important;
  padding: 0 !important;
  width: 100vw !important;
  max-width: none !important;
  height: 100dvh;
}
body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-app-shell > p:empty {
  display: none;
}
body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-embed__stage-note {
  display: none;
}
body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-embed__frame {
  display: block;
  width: 100vw;
  height: 100dvh !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0;
  border: 0;
}
body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-embed__status {
  position: fixed;
  z-index: 10000;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  width: auto;
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 8px 24px rgba(16,24,40,.14);
}
body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-embed__status:empty {
  display: none;
}


/* 0.1.2: App-exit and hard fullscreen fallback, also when a mobile theme template wins. */
.fensterkonfigurator-exit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(152,162,179,.55);
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  color: #344054;
  box-shadow: 0 4px 14px rgba(16,24,40,.12);
  font: 600 12px/1.2 system-ui,-apple-system,"Segoe UI",sans-serif;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.fensterkonfigurator-exit:hover,
.fensterkonfigurator-exit:focus-visible {
  background: #fff;
  color: #101828;
}
body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-exit {
  position: fixed;
  z-index: 2147483000;
  top: max(8px, env(safe-area-inset-top));
  left: max(8px, env(safe-area-inset-left));
  margin: 0;
}

/* If the active/mobile theme still renders its shell, JS moves the configurator into
   a direct body child and this hides all remaining theme chrome without touching scripts. */
html.fensterkonfigurator-force-fullscreen {
  margin: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  overscroll-behavior: none;
}
body.fensterkonfigurator-fullscreen-page.fensterkonfigurator-force-fullscreen-body {
  margin: 0 !important;
  padding: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  overflow: hidden !important;
  overscroll-behavior: none;
}
body.fensterkonfigurator-force-fullscreen-body > *:not(#fensterkonfigurator-app-shell):not(script):not(style):not(link):not(noscript) {
  display: none !important;
}
body.fensterkonfigurator-force-fullscreen-body > #fensterkonfigurator-app-shell {
  display: block !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147482000;
  width: 100vw !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #f5f7fb;
}
body.fensterkonfigurator-force-fullscreen-body > #fensterkonfigurator-app-shell > .fensterkonfigurator-embed {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
}
@media (max-width: 820px) {
  body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-exit {
    min-height: 38px;
    padding: 7px 10px;
    font-size: 11px;
  }
}


/* 0.1.3: branded app header above the configurator progress bar. */
.fensterkonfigurator-app-header {
  display: none;
}
body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-embed,
body.fensterkonfigurator-force-fullscreen-body > #fensterkonfigurator-app-shell > .fensterkonfigurator-embed {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
}
body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-app-header,
body.fensterkonfigurator-force-fullscreen-body .fensterkonfigurator-app-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  min-height: 50px;
  box-sizing: border-box;
  padding: max(7px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 7px max(12px, env(safe-area-inset-left));
  border-bottom: 1px solid #e4e7ec;
  background: rgba(255,255,255,.98);
  box-shadow: 0 1px 5px rgba(16,24,40,.06);
  z-index: 3;
}
body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-exit,
body.fensterkonfigurator-force-fullscreen-body .fensterkonfigurator-exit {
  position: static !important;
  inset: auto !important;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 36px;
  max-width: 100%;
  margin: 0;
  padding: 7px 11px;
  box-sizing: border-box;
  box-shadow: none;
  white-space: nowrap;
}
.fensterkonfigurator-exit__arrow {
  font-size: 16px;
  line-height: 1;
}
.fensterkonfigurator-exit__brand {
  color: #101828;
  font-size: 13px;
  letter-spacing: -.01em;
}
body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-embed__frame,
body.fensterkonfigurator-force-fullscreen-body .fensterkonfigurator-embed__frame {
  min-width: 0 !important;
  min-height: 0 !important;
  width: 100% !important;
  height: 100% !important;
  align-self: stretch;
}
@media (max-width: 820px) {
  body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-app-header,
  body.fensterkonfigurator-force-fullscreen-body .fensterkonfigurator-app-header {
    min-height: 46px;
    padding-top: max(5px, env(safe-area-inset-top));
    padding-bottom: 5px;
  }
  body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-exit,
  body.fensterkonfigurator-force-fullscreen-body .fensterkonfigurator-exit {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 11px;
  }
  .fensterkonfigurator-exit__brand { font-size: 12px; }
}

/* 0.2.0: WooCommerce cart bridge and cart navigation. */
body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-app-header,
body.fensterkonfigurator-force-fullscreen-body .fensterkonfigurator-app-header {
  justify-content: space-between;
  gap: 10px;
}
.fensterkonfigurator-cart-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 11px;
  box-sizing: border-box;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: #fff;
  color: #101828;
  font: 650 12px/1.2 system-ui,-apple-system,"Segoe UI",sans-serif;
  text-decoration: none;
  white-space: nowrap;
}
.fensterkonfigurator-cart-link:hover,
.fensterkonfigurator-cart-link:focus-visible { background: #f9fafb; color: #101828; }
.fensterkonfigurator-cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #101828;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-embed__status[data-state="busy"] { border-color:#98a2b3; }
body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-embed__status[data-state="success"] { border-color:#75b798; }
body.fensterkonfigurator-fullscreen-page .fensterkonfigurator-embed__status[data-state="error"] { border-color:#e98b8b; color:#912018; }
.fensterkonfigurator-cart-preview { width: 110px; height: auto; object-fit: contain; background:#f8fafc; }
@media (max-width: 520px) {
  .fensterkonfigurator-exit__label { display:none; }
  .fensterkonfigurator-cart-link { min-height:34px; padding:6px 9px; font-size:11px; }
}

/* 0.4.4: Im Warenkorb noch keine adressabhängigen Versandkosten anzeigen. */
body.woocommerce-cart [data-fensterglueck-cart-shipping-hidden="1"] {
  display: none !important;
}
.fensterglueck-cart-shipping-notice {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  background: #f8fafc;
  color: #344054;
  font-size: 13px;
  line-height: 1.4;
}
.fensterglueck-cart-shipping-notice strong {
  color: #101828;
  font-size: 13px;
}
.fensterglueck-cart-shipping-notice span {
  color: #667085;
}
.fensterglueck-cart-shipping-notice--block,
.fensterglueck-cart-shipping-notice--after-checkout {
  margin: 14px 0 0;
}
.fensterglueck-cart-net-total th,
.fensterglueck-cart-net-total td {
  font-weight: 600;
}

/* 0.4.5: Nettozeile im WooCommerce Cart Block. */
.fensterglueck-cart-net-total-block {
  font-weight: 600;
}
.fensterglueck-cart-net-total-block .wc-block-components-totals-item__label,
.fensterglueck-cart-net-total-block .wc-block-components-totals-item__value {
  font-weight: 600;
}


/* 0.4.6: technische Produktempfehlungen im leeren Warenkorb ausblenden. */
body.woocommerce-cart [data-fensterglueck-empty-cart-recommendation="1"] {
  display: none !important;
}
body.woocommerce-cart .wp-block-woocommerce-empty-cart-block .wp-block-woocommerce-product-collection {
  display: none !important;
}


/* 0.4.9: anklickbare Produktvorschau im Warenkorb. */
body.woocommerce-cart .fensterkonfigurator-cart-preview,
body.woocommerce-cart .wc-block-cart-item__image img[alt="Produktvorschau"] {
  cursor: zoom-in;
}
body.fensterkonfigurator-preview-lightbox-open {
  overflow: hidden;
}
.fensterkonfigurator-preview-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  box-sizing: border-box;
  background: rgba(15, 23, 42, .86);
  backdrop-filter: blur(3px);
  cursor: zoom-out;
}
.fensterkonfigurator-preview-lightbox__panel {
  position: relative;
  display: grid;
  place-items: center;
  max-width: 96vw;
  max-height: 94vh;
  cursor: default;
}
.fensterkonfigurator-preview-lightbox__image {
  display: block;
  max-width: min(1200px, 92vw);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}
.fensterkonfigurator-preview-lightbox__close {
  position: absolute;
  top: -14px;
  right: -14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 999px;
  background: #fff;
  color: #101828;
  font: 400 30px/1 system-ui,-apple-system,"Segoe UI",sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.fensterkonfigurator-preview-lightbox__close:focus-visible {
  outline: 3px solid #84adff;
  outline-offset: 2px;
}
@media (max-width: 520px) {
  .fensterkonfigurator-preview-lightbox__image {
    max-width: 94vw;
    max-height: 84vh;
  }
  .fensterkonfigurator-preview-lightbox__close {
    top: -10px;
    right: -6px;
  }
}

/* 0.5.23: vorhandene Konfiguration aus dem Warenkorb wieder öffnen. */
.fensterkonfigurator-cart-edit {
  margin-top: .35rem;
  font-size: .875em;
  font-weight: 500;
}
.fensterkonfigurator-cart-edit a,
.fensterkonfigurator-cart-edit-link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 0.5.26: kompakte Inline-Aktionen; der Editor erscheint nur bei Bedarf. */
.fensterkonfigurator-cart-workspace {
  display: contents;
}
.fensterkonfigurator-cart-workspace__actions {
  display: inline;
  font-size: inherit;
  font-weight: inherit;
}
.fensterkonfigurator-cart-action-link,
.fensterkonfigurator-cart-edit-link {
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.fensterkonfigurator-cart-action-link[aria-disabled="true"] {
  opacity: .55;
  pointer-events: none;
}
.fensterkonfigurator-cart-workspace__editor {
  display: grid;
  gap: .55rem;
  margin-top: .55rem;
  padding: .6rem .7rem;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  background: #fff;
  max-width: 520px;
}
.fensterkonfigurator-cart-workspace__editor[hidden] { display: none !important; }
.fensterkonfigurator-cart-workspace__field {
  display: grid;
  gap: .25rem;
  font-size: .9em;
  font-weight: 600;
}
.fensterkonfigurator-cart-workspace__field input,
.fensterkonfigurator-cart-workspace__field textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 220px;
  max-width: 100%;
  padding: .45rem .55rem;
  border: 1px solid #8c8f94;
  border-radius: 4px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-weight: 400;
}
.fensterkonfigurator-cart-workspace__field textarea { resize: vertical; }
.fensterkonfigurator-cart-workspace__footer {
  display: flex;
  gap: .55rem;
  align-items: center;
  flex-wrap: wrap;
}
.fensterkonfigurator-cart-context-save {
  min-height: 34px;
  padding: .4rem .7rem;
  border: 1px solid #767676;
  border-radius: 4px;
  background: #fff;
  color: #1d2327;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.fensterkonfigurator-cart-context-save:hover { background: #f6f7f7; }
.fensterkonfigurator-cart-context-save:disabled { opacity: .6; cursor: wait; }
.fensterkonfigurator-cart-workspace__status {
  display: block;
  margin-top: .25rem;
  font-size: .85em;
  color: #50575e;
}

/* Separate, non-binding offer-request action below the regular purchase button. */
.fensterkonfigurator-offer-request {
  margin: 20px 0 14px;
  padding: 16px 18px;
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 8px;
  background: rgba(0,0,0,.025);
}
.fensterkonfigurator-offer-request__copy p {
  margin: 5px 0 12px;
  font-size: .92em;
  line-height: 1.45;
}
.fensterkonfigurator-offer-request__button {
  width: 100%;
  min-height: 44px;
  background: transparent !important;
  color: inherit !important;
  border: 1px solid currentColor !important;
  font-weight: 600;
}
.fensterkonfigurator-offer-request__button:disabled { opacity: .6; cursor: wait; }
.fensterkonfigurator-offer-request__status { margin: 8px 0 0; font-size: .9em; }
.fensterkonfigurator-offer-request__status:empty { display: none; }
.fensterkonfigurator-offer-request__status[data-kind="error"] { font-weight: 600; }
.fensterkonfigurator-offer-success {
  width: min(880px, calc(100% - 36px));
  margin: 48px auto 72px;
}
