/* ==========================================
1. DIVI THEME BUILDER CLEANUP
========================================== */
#wp-admin-bar-top-secondary {
    display: none !important;
}

/* DIVI BUILDER COMPATIBILITY - Hide custom header when Divi Builder is active */
.et_fb #thecottage-header,
.et-fb #thecottage-header,
.et_fb .cottage-mobile-overlay,
.et-fb .cottage-mobile-overlay,
.et_fb .cottage-desktop-overlay,
.et-fb .cottage-desktop-overlay {
    display: none !important;
}

#thecottage-header {
    position: relative;
    width: 100%;
    z-index: 999999;
    background-color: #ffffff;
}

#thecottage-header .header-container {
    max-width: 1400px;
    width: 90%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 1000003;
    transition: all 0.3s ease;
}

/* Hamburger → X Animation */
.header-hamburger-menu.active .header-hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.header-hamburger-menu.active .header-hamburger-line:nth-child(2) {
    opacity: 0;
}

.header-hamburger-menu.active .header-hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Button Press Effect */
.header-hamburger-menu:active {
    transform: scale(0.95);
}

.header-hamburger-line {
    width: 100%;
    background-color: #536378;
    height: 3px;
    border-radius: 5px;
}

/* ==========================================
SCROLLBAR DESIGN FÜR OVERLAYS
========================================== */

.cottage-mobile-overlay-nav,
.cottage-desktop-overlay-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) #495e77;
}

.cottage-mobile-overlay-nav::-webkit-scrollbar,
.cottage-desktop-overlay-content::-webkit-scrollbar {
    width: 6px;
}

.cottage-mobile-overlay-nav::-webkit-scrollbar-track,
.cottage-desktop-overlay-content::-webkit-scrollbar-track {
    background: #495e77;
}

.cottage-mobile-overlay-nav::-webkit-scrollbar-thumb,
.cottage-desktop-overlay-content::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    border: 1px solid #495e77;
}

.cottage-mobile-overlay-nav::-webkit-scrollbar-thumb:hover,
.cottage-desktop-overlay-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

