/*
 * Custom overrides for the finatic (Helix Ultimate) template.
 * Loaded automatically via templates/finatic/index.php -> $theme->add_css('custom').
 * Keep site-specific tweaks here so they survive template.css regeneration.
 */

/* ------------------------------------------------------------------ *
 * Mobile header layout (phones)                                       *
 * Logo gets its own full-width, centered row; the search / phone /    *
 * PCT logo block wraps to the next row.                               *
 * ------------------------------------------------------------------ */
@media (max-width: 767.98px) {
    #sp-logo-wrap #sp-logo.col-6,
    #sp-logo-wrap #sp-logo-right.col-6 {
        -webkit-box-flex: 0;
        -ms-flex: 0 0 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Center the logo within its full-width row */
    #sp-logo-wrap #sp-logo .sp-column {
        text-align: center;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
        margin-bottom: 5px;
    }

    #sp-logo-wrap #sp-logo .logo,
    #sp-logo-wrap #sp-logo .logo > a {
        display: inline-flex;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
    }

    /* Second row: PCT logo / phone / search kept on a single row */
    #sp-logo-wrap #sp-logo-right .sp-column {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
        -ms-flex-direction: row;
        flex-direction: row;
        -ms-flex-wrap: nowrap;
        flex-wrap: nowrap;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
        text-align: center;
        gap: 8px;
    }

    /* Allow each item to shrink so all three fit on one row */
    #sp-logo-wrap #sp-logo-right .sp-column > * {
        -webkit-box-flex: 0;
        -ms-flex: 0 1 auto;
        flex: 0 1 auto;
        min-width: 0;
        margin: 0;
    }

    #sp-logo-wrap #sp-logo-right .sp-module img {
        max-width: 100%;
        height: auto;
    }

    #sp-logo-wrap #sp-logo-right .sp-module input[type="search"],
    #sp-logo-wrap #sp-logo-right .sp-module .form-control {
        min-width: 0;
        width: 100%;
    }
}
