/**
 * EHNES Elementor Widgets — Frontend CSS
 *  - Icon-Button (gemeinsam fuer alle 3 Widgets)
 *  - Lightbox-Overlay mit Blur (gleicher Effekt wie Bexons .body-overlay)
 */

/* ============================================================
   1:1-Klon von Bexons .tj-primary-btn inkl. Hover-Animation:
   - Text rollt nach oben (translateY -30) + text-shadow als
     unsichtbarer Klon-Trick fuer "neuer Text rein"-Effekt
   - Icon rotiert von -45deg (oben-rechts) zu 0 (rechts) in 0.3s

   Buttons MIT .ehnes-btn__icon-Kind bekommen das asymmetrische
   Bexon-Padding. Buttons OHNE den Icon-Kreis bekommen symmetrisches.
   ============================================================ */
.ehnes-mb-btn,
.ehnes-mag-grid__more-btn,
.ehnes-account-menu__btn,
.ehnes-lightbox__cta,
.mpw-paywall__cta--ehnes .mpw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    padding: 12px 26px 14px;       /* default fuer Buttons OHNE Icon-Kreis */
    border-radius: 50px;
    font-family: 'Ubuntu', 'Trebuchet MS', Verdana, Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    border: 1.5px solid transparent;
    cursor: pointer;
    z-index: 2;
    overflow: hidden;
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* Asymmetrisches Bexon-Padding wenn der Icon-Kreis im Button steckt */
.ehnes-mb-btn:has(> .ehnes-btn__icon),
.ehnes-mag-grid__more-btn:has(> .ehnes-btn__icon),
.ehnes-account-menu__btn:has(> .ehnes-btn__icon),
.ehnes-lightbox__cta:has(> .ehnes-btn__icon),
.mpw-paywall__cta--ehnes .mpw-btn:has(> .ehnes-btn__icon) {
    padding: 5px 5px 5px 25px;
    gap: 10px;
}

/* Text-Wrapper mit overflow-hidden + animiertem Inner-Span (Roll-Up-Effekt) */
.ehnes-btn__text {
    color: inherit;
    overflow: hidden;
}
.ehnes-btn__text > span {
    display: flex;
    line-height: 1;
    text-shadow: 0 30px 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateY(0);
    transition: transform 0.4s ease-in-out;
}
.ehnes-mb-btn:hover .ehnes-btn__text > span,
.ehnes-mag-grid__more-btn:hover .ehnes-btn__text > span,
.ehnes-account-menu__btn:hover .ehnes-btn__text > span,
.ehnes-lightbox__cta:hover .ehnes-btn__text > span,
.mpw-paywall__cta--ehnes .mpw-btn:hover .ehnes-btn__text > span {
    transform: translateY(-30px);
}

/* Icon-Kreis: 42x42 dunkler Kreis, white Pfeil rotiert -45deg -> 0 on hover */
.ehnes-btn__icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: #0C1E21;
    color: #FFFFFF;
    overflow: hidden;
    flex: 0 0 42px;
    line-height: 1;
}
.ehnes-btn__icon svg {
    width: 18px;
    height: 18px;
    color: inherit;
    /* Default: SVG zeigt nach rechts (-> horizontal) */
    transform: rotate(0);
    transition: transform 0.3s ease-in-out;
}
/* Hover: rotiert auf -45deg -> Pfeil zeigt nach oben-rechts (^) */
.ehnes-mb-btn:hover .ehnes-btn__icon svg,
.ehnes-mag-grid__more-btn:hover .ehnes-btn__icon svg,
.ehnes-account-menu__btn:hover .ehnes-btn__icon svg,
.ehnes-lightbox__cta:hover .ehnes-btn__icon svg,
.mpw-paywall__cta--ehnes .mpw-btn:hover .ehnes-btn__icon svg {
    transform: rotate(-45deg);
}

/* Bexon-Pattern: Hintergrund bleibt gruen auf Hover - kein Wechsel zu dunkel.
   Override fuer magic-paywall/frontend.css das per Default auf --mpw-dark wechselt. */
.mpw-paywall__cta--ehnes .mpw-btn--primary,
.mpw-paywall__cta--ehnes .mpw-btn--primary:hover,
.mpw-paywall__cta--ehnes .mpw-btn--primary:focus {
    background: #29BD98 !important;
    color: #FFFFFF !important;
    border-color: #29BD98 !important;
}

/* ============================================================
   Icon-Button (gemeinsame Basis - rund, dunkel, weisses Icon)
   Optisch passend zum Pfeil-Kreis im Bexon-Kontakt-Button.
   ============================================================ */
.ehnes-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #20232B;
    color: #FFFFFF;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    border-radius: 50%;
    flex: 0 0 auto;
    transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
    -webkit-appearance: none;
    appearance: none;
}
.ehnes-icon-btn:hover {
    background: #00A88C;
    color: #FFFFFF;
    transform: translateY(-1px);
}
.ehnes-icon-btn:focus-visible {
    outline: 2px solid #00A88C;
    outline-offset: 2px;
}

.ehnes-icon-btn i,
.ehnes-icon-btn svg {
    font-size: 16px;
    width: 1em;
    height: 1em;
    line-height: 1;
}
.ehnes-icon-btn svg { fill: currentColor; }

/* ============================================================
   Header-Icons-Gruppe: Gap zwischen Icons + Abstand zum Hamburger
   ============================================================ */
