/* ============================================================
   VET BALANCE LEIPZIG - MASTER STYLESHEET
   Stand: iPhone Fix (Z-Index) & Banner Update
   ============================================================ */

/* 0. BROWSER-RESET & NORMIERUNG */
html {
    -webkit-text-size-adjust: 100%;
    font-size: 100%;
    scroll-behavior: smooth;
    width: 100%;
    overflow-x: hidden;
    scrollbar-width: thin; 
    scrollbar-color: var(--primary-light) var(--bg-body);
}

*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; 
}

input, textarea, button, select {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0; 
    font-family: inherit;
}

a[href^="tel"] { color: inherit; text-decoration: none; }

/* 1. VARIABLEN */
:root {
    color-scheme: light dark;
    --primary-dark: #2F4F4F;
    --primary-light: #4E9F98;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --nav-bg: var(--bg-card);
    --bg-footer: #eef2f6; 
    --text-main: #334155;
    --text-muted: #64748b;
    --text-heading: #2F4F4F;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0,0,0,0.08);
    --alert-red: #e74c3c;
    --header-gradient-start: #2F4F4F;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-dark: #b2cccc;
        --primary-light: #4E9F98;
        --bg-body: #0f172a; 
        --bg-card: #1e293b; 
        --nav-bg: var(--bg-card);
        --bg-footer: #162030;
        --text-main: #cbd5e1;
        --text-muted: #94a3b8;
        --text-heading: #b2cccc; 
        --border-color: #334155;
        --shadow-color: rgba(0,0,0,0.3);
        --alert-red: #f87171;
        --header-gradient-start: #1e3a3a; 
    }
    img:not(.mascot-wrapper img) { filter: brightness(0.9); }
}

body { 
    margin: 0; padding: 0; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 
    background-color: var(--bg-body); color: var(--text-main); line-height: 1.6; 
    width: 100%; overflow-x: hidden; position: relative;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}

.site-wrapper {
    width: 100%; max-width: 1450px; margin: 0 auto;           
    background-color: var(--bg-card); position: relative; min-height: 100vh;        
    border-left: 1px solid var(--border-color); border-right: 1px solid var(--border-color);
    box-shadow: 0 0 50px rgba(0,0,0,0.05); 
}

@media (max-width: 1620px) {
    .site-wrapper { max-width: 100%; margin: 0; box-shadow: none; border: none; }
}

/* --- ICONS --- */
.icon-svg { 
    width: 1em; height: 1em; fill: var(--primary-light);
    vertical-align: middle; margin-right: 8px; position: relative; top: -2px; 
    transition: fill 0.3s ease; flex-shrink: 0;
}
a:hover .icon-svg { fill: var(--primary-dark); }

/* --- HEADER --- */
header {
    background: var(--nav-bg); padding: 0.8rem 2rem;
    display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0; z-index: 1000; border-bottom: 1px solid var(--border-color); 
    min-height: 70px; box-sizing: border-box; width: 100%;
}
.logo-group { display: flex; align-items: center; gap: 15px; text-decoration: none; z-index: 1001; }
.logo-badge { height: 60px; width: 60px; object-fit: contain; border-radius: 50%; box-shadow: 0 2px 8px var(--shadow-color); background: white; padding: 6px; transition: transform 0.3s ease; }
.slogan { font-size: 0.9rem; color: var(--primary-dark); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; line-height: 1.2; max-width: 200px; }

.desktop-nav { display: flex; align-items: center; gap: 30px; }
.nav-links { display: flex; gap: 25px; align-items: center; }
.nav-links a { position: relative; text-decoration: none; color: var(--text-main); font-weight: 500; font-size: 1rem; padding: 5px 0; transition: color 0.3s; }
.nav-links a::after { content: ''; position: absolute; width: 0; height: 2px; bottom: 0; left: 0; background-color: var(--primary-light); transition: width 0.3s ease-in-out; }
.nav-links a:hover { color: var(--primary-dark); } 
.nav-links a:hover::after { width: 100%; } 
.nav-active { color: var(--primary-dark) !important; font-weight: 700 !important; } .nav-active::after { width: 100% !important; }
.nav-emergency { color: var(--alert-red) !important; font-weight: 700; } .nav-emergency::after { background-color: var(--alert-red) !important; }

