/*

Theme Name: Pro &ndash; Child Theme
Theme URI: https://theme.co/pro/
Author: Themeco
Author URI: https://theme.co/
Description: Make all of your modifications to Pro in this child theme.
Version: 1.0.0
Template: pro

*/

/* =============================================================================
   Referenz-Navigation
   ============================================================================= */

.referenz-nav-prev,
.referenz-nav-next {
  position: relative;
  display: inline-block;
  text-decoration: none;
}

.referenz-nav-prev:hover,
.referenz-nav-next:hover {
  cursor: none;
  opacity: 0.8;
}

.referenz-hover-preview {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: none;
}

.referenz-hover-preview.show {
  opacity: 1;
}

.referenz-hover-preview img {
  display: block;
  width: 160px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
}

.referenz-nav-prev span,
.referenz-nav-next span {
  font-size: 3.92857rem;
}

@media (max-width: 600px) {
  .referenz-nav-prev span,
  .referenz-nav-next span {
    font-size: 2rem;
  }
}

/* =============================================================================
   Multi-Step Kontaktformular
   ============================================================================= */

/* --- Formular-Reset: CF7 generiert <p>-Tags die das Layout stören --- */
.wpcf7-form .fieldset-cf7mls > p {
  margin: 0;
  padding: 0;
}

/* --- Abstand zwischen unterschiedlichen Eingabefeldern --- */
.wpcf7-form .fieldset-cf7mls > p + p {
  margin-top: 40px;
}

/* --- Radio-Buttons als 2x2 Grid --- */
.haerz-select-01 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 20px;
}

.haerz-select-01 .wpcf7-list-item {
  margin: 0;
  position: relative;
  background: #fff;
  border-radius: 5px;
  border: 1px solid transparent;
}

/* Radio-Button unsichtbar über gesamte Fläche strecken */
.haerz-select-01 input[type="radio"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

/* Label-Text klickbar machen (Step 1 hat keine <label>-Wrapper) */
.haerz-select-01 .wpcf7-list-item-label {
  display: block;
  padding: 18px 20px;
  text-align: center;
  cursor: pointer;
  font-size: 15px;
  transition: opacity 0.2s ease;
}

/* Hover */
.haerz-select-01 .wpcf7-list-item:hover .wpcf7-list-item-label {
  opacity: 0.5;
}

/* Ausgewählter Zustand */
.haerz-select-01 input[type="radio"]:checked + .wpcf7-list-item-label {
  opacity: 0.5;
}

/* --- Textfelder --- */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
  width: 100%;
  border: 1px solid transparent;
  padding: 18px 20px;
  font-size: 15px;
  background: #fff;
  outline: none;
  border-radius: 5px;
  -webkit-appearance: none;
  transition: color 0.2s ease;
}

/* Autofill-Hintergrund überschreiben */
.wpcf7 input:-webkit-autofill,
.wpcf7 input:-webkit-autofill:hover,
.wpcf7 input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color: #333 !important;
  border: 1px solid #fff !important;
  outline: none !important;
}

.wpcf7 input::placeholder,
.wpcf7 textarea::placeholder {
  color: #333;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.wpcf7 input[type="text"]:hover::placeholder,
.wpcf7 input[type="email"]:hover::placeholder,
.wpcf7 input[type="tel"]:hover::placeholder,
.wpcf7 textarea:hover::placeholder,
.wpcf7 input[type="text"]:focus::placeholder,
.wpcf7 input[type="email"]:focus::placeholder,
.wpcf7 input[type="tel"]:focus::placeholder,
.wpcf7 textarea:focus::placeholder {
  opacity: 0.5;
}

/* Step 2 Eingabefelder */
.hz-contact-name,
.hz-contact-email,
.hz-contact-phone,
.hz-contact-company {
  margin-bottom: 20px;
}

/* --- Multi-Step Navigation (Pfeile) --- */
.cf7mls-btns {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding: 0;
}

.cf7mls-btns .cf7mls_next.action-button,
.cf7mls-btns .cf7mls_back.action-button {
  margin: 0;
  padding: 0;
}

.cf7mls-btns.cf7mls-btns-last-step .cf7mls_back.action-button {
  margin-top: 50px;
}

.wpcf7 .wpcf7-spinner {
  display: none;
}

/* Wenn nur Next-Button da ist (Step 1): nach rechts schieben */
.cf7mls-btns:not(:has(.cf7mls_back)) {
  justify-content: flex-end;
}

.cf7mls_back,
.cf7mls_next {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0;
  padding: 10px;
  line-height: 1;
  color: #000;
}

/* Loader-Bild im Button verstecken (auch beim .sending State des Plugins) */
.cf7mls_next img,
.cf7mls_next.action-button.sending img {
  display: none !important;
}

/* Pfeil-Icons via CSS */
.cf7mls_back::before,
.cf7mls_next::before {
  font-size: 40px;
  line-height: 40px;
  font-weight: 700;
  color: #000;
  display: block;
  width: 100%;
  transition: opacity 0.2s ease;
}

.cf7mls_back::before {
  content: "\2190";
  text-align: left;
}

.cf7mls_next::before {
  content: "\2192";
  text-align: end;
}

.cf7mls_back:hover::before,
.cf7mls_next:hover::before {
  opacity: 0.6;
}

/* --- Submit Button (letzter Step) --- */
.hz-submit-wrap {
  width: calc(25% - 2.5px);
  margin-top: 35px;
  float: right;
  padding: 0;
  transition: padding 0.2s ease;
}

.hz-submit-wrap:hover {
  padding: 0 20px;
}

.hz-submit-wrap p {
  margin: 0;
}

form.cf7mls input.wpcf7-form-control.wpcf7-submit {
  background: #000;
  color: #fff;
  border: none;
  padding: 15px 0;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  width: 100%;
  border-radius: 5px;
  transition: color 0.2s ease;
}

form.cf7mls input.wpcf7-form-control.wpcf7-submit:hover {
  color: rgba(255, 255, 255, 0.5);
  opacity: 1 !important;
  background: #000;
}

/* --- Button/Pfeil Anpassung generell --- */
.cf7mls_next.action-button,
.cf7mls_back.action-button {
  background-color: transparent;
}

/* --- Validierung / Error-Handling --- */

/* Shake-Animation */
@keyframes haerz-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  15% {
    transform: translateX(-6px);
  }
  30% {
    transform: translateX(6px);
  }
  45% {
    transform: translateX(-4px);
  }
  60% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
  90% {
    transform: translateX(2px);
  }
}

