/* SMV Repair: modern clickable call control in Clean Commerce header. */
/* Suppress clearfix pseudo-elements that would otherwise become flex items. */
#masthead > .container > .inner-wrapper::before,
#masthead > .container > .inner-wrapper::after {
    display: none !important;
    content: none !important;
}

#masthead > .container > .inner-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 18px;
}

#masthead .site-branding {
    float: none !important;
    width: auto !important;
    max-width: 100%;
    flex: 1 1 220px;
    margin: 0 !important;
}

/* Preserve the theme's optional secondary/header-menu area. */
#masthead #right-header {
    float: none !important;
    width: auto !important;
    flex: 0 1 auto;
    margin: 0 !important;
}

#masthead .smv-header-call {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-left: auto;
    padding: 10px 14px;
    border: 1px solid #d7e3ef;
    border-radius: 9px;
    background: #f4f8fc;
    color: #194e78 !important;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none !important;
    white-space: nowrap;
    box-sizing: border-box;
}

#masthead .smv-header-call svg {
    display: block;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
}

#masthead .smv-header-call:hover,
#masthead .smv-header-call:focus-visible {
    border-color: #194e78;
    background: #e7f1fa;
    color: #123c5c !important;
    text-decoration: none !important;
}

#masthead .smv-header-call:focus-visible {
    outline: 2px solid #194e78;
    outline-offset: 3px;
}

@media (max-width: 767px) {
    /* Give the phone its own centered row, even with an optional header menu. */
    #masthead > .container > .inner-wrapper {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        justify-content: flex-start;
    }
    #masthead .site-branding {
        flex: 0 0 auto;
    }
    #masthead .smv-header-call {
        align-self: center;
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 10px 13px;
        font-size: 16px;
    }
}

/* Shared page grid. Keep full-width section backgrounds intact. */
body {
    --smv-content-width: 1000px;
    --smv-content-gutter: 24px;
}

#masthead > .container,
#main-nav .container,
#main-navigation .container,
#site-navigation > .container,
#breadcrumb > .container,
#breadcrumb .container,
#content > .container,
#content > .container-fluid,
#content > .site-content-inner > .container {
    width: 100% !important;
    max-width: var(--smv-content-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: var(--smv-content-gutter) !important;
    padding-right: var(--smv-content-gutter) !important;
    box-sizing: border-box;
}

/* The theme uses inner wrappers with grid gutters. Reset only the
   header wrapper so the phone cannot extend beyond the content grid. */
#masthead > .container > .inner-wrapper {
    width: 100%;
    max-width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

/* Global single-column layout, independent of Ninja Forms.
   Keep the content area aligned with the shared header grid. */
body #content #primary,
body #primary.content-area {
    float: none !important;
    clear: both;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    margin-left: 0 !important;
    margin-right: 0 !important;
    flex: 0 0 100% !important;
    box-sizing: border-box;
}

/* Remove the theme's side columns across all content templates.
   Footer widget areas and navigation are deliberately not affected. */
body #content #sidebar-primary,
body #content #sidebar-secondary,
body #content #secondary,
body #content #tertiary,
body #sidebar-primary,
body #sidebar-secondary {
    display: none !important;
}

/* Some templates have an extra theme grid wrapper. Allow the primary
   column to span it, without changing article or form inner spacing. */
#content > .container > .inner-wrapper,
#content > .container-fluid > .inner-wrapper {
    width: auto !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

@media (max-width: 767px) {
    body { --smv-content-gutter: 16px; }
}