.hamburger-wrapper { display: none; align-items: center; gap: 10px; cursor: pointer; z-index: 1001; padding: 8px 12px; border-radius: 8px; background: rgba(0,0,0,0.03); }
.menu-label { font-weight: bold; color: var(--primary-dark); font-size: 0.9rem; text-transform: uppercase; }
.hamburger { width: 25px; height: 18px; position: relative; }
.hamburger span { display: block; position: absolute; height: 2px; width: 100%; background: var(--primary-dark); border-radius: 9px; left: 0; transition: .25s ease-in-out; }
.hamburger span:nth-child(1) { top: 0px; } .hamburger span:nth-child(2) { top: 8px; } .hamburger span:nth-child(3) { top: 16px; }
.hamburger.open span:nth-child(1) { top: 8px; transform: rotate(135deg); } .hamburger.open span:nth-child(2) { opacity: 0; left: -60px; } .hamburger.open span:nth-child(3) { top: 8px; transform: rotate(-135deg); }

/* --- HERO BANNER (NEU: IMG ELEMENT) --- */
.hero-banner-wrapper {
    position: relative;
    width: 100%;
    line-height: 0; 
    border-top: 5px solid var(--primary-light);
    background-color: var(--bg-body); 
}

/* PC Standard: Groß und wuchtig */
.hero-img-element {
    width: 100%;
    height: 40vh; 
    min-height: 350px; 
    display: block;
    object-fit: cover; 
    object-position: center;
}

.hero-banner-wrapper .wave-bottom {
    position: absolute;
    bottom: -1px; 
    left: 0;
    width: 100%;
    height: auto;
    max-height: 120px; 
    z-index: 2;
}

/* --- CONTENT --- */
.wave-header {
    position: relative; background: linear-gradient(135deg, var(--header-gradient-start), var(--primary-light));
    color: white; 
    padding: 2.5rem 1rem 6rem 1rem; 
    text-align: center; overflow: hidden; 
}
.wave-header h1 { font-size: 2.8rem; margin: 0 0 1rem 0; color: white; text-shadow: 0 2px 10px rgba(0,0,0,0.1); position: relative; z-index: 10; }
.wave-header p { font-size: 1.2rem; color: rgba(255,255,255,0.9); max-width: 700px; margin: 0 auto; position: relative; z-index: 10; }
.wave-bottom, .wave-svg { position: absolute; bottom: -1px; left: 0; width: 100%; height: auto; max-height: 140px; z-index: 2; }
.wave-path { fill: var(--bg-card); }

.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1rem; }
.section-divider { border: 0; height: 3px; background-color: var(--border-color); border-radius: 10px; margin: 2rem auto 3rem auto; width: 100%; opacity: 0.8; }
.split-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 4rem; margin-top: 4rem; align-items: start; margin-bottom: 6rem; }
.welcome-text h1 { color: var(--primary-dark); font-size: 2.5rem; margin-top: 0; line-height: 1.1; margin-bottom: 1.5rem; }
.welcome-text p { font-size: 1.15rem; color: var(--text-main); margin-bottom: 1.5rem; font-weight: 300; }

.news-section {
    background: var(--bg-card); border: 1px solid var(--border-color); padding: 1.5rem;
    border-radius: 12px; box-shadow: 0 4px 15px var(--shadow-color); border-left: 5px solid var(--primary-light) !important;
}
.news-header { display: flex; align-items: center; gap: 12px; margin-bottom: 1.5rem; color: var(--primary-dark); font-size: 1.3rem; margin-top: 0; }
.news-date { background: var(--primary-dark); color: white; padding: 4px 10px; border-radius: 6px; font-size: 0.85rem; font-weight: 700; }

.team-card, .contact-card, .service-card {
    background: var(--bg-card); 
    border: 1px solid var(--border-color); 
    padding: 1.5rem;
    border-radius: 12px; 
    box-shadow: 0 4px 15px var(--shadow-color);
    border-left: 5px solid var(--primary-light);
}
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 3rem; margin-top: 2rem; }
.team-card { padding: 0; overflow: hidden; display: flex; flex-direction: column;}