.ehnes-header-icons {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-right: 16px;
}
.ehnes-header-icons .ehnes-icon-btn {
    margin: 0;
}

/* ============================================================
   Account-Menu: Hover-Popover (eingeloggt) mit User-Daten,
   Mein-Konto-Button + Logout.
   ============================================================ */
.ehnes-account-menu {
    position: relative;
    display: inline-flex;
}
.ehnes-account-menu__panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 260px;
    background: #fff;
    color: #20232B;
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
    padding: 1.1rem 1.1rem 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 150ms ease, transform 150ms ease, visibility 150ms;
    z-index: 9999;
    pointer-events: none;
    text-align: left;
}
/* Unsichtbare Bruecke zwischen Icon und Panel, damit der Hover beim
   Mauszug nach unten nicht abreisst. */
.ehnes-account-menu__panel::before {
    content: "";
    position: absolute;
    top: -12px;
    right: 0;
    left: 0;
    height: 12px;
    background: transparent;
}
.ehnes-account-menu:hover .ehnes-account-menu__panel,
.ehnes-account-menu:focus-within .ehnes-account-menu__panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.ehnes-account-menu__head {
    padding-bottom: .85rem;
    margin-bottom: .85rem;
    border-bottom: 1px solid #ECECEC;
}
.ehnes-account-menu__eyebrow {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #00A88C;
    margin-bottom: .25rem;
}
.ehnes-account-menu__name {
    font-size: 1rem;
    font-weight: 700;
    color: #20232B;
    line-height: 1.3;
    word-break: break-word;
}
.ehnes-account-menu__email {
    font-size: .85rem;
    color: #6B7077;
    margin-top: .15rem;
    word-break: break-all;
}

.ehnes-account-menu__actions {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
/* Account-Menu Buttons - Basis aus unified pattern, nur Variant-Farben */
.ehnes-account-menu__btn {
    /* Padding kleiner als Default (Popover-Kontext) */
    padding: 10px 18px 11px;
    font-size: .85rem;
}
.ehnes-account-menu__btn--primary {
    background: #29BD98;
    color: #fff;
    border-color: #29BD98;
}
.ehnes-account-menu__btn--primary:hover,
.ehnes-account-menu__btn--primary:focus {
    background: #0C1E21;
    border-color: #0C1E21;
    color: #fff;
}
.ehnes-account-menu__btn--ghost {
    background: transparent;
    color: #15293A;
    border-color: #C9D2CD;
}
.ehnes-account-menu__btn--ghost:hover,
.ehnes-account-menu__btn--ghost:focus {
    background: #F4F5F7;
    color: #15293A;
    border-color: #0C1E21;
}

/* ============================================================
   Mega-Menu Blur-Overlay
   - Wird per JS via body.ehnes-mega-active aktiviert
   - z-index: 50 sitzt UNTER dem Header (99/999) und damit unter
     dem Mega-Menu-Dropdown - Header bleibt scharf, alles drunter
     wird verschwommen. Gleicher Effekt wie Bexon-Sidebar (10px Blur).
   ============================================================ */
.ehnes-mega-blur-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms ease, visibility 220ms;
}
body.ehnes-mega-active .ehnes-mega-blur-overlay {
    opacity: 1;
    visibility: visible;
}

/* ============================================================
   Lightbox: Overlay (Blur analog Bexon .body-overlay)
   ============================================================ */
.ehnes-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: transparent;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: ehnes-lb-fade 200ms ease;
}
@keyframes ehnes-lb-fade { from { opacity: 0; } to { opacity: 1; } }

.ehnes-lightbox {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 3rem 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    max-width: 560px;
    width: 100%;
    text-align: center;
    color: #20232B;
    animation: ehnes-lb-pop 220ms cubic-bezier(.2,.8,.2,1);
}
@keyframes ehnes-lb-pop {
    from { transform: scale(.96); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.ehnes-lightbox__close {
    position: absolute;
    top: .85rem;
    right: 1.1rem;
    background: transparent;
    border: 0;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #808291;
    padding: .25rem .5rem;
    transition: color 120ms ease;
}
.ehnes-lightbox__close:hover { color: #20232B; }

.ehnes-lightbox__phone {
    display: inline-block;
    font-size: 2.6rem;
    font-weight: 700;
    color: #00A88C;
    text-decoration: none;
    margin-bottom: 1rem;
    line-height: 1.2;
    transition: color 150ms ease;
}
.ehnes-lightbox__phone:hover,
.ehnes-lightbox__phone:focus { color: #06CB98; }

.ehnes-lightbox__text {
    font-size: 1rem;
    color: #2E3B42;
    line-height: 1.6;
}
.ehnes-lightbox__text p:last-child { margin-bottom: 0; }

/* Termin-Buchen-CTA in der Phone-Lightbox - nutzt unified pattern.
   Bexon-Pattern: Hintergrund bleibt gruen auf Hover - nur Text rollt
   nach oben + Icon rotiert. Kein Background-Wechsel. */
.ehnes-lightbox__cta {
    margin-top: 1.5rem;
    background: #29BD98 !important;
    color: #FFFFFF !important;
    border-color: #29BD98 !important;
}

@media (max-width: 600px) {
    .ehnes-lightbox { padding: 2.25rem 1.5rem; }
    .ehnes-lightbox__phone { font-size: 2rem; }
}
