.hod-mg {
  --mg-border: #d9dde2;
  --mg-soft: #f5f7f8;
  --mg-text: #17212b;
  --mg-muted: #68727d;
  --mg-accent: #1473e6;
  --mg-danger: #c93333;
  margin: 22px 0;
  padding: 22px;
  border: 1px solid var(--mg-border);
  border-radius: 16px;
  background: #fff;
  color: var(--mg-text);
  box-shadow: 0 12px 35px rgba(22, 33, 43, 0.07);
}

.hod-mg *, .hod-mg *::before, .hod-mg *::after { box-sizing: border-box; }
.hod-mg [hidden] { display: none !important; }

.hod-mg__header,
.hod-mg__summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hod-mg__header { margin-bottom: 18px; }
.hod-mg__header h3 { margin: 0; font-size: clamp(1.25rem, 2vw, 1.65rem); }
.hod-mg__eyebrow { margin: 0 0 3px; color: var(--mg-accent); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hod-mg__version { padding: 5px 9px; border-radius: 999px; background: var(--mg-soft); color: var(--mg-muted); font-size: .75rem; }

.hod-mg__layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); gap: 22px; }
.hod-mg__controls { display: grid; gap: 14px; }
.hod-mg__section { padding: 16px; border: 1px solid var(--mg-border); border-radius: 12px; background: #fff; }
.hod-mg__section h4 { margin: 0 0 12px; font-size: 1rem; }
.hod-mg__grid { display: grid; gap: 12px; }
.hod-mg__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hod-mg__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hod-mg__grid--strips { align-items: start; }
.hod-mg__grid--strips label { grid-template-rows: auto 44px auto; align-content: start; }
.hod-mg__grid--strips label > span { white-space: nowrap; }
.hod-mg__grid--strips label input,
.hod-mg__grid--strips label select { grid-row: 2; }
.hod-mg__grid--strips label small { grid-row: 3; }
.hod-mg__field--full { grid-column: 1 / -1; }

.hod-mg label { display: grid; gap: 6px; margin: 0; font-weight: 700; }
.hod-mg label > span { font-size: .88rem; }
.hod-mg small { color: var(--mg-muted); font-weight: 500; line-height: 1.35; }
.hod-mg input[type="number"],
.hod-mg input[type="text"],
.hod-mg select {
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #cbd1d8;
  border-radius: 9px;
  background: #fff;
  color: var(--mg-text);
  font: inherit;
}
.hod-mg input:focus, .hod-mg select:focus { outline: 2px solid rgba(20,115,230,.25); border-color: var(--mg-accent); }
.hod-mg input.is-invalid { border-color: var(--mg-danger); color: var(--mg-danger); background: #fff7f7; }
.hod-mg input[type="range"] { width: 100%; accent-color: var(--mg-accent); }


.hod-mg__proportion-lock {
  display: flex !important;
  align-items: center;
  gap: 9px !important;
  margin-top: 12px !important;
  padding: 10px 12px;
  border: 1px solid var(--mg-border);
  border-radius: 9px;
  background: var(--mg-soft);
  cursor: pointer;
}
.hod-mg__proportion-lock input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--mg-accent); flex: 0 0 auto; }
.hod-mg__proportion-lock > span { font-size: .86rem; }
.hod-mg__proportion-hint { display: block; margin-top: 6px; }

.hod-mg__rakel-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; align-items: stretch; margin-bottom: 7px; }
.hod-mg__check-card {
  display: grid !important;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px !important;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--mg-border);
  border-radius: 9px;
  background: var(--mg-soft);
  cursor: pointer;
}
.hod-mg__check-card input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--mg-accent); }
.hod-mg__check-card > span { font-size: .9rem; }
.hod-mg__check-card > strong { white-space: nowrap; font-size: .82rem; color: var(--mg-accent); }
.hod-mg__rakel-quantity { min-width: 0; }

