/* =========================================================================
   ACTROM Service GmbH – Frontend
   ========================================================================= */

:root {
    --olive:        #788303;
    --olive-dark:   #5f6802;
    --olive-light:  #a8b70a;
    --border-olive: #b9c400;
    --text:         #7e7e7e;
    --text-dark:    #54595f;
    --white:        #ffffff;
    --grey-bg:      #f4f4f4;
    --grey-line:    #e3e3e3;
    --container:    1140px;
    --font:         'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

/* Sehr lange Wörter (Fachbegriffe) brechen um, statt die Seite zu verbreitern */
body, h1, h2, h3, h4, h5, p, li, td, th { overflow-wrap: break-word; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 20.8px;
    font-weight: 300;
    line-height: 1.5;
    color: var(--text);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--olive); text-decoration: none; }
a:hover { color: var(--olive-dark); }

h1, h2, h3, h4, h5 {
    color: var(--olive);
    font-weight: 500;
    margin: 0 0 .5em;
    line-height: 1.2;
}
h1 { font-size: 36px; }
h2 { font-size: 32px; }
h3 { font-size: 28px; }
h4 { font-size: 24px; }
h5 { font-size: 20px; }

p { margin: 0 0 1em; }
strong, b { font-weight: 600; color: inherit; }
hr { border: 0; border-top: 1px solid var(--grey-line); margin: 2rem 0; max-width: 200px; margin-left: 0; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 15px;
}

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------- Buttons */
.btn {
    display: inline-block;
    background: var(--olive);
    color: var(--white);
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    padding: 12px 24px;
    border: 0;
    border-radius: 3px;
    cursor: pointer;
    transition: background .2s ease;
    font-family: inherit;
}
.btn:hover { background: var(--olive-dark); color: var(--white); }
.btn--small { font-size: 15px; padding: 10px 18px; }
.btn--ghost { background: transparent; color: var(--olive); border: 1px solid var(--olive); }
.btn--ghost:hover { background: var(--olive); color: var(--white); }

/* Knopf zum Fachvideo – in den Farben von YouTube */
.btn--youtube {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ff0000;
    color: var(--white);
}
.btn--youtube:hover,
.btn--youtube:focus-visible { background: #c00000; color: var(--white); }
.btn--youtube .btn__yt { flex: 0 0 auto; display: block; }
/* Weisses Zeichen mit rotem Dreieck – wie das Logo von YouTube */
.btn--youtube .btn__yt-play { fill: #ff0000; }
.btn--youtube:hover .btn__yt-play,
.btn--youtube:focus-visible .btn__yt-play { fill: #c00000; }

/* Knopfreihen in Kacheln und unter dem Beitrag */
.news-card__aktionen,
.beitrag-aktionen {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.beitrag-aktionen { margin-top: 40px; }

/* -------------------------------------------------------------- Header */
/* Sprachauswahl schwebt in der oberen rechten Ecke des Kopfbereichs */
.langswitch {
    position: absolute;
    top: 10px;
    right: 18px;
    z-index: 70;
}
.langswitch__button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-dark);
    border: 1px solid var(--grey-line);
    border-radius: 3px;
    padding: 4px 9px;
    background: var(--white);
    cursor: pointer;
    line-height: 1.3;
}
.langswitch__button:hover { border-color: var(--border-olive); }
.langswitch__arrow { font-size: 10px; opacity: .6; }
.langswitch__flag {
    width: 18px;
    height: 12px;
    display: block;
    border-radius: 1px;
    border: 1px solid rgba(0, 0, 0, .12);
    overflow: hidden;
    flex: 0 0 auto;
}
.langswitch__flag .flagge { display: block; width: 100%; height: 100%; }
.langswitch__list {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    z-index: 90;
    display: none;
    min-width: 180px;
    margin: 0;
    padding: 5px;
    list-style: none;
    background: var(--white);
    border: 1px solid var(--grey-line);
    border-radius: 3px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .13);
}
.langswitch.is-open .langswitch__list { display: block; }
.langswitch__list button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 10px;
    border: 0;
    border-radius: 2px;
    background: none;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-dark);
    text-align: left;
    cursor: pointer;
}
.langswitch__list button:hover { background: var(--grey-bg); }
.langswitch__list button.is-current { background: var(--olive); color: var(--white); }

/* Google-Übersetzer unsichtbar halten – die Bedienung läuft über die eigene Auswahl */
#google_translate_element { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }
body { top: 0 !important; }
.skiptranslate iframe { display: none !important; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--white);
    border-bottom: 3px solid var(--border-olive);
}
/* Logo und Menü stehen als Gruppe beieinander und sind gemeinsam zentriert */
.site-header__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 40px;
}
.site-logo { flex: 0 0 auto; display: block; }
.site-logo img { width: 195px; height: auto; display: block; }

/* Menü sitzt auf der Grundlinie des Schriftzugs */
.main-nav { flex: 0 0 auto; padding-bottom: 4px; }
.main-nav__list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
}
.main-nav__link {
    display: block;
    padding: 10px 14px;
    font-size: 18px;
    font-weight: 400;
    color: var(--olive);
    border-radius: 2px;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease;
}
.main-nav__link:hover { background: var(--olive-light); color: var(--white); }
.main-nav__link.is-active { background: var(--olive); color: var(--white); }

