/*
 * Vorbestell-Block (neu gestaltet, Oktober 2026)
 * Gehört zu template-parts/blocks/block_preorder.php.
 * Alles hängt an der Klasse .vb und berührt sonst nichts auf der Website.
 *
 * Farben laut Farbdefinition: Grün #b5d1ac, Blau #99a9d7, Rosa #ed6c84, Schwarz.
 * Schriften: die beiden Schriften der Website (Adobe Fonts), es wird nichts Zusätzliches geladen.
 */

.vb {
  --vb-green: #b5d1ac;
  --vb-tint: #edf4ea;
  --vb-line: #7d9871;
  --vb-ink: #141414;
  --vb-muted: #4a4a4a;
  --vb-red: #b3261e;
  --vb-red-dark: #8c1d18;
  --vb-sans: acumin-pro-condensed, "Roboto Condensed", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --vb-serif: new-spirit-condensed, "Cormorant Garamond", Georgia, serif;
  --vb-u: calc((100vw - var(--scrollbar-width, 0px)) / 8);

  margin: var(--vb-u) 0;
  padding: 0 calc(var(--vb-u) / 2);
  overflow-x: clip;
  color: var(--vb-ink);
  font-family: var(--vb-sans);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.01em;
  -webkit-text-size-adjust: 100%;
}

@media only screen and (min-width: 575.98px) {
  .vb {
    --vb-u: calc((100vw - var(--scrollbar-width, 0px)) / 24);
    padding: 0 24px;
    font-size: 18px;
  }
}

@media only screen and (min-width: 1440px) {
  .vb {
    --vb-u: 60px;
  }
}

.vb *,
.vb *::before,
.vb *::after {
  box-sizing: border-box;
}

.vb [hidden] {
  display: none !important;
}

.vb a {
  color: inherit;
}

.vb a:focus-visible,
.vb button:focus-visible,
.vb input:focus-visible,
.vb select:focus-visible,
.vb textarea:focus-visible,
.vb-day input:focus-visible + .vb-day-box,
.vb-done-title:focus-visible {
  outline: 3px solid var(--vb-ink);
  outline-offset: 2px;
}

/* Eine Spalte, so breit und an derselben Kante wie der Einleitungstext darüber (13 Rasterfelder). */
.vb-wrap {
  max-width: max(calc(var(--vb-u) * 13), 400px);
  margin: 0 auto;
  scroll-margin-top: 24px;
}

.vb-muted {
  color: var(--vb-muted);
}

/* ---------- Das Wichtigste auf einen Blick ---------- */

.vb-facts {
  margin: 0 0 56px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--vb-green);
}

.vb.is-done .vb-facts {
  display: none;
}

.vb-fact {
  flex: 1 1 100%;
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--vb-green);
}

.vb-fact dt {
  margin: 0;
  flex-shrink: 0;
  color: var(--vb-muted);
}

.vb-fact dd {
  margin: 0;
  min-width: 0;
  font-weight: 600;
  text-align: right;
}

@media only screen and (min-width: 760px) {
  .vb-facts {
    gap: 0 48px;
    border-bottom: 1px solid var(--vb-green);
  }

  .vb-fact {
    flex: 1 1 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2px;
    padding: 18px 0 20px;
    border-bottom: 0;
  }

  .vb-fact dt {
    font-size: 17px;
  }

  .vb-fact dd {
    font-size: 22px;
    text-align: left;
  }
}

/* ---------- Überschriften ---------- */

.vb .vb-title,
.vb .vb-done-title {
  position: static;
  top: auto;
  margin: 0;
  font-family: var(--vb-serif);
  font-weight: 300;
  letter-spacing: -0.03em;
}

.vb .vb-lead {
  margin: -24px 0 36px;
  font-size: 18px;
  color: var(--vb-muted);
}

.vb .vb-title {
  margin-bottom: 36px;
  font-size: clamp(40px, 11vw, 48px);
  line-height: 1;
}

