/* -----------------------------------------------------------
   GLOBAL & VARIABLEN
----------------------------------------------------------- */

html {
    scroll-behavior: smooth; /* Das ist der Zauberbefehl */
}

:root {
    --primary-color: #2E8B57;      /* Apotheken-Grün */
    --secondary-color: #246e45;    /* Etwas dunkler für Hover-Effekte */
    --text-dark: #333333;          /* Dunkelgrau für Text (besser als reines Schwarz) */
    --text-light: #666666;         /* Hellgrau für Nebentexte */
    --bg-light: #f9fdfa;           /* Ganz leichtes Grün-Weiß als Hintergrund */
    --white: #ffffff;
    --spacing: 20px;               /* Standard-Abstand */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

h1, h2, h3 {
    font-family: 'Poppins', sans-serif; /* Überschriften erhalten eine modernere Schrift */
    color: var(--primary-color);
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
}

/* -----------------------------------------------------------
   HELFER-KLASSEN
----------------------------------------------------------- */
.container {
    width: 90%;          /* Mobile: Nutze 90% der Breite */
    max-width: 1200px;   /* Desktop: Werde nie breiter als 1200px */
    margin: 0 auto;      /* Zentriert den Container */
}

.btn {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 10px 25px;
    border-radius: 5px;
    font-weight: 600;
    margin-top: 10px;
    transition: background 0.3s;
}

.btn:hover {
    background: var(--secondary-color);
}

/* -----------------------------------------------------------
   HEADER
----------------------------------------------------------- */
.header {
    background: var(--white);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); /* Subtiler Schatten */
    position: sticky; /* Menü bleibt beim Scrollen oben haften */
    top: 0;
    z-index: 1000;
}

/* -----------------------------------------------------------
   HEADER & LOGO ANPASSUNGEN
----------------------------------------------------------- */
/* Damit der Link um das Logo herum keine Standard-Linkfarbe hat */
.logo-link {
    text-decoration: none;
    color: inherit; /* Erbt die Textfarbe des Eltern-Elements */
}

/* Der Container für Bild + Text */
.logo {
    display: flex;          /* Aktiviert Flexbox */
    align-items: center;    /* Zentriert Bild und Text vertikal */
    gap: 12px;              /* Abstand zwischen Bild und Text */
    font-size: 1.1rem;      /* Text etwas kleiner, damit es mit Bild nicht zu wuchtig wirkt */
    font-weight: 700;
    color: var(--text-dark);
}

/* Das eigentliche Logobild */
.logo-img {
    height: 45px;  /* Fixe Höhe. Die Breite passt sich automatisch an. */
    width: auto;   /* Damit das Bild nicht verzerrt wird */
    display: block; /* Verhindert kleine Abstände unter dem Bild */
}

.highlight {
    color: var(--primary-color);
}

.highlight {
    color: var(--primary-color);
}

.nav {
    margin-top: 10px;
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
}

.nav a:hover {
    color: var(--primary-color);
}

/* -----------------------------------------------------------
   HERO SECTION MIT BILD
----------------------------------------------------------- */
.hero {
    /* Hier binden wir das Bild ein. 'url' muss zum Pfad passen! */
    background: linear-gradient(rgba(46, 139, 87, 0.8), rgba(46, 139, 87, 0.6)), url('../img/hero-bg-apotheke-telfs-st-georgen.jpg');
    background-size: cover;       /* Bild deckt alles ab */
    background-position: center;  /* Bild wird zentriert */
    padding: 100px 0;             /* Mehr Platz oben/unten */
    text-align: center;
    color: var(--white);          /* Text auf dem Bild muss weiß sein */
}

.hero h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    color: var(--white);          /* Überschrift weiß */
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* -----------------------------------------------------------
   SECTIONS & CARDS
----------------------------------------------------------- */
.section {
    padding: 50px 0;
}

.card {
    background: var(--white);
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
    border-left: 4px solid var(--primary-color); /* Grüner Akzent links */
}