.hod-mg__transfer-note { margin: 10px 0 0; padding: 9px 11px; border-radius: 9px; background: var(--mg-soft); color: var(--mg-muted); font-size: .84rem; }
.hod-mg__transfer-note.is-active { background: #eaf3ff; color: #0758b8; }

.hod-mg__visual { min-width: 0; }
.hod-mg__preview-wrap { padding: 14px; border-radius: 14px; background: #eef2f4; }
.hod-mg__preview-title {
  display: grid;
  grid-template-columns: auto minmax(190px, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: .86rem;
  font-weight: 800;
}
.hod-mg__scene-select {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-self: center;
  gap: 7px !important;
  margin: 0 !important;
  font-weight: 600 !important;
}
.hod-mg__scene-select > span { color: var(--mg-muted); white-space: nowrap; }
.hod-mg__scene-select select { min-width: 185px; padding: 7px 32px 7px 10px; font-size: .82rem; }
#hod-mg-preview-measure { color: var(--mg-muted); font-weight: 600; white-space: nowrap; }
.hod-mg__preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 1 / 1;
  min-height: 0;
  margin-inline: auto;
  overflow: hidden;
  border-radius: 11px;
  background-color: #e6ebee;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(99, 111, 122, .12);
}
.hod-mg__preview-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(135deg, rgba(255,255,255,.12), transparent 35%, rgba(255,255,255,.05) 62%, transparent 78%);
  pointer-events: none;
}
#hod-mg-preview {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 80%;
  height: auto;
  max-height: 92%;
  transform: translate(-50%, -50%);
  overflow: visible;
}
/* Nur die BREITE wird je Hintergrund festgelegt. Die Höhe ergibt sich aus dem echten
   Verhältnis von Hauptzuschnitt + optionalen Zusatzstreifen. */
.hod-mg__preview-stage[data-scene="window"] #hod-mg-preview { width: 72%; top: 49%; }
.hod-mg__preview-stage[data-scene="office"] #hod-mg-preview { width: 86%; top: 49%; }
.hod-mg__preview-stage[data-scene="bathroom"] #hod-mg-preview { width: 62%; top: 47%; }
.hod-mg__preview-stage[data-scene="custom"] #hod-mg-preview { width: 88%; top: 50%; }
.hod-mg-svg-glass,
.hod-mg-svg-frost { rx: 0 !important; ry: 0 !important; }
.hod-mg-svg-glass { fill: rgba(235,244,246,.12); shape-rendering: crispEdges; }
.hod-mg-svg-frost,
.hod-mg-svg-positive-text { fill: rgba(239, 244, 245, .975); }
.hod-mg-svg-frost { shape-rendering: crispEdges; }
.hod-mg__preview-hint { margin: 9px 2px 0; color: var(--mg-muted); font-size: .76rem; line-height: 1.4; }