.nav-toggle {
    display: none;
    margin-left: auto;
    background: none;
    border: 0;
    padding: 8px;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 26px; height: 2px;
    background: var(--olive);
    margin: 5px 0;
    transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------------------------------------------------------- Hero */
.hero {
    position: relative;
    overflow: hidden; /* die einfliegende Schrift soll nichts überstehen lassen */
    background: #eaf3f8 center/cover no-repeat;
    min-height: 640px;
    display: flex;
    align-items: center;
}
.hero__inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 24px;
}
.hero__title {
    font-size: 84px;
    font-weight: 700;
    line-height: 1.19;
    color: var(--olive);
    margin: 0 0 28px;
    max-width: 740px;
    white-space: pre-line;
}
.hero__button { font-size: 16px; padding: 13px 22px; }

/* Titel und Schaltfläche fliegen von links ein */
.hero__inner > * {
    animation: einflugLinks 2s cubic-bezier(.19, .68, .35, 1) .5s both;
}
.hero__inner > *:nth-child(2) { animation-delay: .8s; }

@keyframes einflugLinks {
    from { opacity: 0; transform: translate3d(-100%, 0, 0); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .hero__inner > * { animation: none; opacity: 1; transform: none; }
}

.page-image { margin: 0; }
.page-image img { width: 100%; }

/* ---------------------------------------------------------- Seitenkopf */
.page-head { padding: 66px 0 0; }
.page-head__title {
    font-size: 48px;
    font-weight: 300;
    color: var(--olive);
    margin: 0;
    line-height: 1.12;
    letter-spacing: -.012em;
}
/* Kurzer Balken als Akzent unter dem Titel */
.page-head__title::after {
    content: "";
    display: block;
    width: 72px;
    height: 4px;
    margin-top: 22px;
    border-radius: 2px;
    background: linear-gradient(to right, var(--olive) 0%, var(--border-olive) 100%);
    transform-origin: left center;
    animation: titelLinie .7s cubic-bezier(.2, .7, .3, 1) both;
}
@keyframes titelLinie {
    from { transform: scaleX(0); opacity: 0; }
    to   { transform: scaleX(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .page-head__title::after { animation: none; }
}
.page-head + .section { padding-top: 34px; }

/* -------------------------------------------------------------- Inhalt */
.section { padding: 70px 0; }
.section--tight { padding: 40px 0; }

.content h2,
.content h3 { color: var(--olive); }
.content h3 { font-size: 28px; margin-bottom: .6em; }
.content h4 { font-size: 24px; }
.content ul,
.content ol { margin: 0 0 1em; padding-left: 1.4em; }
.content li { margin-bottom: .35em; }
.content a { text-decoration: underline; }
.content a.btn { text-decoration: none; }
.content img { margin: 1.5rem 0; max-width: 100%; height: auto; }
/* Ausrichtung aus den übernommenen Inhalten (WordPress-Klassen) */
.content .alignleft,
.content figure.alignleft { float: left; margin: .4rem 1.6rem 1rem 0; max-width: 50%; }
.content .alignright,
.content figure.alignright { float: right; margin: .4rem 0 1rem 1.6rem; max-width: 50%; }
.content .aligncenter,
.content figure.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.content figure { margin: 1.5rem 0; }
.content figure img { margin: 0; }
.content figcaption { font-size: 15px; color: var(--text); margin-top: .4rem; }
.content .wp-caption { max-width: 100%; }
.term__body::after,
.content::after { content: ""; display: block; clear: both; }

/* Spaltenblöcke aus dem Editor (1, 2 oder 3 Spalten) */
.content .spalten,
.term__body .spalten {
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px 34px;
    margin: 1.8rem 0;
}
.content .spalten--1, .term__body .spalten--1 { grid-template-columns: 1fr; }
.content .spalten--2, .term__body .spalten--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.content .spalten--3, .term__body .spalten--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.content .spalte, .term__body .spalte { min-width: 0; }
.content .spalte > *:first-child, .term__body .spalte > *:first-child { margin-top: 0; }
.content .spalte > *:last-child, .term__body .spalte > *:last-child { margin-bottom: 0; }
.content .spalte img { margin-top: 0; }
@media (max-width: 900px) {
    .content .spalten--3, .term__body .spalten--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .content .spalten--2, .term__body .spalten--2,
    .content .spalten--3, .term__body .spalten--3 { grid-template-columns: 1fr; }
    .content .spalten, .term__body .spalten { gap: 0; }
}

/* Bildgrössen aus dem Editor */
.content img.bild--gross  { display: block; width: 100%; }
.content img.bild--mittel { display: block; width: 100%; max-width: 520px; }
.content img.bild--klein  { display: block; width: 100%; max-width: 280px; }
.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 16px;
}
.content th,
.content td { border: 1px solid var(--grey-line); padding: 8px 12px; text-align: left; }
.content th { background: var(--grey-bg); color: var(--text-dark); }
.content blockquote {
    border-left: 3px solid var(--border-olive);
    margin: 1.5rem 0;
    padding: .3rem 0 .3rem 1.2rem;
    font-style: italic;
}

/* ------------------------------------------------------------- Teaser */
.teasers {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}
.teaser {
    border: 1px solid var(--border-olive);
    padding: 28px 20px 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--white);
    transition: box-shadow .25s ease, transform .25s ease;
}
.teaser:hover { box-shadow: 0 8px 26px rgba(0, 0, 0, .09); transform: translateY(-3px); }
.teaser__icon { height: 96px; margin-bottom: 22px; display: flex; align-items: center; justify-content: center; }
.teaser__icon img { height: 96px; width: auto; max-width: 100%; object-fit: contain; }
.teaser__title { font-size: 26px; font-weight: 400; color: var(--olive); margin: 0 0 14px; }
.teaser__text { font-size: 18px; margin: 0 0 24px; flex: 1 1 auto; }
.teaser .btn { margin-top: auto; }

/* --------------------------------------------------------- News-Raster */
/* Raster in Leserichtung: neueste Beiträge oben links.
   Ohne JavaScript ein normales Raster, mit JavaScript versetzt (Masonry). */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    align-items: start;
}
.news-grid.is-masonry {
    display: flex;
    align-items: flex-start;
    gap: 30px;
}
.news-grid__column {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 30px;
}
.news-card {
    border: 1px solid var(--border-olive);
    padding: 14px;
    margin: 0;
    background: var(--white);
    width: 100%;
    opacity: 1;
    /* Beim Überfahren reagiert die ganze Kachel, nicht das Bild darin */
    transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}