.vb .vb-h3 {
  margin: 0;
  font-family: var(--vb-sans);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

/* ---------- Aufbau: links Eingabe, rechts Zusammenfassung ---------- */

.vb-cols {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.vb-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 52px;
}

.vb-block {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.vb-block:first-child {
  gap: 16px;
}

/* ---------- Artikel und Menge ---------- */

.vb-items {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--vb-green);
}

.vb-items.vb-invalid {
  border-top-color: var(--vb-red);
}

.vb-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  padding: 16px 12px;
  border-bottom: 1px solid var(--vb-green);
  transition: background-color 0.15s ease-out;
}

.vb-items.vb-invalid .vb-item {
  border-bottom-color: var(--vb-red);
}

.vb-item.is-on {
  background: var(--vb-tint);
}

.vb-item-name {
  flex: 999 1 260px;
  min-width: 0;
  font-size: clamp(21px, 5.6vw, 24px);
  line-height: 1.2;
  cursor: pointer;
}

.vb-item-name strong {
  font-weight: 700;
  white-space: nowrap;
}

.vb-group {
  padding: 16px 12px 0;
  font-size: clamp(21px, 5.6vw, 24px);
  line-height: 1.2;
}

.vb-group + .vb-item {
  padding-top: 8px;
}

.vb-item-short {
  gap: 10px 16px;
}

.vb-item-short .vb-item-name {
  flex: 1 1 auto;
}

.vb-item-short .vb-item-buy {
  flex: 0 1 auto;
  gap: 16px;
}

.vb-item-desc {
  display: block;
  padding-top: 2px;
  font-size: 17px;
  line-height: 1.3;
  color: var(--vb-muted);
}

.vb-item-note {
  font-size: 0.8em;
  color: var(--vb-muted);
  white-space: nowrap;
}

