/* ============================================================
WERBEAUF CUSTOM HEADER STYLES
Fully Responsive - Optimized for all screen sizes
CI Colors: #1b3d58 (primary), #4f6073 (secondary), #e8e7e2 (bg)
============================================================ */

#wp-admin-bar-top-secondary {
    display: none !important;
}

/* ============================================================
MAIN HEADER
============================================================ */

.werbeauf-header {
    position: relative;
    width: 100%;
    z-index: 99999;
    background: #ffffff;
    padding: 20px 0;
}

.werbeauf-header.header-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 10px 0;
    box-shadow: 0 2px 20px rgba(27, 61, 88, 0.08);
}

.werbeauf-header__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 50px;
    max-width: 1400px;
    width: 80%;
    margin: 0 auto;
}

/* ============================================================
LOGO
============================================================ */

.werbeauf-header__logo {
    justify-self: start;
}

.werbeauf-header__logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #1b3d58;
    font-weight: 700;
    font-size: 1.125rem;
}

.werbeauf-header__logo img {
    max-height: 48px;
    width: auto;
    height: auto;
    display: block;
}

.werbeauf-header__logo img[src$=".svg"] {
    width: auto;
    height: 48px;
}

/* ============================================================
DESKTOP NAVIGATION
============================================================ */

.werbeauf-header__nav {
    justify-self: start;
}

.werbeauf-header__menu {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.werbeauf-header__menu li {
    position: relative;
    margin: 0;
    padding: 0;
}

.werbeauf-header__menu>li>a {
    display: block;
    padding: 8px 0;
    color: #1b3d58;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 15px;
}

.werbeauf-header__menu>li>a:hover {
    color: #4f6073;
}

/* Dropdown submenu */
.werbeauf-header__menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(27, 61, 88, 0.12);
    border-radius: 10px;
    padding: 10px 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.werbeauf-header__menu li:hover>.sub-menu {
    opacity: 1;
    visibility: visible;
}

.werbeauf-header__menu .sub-menu li a {
    display: block;
    padding: 10px 18px;
    color: #1b3d58;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
}

.werbeauf-header__menu .sub-menu li a:hover {
    background: #e8e7e2;
    color: #4f6073;
}

/* ============================================================
HAMBURGER MENU BUTTON
============================================================ */

.werbeauf-header__hamburger {
    display: none;
    justify-self: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 9999999;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.werbeauf-header__hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: #1b3d58;
    border-radius: 2px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.3s ease;
}

.werbeauf-header__hamburger-line:nth-child(1) {
    top: 13px;
}

.werbeauf-header__hamburger-line:nth-child(2) {
    top: 50%;
    transform: translate(-50%, -50%);
}

.werbeauf-header__hamburger-line:nth-child(3) {
    bottom: 13px;
}

/* Hamburger to X state */
.menu-open .werbeauf-header__hamburger-line:nth-child(1) {
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

.menu-open .werbeauf-header__hamburger-line:nth-child(2) {
    opacity: 0;
}

.menu-open .werbeauf-header__hamburger-line:nth-child(3) {
    bottom: 50%;
    transform: translate(-50%, 50%) rotate(-45deg);
}

/* ============================================================
HEADER BUTTONS
============================================================ */

.werbeauf-header__buttons {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
}

.werbeauf-header__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .8em 2.1em;
    line-height: 1.4em;
    border-radius: 10px;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    box-sizing: border-box;
    border: 2px solid transparent;
}

.werbeauf-header__btn--one,
.werbeauf-header__btn--one:visited,
.werbeauf-header__btn--one:active,
.werbeauf-header__btn--one:focus {
    background: #1b3d58 !important;
    color: #ffffff !important;
    border-color: #1b3d58 !important;
}

.werbeauf-header__btn--one:hover {
    background: transparent !important;
    border-color: #1b3d58 !important;
    color: #1b3d58 !important;
}

.werbeauf-header__btn--second,
.werbeauf-header__btn--second:visited,
.werbeauf-header__btn--second:active,
.werbeauf-header__btn--second:focus {
    background: transparent !important;
    color: #1b3d58 !important;
    border-color: #1b3d58 !important;
}

.werbeauf-header__btn--second:hover {
    background: #1b3d58 !important;
    color: #ffffff !important;
    border-color: #1b3d58 !important;
}

.werbeauf-header__btn-icon {
    display: none;
}

.werbeauf-header__btn-icon svg {
    width: 20px;
    height: 20px;
}

/* ============================================================
MOBILE MENU OVERLAY
============================================================ */

.werbeauf-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 2147483647;
    background: #e8e7e2;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

/* iOS Safe Area Support */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .werbeauf-mobile-menu {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

.menu-open .werbeauf-mobile-menu {
    display: flex;
}

/* Mobile Menu Header */
.werbeauf-mobile-menu__header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #e5e5e5;
}

.werbeauf-mobile-menu__logo {
    flex-shrink: 0;
}

.werbeauf-mobile-menu__logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #1b3d58;
    font-weight: 700;
}