.news-card:hover,
.news-card:focus-within {
    transform: translateY(-5px);
    border-color: var(--olive);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .14);
}
@media (prefers-reduced-motion: reduce) {
    .news-card { transition: box-shadow .2s ease, border-color .2s ease; }
    .news-card:hover, .news-card:focus-within { transform: none; }
}
/* Einblenden beim Scrollen */
.news-grid.has-reveal .news-card {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .55s ease, transform .55s ease;
}
.news-grid.has-reveal .news-card.is-visible {
    opacity: 1;
    transform: none;
}
/* Nach dem Einblenden gilt wieder der kurze Übergang für das Überfahren */
.news-grid.has-reveal .news-card.is-visible {
    transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}
.news-grid.has-reveal .news-card.is-visible:hover,
.news-grid.has-reveal .news-card.is-visible:focus-within {
    transform: translateY(-5px);
}
@media (prefers-reduced-motion: reduce) {
    .news-grid.has-reveal .news-card {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
.news-card__image { display: block; margin: 0 0 20px; overflow: hidden; }
.news-card__image img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}
.news-card__date { font-size: 16px; color: var(--text); margin: 0 0 8px; }
.news-card__title {
    font-size: 24px;
    font-weight: 500;
    line-height: 1.25;
    color: var(--olive);
    margin: 0 0 12px;
}
.news-card__title a { color: inherit; }
.news-card__text { font-size: 18px; margin: 0 0 18px; }
.news-card__aktionen { margin-top: auto; }

.news-single__meta { font-size: 16px; color: var(--text); margin-bottom: 8px; }
.news-single__title { font-size: 36px; margin-bottom: 24px; }
.news-single__image { margin: 0 0 28px; }
.news-back { margin-top: 40px; }

/* ------------------------------------------------------- Labor-Analytik */
.labor-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}
.accordion__item { margin-bottom: 8px; }
.accordion__head {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: var(--olive);
    color: var(--white);
    border: 0;
    padding: 15px 18px;
    font-family: inherit;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: background .2s ease;
}
.accordion__head:hover { background: var(--olive-dark); }
.accordion__icon {
    font-size: 20px;
    line-height: 1;
    flex: 0 0 auto;
    transition: transform .3s ease;
}
.accordion__item.is-open .accordion__icon { transform: rotate(180deg); }

/* Die Hülle steuert nur die Höhe, Rahmen und Abstand sitzen innen –
   so bleibt beim Zuklappen nichts stehen. */
.accordion__panel {
    height: 0;
    overflow: hidden;
    transition: height .34s cubic-bezier(.4, 0, .2, 1);
}
.accordion__inhalt {
    border: 1px solid var(--border-olive);
    border-top: 0;
    padding: 18px;
    font-size: 17px;
}
.accordion__panel h5 { color: var(--olive); font-size: 18px; margin: 0 0 .4em; }
.accordion__panel p { margin-bottom: 1em; }
.accordion__panel p:last-child { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
    .accordion__panel { transition: none; }
    .accordion__icon { transition: none; }
}

