/* Front page footer layout only: positions/arrangement, original styles kept */

/* Follow Us now sits in the black section: same row layout it had before */
footer.fp-footer .footer-social .list { display: flex; flex-direction: row; align-items: center; gap: 40px; }
footer.fp-footer .footer-social .list.ui-accordion-content[aria-hidden="true"] { display: none; }
/* icons are black SVGs, inverted so they stay visible on the black section */
footer.fp-footer .footer-social .list img { filter: invert(1); }

/* Black section colours from the reference: dark charcoal background, white titles, softer grey text/links */
footer.fp-footer #footer-top { background-color: #231f20; }
footer.fp-footer #footer-top .footer-group ul a:not([style]),
footer.fp-footer #footer-top .footer-group p { color: #c9c9c9 !important; }

/* White section: brand info left, BRP logo right */
footer.fp-footer #footer-bottom-content { display: flex; justify-content: space-between; align-items: flex-end; text-align: left; }
footer.fp-footer #footer-bottom-content .footer-brand { order: 1; align-self: flex-start; margin: 0; padding-right: 110px; justify-content: flex-start !important; }
footer.fp-footer #footer-bottom .footer-logo { justify-content: flex-start; }
footer.fp-footer #footer-bottom .footer-info .list { justify-content: flex-start; }
@media (max-width: 1023px) {
    footer.fp-footer #footer-bottom .footer-info { font-size: 10px; }
}
/* BRP logo is out of the flow so the white section keeps its original height */
footer.fp-footer #footer-bottom { position: relative; }
/* BRP tag sits on the bottom edge at its natural proportions */
footer.fp-footer .footer-brp { position: absolute; bottom: 0; right: 16px; line-height: 0; }
footer.fp-footer .footer-brp img { display: block; width: 80px; height: auto; }

@media (min-width: 1024px) {
    /* Black section: menus in the left half, full-height divider in the middle, Keep up + Follow us in the right half */
    footer.fp-footer #footer-top { position: relative; }
    footer.fp-footer #footer-top:before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px solid #fff; }
    footer.fp-footer .ui-accordion#footer-top-content,
    footer.fp-footer #footer-top-content {
        display: grid !important; grid-template-columns: 1fr 1fr 1fr 3fr; grid-template-rows: auto auto; justify-content: stretch;
    }
    footer.fp-footer .footer-group { grid-row: 1 / span 2; }
    footer.fp-footer .footer-group#footer-contact-us,
    footer.fp-footer .footer-group.footer-social { grid-column: 4; padding-left: 96px; }
    footer.fp-footer .footer-group#footer-contact-us { grid-row: 1; }
    footer.fp-footer .footer-group.footer-social { grid-row: 2; display: flex; align-items: center; gap: 24px; padding-top: 32px; }
    /* Keep up: title + text on the left, Subscribe button on the right, top-aligned with the title */
    footer.fp-footer .footer-group#footer-contact-us { display: grid; grid-template-columns: max-content max-content; column-gap: 48px; align-items: start; }
    footer.fp-footer #footer-contact-us h3 { grid-column: 1; grid-row: 1; }
    footer.fp-footer #footer-contact-us .ui-accordion-content,
    footer.fp-footer #footer-contact-us > div { display: contents !important; }
    footer.fp-footer #footer-contact-us p { grid-column: 1; grid-row: 2; margin: 0; max-width: 240px; }
    footer.fp-footer #footer-top .footer-group .explore-button-subscribe { grid-column: 2; grid-row: 1 / span 2; align-self: start; width: auto; padding: 16px 48px; }
    footer.fp-footer .footer-social .list img { width: 40px; height: 40px; }
    footer.fp-footer .footer-social h3 { margin-bottom: 0; padding-bottom: 0 !important; }
    footer.fp-footer .footer-social .list,
    footer.fp-footer .footer-social .list.ui-accordion-content[aria-hidden="true"] { display: flex !important; gap: 24px; }

    /* Brand pages (home-footer): brand | Buying Tools | Discover with Services & Parts below; Keep up stacked on the right */
    footer.home-footer .footer-group:nth-child(2) { grid-column: 1; grid-row: 1 / span 2; }
    footer.home-footer .footer-group.buying-tools { grid-column: 2; grid-row: 1 / span 2; }
    footer.home-footer .footer-group:nth-child(4) { grid-column: 3; grid-row: 1; }
    footer.home-footer .footer-group:nth-child(5) { grid-column: 3; grid-row: 2; padding-top: 32px; }
    footer.home-footer .footer-group#footer-contact-us { display: block; }
    /* content box shrinks to the text width so the button matches the "Sign up" line */
    footer.home-footer #footer-contact-us .ui-accordion-content,
    footer.home-footer #footer-contact-us > div { display: inline-block !important; }
    footer.home-footer #footer-contact-us p { margin-bottom: 16px; max-width: none; }
    footer.home-footer #footer-top .footer-group .explore-button-subscribe { display: block; width: 100%; }

    footer.fp-footer #footer-bottom { padding-top: 2rem; padding-bottom: 2rem; }
    footer.fp-footer #footer-bottom-content { padding-left: 34px; }
    footer.fp-footer #footer-bottom .footer-logo { width: auto; }
    footer.fp-footer #footer-bottom .footer-logo img { width: 180px; height: auto; }
    /* drop the Bootstrap row gutter so the left edge lines up with the menus above */
    footer.fp-footer #footer-bottom .footer-logo,
    footer.fp-footer #footer-bottom .footer-info { padding-left: 0; }
    /* desktop: wider logo from 20px down, plain black bottom of the tag cropped */
    footer.fp-footer .footer-brp { top: 20px; overflow: hidden; right: max(32px, calc((100% - 1280px) / 2 + 32px)); }
    footer.fp-footer .footer-brp img { width: 100px; }
}
