/*
Theme Name: Divi Grauer Mobile
Theme URI: https://grauermobile.de
Description: Child Theme für die Webseite der Grauer Mobile e.K. Basiert auf dem Divi Theme von Elegant Themes. Hier landen alle individuellen Anpassungen (Custom CSS, eigene Templates, Snippets), damit das Parent-Theme Divi update-sicher bleibt.
Author: Len Baumgartner
Author URI: https://grauermobile.de
Template: Divi
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: divi-grauermobile
Tags: child-theme, divi
*/

/* ==========================================================================
   Custom Styles — Grauer Mobile
   --------------------------------------------------------------------------
   Hier kommen alle eigenen CSS-Anpassungen hin. Das Parent-Theme (Divi) wird
   in der functions.php automatisch geladen; diese Datei wird DANACH
   eingebunden, sodass eure Regeln die Divi-Defaults überschreiben können.

   Empfehlung zur Strukturierung:
     1. CSS-Variablen / Design-Tokens (Farben, Schriften, Spacing)
     2. Globale Overrides (Body, Typografie, Buttons)
     3. Komponenten (Header, Footer, Cards)
     4. Seiten-spezifisch (Home, Fahrzeuge, Kontakt …)
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Design-Tokens (Corporate Design Grauer Mobile)
   -------------------------------------------------------------------------- */
:root {
    /* Farben — exakt aus dem offiziellen Style-Guide (Grauer_Mobile_Farben.pdf) */
    --gm-color-bg:           #07050c;   /* Background — Matt Schwarz (ORACAL 970RA #070M) */
    --gm-color-surface:      #1a1a1a;   /* Karten/Sektionen — leicht aufgehellter Hintergrund */
    --gm-color-text:         #ffffff;
    --gm-color-muted:        #b3b3b3;
    --gm-color-accent:       #535835;   /* Primary — Matt Nato Olive (ORACAL 970RA #258M) */
    --gm-color-accent-dark:  #363f1f;   /* Primary Dark — Matt Nato Olive Dark */
    --gm-color-neutral:      #8f9a9e;   /* Neutral — Millennium Grey (ORACAL 970RA #793) */
    --gm-color-secondary:    #66beaf;   /* Secondary — Matt Mint (ORACAL 970RA #055), sparsam für CTAs */
    --gm-color-border:       #2a2a2a;

    /* Typografie */
    --gm-font-base:          1rem;
    --gm-line-height:        1.6;
}


/* --------------------------------------------------------------------------
   2. Globale Overrides
   -------------------------------------------------------------------------- */
/* — leer — hier landen später globale Anpassungen (Buttons, Links, Typo …) — */


/* --------------------------------------------------------------------------
   3. Komponenten
   -------------------------------------------------------------------------- */
/* — leer — Anpassungen je nach Bedarf einfügen — */


/* --------------------------------------------------------------------------
   4. Seiten-spezifisch
   -------------------------------------------------------------------------- */
/* — leer — */


/* --------------------------------------------------------------------------
   5. Drittanbieter — Ansolution/Ackermann Fahrzeug-Widget
   --------------------------------------------------------------------------
   Das Widget steuert sein Styling über CSS-Custom-Properties (--webkfz-*).
   Die meisten Werte werden bereits korrekt per Widget-API von Ackermann gesetzt;
   die untenstehenden Overrides sind nur dort nötig, wo Divi-Globals das
   Widget-CSS überlagern (vor allem `a { color }` und `input { color }`).
   -------------------------------------------------------------------------- */

/* 5.1 — CSS-Variablen für das Widget verankern (defensiv, redundant zu API) */
#ansolution-vehicles {
    /* Buttons: Anfrage / Drucken */
    --webkfz-details-btn-bg:           var(--gm-color-accent);
    --webkfz-details-btn-text:         #ffffff;
    --webkfz-details-btn-border:       var(--gm-color-accent);
    --webkfz-details-btn-bg-hover:     #ffffff;
    --webkfz-details-btn-text-hover:   #111111;
    --webkfz-details-btn-border-hover: #111111;
    --webkfz-details-btn-svg:          #ffffff;
    --webkfz-details-btn-svg-hover:    #111111;

    /* Sekundär-Button (Zurück) */
    --webkfz-secondary-btn-bg:         var(--gm-color-accent);
    --webkfz-secondary-btn-text:       #ffffff;
    --webkfz-secondary-btn-bg-hover:   #ffffff;
    --webkfz-secondary-btn-text-hover: #111111;

    /* Text: Labels, Beschreibung, Listen */
    --webkfz-muted-text:               #ffffff;
    --webkfz-card-text:                #ffffff;
    --webkfz-details-headline-text:    #ffffff;

    /* Dropdowns */
    --webkfz-search-bg:                #363636;
    --webkfz-search-text:              #ffffff;
    --webkfz-select-list-text:         #ffffff;

    /* Formular-Inputs */
    --webkfz-input-bg:                 #444444;
    --webkfz-input-text:               #ffffff;
    --webkfz-input-border:             #363636;
}

