:root {
  --bg: #0b0b0d;
  --card: #15161a;
  --text: #e9eaee;
  --muted: #9aa0a6;
  --accent: #0bb4aa;
  --border: #23252b;

  --stickyTop: 16px;
  --optsGap: 18px;
  --totalsH: 0px;

  --optsH: 0px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  interpolate-size: allow-keywords;
  /*erlaubt Transitions von fester Größe zu Auto*/
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 16px;
}

.wrap {
  max-width: 1340px;
  margin: 0 auto;
  padding: 16px;
}

.grid {
  display: grid;
  grid-template-columns: 1.35fr 360px;
  gap: 18px;
}

.card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  padding: 20px;
  border: 1px solid var(--border);
}

h1,
h2 {
  margin: 0 0 6px;
  font-weight: 800;
  font-family: poppins;
}

h1 {
  font-size: 22px;
  color: var(--accent);
}

h2 {
  font-size: 22px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 30px;
  overflow: hidden;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

th {
  text-align: left;
  font-weight: 700;
  background: var(--card);
  z-index: 2;
  vertical-align: baseline;
  padding-bottom: 20px;
}

td {
  vertical-align: middle;
}

.right {
  text-align: right;
}

.btn {
  background: var(--accent);
  color: #001110;
  padding: 10px 14px;
  border-radius: 12px;
  border: 0;
  font-weight: 800;
  cursor: pointer;
  font-size: 16px;
}

button {
  font-size: 16px;
  font-family: inter;
}

.btn.secondary {
  background: #23252b;
  color: #e9eaee;
}

.sticky {
  position: sticky;
  top: 16px;
  align-self: start;
}

.sticky-sibling {
  position: sticky;
  top: calc(var(--stickyTop) + var(--totalsH) + var(--optsGap));
  align-self: start;
}

/*----------------------End general Styles -----------------*/

header {
  padding: 18px 29px;
}

header img {
  max-width: 327px;
  width: 90%;
}

header a {
  display: inline-block;
}

/* Compact options card */
.card.opts {
  font-size: 12px;
  line-height: 1.25;
}

.card.opts .label {
  font-size: 12px;
  margin-bottom: 2px;
}

.card.opts .toggle-line {
  gap: 6px;
}

.card.opts .side {
  font-size: 12px;
}

.card.opts .wrapedge-toggle {
  transform: scale(0.9);
  transform-origin: center;
}

.card.opts input[type="number"] {
  height: 26px;
  font-size: 12px;
  padding: 2px 6px;
}

.totals .label {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.totals .value {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.badge {
  font-size: 12px;
  background: #1d1f25;
  color: #b9c0c7;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #2a2d39;
}

.hidden {
  display: none;
}

.star {
  font-weight: 900;
  margin-right: 6px;
  color: #0bb4aa;
}

.staffel-meta {
  margin-top: 0;
  border-top: 1px dashed var(--border);
  padding-top: 0;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 14px;
}

.meta-key {
  color: var(--muted);
}

.meta-val {
  font-weight: 700;
}

.section {
  margin-bottom: 18px;
}

.chapter-logo-inline {
  display: flex;
  align-items: center;
  margin-right: 12px;
  transform: translateX(-210px);  /* Logo nach links raus */
  position: absolute;             /* neu: nimmt keinen Platz mehr ein */
}

.chapter-logo-inline img {
  max-height: 170px;
  width: auto;
  object-fit: contain;
}

.label-sub{
  text-align: center;
  font-size: 12px;
  margin-top: 2px;
  color: var(--accent);   /* gleiche Farbe wie Button */
  font-weight: 500;
  opacity: 0.9;
}

.section-head {
  display: flex;
  justify-content: flex-start;   /* Titel nach links */
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.section .muted {
  margin-bottom: 8px;
}

/* Gutschein-Card */
.card.coupon {
  font-size: 12px;
  line-height: 1.25;
}

.coupon-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.coupon-input {
  flex: 1;
  min-width: 0;
}

#couponCard .note-small { 
  margin-top: 10px;
}

.col-price.has-coupon {
  position: relative;
}

.col-price.has-coupon::before {
  content: attr(data-old-price);
  text-decoration: line-through;
  color: var(--accent);      /* kommt aus dem Kapitel (tr.style.setProperty("--accent", color)) */
  opacity: 0.75;
  font-size: 17px;
  margin-right: 6px;
}


/* --- START: Modifizierte Name-Wrapper Stile (Mit Transition) --- */
.name-wrap {
  /* display: grid; */
  /* Zurück zu Flex */
  display: flex;
  flex-direction: column;
  /* Wichtig: Untereinander anordnen */
  align-items: flex-start;
  gap: 4px;
  /* Abstand zwischen Name und Variante */
}

.base-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  /* Abstand zwischen Stern und Basisname */
}

.name-text {
  font-weight: 600;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

/* NEUE ANIMATIONSREGELN:
  Wir zielen direkt auf die Varianten-Container 
  (entweder das Menü oder den statischen Text) 
*/
.variant-menu,
.variant-text-static {
  max-height: 0;
  /* Standard: versteckt */
  opacity: 0;
  overflow: hidden;
  visibility: hidden;
  /* Verhindert Interaktion im versteckten Zustand */
  transition: max-height 0.3s ease-out, opacity 0.2s 0.1s, visibility 0s 0.3s;
  will-change: max-height, opacity;
}

/* NEU: Sichtbarer Zustand, ausgelöst durch JS-Klasse */
.variant-menu.is-visible,
.variant-text-static.is-visible {
  max-height: 100px;
  /* Ein Wert, der garantiert höher als der Inhalt ist */
  opacity: 1;
  visibility: visible;
  transition: max-height 1.2s ease-out, opacity 0.5s ease-out, visibility 0s 0s;
}

/* Unveränderte Stile für den Button etc. */
.variant-select-btn {
  background: #121319;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--text);
  font-size: 16px;
  font-weight: 300;
  text-align: left;
  min-width: 180px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.variant-select-btn:hover {
  border-color: var(--accent);
}

.variant-select-btn span {
  color: var(--muted);
  margin-left: 8px;
}

.variant-text-static {
  font-size: 14px;
  color: var(--muted);
  padding-left: 20px;
}

.seq-variants {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  visibility: hidden;
  transition: max-height 0.3s ease-out, opacity 0.2s 0.1s, visibility 0s 0.3s;
  will-change: max-height, opacity;
}

.seq-variants.is-visible {
  max-height: 400px;
  opacity: 1;
  visibility: visible;
  transition: max-height 1s ease-out, opacity 0.5s ease-out, visibility 0s 0s;
}

/* Abstände zwischen den Dropdown-Buttons */
.seq-variant-wrapper {
  margin-top: 6px;
}

.seq-variant-wrapper:first-child {
  margin-top: 0;
}

.name-arrow {
  background: #121319;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--text);
}

.name-arrow:hover {
  border-color: var(--accent);
}

.menu {
  position: relative;
}

.menu-list {
  position: absolute;
  z-index: 9999;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 260px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  padding: 6px;
  display: none;
  max-height: 70vh;
  overflow: auto;
}

.menu {
  position: relative;
}

.menu.open {
  z-index: 999;
}

.menu.open .menu-list {
  display: block;
}

.menu-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.04);
  /* neutrales Highlight */
  outline: 1px solid var(--accent);
  /* Rand in Kapitel-Farbe */
  color: var(--accent);
  /* Text in Kapitel-Farbe */
}

.menu-item.selected::after {
  content: "✓";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 900;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  width: 100%;
}

.step {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: #121319;
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step:hover {
  border-color: var(--accent);
}

.qty-input {
  width: 36px;
  height: 34px;
  border: 1px solid var(--border);
  background: #121319;
  color: var(--text);
  border-radius: 8px;
  text-align: center;
  font-weight: 700;
  caret-color: transparent;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-input {
  -moz-appearance: textfield;
}

.qty-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* --- START: Stile für Checkbox-Menge (als farbige Box) --- */
.qty-checkbox-wrapper {
  text-align: center;
}

.qty-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  /* Angepasste Größe */
  height: 22px;
  border-radius: 6px;
  /* Eckiger als ein Toggle */
  background: #23252b;
  /* Grau im deaktivierten Zustand */
  border: 1px solid var(--border);
  position: relative;
  display: inline-block;
  cursor: pointer;
  outline: none;
  transition: background 0.2s, border-color 0.2s;
  vertical-align: middle;
}

/* Entfernt den Schieber-Knopf */
.qty-checkbox::after {
  content: none;
}

.qty-checkbox:hover {
  border-color: var(--accent);
}

.qty-checkbox:checked {
  background: var(--accent);
  /* Türkis im aktivierten Zustand */
  border-color: var(--accent);
}

/* Fügt ein Häkchen hinzu, wenn aktiviert */
.qty-checkbox::before {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  font-weight: 900;
  color: #001110;
  /* Dunkle Farbe für das Häkchen */
  opacity: 0;
  /* Standardmäßig versteckt */
  transition: opacity 0.1s;
}

.qty-checkbox:checked::before {
  opacity: 1;
  /* Sichtbar, wenn aktiviert */
}

/* --- END: Stile für Checkbox-Menge --- */

/* Tooltip help icon */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 12px;
  line-height: 1;
  cursor: default;
  color: var(--muted);
  margin-left: 6px;
  position: relative;
  background: #151821;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.help-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 3px rgba(206, 124, 183, 0.12);
}

.help-icon::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 28px;
  white-space: normal;
  min-width: 240px;
  max-width: 360px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, #0f1117, #0a0c12);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  opacity: 0;
  pointer-events: none;
  transform-origin: top center;
  transition: opacity 0.12s, transform 0.12s;
  z-index: 1000;
  backdrop-filter: saturate(120%) blur(2px);
}

.help-icon:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1.02);
}