.team-card img { width: 100%; height: 350px; object-fit: cover; object-position: center top; display: block; border-bottom: none !important; }
.team-info { padding: 2rem; flex-grow: 1; display: flex; flex-direction: column; }
.team-name { color: var(--primary-dark); font-size: 1.6rem; margin: 0 0 0.2rem 0; }
.team-role { color: var(--primary-light); font-weight: bold; font-size: 0.95rem; text-transform: uppercase; margin-bottom: 1.5rem; display: block; }

.contact-dashboard { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 3rem; }
.contact-card h3 { color: var(--primary-dark); margin-top: 0; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; margin-bottom: 15px; }
.contact-card a:hover { color: var(--primary-light); }
.map-container { height: 100%; min-height: 250px; border-radius: 12px; overflow: hidden; }
.full-width-card { grid-column: 1 / -1; max-width: 800px; margin: 0 auto; width: 100%; }

.btn-header { background: var(--primary-light); color: #ffffff; padding: 8px 24px; text-decoration: none; border-radius: 50px; font-weight: bold; font-size: 0.9rem; transition: all 0.3s ease; box-shadow: 0 4px 10px rgba(78, 159, 152, 0.3); white-space: nowrap; }
.btn-header:hover { background: var(--primary-dark); transform: translateY(-2px); color: #ffffff; }
.btn-outline { display: inline-block; border: 2px solid var(--primary-light); color: var(--primary-light); padding: 10px 20px; border-radius: 50px; text-decoration: none; font-weight: bold; transition: all 0.3s; }
.btn-outline:hover { background: var(--primary-light); color: white; }
.form-input { width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; font-family: inherit; font-size: 1rem; background: var(--bg-card); color: var(--text-main); }
.form-input:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(78, 159, 152, 0.2); }

/* --- EXTRAS --- */
.mascot-wrapper { 
    position: absolute; bottom: 20px; right: 5%; 
    display: flex; align-items: flex-end; gap: 15px; 
    z-index: 1; pointer-events: none; 
}
.mascot-wrapper img { 
    height: 100px; width: auto; 
    filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0,0,0,0.2)); 
}

#backToTop { display: none; position: fixed; bottom: 30px; right: 30px; z-index: 9999; border: none; outline: none; background-color: var(--primary-light); color: white; cursor: pointer; width: 45px; height: 45px; padding: 0; border-radius: 50%; box-shadow: 0 4px 10px rgba(0,0,0,0.2); transition: background-color 0.3s, transform 0.3s, opacity 0.3s; opacity: 0; align-items: center; justify-content: center; }
#backToTop.show { display: flex; opacity: 1; }
#backToTop:hover { background-color: var(--primary-dark); transform: translateY(-3px); }

