.xdoll-configurator {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(2,6,23,.06);
  max-width: 980px;
  margin: 0 auto;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
.xdoll-configurator h2 {
  margin: 0 0 12px;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.2;
}
.xdoll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
  gap: 12px;
  margin-top: 10px;
}
.xdoll-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
.xdoll-grid input, .xdoll-grid select {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}
.xdoll-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.xdoll-price { font-size: 18px; }
.xdoll-btn {
  background: #111827;
  color: #fff;
  border: 0;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}
.xdoll-btn:disabled { opacity: .6; cursor: not-allowed; }
.xdoll-note {
  margin-top: 10px;
  color: #6b7280;
  font-size: 12px;
}

/* Heads section */
.xdoll-heads { margin: 8px 0 14px; }
.xdoll-heads h3 { font-size: 18px; margin: 0 0 8px; }
.xdoll-heads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(160px,1fr));
  gap: 12px;
}
.xdoll-head-card {
  display: block;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  transition: box-shadow .2s, border-color .2s, transform .05s;
}
.xdoll-head-card:hover { box-shadow: 0 8px 24px rgba(2,6,23,.08); }
.xdoll-head-card.is-selected { border-color: #111827; }
.xdoll-head-card input[type="radio"] { position: absolute; left: -10000px; }
.xdoll-head-card__img {
  aspect-ratio: 4/5;
  background: #f3f4f6;
  display: grid; place-items: center;
}
.xdoll-head-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xdoll-head-card__placeholder { color: #9ca3af; font-size: 12px; }
.xdoll-head-card__meta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
}
.xdoll-head-card__title { font-weight: 600; font-size: 14px; }
.xdoll-head-card__price { font-size: 12px; color: #374151; }

/* Samples */
.xdoll-samples { margin-top: 20px; }
.xdoll-samples h3 { font-size: 18px; margin: 0 0 8px; }
.xdoll-samples-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
}
.xdoll-sample { border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; background: #fff; }
.xdoll-sample img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3; }
.xdoll-sample__ph { display:grid; place-items:center; aspect-ratio:4/3; color:#9ca3af; font-size:12px; }

/* --- Form control hardening (against theme overrides) --- */
.xdoll-grid select,
.xdoll-grid input[type="number"] {
  width: 100%;
  min-height: 42px;
  line-height: 1.4;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background-color: #fff;
  background-clip: padding-box;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}
.xdoll-grid select { height: auto !important; }   /* falls Themes tiny heights erzwingen */
.xdoll-grid select option { padding: 6px 8px; }

/* -------- Lightbox -------- */
body.xdoll-lb-open { overflow: hidden; }
.xdoll-lb {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: rgba(0,0,0,.75);
  padding: 20px;
}
.xdoll-lb__img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  background: #111;
}
.xdoll-lb__close,
.xdoll-lb__nav {
  position: absolute;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; font-size: 28px; line-height: 1;
  background: rgba(255,255,255,.15); color: #fff; cursor: pointer;
}
.xdoll-lb__close { top: 14px; right: 16px; }
.xdoll-lb__nav { top: 50%; transform: translateY(-50%); }
.xdoll-lb__prev { left: 16px; }
.xdoll-lb__next { right: 16px; }
.xdoll-lb__close:hover,
.xdoll-lb__nav:hover { background: rgba(255,255,255,.25); }

/* ---- Two-column layout ---- */
.xdoll-layout {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr;
  gap: 16px;
}
@media (max-width: 900px){
  .xdoll-layout { grid-template-columns: 1fr; }
}

/* --- LEFT PREVIEW: sticky/fixed GLOBAL DEAKTIVIERT --- */
.xdoll-left {
  position: static !important;   /* KEIN sticky/fixed irgendwo */
  top: auto !important;
  align-self: start;
  z-index: 1 !important;
}
.xdoll-preview-img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 24px rgba(2,6,23,.06);
  background: #fff;
}
.xdoll-preview-ph {
  display:grid; place-items:center;
  height: 420px;
  border-radius: 16px;
  border: 1px dashed #e5e7eb;
  color:#9ca3af; background:#f9fafb;
}

/* keep existing heads / form styles working */
.xdoll-right { position: relative; z-index: 2; }
.xdoll-right h2 { margin: 0 0 8px; }

/* ---------- Mobile layout tweaks (kein sticky, nur Stack) ---------- */
@media (max-width: 768px) {
  .xdoll-layout { display: block !important; }  /* stack left/right */
  .xdoll-left {
    width: 100% !important;
    margin-bottom: 16px !important;
  }
  .xdoll-preview-img,
  .xdoll-preview-ph {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
  }

  /* Head cards kompakter auf Phones */
  .xdoll-heads-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .xdoll-head-card { margin: 0; }
}

/* (Sicherheitsnetz) Preview nie über dem Formular zeichnen */
.xdoll-left { z-index: 1 !important; }
.xdoll-right { z-index: 2 !important; }