.hod-mg__summary { margin-top: 14px; overflow: hidden; border: 1px solid var(--mg-border); border-radius: 13px; background: #fff; }
.hod-mg__summary-row { padding: 11px 14px; border-bottom: 1px solid #edf0f2; font-size: .88rem; }
.hod-mg__summary-row span { color: var(--mg-muted); }
.hod-mg__tier-progress { padding: 13px 14px 14px; border-bottom: 1px solid #edf0f2; background: #fbfcfe; }
.hod-mg__tier-progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 9px; }
.hod-mg__tier-progress-head span { color: var(--mg-muted); font-size: .78rem; font-weight: 700; }
.hod-mg__tier-progress-head strong { font-size: .86rem; }
.hod-mg__tier-progress-track { width: 100%; height: 9px; overflow: hidden; border-radius: 999px; background: #e8edf3; }
.hod-mg__tier-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--mg-accent); transition: width .2s ease; }
.hod-mg__tier-progress p { margin: 9px 0 0; color: var(--mg-text); font-size: .82rem; font-weight: 700; line-height: 1.4; }
.hod-mg__tier-progress small { display: block; margin-top: 4px; color: var(--mg-muted); font-size: .75rem; font-weight: 500; }
.hod-mg__summary-row--total { padding-top: 16px; padding-bottom: 16px; background: #f4f8fd; }
.hod-mg__summary-row--total span { color: var(--mg-text); font-weight: 800; }
.hod-mg__summary-row--total strong { font-size: 1.65rem; line-height: 1; }
.hod-mg__summary-sub { padding: 0 14px 14px; background: #f4f8fd; color: var(--mg-muted); text-align: right; font-size: .78rem; }
.hod-mg-price-placeholder { font-size: .9em; color: #68727d; }


@media (max-width: 720px) {
  .hod-mg__preview-title { grid-template-columns: 1fr auto; }
  .hod-mg__scene-select { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .hod-mg__scene-select select { flex: 1 1 auto; min-width: 0; }
  .hod-mg__grid--2,
  .hod-mg__grid--3 { grid-template-columns: 1fr; }
  .hod-mg__grid--strips label > span { white-space: normal; }
  .hod-mg__rakel-row { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .hod-mg__layout { grid-template-columns: 1fr; }
  .hod-mg__visual { order: -1; }
}

@media (max-width: 560px) {
  .hod-mg { padding: 14px; border-radius: 12px; }
  .hod-mg__grid--2 { grid-template-columns: 1fr; }
  .hod-mg__summary-row--total strong { font-size: 1.4rem; }
}

/* Breite Darstellung unterhalb von Produktbild und Produktinformationen. */
.hod-mg-wide-slot {
  clear: both;
  display: block;
  width: 100%;
  margin: 28px 0 24px;
}

.hod-mg-cart-form--wide {
  display: block;
  width: 100%;
  max-width: none;
  clear: both;
}

.hod-mg--wide {
  width: 100%;
  max-width: none;
  margin: 0 0 18px;
}

.hod-mg--wide .hod-mg__layout {
  grid-template-columns: minmax(340px, .9fr) minmax(480px, 1.35fr);
  gap: 28px;
}

.hod-mg--wide .hod-mg__preview-stage { max-width: 720px; }

.hod-mg-cart-form--wide .quantity,
.hod-mg-cart-form--wide .single_add_to_cart_button {
  margin-top: 0;
}

@media (max-width: 980px) {
  .hod-mg--wide .hod-mg__layout {
    grid-template-columns: 1fr;
  }

  .hod-mg--wide .hod-mg__visual {
    order: -1;
  }

}


.hod-mg__custom-photo,
.hod-mg__scene-tools {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--mg-border);
  border-radius: 10px;
  background: #fff;
}
.hod-mg__photo-dropzone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 2px dashed #b8c2ca;
  border-radius: 9px;
  background: var(--mg-soft);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.hod-mg__photo-dropzone:hover,
.hod-mg__photo-dropzone:focus,
.hod-mg__photo-dropzone.is-dragging {
  border-color: var(--mg-accent);
  background: #edf5ff;
  outline: none;
}
.hod-mg__photo-dropzone > div { display: grid; gap: 3px; }
.hod-mg__photo-dropzone strong { font-size: .9rem; }
.hod-mg__photo-dropzone span { color: var(--mg-muted); font-size: .76rem; }
.hod-mg__photo-select { flex: 0 0 auto; margin: 0 !important; white-space: nowrap; }
.hod-mg__photo-tools { margin-top: 12px; }
.hod-mg__photo-file-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: .82rem; }
#hod-mg-photo-filename { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.hod-mg__photo-remove { border: 0; padding: 0; background: transparent; color: var(--mg-danger); text-decoration: underline; cursor: pointer; white-space: nowrap; }
.hod-mg__photo-sliders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hod-mg__photo-sliders label { min-width: 0; }
.hod-mg__photo-sliders label > span { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; font-size: .76rem; }
.hod-mg__photo-sliders strong { color: var(--mg-accent); }
.hod-mg__photo-privacy { margin: 10px 0 0; color: var(--mg-muted); font-size: .72rem; line-height: 1.4; }
.hod-mg__photo-error { margin: 8px 0 0; padding: 8px 10px; border-radius: 7px; background: #fff0f0; color: var(--mg-danger); font-size: .78rem; }
.hod-mg__custom-photo-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  transform: scale(1);
  transition: transform .08s linear;
  pointer-events: none;
}
.hod-mg__preview-stage.is-custom-photo { background-color: #dfe4e7; }

@media (max-width: 720px) {
  .hod-mg__photo-dropzone { align-items: stretch; flex-direction: column; }
  .hod-mg__photo-select { width: 100%; }
  .hod-mg__photo-sliders { grid-template-columns: 1fr; }
}

.hod-mg__strip-fit-note {
  margin: 10px 0 0;
  padding: 9px 11px;
  border-radius: 9px;
  background: #f4f7f8;
  color: var(--mg-muted);
  font-size: .78rem;
  line-height: 1.4;
}
.hod-mg__strip-fit-note.is-invalid { background: #fff0f0; color: var(--mg-danger); }


.hod-mg__check-card--stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.hod-mg__motif-controls {
  margin-top: 14px;
}
.hod-mg__motif-note {
  margin-top: 8px;
  color: #5e6f8c;
  font-size: 13px;
}
.hod-mg__motif-preview-image {
  display: none;
}

.hod-mg__motif-white-note {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid #e3b341;
  border-radius: 9px;
  background: #fff9e8;
  color: #594100;
  font-size: .82rem;
  line-height: 1.45;
}


#hod-mg-strip-taper-wrap small { display:block; margin-top:4px; }