@media screen and (max-width: 980px) {

    /* HIDE DESKTOP ELEMENTS */
    .desktop-header-nav,
    .header-container-transparent,
    .cottage-desktop-overlay,
    .header-logo-standard {
        display: none;
    }

    /* LOGO */
    .header-logo-small {
        height: 35px;
        width: auto;
        display: block;
        transition: all 0.3s ease;
    }

    .header-logo-small:hover {
        filter: drop-shadow(0 0 8px rgba(201, 160, 80, 0.4));
        transform: scale(1.02);
    }

    /* MOBILE MENU */
    #thecottage-header {
        padding: 10px 0;
    }

    #thecottage-header .header-container {
        width: 100%;
        padding: 0 2.5rem;
    }

    .header-logo-wrapper {
        flex: 1;
        order: 1;
        justify-content: flex-start;
    }

    .header-hamburger-wrapper {
        flex: 1;
        order: 2;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-header-button-wrapper {
        flex: 1;
        order: 3;
        justify-content: flex-end;
        display: flex;
        align-items: center;
    }

    .header-hamburger-menu {
        width: 25px;
        height: 25px;
        margin: 0px;
        transition: all 0.3s ease;
    }

    .header-hamburger-menu:hover {
        transform: scale(1.05);
    }

    .mobile-header-action-button {
        background-color: #495e77;
        color: #ffffff;
        padding: .7em 1.5em;
        font-weight: 700;
        line-height: 1.4em;
        text-decoration: none;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        pointer-events: auto;
        border-radius: 12px;
        font-size: 14px;
        display: inline-block;
        margin: 0;
        box-shadow:
            0 4px 6px rgba(73, 94, 119, 0.05),
            0 15px 35px rgba(73, 94, 119, 0.12);
    }

    /* STICKY STYLES */
    #thecottage-header.sticky {
        padding: 5px 0;
        position: fixed;
        background: rgba(255, 255, 255, 0.85);
        border: 1px solid rgba(255, 255, 255, 0.8);
        box-shadow: 20px 25px 50px rgba(73, 94, 119, 0.12);
    }

    .cottage-mobile-overlay {
        position: fixed;
        inset: 0;
        z-index: 1000004;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        display: none;
    }

    .cottage-mobile-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        display: block;
    }

    .cottage-mobile-overlay-container {
        position: relative;
        width: 100%;
        height: 100%;
        background-color: #495e77;
        display: flex;
        flex-direction: column;
        z-index: 1000005;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .cottage-mobile-overlay.active .cottage-mobile-overlay-container {
        transform: translateX(0);
        animation: overlayFadeIn 0.4s ease-out;
    }

    .cottage-mobile-overlay-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px 25px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.3);
        background-color: #495e77;
        position: relative;
        z-index: 1000006;
    }

    .cottage-mobile-overlay-logo img {
        height: 35px;
        width: auto;
        filter: brightness(0) invert(1);
    }

    .cottage-mobile-overlay-close {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.4);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow:
            0 4px 6px rgba(73, 94, 119, 0.05),
            0 15px 35px rgba(73, 94, 119, 0.12);
        transition: all 0.3s ease;

        border-radius: 50%;
        width: 40px;
        height: 40px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 30px;
        color: #fff;
        line-height: 1;
        padding: 0;
    }

    .cottage-mobile-overlay-close:hover {
        background: #ffffff !important;
        color: #495E77 !important;
        transform: scale(1.05);
        box-shadow:
            0 4px 6px rgba(73, 94, 119, 0.05),
            0 15px 35px rgba(73, 94, 119, 0.12);
    }

    .cottage-mobile-overlay-close:focus {
        outline: 2px solid #ffffff;
        outline-offset: 3px;
    }

    .cottage-mobile-overlay-nav {
        flex: 1;
        overflow-y: auto;
        max-height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 20px 5%;
        width: 100%;
    }

    .cottage-mobile-nav-list li:not(:last-child) {
        margin-bottom: 10px;
    }

    .cottage-mobile-nav-list {
        width: 100%;
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .cottage-mobile-nav-list li {
        width: 100%;
        margin-bottom: 10px;
    }

    .cottage-mobile-nav-list li a {
        color: #ffffff;
        text-decoration: none;
        text-align: center;
        font-size: 16px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        display: block;
        padding: 10px;
        cursor: pointer;
        width: 100%;
        box-sizing: border-box;
        opacity: 0;
        transform: translateY(-20px);
        animation: slideInDown 0.3s ease forwards;
    }

    .cottage-mobile-nav-list li:nth-child(1) a {
        animation-delay: 0.05s;
    }

    .cottage-mobile-nav-list li:nth-child(2) a {
        animation-delay: 0.1s;
    }

    .cottage-mobile-nav-list li:nth-child(3) a {
        animation-delay: 0.15s;
    }

    .cottage-mobile-nav-list li:nth-child(4) a {
        animation-delay: 0.2s;
    }

    .cottage-mobile-nav-list li:nth-child(5) a {
        animation-delay: 0.25s;
    }

    .cottage-mobile-nav-list li:nth-child(6) a {
        animation-delay: 0.3s;
    }

    .cottage-mobile-nav-list li:nth-child(7) a {
        animation-delay: 0.35s;
    }

    .cottage-mobile-nav-list li:nth-child(8) a {
        animation-delay: 0.4s;
    }

    .cottage-mobile-nav-list li:nth-child(9) a {
        animation-delay: 0.45s;
    }

    .cottage-mobile-nav-list li:nth-child(10) a {
        animation-delay: 0.5s;
    }

    .cottage-mobile-nav-list li:nth-child(11) a {
        animation-delay: 0.55s;
    }

    .cottage-mobile-nav-list li:nth-child(12) a {
        animation-delay: 0.6s;
    }

    .cottage-mobile-nav-list li:nth-child(13) a {
        animation-delay: 0.65s;
    }

    .cottage-mobile-nav-list li:nth-child(14) a {
        animation-delay: 0.7s;
    }

    .cottage-mobile-nav-list li:nth-child(15) a {
        animation-delay: 0.75s;
    }

    .cottage-mobile-nav-list li:nth-child(16) a {
        animation-delay: 0.8s;
    }

    .cottage-mobile-nav-list li:nth-child(17) a {
        animation-delay: 0.85s;
    }

    .cottage-mobile-nav-list li:nth-child(18) a {
        animation-delay: 0.9s;
    }

    .cottage-mobile-nav-list li:nth-child(19) a {
        animation-delay: 0.95s;
    }

    .cottage-mobile-nav-list li:nth-child(20) a {
        animation-delay: 1s;
    }

    /* SUBMENU */
    .cottage-mobile-nav-list .sub-menu {
        display: none;
        list-style: none;
        padding: 20px;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.4);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 10px;
        margin: 20px 0;
    }

    .cottage-mobile-nav-list .sub-menu li:not(:last-child) {
        margin-bottom: 0px;
    }

    .cottage-mobile-nav-list .sub-menu li a::before {
        content: '→';
        display: inline-block;
        margin-right: 10px;
        font-size: 14px;
        font-weight: bold;
        vertical-align: middle;
    }

    .cottage-mobile-nav-list .sub-menu li a,
    .cottage-mobile-nav-list .sub-menu li a:link,
    .cottage-mobile-nav-list .sub-menu li a:visited,
    .cottage-mobile-nav-list .sub-menu li a:hover,
    .cottage-mobile-nav-list .sub-menu li a:focus,
    .cottage-mobile-nav-list .sub-menu li a:active {
        padding: 10px 20px;
        font-size: 14px;
        letter-spacing: 0.03em;
        font-weight: 400;
        width: 100%;
        margin: 0;
        display: block;
        box-sizing: border-box;
        text-decoration: none;
        color: #ffffff;
        background: transparent;
        border: none;
        outline: none;
        border-radius: 10px;
        transition: all 0.2s ease;
    }

    .cottage-mobile-nav-list .sub-menu li a:hover {
        background: #ffffff !important;
        color: #495E77 !important;
    }

    .cottage-mobile-nav-list li.menu-item-has-children.open .sub-menu {
        display: block;
    }

    .cottage-mobile-nav-list .wpml-ls-flag {
        display: block;
        margin: 0 auto;
        width: 25px;
        object-fit: contain;
    }

    .cottage-mobile-overlay-footer {
        padding: 20px 25px;
        border-top: 1px solid rgba(255, 255, 255, 0.3);
        text-align: center;
    }

    .cottage-booking-button {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.4);
        color: #fff;
        line-height: 1.4em;
        padding: .7em 2.1em;
        text-decoration: none;
        cursor: pointer;
        border-radius: 12px;
        font-weight: 700;
        font-size: 15px;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        pointer-events: auto;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        transition: all 0.3s ease;
        box-shadow:
            0 4px 6px rgba(73, 94, 119, 0.05),
            0 15px 35px rgba(73, 94, 119, 0.12);
    }

    .cottage-booking-button:hover {
        background: #ffffff !important;
        color: #495E77 !important;
    }

    .cottage-booking-button:focus {
        outline: 2px solid #ffffff;
        outline-offset: 3px;
    }

}

