#footer.footer:has(.s1-footer-directory) {
    padding: 0;
    background: #101c34;
    color: #fff;
    text-align: start;
}

#footer.footer:has(.s1-footer-directory) > .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 1.15rem;
    width: 100%;
    max-width: 82rem;
    margin: 0 auto;
    padding: 0 clamp(1.625rem, 4vw, 3.625rem) 1.1rem;
}

/* Lift the directory and the native locale button into the same layout. */
#footer .container > .list-inline:has(.s1-footer-directory) {
    display: contents;
}

#footer .s1-footer-directory {
    display: grid;
    grid-template-columns: minmax(13rem, 1.32fr) minmax(7.8rem, .75fr) minmax(8.75rem, .82fr) minmax(19.375rem, 1.65fr);
    gap: clamp(1.25rem, 3vw, 3rem);
    align-items: start;
    flex: 0 0 100%;
    padding: 2.375rem 0 1.875rem;
    margin: 0 0 1rem;
    border-bottom: 1px solid #ffffff26;
    text-align: start;
}

#footer .s1-footer-brand {
    padding-top: .45rem;
}

#footer .s1-footer-brand > a {
    display: inline-block;
}

#footer .s1-footer-brand img {
    display: block;
    width: clamp(11.75rem, 15vw, 14.0625rem);
    max-width: 100%;
    height: auto;
}

#footer .s1-footer-brand p {
    max-width: 24ch;
    margin: .95rem 0 0;
    color: #bac4d4;
    font-size: 1rem;
    line-height: 1.5;
}

#footer .s1-footer-social {
    margin: .6rem 0 0;
}

#footer .s1-footer-social:not(:has(li)) {
    display: none;
}

#footer .s1-footer-links {
    padding-top: .3rem;
}

#footer .s1-footer-links h2 {
    margin: 0 0 .625rem;
    color: #fff;
    font-size: 1.04rem;
    font-weight: 730;
    letter-spacing: -.016em;
}

#footer .s1-footer-links ul {
    display: grid;
    gap: .44rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

#footer .s1-footer-links a {
    display: inline-block;
    padding: 0;
    color: #c6cfde;
    font-size: .94rem;
    line-height: 1.5;
    text-decoration: none;
}

#footer .s1-footer-links a:hover {
    color: white;
    text-decoration: underline;
    text-underline-offset: .2em;
}

#footer .s1-footer-help {
    isolation: isolate;
    position: relative;
    overflow: hidden;
    align-self: stretch;
    min-height: 9.625rem;
    border-radius: .75rem;
    background: linear-gradient(111deg, #fff9ee 12%, #fff4df 64%, #f9dfb2);
    color: #111b33;
}

#footer .s1-footer-copy {
    position: relative;
    z-index: 1;
    width: 60%;
    padding: 1.1875rem 0 1.125rem 1.3125rem;
}

#footer .s1-footer-help h2 {
    margin: 0;
    color: #111b33;
    font-size: clamp(1.4rem, 1.65vw, 1.7rem);
    font-weight: 800;
    letter-spacing: -.044em;
    line-height: 1.14;
}

#footer .s1-footer-help p {
    max-width: 18ch;
    margin: .375rem 0 0;
    color: #49526a;
    font-size: .87rem;
    font-weight: 485;
    line-height: 1.35;
}

#footer .s1-footer-help img {
    position: absolute;
    bottom: 0;
    right: -.4375rem;
    width: 47%;
    height: auto;
    pointer-events: none;
}

#footer .s1-footer-button {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 2.32rem;
    margin-top: .875rem;
    padding: .5rem .75rem;
    border-radius: .375rem;
    background: #c91020;
    color: #fff;
    font-size: .84rem;
    font-weight: 720;
    line-height: 1.3;
    text-decoration: none;
}

#footer .s1-footer-button:hover {
    color: white;
    background: #a50d1a;
}

