/*
 * Dazumahl Package Booking – alle Regeln sind unter .dzpb gekapselt und wirken nur auf der Paketseite.
 * Farben und Schrift orientieren sich an der Website (Divi: Überschriften #215732, Links/Buttons #295b30,
 * Überschriftschrift Esteban, Fließtext Shippori Mincho B1 laut Theme). Die Divi-Variablen werden bevorzugt.
 *
 * Die einzige Regel außerhalb von .dzpb steht ganz oben und ist an die Body-Klasse .dzpb-active gebunden, die das
 * Plugin nur auf der freigegebenen Paketansicht setzt (siehe DZPB_Integration::body_class).
 */

/* Divi gibt auf Seiten die Seitenüberschrift (h1.entry-title) aus. Auf der Paketansicht ersetzt sie die Paketüberschrift. */
body.dzpb-active article.page > h1.entry-title.main_title {
  display: none;
}

.dzpb {
  --dzpb-green: var(--gcid-heading-color, #215732);
  --dzpb-green-btn: var(--gcid-link-color, #295b30);
  --dzpb-panel: #eeefe6;
  --dzpb-line: #dcdfd2;
  --dzpb-text: var(--gcid-body-color, #0a0a0a);
  --dzpb-muted: #5b6157;
  --dzpb-radius: 0; /* CR 08.1: Bilder und Sektions-Container eckig (Buttons, Felder und Hinweise behalten ihre Rundung) */
  --dzpb-heading: 'Esteban', Georgia, 'Times New Roman', serif;
  --dzpb-control: 48px;
  /*
   * CR 09: Freiraum unter der fixierten Hauptnavigation. Der Divi-Header liegt als Theme-Builder-Bereich mit
   * position: fixed außerhalb des Seitenflusses (Höhe 76 px, ab 980 px abwärts hängen die Kacheln „Anruf/Buchen“
   * bis 111 px herunter), der Inhalt beginnt aber bei 58 px (Divi-Container). Zusätzlicher Abstand = Unterkante der
   * Navigation + gewünschter Freiraum (36 px bzw. 30 px unter den Kacheln) − 58 px.
   */
  --dzpb-nav-clear: 46px;

  box-sizing: border-box;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(8px + var(--dzpb-nav-clear)) 20px 56px;
  color: var(--dzpb-text);
  font-size: 17px;
  line-height: 1.6;
}
.dzpb *, .dzpb *::before, .dzpb *::after { box-sizing: border-box; }
.dzpb img { max-width: 100%; height: auto; }
.dzpb [hidden] { display: none !important; }

/* Überschriften */
.dzpb-eyebrow {
  margin: 0 0 4px;
  padding: 0;
  font-size: 13px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--dzpb-green);
}
.dzpb-title,
.dzpb-h2,
.dzpb-booking__title,
.dzpb-room__name {
  font-family: var(--dzpb-heading);
  font-weight: 400;
  color: var(--dzpb-green);
  line-height: 1.15;
  margin: 0;
  padding: 0;
}
.dzpb-title { font-size: clamp(2.2rem, 5vw, 3.4rem); padding-bottom: 20px; }
.dzpb-h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 14px; }

/*
 * Hauptbild: Das Bild aus VikBooking (big_<Datei>) wird in seinem eigenen Seitenverhältnis gezeigt,
 * ohne feste Zielhöhe. So wird nichts abgeschnitten und nichts verzerrt, egal ob Banner oder Foto.
 * Nur extrem hohe Hochformatbilder werden über max-height begrenzt (dann mit Zuschnitt aus der Mitte).
 */
.dzpb-hero__figure { margin: 0; }
.dzpb-hero__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
}