/* --- START: Geänderte Spaltenbreiten --- */
.col-qty {
  width: 60px;
  /* Schmaler für die Checkbox */
  text-align: center;
  padding: 12px 0px;
}

.col-name {
  width: auto;
  /* Nimmt den Rest des Platzes ein */
}

.col-wrap {
  width: 150px;
  text-align: center;
}

.col-price {
  width: 175px;
}

.levels-box {
  margin-top: 0;
  border-top: 1px dashed var(--border);
  padding-top: 0;
}

.levels-title {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 56px;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: -4px;
  line-height: 0.7;
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1;
}

.levels-list {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
  padding-top: 0;
}

.level-line {
  display: flex;
  justify-content: center;
  gap: 8px;
  text-align: center;
  margin: 0;
  padding: 0;
}

.level-name {
  color: var(--muted);
}

.level-line.reached {
  color: var(--accent);
}

.scrollbox {
  overflow: visible;
}

td.col-price {
  white-space: normal;
}

/* Wrapedge toggle */
.wrapedge-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.wrapedge-toggle input {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 26px;
  border-radius: 9999px;
  background: #23252b;
  border: 1px solid var(--border);
  position: relative;
  display: inline-block;
  cursor: pointer;
  outline: none;
  transition: background 0.2s, border-color 0.2s;
}