/* The parent supplies the copyright, any configured terms and locale modal. */
#footer:has(.s1-footer-directory) .copyright {
    order: 1;
    margin: 0;
    color: #b5c0d2;
    font-size: .81rem;
    text-align: start;
    line-height: 1.4;
}

#footer:has(.s1-footer-directory) .container > .nav {
    order: 2;
    margin: 0 !important;
}

#footer:has(.s1-footer-directory) .container > .nav .nav-item:has(a[href$="/contact.php"]) {
    display: none;
}

#footer:has(.s1-footer-directory) .container > .nav .nav-link {
    padding: .35rem 0;
    color: #c6cfde;
    font-size: .81rem;
}

#footer:has(.s1-footer-directory) .container > .list-inline > .list-inline-item {
    order: 3;
    margin-inline-start: auto;
}

#footer:has(.s1-footer-directory) [data-target="#modalChooseLanguage"] {
    min-height: 2.2rem;
    margin: 0;
    padding: .375rem .625rem;
    border: 1px solid #7689a166;
    border-radius: .375rem;
    background: #ffffff07;
    color: #e2e8f2;
    font-size: .8rem;
    font-weight: 550;
}

#footer:has(.s1-footer-directory) [data-target="#modalChooseLanguage"]:hover {
    background-color: #ffffff15;
}

#footer:has(.s1-footer-directory) [data-target="#modalChooseLanguage"]::after {
    display: inline-block;
    width: .4rem;
    height: .4rem;
    margin: 0 .15rem .16rem .45rem;
    border: solid currentColor;
    border-width: 0 1.3px 1.3px 0;
    content: "";
    transform: rotate(45deg);
}

@media (min-width: 741px) and (max-width: 1060px) {
    #footer .s1-footer-directory {
        grid-template-columns: minmax(9.2rem, 1fr) minmax(6.5rem, .7fr) minmax(6.8rem, .77fr) minmax(15.3rem, 1.47fr);
        gap: 1rem;
    }
    #footer .s1-footer-brand p { font-size: .92rem; }
    #footer .s1-footer-copy { width: 65%; padding-left: .9rem; }
    #footer .s1-footer-help img { width: 43%; right: -.7rem; }
}

@media (max-width: 740px) {
    #footer.footer:has(.s1-footer-directory) > .container { padding: 0 1.375rem 1.25rem; }
    #footer .s1-footer-directory {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.375rem 1.25rem;
        margin-bottom: .875rem;
        padding: 1.56rem 0 1.25rem;
    }
    #footer .s1-footer-brand {
        display: flex;
        grid-column: 1 / -1;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0;
    }
    #footer .s1-footer-brand img { width: 10rem; }
    #footer .s1-footer-brand p { max-width: 21ch; margin: 0; font-size: .82rem; }
    #footer .s1-footer-help { grid-row: 2; grid-column: 1 / -1; min-height: 7.875rem; }
    #footer .s1-footer-copy { width: 66%; padding: 1rem 0 1rem 1.06rem; }
    #footer .s1-footer-help h2 { font-size: 1.45rem; }
    #footer .s1-footer-help p { max-width: 24ch; margin-top: .25rem; }
    #footer .s1-footer-help img { width: 38%; max-width: 9.25rem; right: .3rem; }
    #footer .s1-footer-button { margin-top: .625rem; }
    #footer .s1-footer-links { padding: 0; }
    #footer .s1-footer-links h2 { margin-bottom: .375rem; }
    #footer .s1-footer-links ul { gap: 0; }
    #footer .s1-footer-links a { min-height: 2rem; padding: .25rem 0; }
}

@media (max-width: 480px) {
    #footer .s1-footer-brand { display: block; }
    #footer .s1-footer-brand p { display: none; }
    #footer:has(.s1-footer-directory) .container > .list-inline > .list-inline-item {
        order: 1;
        margin-inline-start: 0;
    }
    #footer:has(.s1-footer-directory) .copyright { order: 3; flex-basis: 100%; margin-top: .65rem; }
}