/* 5.2 — Divi-Konflikte hart überschreiben
   Divi setzt globale Regeln auf `a`, `input`, `textarea`, die spezifischer
   sind als die Widget-Variablen. Hier mit erhöhter Spezifität + !important. */

/* Input-Felder im Anfrage-Formular */
#ansolution-vehicles input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
#ansolution-vehicles textarea,
#ansolution-vehicles .form-input {
    background-color: #444444 !important;
    color: #ffffff !important;
    border-color: #363636 !important;
}

/* Placeholder-Text in den Inputs */
#ansolution-vehicles input::placeholder,
#ansolution-vehicles textarea::placeholder {
    color: #b3b3b3 !important;
    opacity: 1;
}

/* "Zurück zu den Suchergebnissen" — Divi `a {color}` überlagert hier */
#ansolution-vehicles a.btn.btn-secondary,
#ansolution-vehicles .an-module a.btn-secondary {
    color: #ffffff !important;
    background-color: var(--gm-color-accent) !important;
}
#ansolution-vehicles a.btn.btn-secondary:hover,
#ansolution-vehicles .an-module a.btn-secondary:hover {
    color: #111111 !important;
    background-color: #ffffff !important;
}

/* Fallback: jegliche „muted"-Texte im Widget hart auf weiß */
#ansolution-vehicles .text-\[var\(--webkfz-muted-text\)\] {
    color: #ffffff !important;
}

/* Fallback: Beschreibung / Sonderausstattung */
#ansolution-vehicles p,
#ansolution-vehicles ul li {
    color: #ffffff;
}

/* 5.3 — Preis-Block: komplett schwarz statt blauem Gradient
   Layer 1 (Haupt-Container): Gradient-Variablen auf Schwarz setzen.
   Layer 2 (::after Diagonale): nutzt --ansolution-primary-color (#111111).
   Da das Ergebnis "komplett schwarz" sein soll, blenden wir das ::after aus. */
#ansolution-vehicles {
    --webkfz-price-gradient-from: #111111;   /* Matt Schwarz, Brand-BG */
    --webkfz-price-gradient-to:   #111111;   /* identisch → flat black, kein Verlauf */
}

/* Diagonale Form ausblenden (sonst dunkelgrauer Streifen auf Schwarz sichtbar) */
#ansolution-vehicles #webkfz-details .price::after {
    background-color: transparent !important;
}

/* Schrift im Preis-Block hart auf weiß (Divi `a {color}` Sicherheitsnetz) */
#ansolution-vehicles #webkfz-details .price,
#ansolution-vehicles #webkfz-details .price * {
    color: #ffffff !important;
}

/* 5.4 — Ausstattungs-Icons (Heroicons SVG) sichtbar machen.
   stroke="currentColor" erbt von .text-primary → war #111111 auf schwarzem BG.
   Scoped Override: nur die SVGs in den li.flex-Listenpunkten, damit
   --ansolution-primary-color global unangetastet bleibt. */
#ansolution-vehicles li.flex > span > svg {
    color: #ffffff !important;
}


/* --------------------------------------------------------------------------
   6. Fluent Forms — Fahrzeug-Ankauf-Formular
   --------------------------------------------------------------------------
   Passt Fluent Forms ans Grauer-Mobile-CD an: dunkelgraue Inputs, weiße
   Schrift, eckige Ränder, Olive-Akzente. Scope: `.fluentform` → wirkt für
   ALLE Fluent-Forms-Instanzen einheitlich (z.B. später ein Kontaktformular).
   -------------------------------------------------------------------------- */

/* 6.1 — Allgemeine Typo im Formular */
.fluentform {
    color: var(--gm-color-text);
}

/* Sektion-Überschriften deutlich größer (wie im alten Formular).
   Hohe Specificity via `body` damit Divi-Headings nicht überschreiben. */