.dzpb-facts {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  align-items: center;
  margin: 24px 0 4px;
}
.dzpb-facts__price { padding: 4px 32px 4px 0; border-right: 1px solid var(--dzpb-line); }
.dzpb-facts__meta { padding-left: 32px; }
.dzpb-compare {
  display: block;
  margin: 0 0 5px;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--dzpb-muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.dzpb-price {
  display: block;
  font-family: var(--dzpb-heading);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  line-height: 1.05;
  color: var(--dzpb-green);
}
.dzpb-price .vbo_currency { margin-right: .15em; }
.dzpb-price__per { display: block; margin-top: 6px; font-size: 14px; color: var(--dzpb-muted); }
.dzpb-validity { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; padding: 0; font-size: 1.05rem; }
.dzpb-icon { flex: none; color: var(--dzpb-green); }
.dzpb-lead { margin: 0; padding: 0; font-size: 1.05rem; }

/* Beschreibung */
.dzpb-section { margin-top: 40px; }
.dzpb-prose > :first-child { margin-top: 0; }
.dzpb-prose > :last-child { margin-bottom: 0; padding-bottom: 0; }
.dzpb-prose p { margin: 0 0 1.1em; padding: 0; }
.dzpb-prose ul, .dzpb-prose ol { margin: 0 0 1.1em 1.3em; padding: 0; }
.dzpb-prose h2, .dzpb-prose h3, .dzpb-prose h4 { font-family: var(--dzpb-heading); font-weight: 400; color: var(--dzpb-green); }
.dzpb-description .dzpb-prose { max-width: 820px; }

/* Buchungsbox */
.dzpb-booking {
  margin-top: 36px;
  padding: 22px 28px 20px;
  background: var(--dzpb-green);
  color: #fff;
  border-radius: var(--dzpb-radius);
}
.dzpb-booking__title { color: #fff; font-size: clamp(1.4rem, 3vw, 1.8rem); margin-bottom: 14px; }
.dzpb-form {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 16px;
  align-items: flex-end;
}
.dzpb-field { flex: 1 1 170px; min-width: 0; margin: 0; }
.dzpb-field--small { flex: 0 1 130px; }
.dzpb-field--action { flex: 0 0 220px; }
.dzpb-field label { display: block; margin: 0 0 5px; padding: 0; font-size: 14px; line-height: 1.2; color: #fff; }
.dzpb-field input,
.dzpb-field select {
  display: block;
  width: 100%;
  height: var(--dzpb-control);
  min-height: 0;
  margin: 0;
  padding: 0 12px;
  font: inherit;
  font-size: 16px; /* verhindert Zoom auf iOS */
  line-height: normal;
  color: #1a1a1a;
  background-color: #fff;
  border: 2px solid transparent;
  border-radius: 8px;
  -webkit-appearance: none;
  appearance: none;
}
.dzpb-field select {
  background-image: linear-gradient(45deg, transparent 50%, #215732 50%), linear-gradient(135deg, #215732 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.dzpb-hint { margin: 10px 0 0; padding: 0; font-size: 13px; line-height: 1.4; opacity: .8; }
.dzpb-error {
  margin: 12px 0 0;
  padding: 10px 14px;
  background: #fff3f0;
  color: #8a1c0c;
  border-radius: 8px;
  font-size: 15px;
}
.dzpb-messages { margin: 0 0 20px; }

/* Buttons */
.dzpb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--dzpb-control);
  min-height: var(--dzpb-control);
  margin: 0;
  padding: 0 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
  border-radius: 8px;
  border: 2px solid var(--dzpb-green-btn);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.dzpb-btn--light { width: 100%; background: #fff; color: var(--dzpb-green); border-color: #fff; }
.dzpb-btn--light:hover { background: #eef2e8; }
.dzpb-btn--outline { background: #fff; color: var(--dzpb-green); }
.dzpb-btn--outline:hover { background: var(--dzpb-green-btn); color: #fff; }
.dzpb-btn[disabled] { opacity: .6; cursor: progress; }

/* Fokus sichtbar (Tastatur) */
.dzpb a:focus-visible, .dzpb button:focus-visible, .dzpb input:focus-visible, .dzpb select:focus-visible {
  outline: 3px solid #f2c94c;
  outline-offset: 2px;
}
.dzpb-h2:focus { outline: none; }

/* Unterkünfte: Bild | Text | Button */
.dzpb-rooms .dzpb-h2 { margin-bottom: 6px; }
.dzpb-status { margin: 0 0 6px; padding: 0; font-size: .95rem; }
.dzpb-status:empty { display: none; }
.dzpb-room-list { list-style: none; margin: 0; padding: 0; }
.dzpb-room {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 210px;
  gap: 24px;
  align-items: center;
  margin: 0;
  padding: 18px 0;
  border-bottom: 1px solid var(--dzpb-line);
}
.dzpb-room:last-child { border-bottom: 0; }
.dzpb-room--noimg { grid-template-columns: minmax(0, 1fr) 210px; }
.dzpb-room__media { margin: 0; }
.dzpb-room__media img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0;
  background: var(--dzpb-panel);
}
.dzpb-room__name { font-size: 1.45rem; margin-bottom: 6px; }
.dzpb-room__text { font-size: 14px; line-height: 1.55; color: #2a2e27; }
.dzpb-room__text p { margin: 0 0 .5em; padding: 0; font-size: inherit; line-height: inherit; }
.dzpb-room__text > :last-child { margin-bottom: 0; }
.dzpb-room__action { margin: 0; }
.dzpb-room__action .dzpb-btn { width: 100%; }

/* Rückmeldungen zur Verfügbarkeitsprüfung (keine Treffer, technischer Fehler, Hinweis ohne JavaScript) */
.dzpb-feedback {
  margin: 20px 0 0;
  padding: 16px 20px;
  border-radius: 10px;
  border: 1px solid var(--dzpb-line);
  background: var(--dzpb-panel);
  color: var(--dzpb-text);
  scroll-margin-top: 120px;
}
.dzpb-feedback p { margin: 0; padding: 0; }
.dzpb-feedback p + p { margin-top: 8px; }
.dzpb-feedback--error,
.dzpb-feedback--warn { background: #fff3f0; border-color: #efc7bf; color: #6b1a0d; }
.dzpb-link { color: var(--dzpb-green-btn); text-decoration: underline; text-underline-offset: 2px; }
.dzpb-link:hover { text-decoration-thickness: 2px; }
.dzpb-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.dzpb-rooms { scroll-margin-top: 120px; }

/* Ladezustand des Buttons */
.dzpb-btn.is-loading { cursor: progress; opacity: 1; }
.dzpb-btn.is-loading::before {
  content: '';
  flex: none;
  width: 14px;
  height: 14px;
  margin-right: 10px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: dzpb-spin .8s linear infinite;
}
@keyframes dzpb-spin { to { transform: rotate(360deg); } }

/* Konditionen und Vorteile */
.dzpb-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 44px;
  padding: 30px 36px;
  background: var(--dzpb-panel);
  border-radius: var(--dzpb-radius);
}
.dzpb-panel--single { grid-template-columns: minmax(0, 1fr); }
.dzpb-panel__col { min-width: 0; }
.dzpb-panel__col + .dzpb-panel__col { padding-left: 36px; border-left: 1px solid var(--dzpb-line); }
.dzpb-panel .dzpb-prose { font-size: 16px; line-height: 1.55; }

/* Vorteile: nur das grüne Häkchen. Divi setzt list-style direkt am li, daher beide zurücksetzen. */
.dzpb .dzpb-benefits ul,
.dzpb .dzpb-benefits li { list-style: none; }
.dzpb .dzpb-benefits ul { margin: 0; padding: 0; }
.dzpb .dzpb-benefits li {
  position: relative;
  margin: 0 0 .55em;
  padding: 0 0 0 30px;
}
.dzpb .dzpb-benefits li:last-child { margin-bottom: 0; }
.dzpb .dzpb-benefits li::marker { content: ''; }
.dzpb .dzpb-benefits li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: .38em;
  width: 7px;
  height: 13px;
  border: solid var(--dzpb-green);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* CR 09: Header mit Kacheln (Divi-Umschaltung bei 980 px) */
@media (max-width: 980px) {
  .dzpb { --dzpb-nav-clear: 75px; }
}

/* Tablet */
@media (max-width: 900px) {
  /* Divi nutzt hier 80 % Breite. Auf dieser Ansicht etwas mehr Platz für Text und Buttons. */
  body.dzpb-active #main-content > .container { width: 92%; }
  .dzpb-room,
  .dzpb-room--noimg { grid-template-columns: 180px minmax(0, 1fr); gap: 14px 20px; align-items: start; }
  .dzpb-room--noimg { grid-template-columns: minmax(0, 1fr); }
  .dzpb-room__action { grid-column: 2; max-width: 240px; }
  .dzpb-room--noimg .dzpb-room__action { grid-column: 1; }
  .dzpb-panel { grid-template-columns: 1fr; padding: 26px 24px; }
  .dzpb-panel__col + .dzpb-panel__col { padding: 22px 0 0; margin-top: 22px; border-left: 0; border-top: 1px solid var(--dzpb-line); }
}

/* Smartphone */
@media (max-width: 640px) {
  /* Divi lässt auf Mobilgeräten 10 % Rand je Seite. Nur auf dieser Ansicht nutzen wir die volle Breite. */
  body.dzpb-active #main-content > .container { width: 100%; }
  .dzpb { --dzpb-nav-clear: 79px; padding: calc(4px + var(--dzpb-nav-clear)) 16px 44px; font-size: 16px; }
  .dzpb-facts { grid-template-columns: 1fr; margin-top: 18px; }
  .dzpb-facts__price { padding: 0 0 14px; border-right: 0; border-bottom: 1px solid var(--dzpb-line); }
  .dzpb-facts__meta { padding: 14px 0 0; }
  .dzpb-booking { padding: 20px 16px 18px; }
  .dzpb-form { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 12px; }
  .dzpb-field,
  .dzpb-field--small,
  .dzpb-field--action { flex: 0 0 auto; width: 100%; }
  .dzpb-room,
  .dzpb-room--noimg { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 20px 0; }
  .dzpb-room__action,
  .dzpb-room--noimg .dzpb-room__action { grid-column: 1; max-width: none; }
  .dzpb-room__media img { aspect-ratio: 16 / 10; }
  .dzpb-panel { padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .dzpb * { transition: none !important; scroll-behavior: auto !important; }
  .dzpb-btn.is-loading::before { animation-duration: 2.4s; }
}