#cookie-banner { display: none; position: fixed; bottom: 0; left: 0; width: 100%; background-color: var(--bg-card); border-top: 1px solid var(--primary-light); box-shadow: 0 -4px 20px rgba(0,0,0,0.1); padding: 1.5rem; z-index: 99999; }
.cookie-content { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.cookie-text { font-size: 0.95rem; color: var(--text-main); margin: 0; }
.btn-cookie { background: var(--primary-dark); color: white; border: none; padding: 8px 20px; border-radius: 6px; cursor: pointer; font-weight: bold; }

.login-body { font-family: sans-serif; background: #f0f4f4; display: flex; height: 100vh; justify-content: center; align-items: center; margin: 0; color: #2F4F4F; }
.login-box { background: white; padding: 3rem; border-radius: 12px; box-shadow: 0 10px 25px rgba(47, 79, 79, 0.1); text-align: center; max-width: 400px; width: 100%; }
.login-box button { background: #4E9F98; color: white; border: none; padding: 12px 20px; border-radius: 6px; cursor: pointer; width: 100%; font-size: 1rem; font-weight: bold; }

/* --- TITEL-BLATT --- */
.title-leaf {
    height: 38px; width: auto; display: block; transform: translateY(-6px);
}

/* --- FOOTER LAYOUT --- */
footer { 
    background: var(--bg-footer); border-top: 1px solid var(--border-color); 
    color: var(--text-main); padding: 6rem 2rem; margin-top: 2rem; 
}
.footer-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 3rem; text-align: left; }
.footer-col h4 { color: var(--primary-dark); font-size: 1.1rem; margin-top: 0; margin-bottom: 1.5rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.footer-col p, .footer-col a { color: var(--text-muted); text-decoration: none; display: block; margin-bottom: 0.8rem; padding: 2px 0; transition: color 0.3s; }
.footer-col a:hover { color: var(--primary-light); }
.footer-bottom { max-width: 1100px; margin: 4rem auto 0 auto; padding-top: 2rem; border-top: 1px solid var(--border-color); text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* =========================================
   MOBILE OPTIMIERUNG (Max-Width: 950px)
   ========================================= */
@media (max-width: 950px) {
    header { padding: 1rem; justify-content: space-between; }
    .logo-group { gap: 10px; } .logo-badge { height: 50px; width: 50px; } .slogan { display: block; font-size: 0.65rem; line-height: 1.1; }
    .hamburger-wrapper { display: flex; }

    /* HIER IPHONE FIX: Z-Index auf 2000 (höher als Logo) */
    .desktop-nav { 
        position: fixed; top: 0; right: 0; transform: translateX(100%); width: 100%; height: 100vh; background: var(--bg-card); border-radius: 0;
        display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 30px; padding: 0; 
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s; 
        z-index: 2000; /* WICHTIG: Höher als Logo (1001) */
        visibility: hidden; 
    }
    .desktop-nav.active { transform: translateX(0); visibility: visible; }
    
    .nav-links { display: flex; flex-direction: column; gap: 25px; width: 100%; align-items: center; justify-content: center; padding: 0 !important; margin: 0 !important; } 
    .nav-links a { font-size: 1.5rem; font-weight: bold; background: transparent; display: inline-block; text-align: center; margin: 0 auto; cursor: pointer; }
    .btn-header { width: auto !important; min-width: 200px; text-align: center; display: flex; justify-content: center; align-items: center; padding: 12px 30px; margin: 0 auto; }
    
    .split-layout { grid-template-columns: 1fr; gap: 3rem; margin-top: 2rem; }
    .news-section { order: 1; padding-left: 1.5rem; }
    .welcome-text { order: 2; padding-right: 0; }
    .contact-dashboard { grid-template-columns: 1fr; }
    .map-container { height: 300px; }
    
    .footer-grid { text-align: center; }

    .btn-outline, button:not(.intro-btn):not(.btn-header):not(.btn-cookie) { white-space: normal !important; max-width: 100%; width: 100%; box-sizing: border-box; margin-bottom: 10px; }
    .cookie-content { flex-direction: column; text-align: center; }
    .btn-cookie { width: 100%; padding: 12px; }
    .intro-box { width: 95%; padding: 30px 20px; }
    
    .title-leaf { height: 28px !important; transform: translateY(-4px) !important; }
}

@media (max-width: 768px) {
    .wave-header { 
        padding-top: 30px !important; 
        padding-bottom: 60px !important; 
    }
    
    .hero-banner-wrapper .wave-bottom {
        max-height: 60px;
    }

    /* HIER BANNER FIX: Feste Höhe 280px für Handy (nicht riesig!) */
    .hero-img-element {
        height: 280px !important; 
        min-height: 0 !important;
        max-height: none !important; 
        object-fit: cover !important; 
        object-position: center center !important;
    }
    
    .wave-header h1 { font-size: 1.8rem !important; margin-top: 0 !important; margin-bottom: 5px !important; line-height: 1.2 !important; }
    .wave-header p { font-size: 1rem !important; margin-top: 0 !important; max-width: 90% !important; margin-left: auto; margin-right: auto; }
    #backToTop { right: auto !important; left: 20px !important; bottom: 20px !important; opacity: 0.9; }
}