body .fluentform h2,
body .fluentform h3,
body .fluentform h4,
body .fluentform .ff-el-section-break h2,
body .fluentform .ff-el-section-break h3,
body .fluentform .ff-el-section-break h4 {
    color: var(--gm-color-text) !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    margin: 36px 0 6px 0 !important;
}
body .fluentform h2 { font-size: 2.25rem !important; } /* 36px */
body .fluentform h3 { font-size: 2rem !important; }    /* 32px */
body .fluentform h4 { font-size: 1.5rem !important; }  /* 24px */

/* Unterüberschriften (Erklärtext direkt unter Header) etwas größer */
body .fluentform .ff-el-section-break p,
body .fluentform p {
    font-size: 1.125rem !important;  /* 18px statt 16px */
    line-height: 1.55 !important;
    margin: 0 0 24px 0 !important;
}

/* Erster Header oben — weniger Top-Margin */
.fluentform > .ff-t-cell:first-child h2,
.fluentform > .ff-t-cell:first-child h3,
.fluentform .ff-el-group:first-child h2,
.fluentform .ff-el-group:first-child h3 {
    margin-top: 0 !important;
}

.fluentform .ff-el-input--label label {
    color: var(--gm-color-text) !important;
    font-weight: 500;
    margin-bottom: 2px !important;   /* enger an Eingaben/Optionen ankoppeln */
}

/* Fluent Forms-Default padding-bottom auf den Label-Wrapper kappen —
   sonst klafft zwischen Frage-Label und Radio-/Checkbox-Liste eine
   unnötige Lücke (~10-15px), die im dunklen Layout besonders auffällt. */
body .fluentform .ff-el-input--label {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* Help-Text (Beispiel: FIN-Hinweis) */
.fluentform .ff-el-help-message,
.fluentform .text-muted {
    color: var(--gm-color-muted) !important;
    font-size: 0.875rem;
}

/* Pflichtfeld-Sternchen */
.fluentform .ff-el-is-required.asterisk-right label:after,
.fluentform .ff-el-is-required.asterisk-left label:before,
.fluentform .ff_required_asterisks {
    color: #d9534f !important;
}

/* 6.2 — Eingabefelder: Text, E-Mail, Number, Mask, Select, Textarea */
.fluentform input[type="text"],
.fluentform input[type="email"],
.fluentform input[type="number"],
.fluentform input[type="tel"],
.fluentform input[type="url"],
.fluentform input[type="password"],
.fluentform input[type="date"],
.fluentform select,
.fluentform textarea,
.fluentform .ff-el-form-control {
    background-color: #444444 !important;
    color: var(--gm-color-text) !important;
    border: 1px solid #444444 !important;
    border-radius: 0 !important;        /* eckig statt abgerundet */
    padding: 14px 16px !important;
    font-size: 1rem;
    line-height: 1.4;
    box-shadow: none !important;
}

/* Placeholder-Text */
.fluentform input::placeholder,
.fluentform textarea::placeholder {
    color: var(--gm-color-muted) !important;
    opacity: 1;
}

/* Focus-State: Olive-Border, kein blauer Default-Ring */
.fluentform input:focus,
.fluentform select:focus,
.fluentform textarea:focus,
.fluentform .ff-el-form-control:focus {
    border-color: var(--gm-color-accent) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(83, 88, 53, 0.35) !important;
}

/* Dropdown-Pfeil neu zeichnen (sonst weißer Pfeil auf grau unsichtbar) */
.fluentform select,
.fluentform select.ff-el-form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    padding-right: 40px !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* 6.3 — Radio Buttons + Checkboxen — komplett custom, weil Browser-Defaults
   auf dunklem Hintergrund schlecht aussehen (Bullets werden abgeschnitten,
   Größen variieren je nach OS/Browser). */
.fluentform .ff-el-form-check label,
.fluentform .ff_item_panel_body label {
    color: var(--gm-color-text) !important;
    display: inline-flex !important;
    align-items: center;
    cursor: pointer;
    line-height: 1.4;
}

.fluentform .ff-el-form-check {
    margin-Top: 10px;
    margin-bottom: 0px;
}

.fluentform input[type="radio"],
.fluentform input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    background-color: #444444 !important;
    border: 1px solid #555 !important;
    cursor: pointer;
    margin: 0 14px 0 0 !important;
    position: relative;
    flex-shrink: 0;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* Form-Check-Wrapper (Radios + Checkboxen): saubere Spalten-Geometrie
   via position:absolute auf den Input + padding-left auf den Container.
   Robust gegen Fluent-Forms-interne Layout-Varianten. */
body .fluentform .ff-el-form-check,
body .fluentform .ff-el-form-check-gdpr,
body .fluentform .ff_gdpr,
body .fluentform .ff_acceptance_field {
    position: relative !important;
    padding-left: 30px !important;   /* 20px Checkbox + 20px Lücke zum Text */
    margin-bottom: 10px !important;
    min-height: 24px;
}

body .fluentform .ff-el-form-check input[type="checkbox"],
body .fluentform .ff-el-form-check input[type="radio"],
body .fluentform .ff-el-form-check-gdpr input[type="checkbox"],
body .fluentform .ff_gdpr input[type="checkbox"],
body .fluentform .ff_acceptance_field input[type="checkbox"] {
    position: absolute !important;
    left: 0 !important;
    top: 3px !important;
    margin: 0 !important;
}

body .fluentform .ff-el-form-check label,
body .fluentform .ff-el-form-check-gdpr label,
body .fluentform .ff_gdpr label,
body .fluentform .ff_acceptance_field label {
    display: inline !important;
    align-items: initial !important;
    margin: 0 !important;
    line-height: 1.5;
}

.fluentform input[type="radio"] {
    border-radius: 50% !important;
}

.fluentform input[type="checkbox"] {
    border-radius: 0 !important;
}

/* Radio selected: vollflächig oliv — gleiche Farbe wie der Submit-Button drunter.
   (Kein eingelassener grauer Innenring mehr — sonst wirkt der Punkt blasser
   als der vollflächige "Anfrage Senden"-Button.) */
.fluentform input[type="radio"]:checked {
    background-color: var(--gm-color-accent) !important;
    border-color: var(--gm-color-accent) !important;
    box-shadow: none !important;
}

/* Checkbox selected: oliver Hintergrund mit weißem Häkchen */
.fluentform input[type="checkbox"]:checked {
    background-color: var(--gm-color-accent) !important;
    border-color: var(--gm-color-accent) !important;
}

.fluentform input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Focus-Ring für Tastatur-Bedienung */
.fluentform input[type="radio"]:focus-visible,
.fluentform input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--gm-color-accent);
    outline-offset: 2px;
}