/* -----------------------------------------------------------
   FOOTER
----------------------------------------------------------- */
.footer {
    background: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 20px 0;
    font-size: 0.8rem;
}

/* -----------------------------------------------------------
   DESKTOP (Media Queries)
   Alles ab hier gilt erst ab 768px Breite (Tablet/PC)
----------------------------------------------------------- */
@media (min-width: 768px) {
    .header .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .nav {
        margin-top: 0;
    }

    .hero {
        padding: 100px 0;
    }

    .hero h1 {
        font-size: 3rem;
    }

    /* Grid Layout für die Karten nebeneinander */
    .grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* 3 Spalten */
        gap: 30px;
    }

    .card {
        margin-bottom: 0;
    }
}

/* -----------------------------------------------------------
   STYLES FÜR UNTERSEITEN
----------------------------------------------------------- */

/* Der schmale Header auf Unterseiten */
.page-header {
    background: var(--primary-color); /* Dein Apotheken-Grün */
    color: var(--white);
    padding: 60px 0; /* Weniger Höhe als auf der Startseite */
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    color: var(--white);
    margin: 0;
    font-size: 2.5rem;
}

/* Ein einfaches Raster für Team-Mitglieder */
.team-grid {
    display: grid;
    gap: 30px;
    /* Automatisch: So viele Spalten wie passen, mindestens 250px breit */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.team-member {
    background: white;
    border-radius: 8px;
    overflow: hidden; /* Damit das Bild an den Ecken auch rund wird */
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    text-align: center;
    padding-bottom: 20px;
}

.team-member img {
    width: 100%;
    height: 250px;
    object-fit: cover; /* Schneidet das Bild zu, verzerrt es nicht */
    background-color: #eee; /* Platzhalterfarbe, falls Bild fehlt */
}

.team-member h3 {
    margin-top: 15px;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.team-member p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* -----------------------------------------------------------
   KONTAKT (INFO KARTEN)
----------------------------------------------------------- */

.contact-grid-simple {
    display: grid;
    /* Erzeugt automatisch Spalten, die mindestens 300px breit sind */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 30px;
    margin-top: 20px;
}

.contact-card {
    background: var(--white);
    padding: 40px; /* Viel Innenabstand für "Luft" */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* Leichter Schatten */
    border-top: 4px solid var(--primary-color); /* Grüner Balken oben */
    text-align: center; /* Text zentriert */
}

.contact-card h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.contact-card p {
    font-size: 1.1rem;
    color: var(--text-dark);
    line-height: 1.8;
}

/* Icons oder Labels fett machen */
.contact-label {
    font-weight: 700;
    color: var(--primary-color);
    display: block; /* Neue Zeile */
    margin-top: 15px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* -----------------------------------------------------------
   ANIMATIONEN & ÜBERGÄNGE
----------------------------------------------------------- */

/* 1. Definition der Animation "Einschweben" */
@keyframes fadeInUp {
    from {
        opacity: 0;                 /* Start: Unsichtbar */
        transform: translateY(20px); /* Start: 20px weiter unten */
    }
    to {
        opacity: 1;                 /* Ende: Sichtbar */
        transform: translateY(0);    /* Ende: Originalposition */
    }
}

/* 2. Anwenden der Animation auf Bereiche */

/* Der Hero-Bereich (Startbild) erscheint sofort sanft */
.hero {
    animation: fadeInUp 1s ease-out;
}

/* Die Überschriften auf Unterseiten */
.page-header {
    animation: fadeInUp 0.8s ease-out;
}

/* Die Karten (Leistungen, Team, Kontakt) sollen auch einschweben */
.card, .contact-card, .team-member {
    animation: fadeInUp 0.8s ease-out forwards; /* forwards behält den Endzustand bei */
    opacity: 0; /* Startzustand unsichtbar, damit man kein Flackern sieht */
    animation-delay: 0.2s; /* Startet kurz nach dem Laden */
}

/* 3. Button Hover-Effekt (noch weicher machen) */
.btn {
    transition: all 0.3s ease; /* Weicher Übergang für Farbe UND Position */
}

.btn:hover {
    transform: translateY(-3px); /* Button schwebt beim Drüberfahren leicht hoch */
    box-shadow: 0 4px 10px rgba(46, 139, 87, 0.3); /* Wirft einen Schatten */
}

/* 4. Navigation Hover (Unterstrich-Effekt) */
.nav a {
    position: relative;
    transition: color 0.3s;
}

.nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

.nav a:hover::after {
    width: 100%; /* Strich wächst von 0 auf 100% */
}

/* -----------------------------------------------------------
   LEISTUNGEN (4 KARTEN 2x2 RASTER)
----------------------------------------------------------- */
.services-grid {
    display: grid;
    gap: 30px;
    margin-top: 20px;
    grid-template-columns: 1fr; /* Mobile: Alle 4 untereinander */
}

/* Ab Tablet-Größe: Exakt 2 Spalten */
@media (min-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr); /* Desktop: 2x2 Raster */
    }
}

/* -----------------------------------------------------------
   MOBILE STICKY ACTION BAR
----------------------------------------------------------- */
.mobile-sticky-bar {
    display: none; /* Am Desktop unsichtbar */
}

/* Nur auf Bildschirmen kleiner als 768px sichtbar */
@media (max-width: 768px) {
    .mobile-sticky-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 9999;
        height: 60px;
    }

    .mobile-action-btn {
        flex: 1; /* Beide Buttons gleich groß */
        display: flex;
        justify-content: center;
        align-items: center;
        text-decoration: none;
        font-weight: 600;
        font-size: 1rem;
    }

    .btn-call {
        background-color: var(--white);
        color: var(--primary-color);
        border-top: 2px solid var(--primary-color);
    }

    .btn-route {
        background-color: var(--primary-color);
        color: var(--white);
    }
}
/* Damit der Footer nicht verdeckt wird am Handy */
@media (max-width: 768px) {
    body { padding-bottom: 60px; }
}