.wrapedge-toggle input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #aaa;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s, background 0.2s;
}

.wrapedge-toggle input:hover {
  border-color: var(--accent);
}

.wrapedge-toggle input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.wrapedge-toggle input:checked::after {
  background: #001110;
  transform: translateX(18px);
}

.wrapedge-note {
  display: none;
  font-size: 12px;
  color: var(--muted);
}

/* Options card */
.opts .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.opts .row .label {
  font-weight: 700;
}

.opts .sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.toggle-line .side {
  flex: 1;
}

.toggle-line .side.left {
  text-align: right;
  color: var(--muted);
}

.toggle-line .side.right {
  text-align: left;
  color: var(--muted);
}

.toggle-line .wrapedge-toggle {
  min-width: 56px;
  justify-content: center;
}

.km-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.km-input input[type="number"] {
  width: 96px;
  height: 36px;
  border: 1px solid var(--border);
  background: #121319;
  color: #fff;
  border-radius: 10px;
  padding: 0 10px;
  font-weight: 700;
  -moz-appearance: textfield;
}

.km-input input::-webkit-outer-spin-button,
.km-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.hr {
  border-top: 1px dashed var(--border);
  margin: 14px 0;
}

.warn {
  background: #201312;
  border: 1px solid #5a2a2a;
  color: #ffb4b4;
  padding: 8px 10px;
  border-radius: 10px;
  margin: 8px 0;
  font-size: 14px;
}