/* DSGVO-Link innerhalb der Checkbox */
.fluentform .ff-el-form-check a {
    color: var(--gm-color-accent) !important;
    text-decoration: underline;
}
.fluentform .ff-el-form-check a:hover {
    color: var(--gm-color-text) !important;
}

/* ----- DSGVO / Terms-Consent-Checkbox -----------------------------------
   Sonderfall: Fluent Forms rendert die DSGVO-Box anders als die normalen
   Checkboxen/Radios. Struktur:
     .ff-el-form-check.ff-el-tc
       └─ label.ff_tc_label
            ├─ span.ff_tc_checkbox > input[type=checkbox].ff_gdpr_field
            └─ div.ff_t_c  (der Einwilligungstext)
   Das absolute-Positioning aus 6.3 greift hier nicht sauber, weil Fluent
   ein eigenes Flex-Layout auf das Label setzt. Wir überschreiben das hier
   explizit mit einem Flexbox-Setup und Gap — robust, unabhängig von
   Fluent-internen Änderungen. */
body .fluentform .ff-el-form-check.ff-el-tc {
    padding-left: 0 !important;   /* statt 40px — Gap macht jetzt das Flex */
}

body .fluentform .ff-el-tc .ff_tc_label {
    display: flex !important;
    align-items: flex-start !important;
    gap: 16px !important;
    line-height: 1.5;
    margin: 0 !important;
}

body .fluentform .ff-el-tc .ff_tc_checkbox {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center;
    margin-top: -7.5px;   /* visuelle Mitte der Checkbox an erste Textzeile —
                          bei font-size 18px + line-height 1.5 = 27px Zeilenhöhe
                          ergibt das sauber zentriert auf der ersten Zeile */
}

body .fluentform .ff-el-tc .ff_tc_checkbox input[type="checkbox"] {
    position: static !important;   /* überschreibt das absolute aus 6.3 */
    left: auto !important;
    top: auto !important;
    margin: 0 !important;
}

body .fluentform .ff-el-tc .ff_t_c {
    flex: 1 1 auto;
}