.product {
    border: 1px solid var(--border-olive);
    padding: 22px;
    margin-bottom: 26px;
    display: grid;
    grid-template-columns: 375px 1fr;
    gap: 30px;
    align-items: start;
}
.product--no-image { grid-template-columns: 1fr; }
.product__image img { width: 100%; }
.product__title { font-size: 26px; margin: 0 0 .4em; }
.product__desc { font-size: 19px; margin: 0 0 18px; }
.product__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 18px;
}
.product__table th,
.product__table td { border: 1px solid var(--grey-line); padding: 7px 10px; }
.product__table th {
    text-align: left;
    font-weight: 700;
    color: var(--text-dark);
    background: var(--white);
    width: 33%;
    vertical-align: top;
}
.product__table td:nth-child(2) { color: var(--text); background: #fafafa; }
.product__table td:last-child { text-align: right; font-weight: 700; color: var(--text-dark); }

/* ---------------------------------------------------------- Bestellung */
.order-section { background: var(--olive); padding: 60px 0; }
.order-box {
    background: var(--white);
    border: 1px solid var(--border-olive);
    padding: 34px;
}
.order-box__title { font-size: 26px; margin-bottom: 24px; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 26px;
}
.form-field { display: flex; flex-direction: column; }
.form-field--full { grid-column: 1 / -1; }
.form-field label {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 6px;
}
.form-field .req { color: #d33; }
.form-field input,
.form-field select,
.form-field textarea {
    font-family: inherit;
    font-size: 16px;
    color: var(--text-dark);
    padding: 9px 12px;
    border: 1px solid #b8b8b8;
    border-radius: 3px;
    background: var(--white);
    width: 100%;
}
.form-field textarea { min-height: 110px; resize: vertical; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { outline: 2px solid var(--olive-light); outline-offset: 1px; }

.form-check {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 17px;
}
.form-check input { width: 17px; height: 17px; }

.cart { grid-column: 1 / -1; }
.cart__table { width: 100%; border-collapse: collapse; font-size: 16px; }
.cart__table th,
.cart__table td { border-bottom: 1px solid var(--grey-line); padding: 9px 8px; text-align: left; vertical-align: middle; }
.cart__table th { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dark); }
.cart__table td:nth-child(4),
.cart__table th:nth-child(4) { text-align: right; }
.cart__table td:last-child,
.cart__table th:last-child { text-align: right; width: 40px; }
.cart__qty { width: 82px; }
.cart__variant { width: 150px; position: relative; }
.cart__variant-select { width: 100%; }
.cart__product { width: 100%; }
.cart__table select,
.cart__table input[type="number"] {
    font-family: inherit;
    font-size: 15px;
    color: var(--text-dark);
    padding: 7px 9px;
    border: 1px solid #b8b8b8;
    border-radius: 3px;
    background: var(--white);
}
.cart__line { white-space: nowrap; font-weight: 600; color: var(--text-dark); line-height: 1.3; }
.cart__tier {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--text);
    margin-top: 2px;
}

/* Erläuterung zum Umfang der gewählten Analyse */
.cart__cell { position: relative; display: flex; align-items: center; gap: 7px; }
.cart__cell .cart__product { flex: 1 1 auto; min-width: 0; }
.cart__info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    border: 1px solid var(--olive);
    border-radius: 50%;
    background: var(--white);
    color: var(--olive);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    vertical-align: middle;
    text-transform: none;
}
.cart__info:hover { background: var(--olive); color: var(--white); }
.cart__tip {
    display: none;
    position: absolute;
    z-index: 80;
    max-height: min(70vh, 460px);
    overflow-y: auto;
    top: calc(100% + 8px);
    left: 0;
    width: 330px;
    max-width: 78vw;
    padding: 14px 16px;
    background: var(--white);
    border: 1px solid var(--border-olive);
    border-radius: 3px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .16);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    text-transform: none;
    letter-spacing: normal;
    font-weight: 300;
}
.cart__tip strong { display: block; color: var(--olive); font-weight: 600; margin-bottom: 3px; }
.cart__tip strong + span { display: block; margin-bottom: 11px; }
.cart__tip span:last-child { margin-bottom: 0; }
.cart__tip-head {
    font-size: 15px;
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--grey-line);
}
.cart__tip-body { margin: 0 0 12px; }
.cart__tip-body:last-child { margin-bottom: 0; }
.cart__tip-body p { margin: 0 0 8px; }
.cart__tip-body p:last-child { margin-bottom: 0; }
.cart__tip-body h5 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: .05em;
    margin: 10px 0 2px;
}
.cart__tip-body h5:first-child { margin-top: 0; }

.has-tip .tip__body { display: block; margin-top: 6px; }
.has-tip .tip__body p { margin: 0 0 8px; }
.has-tip .tip__body p:last-child { margin-bottom: 0; }
.has-tip .tip__body h5 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: .05em;
    margin: 10px 0 2px;
}
.has-tip .tip__body h5:first-child { margin-top: 0; }
.cart__info:hover + .cart__tip,
.cart__info:focus + .cart__tip,
.cart__tip:hover,
.cart__tip.is-open { display: block; }
/* Von JavaScript gesetzt, wenn unterhalb kein Platz bleibt */
.cart__tip--oben { top: auto; bottom: calc(100% + 8px); }