/* -----------------------------------------------------------
   SOCIAL MEDIA ICONS
----------------------------------------------------------- */
.social-link {
    display: inline-flex; /* Setzt Icon und Text in eine Reihe */
    align-items: center;  /* Zentriert beides vertikal */
    gap: 8px;             /* Abstand zwischen Icon und Text */
    transition: opacity 0.3s;
}

.social-link:hover {
    opacity: 0.8; /* Leichter Transparenz-Effekt beim Drüberfahren */
}

.social-icon {
    height: 24px; /* Einheitliche Größe */
    width: 24px;
    display: block;
}

/* Macht ein schwarzes/farbiges SVG-Icon komplett weiß */
.icon-white {
    filter: brightness(0) invert(1); 
}

/* -----------------------------------------------------------
   BILDKARUSSELL (DEZENTER CROSSFADE)
----------------------------------------------------------- */
.carousel-container {
    position: relative;
    max-width: 900px;
    height: 450px; /* WICHTIG: Feste Höhe, damit die Bilder übereinanderliegen können */
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.carousel-slide {
    position: absolute; /* Legt alle Bilder exakt übereinander */
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0; /* Standardmäßig unsichtbar */
    transition: opacity 0.8s ease-in-out; /* Der magische, sanfte Übergang */
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1; /* Nur das aktive Bild ist sichtbar */
    z-index: 2; /* Schiebt das aktive Bild nach vorne */
}

.carousel-slide img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    display: block;
}

/* Die Pfeil-Buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--primary-color);
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 50%;
    transition: background 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10; /* WICHTIG: Pfeile müssen immer ganz vorne über den Bildern liegen */
}

.carousel-btn:hover {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.carousel-btn.prev { left: 20px; }
.carousel-btn.next { right: 20px; }

/* Mobile Anpassung: Auf Handys nicht so hoch */
@media (max-width: 768px) {
    .carousel-container {
        height: 250px; /* Container-Höhe am Handy anpassen */
    }
    .carousel-slide img {
        height: 250px;
    }
}