/* 6.4 — Buttons (global)
   --------------------------------------------------------------------------
   EIN konsistenter Stil für alle Buttons der Seite:
     • Fluent-Forms Submit ("Anfrage Senden")
     • Divi Section-Buttons ("Mehr erfahren", "Fahrzeug suchen",
       "Termin vereinbaren", "Anfrage", "Drucken" im Fahrzeug-Detail, …)
     • Ackermann-Widget-Buttons werden bereits in Abschnitt 5 via
       CSS-Variablen gleich konfiguriert (BG-Hover #fff, Text-Hover #111).

   Default: olivgrünes Pill, weiße Schrift
   Hover:   weißes Pill, dunkle Schrift, +5% Scale
   -------------------------------------------------------------------------- */

/* Default-State — gilt für ALLE Button-Typen.
   `body`-Präfix vor den Divi-Selektoren ist nötig, weil Divi seine eigenen
   Button-Regeln mit hoher Specificity ausliefert (z.B. `.et_pb_section
   .et_pb_button`). Mit `body` davor + !important gewinnen wir sicher. */
.fluentform .ff-btn-submit,
.fluentform button.ff-btn-submit,
.fluentform input[type="submit"],
body .et_pb_button,
body a.et_pb_button,
body .et_pb_button_module_wrapper a.et_pb_button {
    background-color: var(--gm-color-accent) !important;
    color: var(--gm-color-text) !important;
    border: 0 !important;
    border-radius: 30px !important;           /* Pill-Form */
    padding: 14px 36px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    line-height: 1 !important;                /* Button-Höhe konstant halten */
    cursor: pointer;
    text-transform: none !important;          /* Divi setzt manchmal uppercase */
    letter-spacing: normal !important;        /* Divi setzt manchmal Spacing */
    transition: background-color 0.2s ease,
                color 0.2s ease,
                transform 0.2s ease !important;
}

/* Hover-State — gilt für ALLE Button-Typen.
   Specificity-Eskalation ist hier nötig, weil Divi sein Custom-CSS
   oft über `body #page-container .et_pb_button` ausliefert — und
   eine ID schiebt die Specificity über alles, was mit reinen Klassen
   erreichbar ist. Wir matchen denselben ID-Pfad und packen zusätzlich
   `:hover *` rein, falls in manchen Divi-Modulen der Button-Text in
   einem <span> mit eigener color-Regel sitzt. */
.fluentform .ff-btn-submit:hover,
.fluentform button.ff-btn-submit:hover,
.fluentform input[type="submit"]:hover,
body #page-container .et_pb_button:hover,
body #page-container a.et_pb_button:hover,
body #page-container .et_pb_button:hover *,
body #page-container a.et_pb_button:hover *,
body .et_pb_module .et_pb_button.et_pb_button:hover,
body .et_pb_module .et_pb_button.et_pb_button:hover *,
body a.et_pb_button.et_pb_button:hover,
body a.et_pb_button.et_pb_button:hover * {
    background-color: #ffffff !important;     /* Weißer Hintergrund */
    color: #111111 !important;                /* Schwarze Schrift */
    border-color: #ffffff !important;
    padding: 14px 36px !important;            /* Padding KONSTANT halten —
                                                 Divi würde sonst beim Hover
                                                 padding-right vergrößern */
    transform: scale(1.05) !important;        /* 5% größer */
}

/* Divi-Pfeil (↘) komplett ausschalten — Submit-Button hat auch keinen,
   und wir wollen alle Buttons identisch.  Killt gleichzeitig den
   Layout-Shift, den der erscheinende Pfeil auf der Kontakt-Seite verursacht. */
body .et_pb_button::after,
body .et_pb_button::before,
body a.et_pb_button::after,
body a.et_pb_button::before {
    display: none !important;
    content: none !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 6.5 — Validierungs- und Erfolgsmeldungen */
.fluentform .ff-el-is-error input,
.fluentform .ff-el-is-error textarea,
.fluentform .ff-el-is-error select {
    border-color: #d9534f !important;
}

.fluentform .error,
.fluentform .text-danger,
.fluentform .ff-el-is-error .error {
    color: #d9534f !important;
    font-size: 0.875rem;
    margin-top: 4px;
}

.fluentform .ff-message-success {
    background-color: rgba(83, 88, 53, 0.15) !important;
    border: 1px solid var(--gm-color-accent) !important;
    color: var(--gm-color-text) !important;
    border-radius: 0 !important;
    padding: 16px !important;
}

/* 6.6 — Spacing der Feldgruppen */
.fluentform .ff-el-group {
    margin-bottom: 16px;
}