/* Gleiche Erläuterung in den Preistabellen */
.has-tip { position: relative; display: inline-block; cursor: help; border-bottom: 1px dotted var(--border-olive); }
.has-tip .tip {
    display: none;
    position: absolute;
    z-index: 80;
    max-height: min(70vh, 460px);
    overflow-y: auto;
    bottom: calc(100% + 9px);
    left: 0;
    width: 320px;
    max-width: 72vw;
    padding: 13px 15px;
    background: var(--white);
    border: 1px solid var(--border-olive);
    border-radius: 3px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .16);
    font-size: 14px;
    font-weight: 300;
    line-height: 1.5;
    color: var(--text);
    text-align: left;
}
.has-tip .tip strong { display: block; color: var(--olive); margin-bottom: 3px; }
.has-tip:hover .tip,
.has-tip:focus .tip,
.has-tip:focus-within .tip { display: block; }
/* Von JavaScript gesetzt, wenn oberhalb bzw. rechts kein Platz bleibt */
.has-tip--unten .tip { bottom: auto; top: calc(100% + 9px); }
.has-tip--links .tip { left: auto; right: 0; }

/* Immer sichtbarer Warenkorb */
.cart-badge {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 120;
}
.cart-badge[hidden] { display: none; }
.cart-badge {
    transition: opacity .2s ease, transform .2s ease;
}
.cart-badge.is-versteckt {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
    .cart-badge { transition: none; }
}
.cart-badge__button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px 11px 14px;
    background: var(--olive);
    color: var(--white);
    border: 0;
    border-radius: 40px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, .24);
    cursor: pointer;
    font-family: inherit;
    transition: background .2s ease, transform .2s ease;
}
.cart-badge__button:hover { background: var(--olive-dark); transform: translateY(-2px); }
.cart-badge__icon { position: relative; display: flex; }
.cart-badge__count {
    position: absolute;
    top: -7px;
    right: -9px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--white);
    color: var(--olive);
    font-size: 12px;
    font-weight: 700;
    line-height: 19px;
    text-align: center;
}
.cart-badge__text { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.cart-badge__text strong { font-size: 15px; font-weight: 600; }
.cart-badge__text span { font-size: 13px; opacity: .85; }
.cart-badge__hint {
    display: block;
    margin-top: 8px;
    padding: 7px 13px;
    background: #2f3327;
    color: #eef1e6;
    border-radius: 3px;
    font-size: 13px;
    text-align: right;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity .2s ease, transform .2s ease;
}
.cart-badge__hint.is-visible { opacity: 1; transform: none; }
.cart-badge.is-pulsing .cart-badge__button { animation: korbPuls .5s ease; }
@keyframes korbPuls {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.09); }
    100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .cart-badge.is-pulsing .cart-badge__button { animation: none; }
}
.cart__remove {
    background: none; border: 0; color: #b33; cursor: pointer;
    font-size: 20px; line-height: 1; padding: 0 4px;
}
.cart__empty { font-size: 17px; color: var(--text); padding: 10px 0; }
.cart__total { font-weight: 700; color: var(--text-dark); font-size: 18px; }

.alert { padding: 13px 16px; margin-bottom: 18px; border-radius: 3px; font-size: 17px; }
.alert--success { background: #eef5d8; color: #4a6300; border: 1px solid #c3d95d; }
.alert--error   { background: #fdeaea; color: #a12b2b; border: 1px solid #f0b6b6; }

/* -------------------------------------------------------------- Kurse */
.course {
    border: 1px solid var(--border-olive);
    padding: 20px 22px 26px;
    margin-bottom: 22px;
}
.course__title {
    display: inline-block;
    max-width: 100%;
    background: var(--olive);
    color: var(--white);
    font-size: 21px;
    font-weight: 600;
    padding: 7px 14px;
    margin: 0 0 18px;
}
.course__subtitle { font-size: 21px; color: var(--olive); font-weight: 600; margin: 0 0 14px; }
.course__row {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--border-olive);
    padding-bottom: 10px;
    margin-bottom: 24px;
    font-size: 18px;
}
.course__seats strong { color: var(--text-dark); }
/* Kurzbeschrieb unterhalb des Hinweises – etwas kleiner als der Fliesstext,
   passend zur Hinweiszeile der Kachel */
.course__text {
    margin: 0 0 24px;
    font-size: 18px;
    line-height: 1.6;
}
.course__text h2,
.course__text h3 { font-size: 22px; margin-bottom: .5em; }
.course__text h4,
.course__text h5 { font-size: 20px; margin-bottom: .5em; }
.course__text > *:first-child { margin-top: 0; }
.course__text > *:last-child { margin-bottom: 0; }

/* ------------------------------------------- Analyse-Beispiele (PDFs) */
.downloads__titel { color: var(--olive); margin: 0 0 14px; }
.downloads__text {
    font-size: 18px;
    line-height: 1.6;
    max-width: 900px;
    margin: 0 0 22px;
}
.downloads__text > *:first-child { margin-top: 0; }
.downloads__text > *:last-child { margin-bottom: 0; }
.downloads {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.btn--download {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
}
.btn--download .btn__pdf { flex: 0 0 auto; display: block; }

/* ----------------------------------------------------------- Glossare */
.glossary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}
.glossary-card {
    background: var(--olive);
    padding: 18px 18px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease, box-shadow .25s ease;
}
.glossary-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0, 0, 0, .17); }
.glossary-card__title {
    font-size: 25px;
    font-weight: 600;
    color: var(--white);
    margin: 0 0 16px;
    line-height: 1.2;
}
.glossary-card__image {
    display: block;
    margin: 0 0 20px;
    overflow: hidden;
}
.glossary-card__image img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    transition: transform .45s ease;
}
.glossary-card:hover .glossary-card__image img { transform: scale(1.04); }
.glossary-card .btn { align-self: center; margin-top: auto; }