.vb-item-buy {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.vb-item-price {
  font-size: clamp(21px, 5.6vw, 24px);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.vb-stepper {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.vb-step {
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--vb-ink);
  background: #ffffff;
  border: 1.5px solid var(--vb-line);
  border-radius: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.vb-step:disabled {
  color: #8a938a;
  border-color: var(--vb-green);
  cursor: default;
}

.vb-step:not(:disabled):active {
  background: var(--vb-tint);
}

.vb .vb-qty {
  width: 42px;
  height: 48px;
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--vb-ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.vb .vb-qty::-webkit-outer-spin-button,
.vb .vb-qty::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.vb-subtotal {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 0 12px;
}

.vb-subtotal-sum {
  font-size: 24px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- Felder ---------- */

.vb-row {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vb-pair > .vb-row {
  flex: 1 1 220px;
}

.vb-pair {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px 16px;
}

.vb .wpcf7-form-control-wrap {
  display: block;
  position: static;
}

.vb-label {
  font-size: 18px;
  font-weight: 600;
}

.vb-optional {
  font-weight: 400;
  color: var(--vb-muted);
}

.vb-hint {
  font-size: 17px;
  color: var(--vb-muted);
}

.vb-hint-large {
  font-size: 18px;
}

.vb .vb-input {
  display: block;
  width: 100%;
  height: 56px;
  margin: 0;
  padding: 0 14px;
  font-family: inherit;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: inherit;
  color: var(--vb-ink);
  background-color: #ffffff;
  border: 1.5px solid var(--vb-line);
  border-radius: 0;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.vb .vb-select {
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23141414' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.vb .vb-textarea {
  height: 88px;
  min-height: 80px;
  padding: 12px 14px;
  resize: vertical;
}

.vb .vb-input.vb-invalid,
.vb .vb-input.wpcf7-not-valid {
  border-color: var(--vb-red);
}

.vb .wpcf7-not-valid-tip,
.vb .wpcf7-response-output,
.vb .wpcf7-spinner {
  display: none;
}

.vb .screen-reader-response {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Abholtag ---------- */

.vb-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
}

.vb-day {
  position: relative;
  min-width: 0;
  display: block;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.vb-day input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.vb-day-box {
  height: 72px;
  padding: 0 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--vb-ink);
  background: #ffffff;
  border: 1.5px solid var(--vb-line);
  transition: background-color 0.15s ease-out, color 0.15s ease-out;
}

.vb-days.vb-invalid .vb-day-box {
  border-color: var(--vb-red);
}

.vb-day input:checked + .vb-day-box {
  color: #ffffff;
  background: var(--vb-ink);
  border-color: var(--vb-ink);
}

.vb-day-wd {
  font-size: 17px;
  line-height: 1;
}

.vb-day-date {
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
}

/* ---------- Zusammenfassung ---------- */

.vb-summary {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 24px;
  background: var(--vb-tint);
}

.vb-sum-list,
.vb-sum-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vb-sum-meta,
.vb-total {
  padding-top: 16px;
  border-top: 1px solid var(--vb-green);
}

.vb-line,
.vb-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.vb-line > div {
  min-width: 0;
}

.vb-line-value {
  text-align: right;
}

.vb-line-value span {
  display: block;
}

.vb-line-sum {
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.vb-total-label {
  font-size: 24px;
  font-weight: 700;
}

.vb-total-sum {
  font-family: var(--vb-serif);
  font-size: 46px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.vb-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 17px;
  line-height: 1.35;
  color: #333333;
  cursor: pointer;
}

.vb-consent.vb-invalid {
  color: var(--vb-red-dark);
}

.vb-consent input {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  margin: 0;
  padding: 0;
  accent-color: var(--vb-ink);
  cursor: pointer;
}

.vb-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  font-size: 19px;
  line-height: 1.3;
  color: var(--vb-red-dark);
  background: #ffffff;
  border: 1.5px solid var(--vb-red);
}

.vb-alert-calm {
  color: var(--vb-ink);
  border-color: var(--vb-line);
}

.vb-alert svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.vb-alert strong {
  font-weight: 700;
}

.vb-alert-link {
  margin: 0;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.vb-alert-action {
  display: block;
  height: 44px;
  margin: 12px 0 0;
  padding: 0 18px;
  font: inherit;
  font-weight: 600;
  letter-spacing: inherit;
  color: var(--vb-ink);
  background: transparent;
  border: 1.5px solid var(--vb-ink);
  border-radius: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.vb .vb-submit {
  display: block;
  width: 100%;
  height: 64px;
  margin: 0;
  padding: 0 8px;
  font-family: inherit;
  font-size: clamp(17px, 5vw, 22px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #ffffff;
  background: var(--vb-ink);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

.vb .vb-submit:active {
  background: #333333;
}

.vb .vb-submit.is-busy {
  background: #555555;
  cursor: progress;
}

.vb-note {
  font-size: 17px;
  line-height: 1.35;
  text-align: center;
  color: var(--vb-muted);
}

/* ---------- Bestätigung ---------- */

/* Gleich breit wie das Formular und der Einleitungstext, damit beim Absenden nichts springt. */
.vb-done {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.vb-done-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.vb .vb-done-title {
  font-size: clamp(42px, 11vw, 54px);
  line-height: 0.98;
  outline-offset: 6px;
}

.vb-done-text {
  margin: 0;
  font-size: 21px;
  line-height: 1.4;
}

.vb-pickup {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 34px;
  text-align: center;
  color: #000000;
  background: var(--vb-green);
}

.vb-pickup-label {
  font-size: 17px;
}

.vb-pickup-wd {
  padding-top: 8px;
  font-size: 21px;
}

.vb-pickup-date {
  font-family: var(--vb-serif);
  font-size: clamp(46px, 14vw, 62px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.03em;
}

.vb-pickup-store {
  padding-top: 12px;
  font-size: 20px;
  line-height: 1.3;
}

.vb-order-label {
  padding-bottom: 8px;
  font-size: 17px;
  color: var(--vb-muted);
}

.vb-order-list {
  border-top: 2px solid #000000;
  border-bottom: 2px solid #000000;
}

.vb-order-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.vb-order-line + .vb-order-line {
  border-top: 1px solid var(--vb-green);
}

.vb-order-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
}

.vb-order-total-label {
  font-size: 22px;
  font-weight: 700;
}

.vb-order-total-sum {
  font-family: var(--vb-serif);
  font-size: 42px;
  font-weight: 300;
  line-height: 1;
  white-space: nowrap;
}

.vb-order-pay {
  padding-top: 4px;
  font-size: 17px;
  color: var(--vb-muted);
}

.vb-done-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-top: 32px;
  text-align: center;
  border-top: 1px solid var(--vb-green);
}

.vb-claim {
  font-family: var(--vb-serif);
  font-size: 30px;
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.vb-again {
  height: 52px;
  margin: 0;
  padding: 0 28px;
  font: inherit;
  font-weight: 600;
  letter-spacing: inherit;
  color: var(--vb-ink);
  background: transparent;
  border: 1.5px solid var(--vb-ink);
  border-radius: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* ---------- Vorbestellung geschlossen ---------- */

.vb-closed {
  margin: 0;
}

.vb-closed .vb-title {
  margin-bottom: 16px;
}

.vb-closed p {
  margin: 0;
  font-size: 21px;
  line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
  .vb-item,
  .vb-day-box {
    transition: none;
  }
}

/* ---------- Ab Tablet-Breite: Schriftgrößen passend zum Text der Seite ---------- */

@media only screen and (min-width: 575.98px) {
  .vb .vb-title {
    font-size: 44px;
  }

  .vb .vb-lead {
    font-size: 16px;
  }

  .vb .vb-h3 {
    font-size: 24px;
  }

  .vb-item-name,
  .vb-item-price,
  .vb-group {
    font-size: 21px;
  }

  .vb .vb-qty {
    font-size: 22px;
  }

  .vb-subtotal-sum {
    font-size: 21px;
  }

  .vb-label {
    font-size: 16px;
  }

  .vb-hint,
  .vb-hint-large,
  .vb-item-desc,
  .vb-note {
    font-size: 15px;
  }

  .vb .vb-input {
    height: 52px;
    font-size: 18px;
  }

  .vb .vb-textarea {
    height: 84px;
  }

  .vb-day-box {
    height: 64px;
  }

  .vb-day-wd {
    font-size: 15px;
  }

  .vb-day-date {
    font-size: 22px;
  }

  .vb-summary {
    padding: 28px 28px 24px;
  }

  .vb-total-label {
    font-size: 21px;
  }

  .vb-total-sum {
    font-size: 40px;
  }

  .vb .vb-submit {
    height: 60px;
    font-size: 20px;
  }

  .vb-alert {
    font-size: 17px;
  }

  .vb-fact dt {
    font-size: 15px;
  }

  .vb-fact dd {
    font-size: 20px;
  }

  .vb .vb-done-title {
    font-size: 44px;
  }

  .vb-done-text {
    font-size: 18px;
  }
}

/* ---------- Fette Zeilen in der Einleitung über dem Formular, nur am Handy ---------- */
/* Etwas kleiner und enger, damit eine Zeile wie „Aus feinem Butter-Brioche-Teig." nicht
   mit einem einzelnen Wort umbricht. Gilt nur für Einleitungen, auf die ein Vorbestell-Block folgt, und nur für Seiten,
   in denen diese Zeilen noch als h1 stehen. Neue Seiten verwenden die Klasse vb-intro-line. */

@media only screen and (max-width: 575.97px) {
  .section-intro:has(~ .vb) h1:not(.h2) {
    font-size: calc((100vw - var(--scrollbar-width, 0px)) / 8 * 0.55);
    line-height: 1.2;
    text-wrap: balance;
  }
}

/* ---------- Bildzeile unter dem Bild nach dem Formular ---------- */

.vb ~ .wp-block-image figcaption {
  margin: 14px 0 0;
  font-family: acumin-pro-condensed, "Roboto Condensed", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: 0.01em;
  text-align: center;
  color: #4a4a4a;
}
