/* =========================================
   KW SMART NAVIGATION & STICKY LOGIC
   ========================================= */
:root {
    /* Defaults (werden durch PHP überschrieben) */
    --kw-mob-bg: #ffffff;
    --kw-mob-text: #00315d;
    --kw-mob-btn-bg: #BD9B5C;
    --kw-mob-btn-text: #ffffff;
}

/* --- 1. MOBILE BAR (Fixed Bottom) --- */
.kw-mobile-bar {
    background: var(--kw-mob-bg);
    color: var(--kw-mob-text);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 99999; /* Immer ganz oben */
    border-top: 1px solid #BD9B5C; /* Brunner Gold */
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    padding: 12px 20px;
    box-sizing: border-box;
    
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    
    /* Animation State: Start (versteckt) */
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Zustand: Sichtbar (wird via JS gesetzt) */
.kw-mobile-bar.is-visible {
    transform: translateY(0);
}

/* Desktop: Immer ausblenden! */
@media (min-width: 768px) {
    .kw-mobile-bar {
        display: none !important;
    }
}

/* --- 2. LAYOUTS --- */

/* Kontext: Commerce (Preis + Button) */
.kw-context-commerce {
    justify-content: space-between;
}

.kw-bar-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.kw-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
}

.kw-price-value {
    font-size: 18px;
    font-weight: 700;
    color: #00315d; /* Brunner Blau */
    font-family: 'Quincy CF', serif; /* Fallback beachten */
}

/* Kontext: Service (Icons + Button) */
.kw-context-service {
    display: grid;
    grid-template-columns: auto 1fr; 
}

.kw-bar-icons {
    display: flex;
    gap: 12px;
}

.kw-icon-circle {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f4f4f4;
    color: #00315d;
    transition: background 0.2s;
    border: 1px solid #e0e0e0;
}

.kw-icon-circle:active {
    background: #BD9B5C;
    color: #fff;
    border-color: #BD9B5C;
}