/* Heller Knopf auf farbigem Grund */
.btn--light { background: var(--white); color: var(--olive); }
.btn--light:hover { background: var(--grey-bg); color: var(--olive-dark); }

.alphabet {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 30px 0 44px;
}
.alphabet__item {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: var(--olive);
    color: var(--white);
    font-size: 15px;
    font-weight: 500;
    border: 0;
    border-radius: 3px;
    cursor: pointer;
    font-family: inherit;
    transition: background .2s ease;
}
.alphabet__item:hover { background: var(--olive-dark); color: var(--white); }
.alphabet__item.is-active { background: var(--olive-light); }
.alphabet__item.is-empty { background: var(--grey-bg); color: #c9c9c9; cursor: default; }

.term {
    border-bottom: 1px solid var(--grey-line);
    padding-bottom: 26px;
    margin-bottom: 30px;
}
.term__title { font-size: 24px; font-weight: 600; margin-bottom: .4em; }
.term__body { font-size: 18px; }
.term__body p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------ Kontakt */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}
.contact-block h3 { font-size: 28px; margin-bottom: .6em; }
.contact-block p { font-size: 19px; }
.contact-map {
    height: 350px;
    border: 1px solid var(--grey-line);
    background: var(--grey-bg);
}

/* ------------------------------------------------------------- Footer */
.site-footer {
    background: var(--olive);
    color: var(--white);
    padding: 46px 0 40px;
    font-size: 18px;
    font-weight: 300;
}
.site-footer a { color: var(--white); }
.site-footer a:hover { color: rgba(255, 255, 255, .78); }
.site-footer h3 { color: var(--white); font-size: 26px; font-weight: 600; margin-bottom: .55em; }
.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    align-items: start;
}
.footer-cert { text-align: center; white-space: pre-line; }
.footer-cert img { width: 112px; margin: 14px auto 0; }
.footer-links { text-align: right; }
.footer-links ul { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 3px; }

/* ------------------------------------------------------- Nach oben */
.nach-oben {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 110;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    /* Weiss mit olivem Pfeil – hebt sich sowohl vom hellen Inhalt als auch
       vom olivgrünen Fussbereich deutlich ab */
    background: var(--white);
    color: var(--olive);
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .25), 0 0 0 1px rgba(0, 0, 0, .06);

    /* Ruhezustand: leicht nach unten versetzt und unsichtbar */
    opacity: 0;
    transform: translateY(14px) scale(.9);
    pointer-events: none;
    transition: opacity .3s ease, transform .35s cubic-bezier(.22, .68, .35, 1),
                background .2s ease, bottom .35s ease;
}
.nach-oben[hidden] { display: flex; } /* Sichtbarkeit steuert die Klasse */
.nach-oben.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
.nach-oben:hover { background: var(--olive); color: var(--white); }
.nach-oben.is-visible:hover { transform: translateY(-3px); }
.nach-oben:focus-visible { outline: 3px solid var(--border-olive); outline-offset: 3px; }
.nach-oben:active { transform: translateY(0) scale(.94); }
.nach-oben svg { width: 24px; height: 24px; display: block; }

/* Weicht dem Warenkorb aus, sobald dieser eingeblendet ist */
.nach-oben.hat-korb { bottom: 92px; }

@media (max-width: 620px) {
    .nach-oben { right: 14px; bottom: 14px; width: 46px; height: 46px; }
    .nach-oben.hat-korb { bottom: 84px; }
}

@media (prefers-reduced-motion: reduce) {
    .nach-oben { transition: opacity .2s linear; transform: none; }
    .nach-oben.is-visible:hover { transform: none; }
}

/* ---------------------------------------------------------- Einwilligung */
.footer-links__knopf {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
}
.footer-links__knopf:hover { text-decoration: underline; }

.cookie {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 300;
    padding: 18px;
    display: flex;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .25s ease, transform .25s ease;
}
.cookie.is-visible { opacity: 1; transform: none; }
.cookie[hidden] { display: none; }

.cookie__box {
    width: 100%;
    max-width: 720px;
    background: #fff;
    border-top: 4px solid var(--border-olive);
    border-radius: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
    padding: 26px 28px 24px;
    font-size: 15px;
    line-height: 1.55;
}
.cookie__titel { font-size: 22px; margin: 0 0 10px; }
.cookie__text { margin: 0 0 16px; }
.cookie__nachfrage {
    margin: 0 0 14px;
    padding: 10px 14px;
    background: #f2f6df;
    border-left: 3px solid var(--border-olive);
    font-weight: 500;
}
.cookie__nachfrage[hidden] { display: none; }