.werbeauf-mobile-menu__logo img {
    max-height: 48px;
    width: auto;
    height: auto;
    display: block;
}

.werbeauf-mobile-menu__logo img[src$=".svg"] {
    width: auto;
    height: 48px;
}

.werbeauf-mobile-menu__close {
    width: 42px;
    height: 42px;
    background: rgba(27, 61, 88, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.werbeauf-mobile-menu__close:hover {
    background: rgba(27, 61, 88, 0.2);
}

.werbeauf-mobile-menu__close-icon {
    font-size: 22px;
    line-height: 1;
    color: #1b3d58;
}

/* Mobile Menu Content */
.werbeauf-mobile-menu__content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    -webkit-overflow-scrolling: touch;
}

.werbeauf-mobile-menu__nav {
    max-width: 300px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

.werbeauf-mobile-menu__list {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;
}

.werbeauf-mobile-menu__list li {
    margin: 0;
    padding: 0;
}

.werbeauf-mobile-menu__list>li>a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    gap: 8px;
    padding: 14px 18px;
    color: #1b3d58;
    text-decoration: none;
    font-size: 17px;
    font-weight: 600;
}

.werbeauf-mobile-menu__list>li>a:hover {
    color: #4f6073;
}

/* Submenu parent item layout */
.werbeauf-mobile-menu__list>.menu-item-has-children {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.werbeauf-mobile-menu__list>.menu-item-has-children>a {
    flex: 0 0 auto;
}

/* Separate toggle button for submenu arrow */
.werbeauf-submenu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(27, 61, 88, 0.08);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.werbeauf-submenu-toggle:hover {
    background: rgba(27, 61, 88, 0.15);
}

.werbeauf-submenu-arrow {
    display: block;
    width: 8px;
    height: 8px;
    border-right: 2px solid #1b3d58;
    border-bottom: 2px solid #1b3d58;
    transform: rotate(45deg);
    margin-top: -3px;
    transition: transform 0.2s ease;
}

.menu-item-has-children.open .werbeauf-submenu-arrow {
    transform: rotate(-135deg);
    margin-top: 3px;
}

/* Submenu takes full width */
.werbeauf-mobile-menu__list>.menu-item-has-children>.sub-menu {
    flex-basis: 100%;
}

/* Mobile Submenus */
.werbeauf-mobile-menu__list .sub-menu {
    display: none;
    list-style: none;
    margin: 6px auto 12px;
    padding: 10px 14px;
    background: rgba(27, 61, 88, 0.06);
    border-radius: 10px;
    max-width: 260px;
}

.werbeauf-mobile-menu__list .menu-item-has-children.open>.sub-menu {
    display: block;
}

.werbeauf-mobile-menu__list .sub-menu li a {
    display: block;
    padding: 10px 14px;
    font-size: 15px;
    font-weight: 500;
    color: #4f6073;
    text-decoration: none;
    border-radius: 10px;
}

.werbeauf-mobile-menu__list .sub-menu li a:hover {
    background: rgba(27, 61, 88, 0.08);
    color: #1b3d58;
}

/* Mobile Menu Footer */
.werbeauf-mobile-menu__footer {
    flex-shrink: 0;
    padding: 18px 24px 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    border-top: 1px solid #e5e5e5;
}

.werbeauf-mobile-menu__buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.werbeauf-mobile-menu__btn {
    display: inline-block;
    padding: 1em 2.2em;
    line-height: 1.4em;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile Menu Buttons - High specificity to override Divi */
.werbeauf-mobile-menu__btn--one,
body .werbeauf-mobile-menu__btn--one,
a.werbeauf-mobile-menu__btn--one,
.werbeauf-mobile-menu .werbeauf-mobile-menu__btn--one {
    background: #1b3d58 !important;
    color: #ffffff !important;
    border: 2px solid #1b3d58 !important;
}

.werbeauf-mobile-menu__btn--one:visited,
.werbeauf-mobile-menu__btn--one:active,
.werbeauf-mobile-menu__btn--one:focus,
body .werbeauf-mobile-menu__btn--one:visited,
body .werbeauf-mobile-menu__btn--one:active,
body .werbeauf-mobile-menu__btn--one:focus,
a.werbeauf-mobile-menu__btn--one:visited,
a.werbeauf-mobile-menu__btn--one:active,
a.werbeauf-mobile-menu__btn--one:focus {
    background: #1b3d58 !important;
    color: #ffffff !important;
    border-color: #1b3d58 !important;
}

.werbeauf-mobile-menu__btn--one:hover,
body .werbeauf-mobile-menu__btn--one:hover,
a.werbeauf-mobile-menu__btn--one:hover {
    background: transparent !important;
    border-color: #1b3d58 !important;
    color: #1b3d58 !important;
}

.werbeauf-mobile-menu__btn--second,
body .werbeauf-mobile-menu__btn--second,
a.werbeauf-mobile-menu__btn--second,
.werbeauf-mobile-menu .werbeauf-mobile-menu__btn--second {
    background: transparent !important;
    color: #1b3d58 !important;
    border: 2px solid #1b3d58 !important;
}

.werbeauf-mobile-menu__btn--second:visited,
.werbeauf-mobile-menu__btn--second:active,
.werbeauf-mobile-menu__btn--second:focus,
body .werbeauf-mobile-menu__btn--second:visited,
body .werbeauf-mobile-menu__btn--second:active,
body .werbeauf-mobile-menu__btn--second:focus,
a.werbeauf-mobile-menu__btn--second:visited,
a.werbeauf-mobile-menu__btn--second:active,
a.werbeauf-mobile-menu__btn--second:focus {
    background: transparent !important;
    color: #1b3d58 !important;
    border-color: #1b3d58 !important;
}

.werbeauf-mobile-menu__btn--second:hover,
body .werbeauf-mobile-menu__btn--second:hover,
a.werbeauf-mobile-menu__btn--second:hover {
    background: #1b3d58 !important;
    color: #ffffff !important;
    border-color: #1b3d58 !important;
}

/* Social Icons */
.werbeauf-mobile-menu__social {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.werbeauf-mobile-menu__social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(27, 61, 88, 0.1);
    border-radius: 50%;
    color: #1b3d58;
    text-decoration: none;
}

.werbeauf-mobile-menu__social-icon:hover {
    background: #1b3d58;
    color: #ffffff;
}

.werbeauf-mobile-menu__social-icon svg {
    width: 18px;
    height: 18px;
}

body.menu-open {
    overflow: hidden;
}

/* ============================================================
RESPONSIVE: Tablet (max-width: 1300px) - Switch to mobile menu
============================================================ */

@media (max-width: 1300px) {
    .werbeauf-header {
        padding: 16px 0;
    }

    .werbeauf-header.header-sticky {
        padding: 8px 0;
    }

    .werbeauf-header__nav {
        display: none;
    }

    .werbeauf-header__hamburger {
        display: block;
    }

    .werbeauf-header__inner {
        grid-template-columns: 1fr auto 1fr;
    }

    .werbeauf-header__logo {
        justify-self: start;
    }

    .werbeauf-header__buttons {
        justify-self: end;
    }

    .werbeauf-header__logo img {
        max-height: 44px;
    }

    .werbeauf-header__logo img[src$=".svg"] {
        height: 44px;
    }

    .werbeauf-header__btn {
        padding: 10px 20px;
        font-size: 13px;
    }

    /* Mobile Menu bei 1300px */
    .werbeauf-mobile-menu__list>li>a {
        font-size: 16px;
    }

    .werbeauf-mobile-menu__list .sub-menu li a {
        font-size: 14px;
    }

    .werbeauf-mobile-menu__btn {
        font-size: 13px;
    }
}

/* ============================================================
RESPONSIVE: Large Mobile (max-width: 900px)
============================================================ */

@media (max-width: 980px) {
    .werbeauf-header__inner {
        grid-template-columns: 1fr auto 1fr;
        width: 100%;
        padding: 0 2.5rem;
        gap: 16px;
    }

    .werbeauf-header__btn {
        padding: 9px 16px;
        font-size: 12px;
    }

    .werbeauf-header__hamburger {
        width: 44px;
        height: 44px;
    }

    .werbeauf-mobile-menu__header {
        padding: 16px 20px;
    }

    .werbeauf-mobile-menu__content {
        padding: 20px;
    }

    .werbeauf-mobile-menu__footer {
        padding: 16px 20px 22px;
        padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    }

    /* Mobile Menu Font Sizes bei 980px */
    .werbeauf-mobile-menu__list>li>a {
        font-size: 16px;
        padding: 12px 16px;
    }

    .werbeauf-mobile-menu__list .sub-menu li a {
        font-size: 14px;
        padding: 9px 12px;
    }

    .werbeauf-mobile-menu__btn {
        font-size: 13px;
    }
}

/* ============================================================
RESPONSIVE: Mobile (max-width: 767px) - Icon buttons
============================================================ */

@media (max-width: 767px) {
    .werbeauf-header {
        padding: 14px 0;
    }

    .werbeauf-header__inner {
        padding: 0 1.5rem;
        gap: 12px;
    }

    /* Switch to icon buttons */
    .werbeauf-header__btn-text {
        display: none;
    }

    .werbeauf-header__btn-icon {
        display: flex;
    }

    .werbeauf-header__btn {
        padding: 10px;
        border-radius: 50%;
    }

    .werbeauf-header__buttons {
        gap: 8px;
    }

    .werbeauf-header__btn-icon svg {
        width: 18px;
        height: 18px;
    }

    .werbeauf-header__hamburger {
        width: 44px;
        height: 44px;
    }

    /* Mobile menu adjustments */
    .werbeauf-mobile-menu__header {
        padding: 14px 16px;
    }

    .werbeauf-mobile-menu__content {
        padding: 16px;
    }

    .werbeauf-mobile-menu__nav {
        max-width: 280px;
    }

    .werbeauf-mobile-menu__list>li>a {
        font-size: 15px;
        padding: 11px 14px;
    }

    .werbeauf-mobile-menu__list .sub-menu {
        padding: 8px 12px;
        max-width: 240px;
    }

    .werbeauf-mobile-menu__list .sub-menu li a {
        font-size: 13px;
        padding: 8px 10px;
    }

    .werbeauf-mobile-menu__footer {
        padding: 14px 16px 20px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        gap: 25px;
    }

    .werbeauf-mobile-menu__btn {
        padding: 11px 22px;
        font-size: 12px;
    }

    .werbeauf-mobile-menu__social-icon {
        width: 36px;
        height: 36px;
    }

    .werbeauf-mobile-menu__social-icon svg {
        width: 16px;
        height: 16px;
    }
}

/* ============================================================
RESPONSIVE: Small Mobile (max-width: 480px)
============================================================ */

@media (max-width: 480px) {
    .werbeauf-header {
        padding: 12px 0;
    }

    .werbeauf-header__btn {
        padding: 8px;
    }

    .werbeauf-header__btn-icon svg {
        width: 16px;
        height: 16px;
    }

    .werbeauf-header__hamburger {
        width: 44px;
        height: 44px;
    }

    .werbeauf-header__buttons {
        gap: 6px;
    }

    /* Mobile menu */
    .werbeauf-mobile-menu__header {
        padding: 12px 14px;
    }

    .werbeauf-mobile-menu__content {
        padding: 14px 12px;
    }

    .werbeauf-mobile-menu__nav {
        max-width: 260px;
    }

    .werbeauf-mobile-menu__list>li>a {
        font-size: 14px;
        padding: 10px 12px;
    }

    .werbeauf-mobile-menu__list .sub-menu {
        padding: 6px 10px;
        max-width: 220px;
        margin: 4px auto 10px;
    }

    .werbeauf-mobile-menu__list .sub-menu li a {
        font-size: 12px;
        padding: 7px 9px;
    }

    .werbeauf-mobile-menu__footer {
        padding: 12px 14px 18px;
        padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
        gap: 20px;
    }

    .werbeauf-mobile-menu__buttons {
        gap: 8px;
    }

    .werbeauf-mobile-menu__btn {
        padding: 10px 18px;
        font-size: 11px;
    }

    .werbeauf-mobile-menu__social {
        gap: 8px;
    }

    .werbeauf-mobile-menu__social-icon {
        width: 34px;
        height: 34px;
    }

    .werbeauf-mobile-menu__social-icon svg {
        width: 14px;
        height: 14px;
    }
}

/* ============================================================
RESPONSIVE: Extra Small Mobile (max-width: 360px)
============================================================ */

@media (max-width: 360px) {
    .werbeauf-header__logo img {
        max-height: 34px;
    }

    .werbeauf-header__logo img[src$=".svg"] {
        height: 34px;
    }

    .werbeauf-mobile-menu__logo img {
        max-height: 34px;
    }

    .werbeauf-mobile-menu__logo img[src$=".svg"] {
        height: 34px;
    }

    .werbeauf-header__btn {
        padding: 7px;
    }

    .werbeauf-header__btn-icon svg {
        width: 14px;
        height: 14px;
    }

    .werbeauf-header__hamburger {
        width: 44px;
        height: 44px;
    }

    .werbeauf-mobile-menu__header {
        padding: 10px 12px;
    }

    .werbeauf-mobile-menu__close {
        width: 38px;
        height: 38px;
    }

    .werbeauf-mobile-menu__close-icon {
        font-size: 20px;
    }

    .werbeauf-mobile-menu__list>li>a {
        font-size: 13px;
        padding: 9px 10px;
    }

    .werbeauf-mobile-menu__list .sub-menu li a {
        font-size: 11px;
    }

    .werbeauf-mobile-menu__btn {
        padding: 9px 16px;
        font-size: 10px;
    }

    .werbeauf-mobile-menu__social-icon {
        width: 30px;
        height: 30px;
    }

    .werbeauf-mobile-menu__social-icon svg {
        width: 12px;
        height: 12px;
    }
}

/* ============================================================
RESPONSIVE: Tiny Mobile (max-width: 265px) - No buttons
============================================================ */

@media (max-width: 265px) {
    .werbeauf-header__inner {
        grid-template-columns: 1fr auto;
    }

    .werbeauf-header__buttons {
        display: none;
    }

    .werbeauf-header__logo {
        justify-self: start;
    }

    .werbeauf-header__hamburger {
        justify-self: end;
        width: 40px;
        height: 40px;
    }
}

/* ============================================================
ADMIN BAR OFFSETS
============================================================ */

/* Desktop (above 782px): Admin bar is 32px fixed */
body.admin-bar .werbeauf-header.header-sticky {
    top: 32px !important;
}

body.admin-bar .werbeauf-mobile-menu {
    top: 32px !important;
    bottom: 0 !important;
    height: auto !important;
}

/* Tablet/Mobile (601px - 782px): Admin bar is 46px fixed */
@media (max-width: 782px) and (min-width: 601px) {
    body.admin-bar .werbeauf-header.header-sticky {
        top: 46px !important;
    }

    body.admin-bar .werbeauf-mobile-menu {
        top: 46px !important;
        bottom: 0 !important;
        height: auto !important;
    }
}

/* Small Mobile (600px and below): Admin bar scrolls with page (position: absolute) */
/* Both sticky header and mobile menu should be at top: 0 since admin bar scrolls away */
@media (max-width: 600px) {
    body.admin-bar .werbeauf-header.header-sticky {
        top: 0 !important;
    }

    body.admin-bar .werbeauf-mobile-menu {
        top: 0 !important;
        bottom: 0 !important;
        height: auto !important;
    }
}

/* ============================================================
iOS SPECIFIC SAFE AREA FIX
Uses env() which updates dynamically when iOS bar hides
============================================================ */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .werbeauf-mobile-menu__footer {
        padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
    }
}