body {position: relative;}
header.init:has( + #compare-header) {
    
    position: relative;
    z-index: 9999;
}

#compare-header {
    display: grid;
    grid-template-columns: 240px 1fr 240px;
    padding: 0;
    background-image: linear-gradient(180deg, #f9f9f9 74px, #aaaaaa22 75px, transparent 80px);
    position: relative;
    z-index: 1999;
    margin-bottom: -1rem;
}
#compare-header.scrolled {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
    background-color: hsla(200, 20%, 93%, 1);
    box-shadow: inset 0 0 10px 0 rgba(0, 0, 0, 0.1);
    padding-bottom: 0.5rem;
}

header.init nav {
    position: relative;
    z-index: 10000; /* Higher than header.init */
    transform: translateZ(0);
}

#contact-button {
    display: flex;
    justify-content: center;
    align-items: center;
}

#contact-button button {
    padding: 0.4rem 0.8rem;
    font-size: 0.92rem;
    border-radius: 6px;
    background-color: #49aec8;
    color: white;
    border: 3px solid #49aec8;
    transition: 100ms linear;
    cursor: pointer;
}
#contact-button button:hover {
    background-color: white;
    color: #49aec8;
}

#contact-button button span {
    display: inline-block;
}
#contact-button button span:nth-child(2) {
    display: none;
}
#contact-button.active button span:nth-child(2) {
    display: inline-block;
}
#contact-button.active button span:nth-child(1) {
    display: none;
}
#contact-button button span:nth-child(1) {
    display: inline-block;
}

#compare-header .compare-header-logo {
    grid-column: 1 / 2;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.0rem;
}

#compare-header .compare-header-logo a {
    width: 86px;
    height: 86px;
    margin-top: 8px;
    background-color: white;
    border: 3px solid white;
    border-radius: 43px;
    box-shadow: 0 2px 4px 0px rgba(0, 0, 0, 0.1);
}

#compare-header.scrolled .compare-header-logo a {
    width: 64px;
    height: 64px;
    margin-top: 2px;
    border-radius: 32px;
}
#compare-header.scrolled .compare-header-logo {
    width: 60px;
    margin-left: auto;
    margin-right: 1.5rem;
    margin-top: 0rem;
    /* margin-left: auto; */
}
#compare-header .compare-header-logo img {
    width: 80px;
    padding: 0rem;

}
#compare-header.scrolled .compare-header-logo img {
    width: 60px;
    padding: 0rem;
}
.compare-header-nav {
    grid-column: 2 / 3;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.1rem;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    line-height: 1.1;
}

@media (max-width: 1152px) {
    #compare-header {
        grid-template-columns: 0px 1fr 240px;
        padding-top: 0.5rem;
        background-color: #f9f9f9;
        background-image: none
    }
    #compare-header .compare-header-logo {
        display: none;
    }
}
.compare-header-nav a,
.compare-header-nav a:visited,
.compare-header-nav a:link {
    color: var(--text);
    font-size: 0.9rem;
    margin: 0;

    padding: 1.00rem 1rem;
    /* margin: 0.65rem 0.25rem; */

    background-color: transparent;

    transition: 0.3s ease-in-out;
    border-radius: 3px;
}
.compare-header-nav a:hover {
    color: white;
    font-size: 0.9rem;
    background-color: #49aec8;
}

@media (max-width: 1268px) {
    .compare-header-nav a,
    .compare-header-nav a:visited,
    .compare-header-nav a:link {
        padding: 0.5rem 0.7rem;
    }

}

#form {
    position: fixed;
	interpolate-size: allow-keywords;
    display: flex;
    flex-direction: column;
    top: 167px;
    height: 120px;
    right: 0;
    padding: 2rem;
    z-index: 2000;
    background-color: white;
    border-radius: 8px 0px 0px 8px;
    box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
    border-right: 3px solid var(--h-color);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: height 1s, opacity 0.5s;
    transition-delay: height 1s, opacity 0s;
}
#compare-header.scrolled + #form.active {
    top: 87px;
}

#form.active {
    height: auto;
    border-right: 8px solid var(--h-color);
    width: auto;
    opacity: 1;
    pointer-events: all;
}

#form .input {
    display: flex;
    flex-direction: column;
    margin: 0.5rem 0;
}
#form label {
    font-size: 0.8rem;
    color: #616161;
}

#form label:has(+ :focus-visible) {
    color: var(--h-color);
}
#form input {
    border: 0;
    border-bottom: 1px solid #e9e9e9;
}
#form input:focus-visible {
    outline: none;
    border-bottom: 1px solid var(--h-color);
}
#form input[type="datetime-local"] {
    font-size: 0.95em;
}
#form button {
    border-color: var(--h-color);
    color: var(--h-color);
    transition: all 0.3s;
}
#form button:hover {
    background-color: var(--h-color);
    color: white;
}

.req {
    color: red;
    font-size: inherit;
}
legend {
    font-size: 0.8rem;
    font-weight: normal;
    color: #616161;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    #compare-header.scrolled + #form.active,
    form#form {
        top: 127px;
    }
    .compare-header-nav a,
    .compare-header-nav a:visited,
    .compare-header-nav a:link {
        padding: 0.25rem 0.37rem;
    }

    .compare-header-nav {
        grid-column: 1 / -1;
        gap: 0rem 0.5rem;
        grid-column: 1 / 2;
    }
    #compare-header {
        grid-template-columns: 1fr 156px;
    }
    #compare-header .compare-header-logo {
        display: none;
    }
    #contact-button {
        margin-top: 0rem;
        grid-column: 2 / 3;
        margin-right: 1rem;
    }
}