@media screen and (max-width: 767px) {
    #thecottage-header .header-container {
        padding: 0 1.5rem;
    }

    .mobile-header-action-button {
        font-size: 13px;
    }

    .cottage-mobile-nav-list li a {
        font-size: 15px;
    }

    .cottage-mobile-nav-list .sub-menu li a::before {
        font-size: 13px;
    }

    .cottage-mobile-nav-list .sub-menu li a,
    .cottage-mobile-nav-list .sub-menu li a:link,
    .cottage-mobile-nav-list .sub-menu li a:visited,
    .cottage-mobile-nav-list .sub-menu li a:hover,
    .cottage-mobile-nav-list .sub-menu li a:focus,
    .cottage-mobile-nav-list .sub-menu li a:active {
        font-size: 13px;
    }

    .cottage-booking-button {
        font-size: 14px;
    }
}

@media screen and (min-width: 981px) {

    /* HIDE MOBILE ELEMENTS */
    .cottage-mobile-overlay,
    .mobile-header-action-button,
    .menu-items-desktop ul.sub-menu {
        display: none;
    }

    /* LOGO */
    .header-logo-standard,
    .header-logo-small {
        width: auto;
        height: 60px;
        display: block;
    }

    .header-logo-small {
        display: none;
    }

    /* DESKTOP MENU */
    #thecottage-header {
        padding: 10px 0;
    }

    .desktop-header-nav {
        display: block;
    }

    .header-logo-wrapper {
        order: 1;
        justify-content: flex-start;
    }

    .desktop-header-nav-wrapper {
        order: 2;
        flex: 1;
        justify-content: flex-end;
        display: flex;
        align-items: center;
    }

    .header-hamburger-wrapper {
        order: 3;
        justify-content: flex-end;
    }

    .menu-items-desktop {
        display: flex;
        list-style: none;
        gap: 35px;
        margin: 0;
        padding: 0;
        align-items: center;
    }

    .menu-items-desktop>li {
        position: relative;
        padding: 20px 0;
    }

    .menu-items-desktop>li>a {
        text-decoration: none;
        color: #536378;
        font-weight: 700;
        font-size: 16px;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .menu-items-desktop .current-menu-item>a {
        text-decoration: underline;
        text-underline-offset: 20px;
        text-decoration-thickness: 6px;
    }

    .menu-items-desktop>li:hover>a {
        opacity: 0.9;
    }

    .header-hamburger-menu {
        width: 27px;
        height: 27px;
        margin-left: 35px;
    }

    /* TRANSPARENT BAR */
    .header-container-transparent {
        max-width: 1400px;
        width: 90%;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
    }

    .transparent-left-container {
        background-color: #fff;
        display: none;
        align-items: center;
        gap: 20px;
        padding: 15px 20px;
        border-radius: 0 0 12px 12px;
        box-shadow:
            0 4px 6px rgba(73, 94, 119, 0.05),
            0 15px 35px rgba(73, 94, 119, 0.12);
    }

    .transparent-logo-small {
        height: 35px;
        width: auto;
    }

    .scroll-to-top-hamburger-menu-icon {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 30px;
        background: none;
        border: none;
        cursor: pointer;
        margin: 0;
        padding: 0;
        position: relative;
        z-index: 1000003;
    }

    .scroll-to-top-hamburger-menu-icon .scroll-to-top-hamburger-line {
        width: 100%;
        height: 4px;
        background-color: #536378;
        border-radius: 5px;
    }

    .transparent-right-container {
        display: flex;
        align-items: center;
        margin-left: auto;
        opacity: 1;
        transition: opacity 0.1s ease-out;
    }

    #thecottage-header.sticky .header-container-transparent .transparent-right-container {
        opacity: 1;
    }

    .desktop-booking-button {
        background-color: #495e77;
        color: #ffffff;
        line-height: 1.4em;
        padding: .7em 2.1em;
        font-weight: 700;
        font-size: 17px;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        pointer-events: auto;
        border-radius: 0 0 12px 12px;
        box-shadow:
            0 4px 6px rgba(73, 94, 119, 0.05),
            0 15px 35px rgba(73, 94, 119, 0.12);
    }

    /* STICKY STYLES */
    .admin-bar #thecottage-header.sticky .header-container-transparent {
        top: 32px;
        animation: stickySlideDown 0.4s ease-out;
    }

    #thecottage-header.sticky .header-container-transparent {
        position: fixed;
        top: 0;
        z-index: 1000002;
        animation: stickySlideDown 0.4s ease-out;
    }

    #thecottage-header.sticky .header-container-transparent .transparent-left-container {
        display: flex;
        animation: overlayFadeIn 0.1s ease-out 0.05s both;
    }

    #thecottage-header.sticky .header-container-transparent .transparent-right-container {
        animation: overlayFadeIn 0.1s ease-out 0.1s both;
    }

    /* DESKTOP OVERLAY */
    .cottage-desktop-overlay {
        position: fixed;
        inset: 0;
        z-index: 1000004;
        opacity: 0;
        visibility: hidden;
        transition: 0.4s;
        pointer-events: none;
        display: none;
    }

    .cottage-desktop-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        display: block;
    }

    .cottage-desktop-overlay .cottage-desktop-overlay-container {
        position: relative;
        width: 100%;
        height: 100%;
        background: #495e77;
        display: flex;
        flex-direction: column;
        z-index: 1000005;
    }

    .cottage-desktop-overlay .cottage-desktop-overlay-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px 50px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.3);
        position: relative;
        z-index: 1000006;
    }

    .cottage-desktop-overlay .cottage-desktop-overlay-logo {
        flex-shrink: 0;
    }

    .cottage-desktop-overlay .cottage-desktop-overlay-logo img {
        height: 60px;
        width: auto;
        filter: brightness(0) invert(1);
    }

    .cottage-desktop-overlay .cottage-desktop-overlay-close {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.4);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow:
            0 4px 6px rgba(73, 94, 119, 0.05),
            0 15px 35px rgba(73, 94, 119, 0.12);
        transition: all 0.3s ease;

        border-radius: 50%;
        width: 50px;
        height: 50px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 40px;
        color: #fff;
        line-height: 1;
        padding: 0;
    }

    .cottage-desktop-overlay .cottage-desktop-overlay-close:hover {
        background: #ffffff !important;
        color: #495E77 !important;
        transform: scale(1.1);
        box-shadow:
            0 4px 6px rgba(73, 94, 119, 0.05),
            0 15px 35px rgba(73, 94, 119, 0.12);
    }

    .cottage-desktop-overlay .cottage-desktop-overlay-close:focus {
        outline: 2px solid #ffffff;
        outline-offset: 3px;
    }

    .cottage-desktop-overlay .cottage-desktop-overlay-content {
        flex: 1;
        padding: 50px;
        overflow-y: auto;
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
        gap: 50px;
    }

    .cottage-desktop-overlay .cottage-desktop-overlay-wrapper {
        flex: 1;
    }

    .cottage-desktop-overlay-menu {
        flex: 0 0 auto;
        width: auto;
        padding: 0;
    }

    .desktop-overlay-nav-menu {
        display: flex;
        flex-direction: column;
        list-style: none;
        margin: 0;
        padding: 0;
        gap: 35px;
        justify-content: flex-start;
        align-items: flex-start;
    }

    .desktop-overlay-nav-menu li a {
        color: #ffffff;
        text-decoration: none;
        font-size: 18px;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        padding: 0;
    }

    .desktop-overlay-nav-menu-second {
        display: flex;
        flex-direction: column;
        list-style: none;
        margin: 50px 0 0 0;
        padding: 0;
        gap: 35px;
        justify-content: flex-start;
        align-items: flex-start;
    }

    .desktop-overlay-nav-menu-second li a {
        color: #ffffff;
        text-decoration: none;
        font-size: 18px;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        padding: 0;
    }
}

@media screen and (min-width: 1151px) {
    .header-logo-standard {
        display: block;
    }

    .header-logo-small {
        display: none;
    }
}

/* ANIMATIONS */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media screen and (min-width: 981px) and (max-width: 1150px) {
    .header-logo-standard {
        display: none;
    }

    .header-logo-small {
        display: block;
    }
}