.cookie__gruppen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}
.cookie__gruppe {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.45;
    cursor: pointer;
}
.cookie__gruppe input { margin-top: 3px; flex: 0 0 auto; }
.cookie__gruppe input:disabled { cursor: default; }
.cookie__gruppe strong { display: block; margin-bottom: 2px; }

.cookie__knoepfe { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie__knoepfe .btn { font-size: 14px; padding: 11px 20px; }

/* Platzhalter statt Karte, solange keine Zustimmung vorliegt */
.karte-hinweis {
    height: 100%;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    padding: 24px;
    background: #f4f4f2;
    border: 1px solid #e2e2e2;
}
.karte-hinweis p { margin: 0; max-width: 380px; font-size: 15px; }
.karte-hinweis__klein { font-size: 13px; }

@media (max-width: 620px) {
    .cookie { padding: 0; }
    .cookie__box { border-radius: 0; max-height: 88vh; overflow-y: auto; }
    .cookie__gruppen { grid-template-columns: 1fr; }
    .cookie__knoepfe .btn { flex: 1 1 100%; }
}

/* -------------------------------------------------------------- 404 */
.error-page { text-align: center; padding: 90px 0; }
.error-page h1 { font-size: 72px; margin-bottom: .2em; }

/* --------------------------------------------------------- Responsive */
@media (max-width: 1200px) {
    .teasers { grid-template-columns: repeat(3, 1fr); }
    .hero__title { font-size: 64px; }
    .product { grid-template-columns: 300px 1fr; gap: 22px; }
}

@media (max-width: 1024px) {
    .news-grid { grid-template-columns: repeat(2, 1fr); }
    .labor-top { grid-template-columns: 1fr; gap: 40px; }
    .glossary-cards { grid-template-columns: 1fr; }
    .site-header__inner { gap: 20px; }
    .main-nav__link { font-size: 16px; padding: 9px 10px; }
}

@media (max-width: 860px) {
    body { font-size: 18px; }
    .site-header__inner { justify-content: flex-start; align-items: center; padding-top: 34px; }
    .main-nav { padding-bottom: 0; }
    .langswitch { top: 6px; right: 12px; }
    .langswitch__button { padding: 3px 7px; font-size: 12px; }
    .hero__inner > * { animation-duration: 1.2s; }
    .hero { min-height: 420px; }
    .hero__title { font-size: 40px; }
    .nav-toggle { display: block; }
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: var(--white);
        border-bottom: 3px solid var(--border-olive);
        padding: 10px 20px 18px;
        box-shadow: 0 12px 24px rgba(0, 0, 0, .08);
    }
    .main-nav.is-open { display: block; }
    .main-nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
    .main-nav__link { padding: 12px 10px; }
    .teasers { grid-template-columns: repeat(2, 1fr); }
    .news-grid { grid-template-columns: 1fr; }
    .product { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; gap: 30px; }
    .cart__table { font-size: 14px; }
    .cart__table th,
    .cart__table td { padding: 7px 4px; }
    .cart__variant { width: 108px; }
    .cart__qty { width: 62px; }
    .cart-badge { right: 12px; bottom: 12px; }
    .cart-badge__text strong { font-size: 14px; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .footer-links { text-align: center; }
    .footer-cert { text-align: center; }
    .section { padding: 46px 0; }
    .page-head { padding-top: 40px; }
    .page-head__title { font-size: 32px; }
    .page-head__title::after { width: 56px; height: 3px; margin-top: 16px; }
    .page-head + .section { padding-top: 26px; }
    .course__row { flex-direction: column; gap: 6px; }
}

/* Hinweis zur Mehrwertsteuer neben einem Betrag */
.preis-mwst {
    display: inline-block;
    font-size: 13px;
    font-weight: 400;
    color: var(--text);
    opacity: .75;
    white-space: nowrap;
    margin-left: 4px;
}
.cart__total .preis-mwst { font-size: 14px; }

/* Breite Tabellen scrollen in ihrem eigenen Rahmen, statt die Seite zu verbreitern.
   Wichtig: overflow schneidet auch nach oben ab – deshalb ist der Rahmen nur auf
   schmalen Bildschirmen aktiv, sonst wuerden die Erklaerungsfenster (Tooltips)
   der Preistabellen abgeschnitten. */
.table-scroll { max-width: 100%; min-width: 0; overflow: visible; -webkit-overflow-scrolling: touch; }
.table-scroll > table { margin-bottom: 0; }
/* Rasterfelder duerfen schmaler werden als ihr Inhalt, sonst schiebt eine
   breite Tabelle die ganze Seite auf */
.product__body { min-width: 0; }

/* Erst wenn es eng wird, scrollt die Tabelle in ihrem Rahmen. Damit der
   Tooltip dann nicht abgeschnitten wird, steht er dort im Textfluss. */
@media (max-width: 900px) {
    .table-scroll { overflow-x: auto; }
    /* Auf schmalen Bildschirmen erscheint die Erlaeuterung als Blatt am
       unteren Rand: fest positioniert, damit der Scrollrahmen der Tabelle
       sie nicht abschneidet, und ueber die volle Breite gut lesbar. */
    .has-tip .tip {
        position: fixed;
        top: auto;
        bottom: 12px;
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        max-height: 62vh;
        overflow-y: auto;
        z-index: 200;
        box-shadow: 0 -10px 34px rgba(0, 0, 0, .28);
    }
}

/* ------------------------------- Bestellung auf schmalen Bildschirmen
   Die Warenkorbtabelle wird zu gestapelten Karten: fuenf Spalten passen auf
   einem Telefon nicht nebeneinander und haetten die ganze Seite verbreitert. */
@media (max-width: 700px) {
    .order-section { padding: 40px 0; }
    .order-box { padding: 22px 16px; }
    .order-box__title { font-size: 22px; }
    .form-grid { gap: 16px; }
    .form-check { align-items: flex-start; }
    .form-check label { line-height: 1.4; }

    .cart__table,
    .cart__table thead,
    .cart__table tbody,
    .cart__table tfoot,
    .cart__table tr,
    .cart__table th,
    .cart__table td { display: block; }

    .cart__table { font-size: 16px; }
    .cart__table thead { display: none; }

    .cart__table tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px 12px;
        align-items: end;
        border: 1px solid var(--border-olive);
        border-radius: 4px;
        background: var(--white);
        padding: 14px 14px 12px;
        margin-bottom: 12px;
        position: relative;
    }
    .cart__table tbody td {
        border: 0;
        padding: 0;
        width: auto !important;
        text-align: left !important;
    }
    /* Beschriftung, die sonst in der Kopfzeile stuende */
    .cart__table tbody td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: .05em;
        color: var(--text);
        opacity: .75;
        margin-bottom: 4px;
    }
    .cart__table tbody td.cart__cell {
        grid-column: 1 / -1;
        padding-right: 34px; /* Platz fuer das Entfernen-Kreuz */
    }
    .cart__table tbody td.cart__line {
        grid-column: 1 / -1;
        font-size: 18px;
        padding-top: 4px;
        border-top: 1px solid var(--grey-line);
    }
    .cart__table tbody td.cart__weg {
        position: absolute;
        top: 6px;
        right: 6px;
    }
    /* Grössere Trefferfläche für den Finger */
    .cart__table tbody td.cart__weg .cart__remove {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        font-size: 24px;
        padding: 0;
        border-radius: 50%;
    }
    .cart__table tbody td.cart__weg .cart__remove:active { background: #fdeaea; }
    .cart__table select,
    .cart__table input[type="number"] { width: 100%; font-size: 16px; }
    .cart__variant, .cart__qty { width: auto; }
    .cart__tier { display: block; margin: 4px 0 0; }

    .cart__table tfoot tr {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 12px;
        border-top: 2px solid var(--border-olive);
        padding-top: 10px;
    }
    .cart__table tfoot td { border: 0; padding: 0; text-align: left !important; }
    .cart__table tfoot td:empty { display: none; }
    .cart__total { font-size: 18px; }

    .cart__tip {
        left: 0;
        right: 0;
        width: auto;
        max-width: none;
    }

    /* Preistabellen der Analyse-Sets */
    .product { padding: 16px; }
    .product__table { font-size: 13px; min-width: 260px; }
    .product__table th,
    .product__table td { padding: 6px 7px; }
    .product__table th { width: 38%; }

    /* Schwebender Korb darf die Schaltflaechen nicht verdecken */
    .cart-badge { right: 10px; bottom: 10px; }
    .cart-badge__button { padding: 9px 14px 9px 11px; font-size: 14px; }
    .order-box { padding-bottom: 84px; }
}