/* --- NEU: HOVER EFFECT (Runde Buttons) --- */
@media (hover: hover) {
    .kw-icon-circle:hover {
        transform: translateY(-3px) scale(1.05); /* Schwebt hoch & wächst */
        background-color: #ffffff;
        color: var(--kw-mob-btn-bg, #BD9B5C); /* Icon wird Gold */
        border-color: var(--kw-mob-btn-bg, #BD9B5C); /* Rand wird Gold */
        box-shadow: 0 5px 15px rgba(0,0,0,0.15); /* Wirft Schatten */
        z-index: 10; /* Kommt in den Vordergrund */
    }
}

/* --- 3. BUTTONS --- */
.kw-bar-action {
    flex-grow: 1;
    text-align: right;
}

.kw-btn-mobile-primary {
    background-color: var(--kw-mob-btn-bg);
    color: var(--kw-mob-btn-text);
    display: block;
    text-align: center;
    width: 100%;
    padding: 12px 15px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(189, 155, 92, 0.3);
}

.kw-btn-mobile-primary:active {
    background-color: #00315d;
    transform: translateY(1px);
}

/* --- 4. BODY & HEADER STATES (für Sticky) --- */
/* Diese Klasse setzt das JS, wenn man scrollt (>50px) */
body.kw-is-scrolled {
    /* Hooks für CSS Transitionen */
}

/* =========================================
   KW SMART NAVIGATION & STICKY LOGIC
   (Clean Version: High Specificity, No !important)
   ========================================= */

/* --- 1. MOBILE BAR (Fixed Bottom) --- */
/* Wir nutzen 'body' davor, um die Priorität zu erhöhen ohne !important */
body .kw-mobile-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
    background: var(--kw-mob-bg, #ffffff);
    color: var(--kw-mob-text, #00315d);
    
    /* Standard-Design (Circle) */
    border-top: 1px solid #BD9B5C;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    padding: 12px 20px;
    box-sizing: border-box;
    
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    
    /* Animation: Start (versteckt) */
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Sichtbar machen (via JS) */
body .kw-mobile-bar.is-visible {
    transform: translateY(0);
}

/* Desktop: Hier ist !important okay, da es eine harte Utility-Regel ist */
@media (min-width: 768px) {
    .kw-mobile-bar {
        display: none !important;
    }
}

/* --- 2. LAYOUTS (Standard Circle Mode) --- */
.kw-context-commerce {
    justify-content: space-between;
}

.kw-bar-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.kw-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
}

.kw-price-value {
    font-size: 18px;
    font-weight: 700;
    color: inherit;
    font-family: 'Quincy CF', serif;
}

.kw-context-service {
    display: grid;
    grid-template-columns: auto 1fr; 
}

.kw-bar-icons {
    display: flex;
    gap: 12px;
}

/* Runde Icons (Standard) */
.kw-icon-circle {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f4f4f4;
    color: var(--kw-mob-text, #00315d);
    transition: background 0.2s;
    border: 1px solid #e0e0e0;
    text-decoration: none;
}

.kw-icon-circle:active {
    background: var(--kw-mob-btn-bg, #BD9B5C);
    color: #fff;
    border-color: var(--kw-mob-btn-bg, #BD9B5C);
}

/* --- 3. BUTTONS (Standard) --- */
.kw-bar-action {
    flex-grow: 1;
    text-align: right;
}

.kw-btn-mobile-primary {
    display: block;
    text-align: center;
    width: 100%;
    padding: 12px 15px;
    background-color: var(--kw-mob-btn-bg, #BD9B5C);
    color: var(--kw-mob-btn-text, #ffffff);
    font-weight: 700;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(189, 155, 92, 0.3);
    transition: background-color 0.2s, transform 0.1s;
}

.kw-btn-mobile-primary:active {
    filter: brightness(0.9);
    transform: translateY(1px);
}

/* ---------------------------------------------------------
   STYLE: KACHELN (TILES) - "High-End UX"
   Wir nutzen 'body' für höhere Spezifität statt !important
   --------------------------------------------------------- */
   
body .kw-mobile-bar.kw-style-tile {
    padding: 0;
    border-top: none;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.15); 
    height: 60px; /* Ideale Touch-Höhe */
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0;
}

/* Linker Bereich (Icons/Preis) - Exakt 50% */
body .kw-mobile-bar.kw-style-tile .kw-bar-icons,
body .kw-mobile-bar.kw-style-tile .kw-bar-info {
    flex: 0 0 50%;
    width: 50%;
    max-width: 50%;
    margin: 0;
    padding: 0;
    background: var(--kw-mob-bg, #ffffff);
    display: flex;
    position: relative;
    z-index: 1;
}

/* Rechter Bereich (Button) - Exakt 50% */
body .kw-mobile-bar.kw-style-tile .kw-bar-action {
    flex: 0 0 50%;
    width: 50%;
    max-width: 50%;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 2;
}

/* --- Tile Icons --- */
body .kw-mobile-bar.kw-style-tile .kw-icon-circle {
    flex: 1; /* Teilt Platz auf */
    width: auto;
    height: 100%;
    border-radius: 0;
    border: none;
    border-right: 1px solid rgba(0,0,0,0.15); /* Trennlinie */
    background: transparent;
    box-shadow: none;
    
    /* Animation */
    transition: background-color 0.2s, color 0.2s;
}

body .kw-mobile-bar.kw-style-tile .kw-icon-circle:last-child {
    border-right: none;
}

body .kw-mobile-bar.kw-style-tile .kw-icon-circle svg {
    width: 26px;
    height: 26px;
    color: var(--kw-mob-text, #00315d);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.05));
}

/* Hover (Nur Maus) */
@media (hover: hover) {
    body .kw-mobile-bar.kw-style-tile .kw-icon-circle:hover {
        background-color: #f4f4f4;
    }
    body .kw-mobile-bar.kw-style-tile .kw-icon-circle:hover svg {
        transform: scale(1.15);
        color: var(--kw-mob-btn-bg, #BD9B5C);
    }
}

/* Active (Klick/Touch) - "Eindrücken" */
body .kw-mobile-bar.kw-style-tile .kw-icon-circle:active {
    background-color: #e0e0e0;
    box-shadow: inset 0 3px 8px rgba(0,0,0,0.15);
}

body .kw-mobile-bar.kw-style-tile .kw-icon-circle:active svg {
    transform: scale(0.9);
    filter: none;
}

/* Focus (Tastatur / A11y) */
body .kw-mobile-bar.kw-style-tile .kw-icon-circle:focus-visible {
    background-color: #f4f4f4;
    box-shadow: inset 0 0 0 3px var(--kw-mob-text, #00315d);
    z-index: 20;
    outline: none;
}

/* --- Tile Preis --- */
body .kw-mobile-bar.kw-style-tile .kw-bar-info {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 5px 0 10px -2px rgba(0,0,0,0.1);
    z-index: 5;
}

body .kw-mobile-bar.kw-style-tile .kw-bar-info .kw-label {
    font-size: 10px;
    margin-bottom: 2px;
    font-weight: 700;
    color: #777;
}

body .kw-mobile-bar.kw-style-tile .kw-bar-info .kw-price-value {
    font-size: 18px;
    font-weight: 800;
}

/* --- Tile Button --- */
body .kw-mobile-bar.kw-style-tile .kw-btn-mobile-primary {
    border-radius: 0;
    height: 100%;
    width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: none;
    
    /* 3D-Look */
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.15), rgba(0,0,0,0.05));
    border-left: 1px solid rgba(0,0,0,0.1);
}

body .kw-mobile-bar.kw-style-tile .kw-btn-mobile-primary:hover {
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
}

body .kw-mobile-bar.kw-style-tile .kw-btn-mobile-primary:active {
    background-image: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.4));
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.3);
}

body .kw-mobile-bar.kw-style-tile .kw-btn-mobile-primary:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -3px;
    box-shadow: inset 0 0 0 3px var(--kw-mob-text, #00315d);
    z-index: 30;
}

/* --- STICKY HEADER LOGIC --- */
body.kw-is-scrolled .sticky-header {
    background-color: #ffffff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}