/* Fehlertexte komplett ausblenden */
.wpcf7-not-valid-tip,
.wpcf7-response-output,
.wpcf7 .screen-reader-response {
  display: none !important;
}

/* Roter Rand bei invaliden Textfeldern (CF7 + Multi-Step) */
/* Radio-Inputs in .haerz-select-01 ausschließen - dort wird der Container rot */
.wpcf7 input.wpcf7-not-valid:not([type="radio"]),
.wpcf7 textarea.wpcf7-not-valid,
.wpcf7 input.cf7mls-invalid:not([type="radio"]),
.wpcf7 textarea.cf7mls-invalid {
  border-color: #e74c3c !important;
  animation: haerz-shake 0.5s ease;
}

.wpcf7 input.hz-contact-name.wpcf7-not-valid:not([type="radio"]),
.wpcf7 input.hz-contact-email.wpcf7-not-valid:not([type="radio"]) {
  margin-bottom: 20px;
}

/* Roter Rand um gesamte Radio-Gruppe wenn invalid */
.haerz-select-01:has(.cf7mls-invalid),
.haerz-select-01.wpcf7-not-valid,
.haerz-select-01.cf7mls-invalid {
  border: 1px solid #e74c3c !important;
  border-radius: 5px;
  padding: 5px;
  animation: haerz-shake 0.5s ease;
}

/* Einzelne Items in Radio-Gruppe sollen nicht rot werden */
.haerz-select-01 .wpcf7-list-item.cf7mls-invalid {
  border-color: transparent !important;
  animation: none !important;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .haerz-select-01 {
    grid-template-columns: 1fr;
  }

  .haerz-select-01 .wpcf7-list-item:nth-child(odd) {
    border-right: none;
  }
}

/* --- File-Upload Felder (Step 3) --- */

/* Container als 2-Spalten Grid */
.wpcf7-form .fieldset-cf7mls > p:has(.wpcf7-file) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

/* <br> zwischen den Spans entfernen */
.wpcf7-form .fieldset-cf7mls > p:has(.wpcf7-file) br {
  display: none;
}

/* Wrapper-Span als gestylten Button */
.wpcf7-form-control-wrap:has(.wpcf7-file) {
  position: relative;
  display: block;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 18px 20px;
  cursor: pointer;
}

/* "Bild auswählen" Text */
.wpcf7-form-control-wrap:has(.wpcf7-file)::before {
  content: "Bild auswählen";
  font-size: 15px;
  color: #333;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Pfeil rechts */
.wpcf7-form-control-wrap:has(.wpcf7-file)::after {
  content: "\25B8";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: #333;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Hover: Text und Pfeil auf 50% Opacity */
.wpcf7-form-control-wrap:has(.wpcf7-file):hover::before,
.wpcf7-form-control-wrap:has(.wpcf7-file):hover::after {
  opacity: 0.5;
}

/* Datei ausgewählt: Dateinamen anzeigen + 50% Opacity */
.wpcf7-form-control-wrap.has-file::before {
  content: attr(data-filename);
  opacity: 0.5;
}

.wpcf7-form-control-wrap.has-file::after {
  opacity: 0.5;
}

/* Nativen File-Input unsichtbar über die Fläche legen */
.wpcf7 input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  padding: 0;
}

/* Validierung für File-Inputs */
.wpcf7-form-control-wrap:has(.wpcf7-file.wpcf7-not-valid),
.wpcf7-form-control-wrap:has(.wpcf7-file.cf7mls-invalid) {
  border-color: #e74c3c !important;
  animation: haerz-shake 0.5s ease;
}

/* Responsive: untereinander auf Mobile */
@media (max-width: 600px) {
  .wpcf7-form .fieldset-cf7mls > p:has(.wpcf7-file) {
    grid-template-columns: 1fr;
  }

  .hz-submit-wrap {
    width: calc(50% - 2.5px);
  }
}

/* Zusatztext (Step 3) */
.hz-contact-infos {
  margin-top: -3px;
  padding: 0 20px;
  color: rgba(0, 0, 0, 0.5);
}

form {
  margin-bottom: 15px;
}