/* NEW: Subchapter styling */
.subchapter-row td {
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  background: transparent;
  border-bottom: 1px dashed var(--border);
  padding-top: 14px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
}

.modal .panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #2a2d39;
  background: #121319;
  color: var(--text);
}

.err {
  color: #ff6b6b;
  font-size: 13px;
  margin-top: 6px;
  min-height: 1em;
}

.contact-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.contact-modal.open {
  display: flex;
}

.contact-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.contact-panel {
  position: relative;
  margin-top: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.55);
  max-width: 560px;
  width: 100%;
  padding: 20px;
}

.contact-title {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 4px;
  color: var(--accent);
}

.contact-sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-grid .full {
  grid-column: 1/-1;
}

.form-input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #2a2d39;
  background: #121319;
  color: var(--text);
  font-weight: 600;
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.note-small {
  font-size: 12px;
  color: var(--muted);
}

.copy-pill {
  font-size: 12px;
  background: #1d1f25;
  color: #b9c0c7;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #2a2d39;
  cursor: pointer;
}

.close-x {
  position: absolute;
  right: 12px;
  top: 12px;
  border: 1px solid var(--border);
  background: #121319;
  color: var(--text);
  border-radius: 8px;
  font-weight: 800;
  padding: 4px 8px;
  cursor: pointer;
}

.close-x:hover {
  border-color: var(--accent);
}

textarea.form-input {
  min-height: 78px;
  max-height: 200px;
}

/* Sticky Send Button just under Auftragsoptionen */
#sendConfigBar {
  position: static;
  z-index: auto;
  padding: 0;
  margin-top: var(--optsGap);
}

/* Taller, full-width button */
#sendConfigBar .btn {
  display: block;
  width: 100%;
  padding: 16px 18px;
  font-size: 16px;
  line-height: 1.2;
  border-radius: 12px;
}

/* Added by ChatGPT: increase space between password label and input */
.auth-box label[for="authPassword"],
.auth-box .auth-label {
  margin-bottom: 10px;
  display: block;
}

.auth-box input[type="password"] {
  margin-top: 8px;
}

/* Responsive Layout */
@media (max-width: 1025px) {
  .grid {
    grid-template-columns: 1fr;
    row-gap: 50px;
  }

  .col-name,
  .col-wrap,
  .col-price,
  .col-qty {
    width: auto;
  }

  th,
  td {
    padding: 9px;
  }

  th {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    padding: 15px 0;
  }
}

/* Mobile: Logo über der Tabelle */
@media (max-width: 768px) {
  .section-head {
    flex-direction: column;
    align-items: center;
  }

  .chapter-logo-inline {
    margin: 6px 0;
  }
}

@media (max-width: 768px) {
  header {
    padding: 18px 29px 0 29px;
  }

  header img {
    text-align: center;
    display: block;
    margin: 0 auto;
  }

  .card {
    overflow: auto;
  }

  .menu-list {
    left: 6vw !important;
    width: 86vw !important;
  }

  .variant-select-btn {
    min-width: 50px;
  }

  .col-wrap,
  .col-price {
    text-align: center;
  }

  .help-icon {
    display: block;
    margin: 8px auto 0 auto;
  }
}