/* Sehr schmale Geräte (ältere Telefone ab 320 px) */
@media (max-width: 359px) {
    .product__table { min-width: 0; font-size: 12px; }
    .product__table th,
    .product__table td { padding: 5px 6px; }
    .product__table th { width: 42%; }
    .course { padding: 16px 14px 20px; }
    .course__title { font-size: 18px; padding: 6px 10px; }
    .course__subtitle { font-size: 18px; }
}

@media (max-width: 560px) {
    .teasers { grid-template-columns: 1fr; }
    .site-logo img { width: 158px; }
    .hero__title { font-size: 32px; }
    .order-box { padding: 20px; }
}

@media print {
    .site-header, .langswitch, .site-footer, .cookie, .nav-toggle,
    .cart-badge { display: none !important; }
}

/* ------------------------------------------------- Anfrageformular (Seiten) */
.anfrage {
    border: 1px solid var(--border-olive);
    padding: 26px 28px 30px;
    background: var(--white);
}
.anfrage h2 { margin: 0 0 20px; }
.anfrage .form-field--klein { max-width: 180px; }
.anfrage__hinweis {
    font-size: 14px;
    color: var(--text);
    opacity: .8;
    margin: 12px 0 0;
    max-width: 62ch;
}

@media (max-width: 700px) {
    .anfrage { padding: 20px 16px 24px; }
    .anfrage .form-field--klein { max-width: none; }
}
