header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;

    #headerTopContainer {
        background-color: var(--primaryColor);

        .headerTopFirstContainer {
            padding: 1rem;
            text-align: center;

            .customerDisplayName {
                text-transform: uppercase;
                font-size: 0.8rem;
                color: white;

                @media (min-width: 1024px) {
                    font-size: 1rem;
                } 
            }
        }
        
        .headerTopSecondContainer {
            padding: 0.5rem;
            display: flex;
            align-items: center;

            img {
                width: 20px;
                filter :invert(100%); 
                cursor: pointer;

                @media (min-width: 1024px) {
                    width: 40px;
                } 
            }

            #headerItemsContainer {
                display: flex;
                gap: 1rem;
                margin-left: auto;

                .accessToPersonalizedSpace, .logoutBtn, .showPriceBtn, .cartOpenerContainer, .burgerMenuIconContainer, .connection {
                    text-decoration: none;
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    justify-content: center;
                    gap: 0.5rem;

                    .headerLinkHint {
                        display: none;
                        font-size: 0.7rem;
                        color: white;
                        text-align: center;

                        @media (min-width: 1024px) {
                            display: block;
                        } 
                    }
                }

                .accessToPersonalizedSpace {
                    position: relative;

                    .passwordWarningBadge {
                        position: absolute;
                        top: -0.25rem;
                        right: -0.5rem;
                        display: inline-flex;
                        align-items: center;
                        justify-content: center;
                        width: 25%;
                        height: 25%;
                        border-radius: 100%;
                        background-color: indianred;
                        padding: 0.4rem;

                        @media (min-width: 1024px) {
                            padding: 0.75rem;
                            top: 0;
                            right: 0; 
                        } 

                        img {
                            width: 6px;

                            @media (min-width: 1024px) {
                                width: 12px;
                            } 
                        }
                    }
                }
                
                .connection {
                    margin-left: auto;
                }

                .showPriceBtn {
                    position: relative;
                }

                .crossedOutEuro {
                    &::after {
                        content: "";
                        position: absolute;
                        width: 100%;
                        height: 1px;
                        background-color: indianred;
                        top: 50%;
                        left: 50%;
                        transform: translate(-50%, -50%) rotate(-20deg);
                        pointer-events: none;

                        @media (min-width: 1024px) {
                            width: 75%;
                            top: 25%;
                            height: 2px;
                        } 
                    }
                }

                .cartOpenerContainer {
                    position: relative;
                    
                    #cartOpener {
                        position: relative;
                        display: flex;
                        justify-content: center;
                        width: fit-content;
                        cursor: pointer;

                        #cartNumber {
                            position: absolute;
                            top: 30%;
                            right:40%;
                            font-size: 0.4rem;
                            transform: translate(50%);
                            font-weight: bold;
                            color: white;

                            @media (min-width: 1024px) {
                                right:45%;
                                font-size: 0.8rem;
                            } 
                        }
                    }
                }
            }
    
            #otherPageLinkContainer {
                display: none;
                align-items: center;
                background-color: var(--primaryColor);
                position: absolute;
                top: 0;
                right: 0;
                width: 100%;
                z-index: 10000;
                padding: 1rem;
                flex-direction: column;
                box-shadow: var(--boxShadow);
    
                #headerBurgerMenuCloser {
                    color: white;
                    font-size: 2rem;
                    padding: 0 0.5rem;
                    margin-left: auto;
                    cursor: pointer;
                }
    
                .otherPageLinkContainerItem {
                    list-style: none;
                    margin-left: auto;
                    padding: 0.5rem;
                    
                    a {
                        color: white;
                        text-decoration: none;
                        text-transform: uppercase;
                        font-size: 0.7rem;
                        transition: 0.3s;

                        @media (min-width: 1024px) {
                            font-size: 1rem;

                            &:hover {
                                color: #004eb4;
                                transition: 0.3s;
                            }
                        } 
                    }
                }
            }
    
            .burgerMenuIsOpen {
                display: flex !important;
            }
        }
    }
    
    #headerMainContainer {
        display: flex;
        position: relative;
        flex-direction: column;

        @media (min-width: 1600px) {
            gap: 0;
            padding: 1rem;
            align-items: center;
            justify-content: space-around;
            flex-direction: row;
            padding: 2rem;
        }
        
        #otherLinkContainer {
            position: absolute;
            top: 0;
            left: 0;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            padding: 0.5rem;

            li {
                list-style: none;
                font-size: 0.75rem;

                a {
                    color: #232F3E;
                    text-decoration: none;
                }
            }
        }

        .logoContainer {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            width: var(--fit);
            align-items: center;

            a {
                margin-right: auto;
            }

            #logo {
                width: 200px;
                margin-right: auto;
                margin-left: 1rem;
                
                @media (min-width: 768px) {
                    margin-left: 0;
                }     
                
                @media (min-width: 1024px) {
                    width: 260px;
                } 
            }
            
            h2 {
                margin-right: auto;
                text-transform: uppercase;
                color: #232F3E;
                font-size: 0.8rem;
                margin-left: 1.25rem;
                
                @media (min-width: 768px) {
                    font-size: 0.9rem;
                    margin: 0;
                }  
            }
        }

        .searchBar {
            position: relative;
            display: flex;
            gap: 0;
            border-radius: 0.25rem;
            border: none;
            box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.6);
            width: fit-content;
            margin: 2rem auto;

            @media (min-width: 1600px) {
                margin : 0;
            }  

            #searchForm {
                display: flex;
                
                @media (min-width: 1024px) {
                    width: 400px;
                }

                @media (min-width: 1600px) {
                    width: 500px;
                }

                #searchInput {
                    flex: 1;
                    font-weight: bolder;
                    padding: 0.5rem;
                    border: none;
                    border-bottom: black 1px solid;
                    border-left: black 1px solid;
                    border-top: black 1px solid;
                    border-top-left-radius: 0.25rem;
                    border-bottom-left-radius: 0.25rem;
                    font-size: 0.7rem;

                    @media (min-width: 768px) {
                        font-size: 1rem;
                    }  
                }

                #searchBtn {
                    text-transform: uppercase;
                    font-weight: bolder;
                    padding: 0.5rem;
                    color: white;
                    background-color: #002B5C;                    
                    border: none;
                    border-bottom: black 1px solid;
                    border-right: black 1px solid;
                    border-top: black 1px solid;
                    border-top-right-radius: 0.25rem;
                    border-bottom-right-radius: 0.25rem;
                    font-size: 0.6rem;
                    
                    @media (min-width: 1024px) {
                        transition: 0.3s;
                        font-size: 1rem;
                        
                        &:hover {
                            cursor: pointer;
                            transition: 0.3s;
                            background-color: #004eb4;
                        }
                    } 
                }
            }

            .search-dropdown {
                display: none;
                position: absolute;
                top: 100%;
                left: 0;
                right: 0;
                background: white;
                border: none;
                border-bottom-left-radius: 0.25rem;
                border-bottom-right-radius: 0.25rem;
                box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.6);
                max-height: 420px;
                overflow: auto;
                z-index:  10000;
                flex-direction: column;
                gap: 0.5rem;
                padding: 0.5rem;

                .searchTitle {
                    padding: 0.5rem;
                    font-size: 0.8rem;
                    color: #232F3E;
                    background: #fefefe;
                    border-bottom: 1px solid #f3f4f6;
                    font-weight: bold;
                }

                .search-item {
                    display: flex;
                    align-items: center;
                    gap: 0.75rem;
                    padding: 0.5;
                    border-bottom: 1px solid #f3f4f6;
                    text-decoration: none;
                    color: #004eb4;

                    small {
                        color: #6b7280;
                    }   

                    .badge {
                        font-size: .7rem;
                        background: #eef2ff;
                        color: #3730a3;
                        border: 1px solid #c7d2fe;
                        border-radius : 0.25rem;
                        padding: 0.35rem;
                    }

                    &:last-child {
                        border-bottom: 0;
                    }

                    &:hover {
                        background: #f9fafb;
                    }
                }
            }

            .search-dropdown.visible {
                display: flex;
            }
        }
    }

    #headerMainNav {
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #232F3E;
        position: relative;

        #mainNav {
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative; 
            width: 100%;

            #navMenu {
                display: flex;
                list-style: none;
                text-align: center;
                align-items: center;

                .navItem {
                    position: relative;
                    text-decoration: none;

                    .navCategory, .fullCatalogAcces {
                        display: block;
                        padding: 0.5rem;
                        text-decoration: none;
                        color: #fff;
                        font-weight: bold;
                        text-transform: uppercase;
                        font-size: 0.6rem;

                        @media (min-width: 764px) {
                            font-size: 0.8rem;
                        }

                        @media (min-width: 1024px) {
                            font-size: 1rem;
                            padding: 1rem;
                        }
                    }
                }
            }

            .megaMenu {
                position: absolute;
                top: 100%;
                left: 0;
                right: 0;
                background: #fff;
                border-right: 2px solid #333;
                border-bottom: 2px solid #333;
                border-left: 2px solid #333;
                border-bottom-right-radius: 0.25rem;
                border-bottom-left-radius: 0.25rem;
                z-index: 100000000;
                display: none;
                justify-content: space-around;
                white-space: nowrap;
                justify-content: left;
                width: fit-content;
                margin: auto;

                .columnContainer {
                    display: flex;
                    flex-direction: column;
                    text-align: left;
                    width: 100%;

                    @media (min-width: 1024px) {
                        flex-direction: row;
                    }

                    h4 {
                        color: #002B5C;
                        text-transform: uppercase;
                        font-size: 0.6rem;
                        padding: 0.5rem;

                        @media (min-width: 764px) {
                            font-size: 0.8rem;
                        }

                        @media (min-width: 1024px) {
                            font-size: 1rem;
                        }
                    }

                    .megaColumn {
                        border-bottom: solid #caca 1px;
                        width: 100%;

                        @media (min-width: 1024px) {
                            border-bottom: none;
                            border-right: solid #caca 1px;
                        }

                        &:last-child {
                            border: none;
                        }

                        ul {
                            display: flex;
                            flex-direction: column;
                            gap: 0.75rem;
                            font-size: 0.8rem;

                            @media (min-width: 764px) {
                                font-size: 0.8rem;
                            }

                            @media (min-width: 1024px) {
                                font-size: 1rem;
                            }

                            li {
                                list-style: none;
                                text-transform: none;
                                padding: 0.25rem;

                                a {
                                    color: black;
                                    text-decoration: none;
                                    font-size: 0.6rem;
                                    margin-left: 0.5rem;

                                    @media (min-width: 764px) {
                                        font-size: 0.8rem;
                                    }

                                    @media (min-width: 1024px) {
                                        font-size: 1rem;
                                    }
                                }
                            }
                        }
                    }
                }
            }

            .isOpen { 
                display: flex; 
            }
        }
    }
}