@media screen and (max-width: 980px) {

    /* Global Box Sizing */
    * {
        box-sizing: border-box;
    }

    img {
        max-width: 100%;
        height: auto;
    }

    /* Main wrappers reset - Aggressive removal of desktop styles */
    #wrap,
    #header_wrap,
    #header,
    #header_upper,
    #header_lower,
    #header_nav,
    #page,
    #main_content,
    #footer,
    #header_secondary,
    #header_wrap_secondary,
    #page_secondary {
        width: 100% !important;
        height: auto !important;
        float: none !important;
        background: none !important;
        background-color: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
    }

    body {
        min-width: 320px;
        background: none !important;
        background-color: #fff !important;
        overflow-x: hidden;
        font-size: 16px !important;
        /* Increased base font size for mobile */
        line-height: 1.5;
    }

    p,
    li {
        font-size: 16px !important;
        /* Ensure paragraphs and list items inherit or set larger size */
    }

    /* Mobile Header Image Area - Primary & Secondary */
    #header::before,
    #header_secondary::before {
        content: "";
        display: block;
        width: 100%;
        height: 120px;
        /* Use the requested image. Ensure path is correct relative to CSS file */
        background-image: url('corpo/logo5.jpg');
        /* Updated to logo5.jpg per user request */
        background-size: cover;
        /* Resize to fill, cutting off sides if needed */
        background-repeat: no-repeat;
        /* Center the logo so if width is cut, the middle remains */
        background-position: center center;
        margin-bottom: 0px;
        border-bottom: 4px solid #0C356A;
        background-color: #fff;
    }

    /* Fix for fixed-width inline style containers (e.g. Google page) */
    div[style*="width: 520px"] {
        width: 100% !important;
    }

    /* Mobile Banner Logic */
    .mobile-banner-img {
        display: block !important;
        width: 100%;
        text-align: center;
        background: #f0f0f0;
        margin-bottom: 20px;
    }

    .mobile-banner-img img {
        width: 100%;
        height: auto;
        display: block;
    }

    /* Hide Desktop Slider & Original Logo */
    .slider-wrap,
    .slider,
    #mySlides,
    .slider_nav,
    #myController {
        display: none !important;
    }

    #header_logo {
        display: none !important;
    }

    /* Remove specific subpage header text areas to kill white blocks & clutter */
    /* Kept header_nav visible for breadcrumbs, but styled compactly below */
    #header_sub_secondary,
    #header_sub_secondary_right {
        display: none !important;
    }

    /* Breadcrumbs (Header Nav) Styling */
    #header_nav {
        display: block !important;
        width: 100% !important;
        background: #f9f9f9 !important;
        /* Light background for separation */
        border-bottom: 1px solid #ddd;
        padding: 5px 10px !important;
        margin-bottom: 15px !important;
    }

    #header_sub_terc,
    #header_sub_text_terc {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        text-align: left !important;
        /* Align left for breadcrumbs */
    }

    #header_sub_text_terc p {
        margin: 0 !important;
        font-size: 12px !important;
        color: #666 !important;
    }

    #header_sub_text_terc a {
        color: #0C356A !important;
        text-decoration: underline;
    }

    /* Fix Header Text Contrast */
    #header_sub h1,
    #header_sub h2,
    #header_sub_headline h1,
    #header_sub_headline h2 {
        color: #0C356A !important;
        text-shadow: none !important;
        text-align: center;
        width: 100%;
        padding: 0 15px;
        margin-bottom: 5px;
    }

    #header_sub h2 {
        font-size: 16px;
        font-weight: normal;
        margin-bottom: 20px;
    }

    #header_sub,
    #header_sub_text,
    #header_sub_text_secondary,
    #header_sub_text_terc,
    #header_sub_headline,
    #header_sub_port,
    #header_sub_secondary,
    #header_sub_terc {
        width: 100% !important;
        float: none !important;
        padding: 10px !important;
        box-sizing: border-box;
        height: auto !important;
        text-align: center;
    }

    #left_navigation {
        display: none !important;
    }

    /* Navigation */
    #navs {
        float: none;
        width: 100%;
        height: auto;
        background: #0C356A;
        position: relative;
        margin-bottom: 20px !important;
    }

    #navs_center {
        background: none !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
        float: none !important;
    }

    #navs_left,
    #navs_right {
        display: none !important;
    }

    /* Mobile Menu Toggle */
    #mobile-menu-toggle {
        display: block !important;
        background: #0C356A;
        color: #fff;
        padding: 15px;
        text-align: right;
        cursor: pointer;
        font-weight: bold;
        font-size: 18px;
        border-bottom: 1px solid #1A5A8A;
        border-top: 0;
        border-left: 0;
        border-right: 0;
        width: 100%;
        appearance: none;
    }

    #navs_center ul.dropdown {
        display: block;
        width: 100%;
        float: none;
        height: auto;
        padding: 0;
        margin: 0;
        background: #0C356A;
    }

    #navs_center ul.dropdown.js-mobile-menu {
        display: none;
    }

    #navs_center ul.dropdown.active {
        display: block;
    }

    #navs_center ul.dropdown li {
        float: none;
        display: block;
        width: 100%;
        margin: 0;
        border-bottom: 1px solid #1A5A8A;
        height: auto !important;
        background: #0C356A;
    }

    #navs a,
    .dropdown li.plain {
        float: none;
        display: block;
        padding: 15px 20px;
        height: auto !important;
        width: auto;
        color: #fff;
        text-decoration: none;
        font-weight: bold;
        font-size: 16px;
        /* Increased from 14px */
        background: transparent !important;
        border-bottom: 1px solid #1A5A8A;
        /* clearer separation */
    }

    #navs a:hover,
    .dropdown li.plain:hover {
        background-color: #0056b3 !important;
        /* Brighter, standard blue hover */
        background-image: none !important;
        /* Ensure no greenish image leaks */
        color: #fff !important;
    }

    ul.dropdown ul.dropdownsub {
        position: static;
        visibility: visible;
        display: block;
        border: none;
        background: #114b96;
        width: 100%;
        padding: 0;
        margin: 0;
    }

    ul.dropdown ul.dropdownsub li {
        border-bottom: 1px solid #2a6bb0;
        background: none !important;
    }

    ul.dropdown ul.dropdownsub li a {
        padding: 12px 20px 12px 40px;
        font-weight: normal;
        color: #e0e0e0;
        font-size: 14px;
        /* Slight bump to align with hierarchy */
        background: none !important;
        border-bottom: 1px solid #2a6bb0;
    }

    ul.dropdown ul.dropdownsub li a:hover {
        background-color: #004494 !important;
        /* Slightly darker blue hover for subitems */
        background-image: none !important;
        color: #fff !important;
    }

    form {
        width: 100%;
    }

    form table,
    form tbody,
    form tr,
    form td {
        display: block;
        width: 100% !important;
    }

    form tr {
        margin-bottom: 14px;
    }

    form td {
        padding: 0;
    }

    form td.body {
        margin-bottom: 6px;
    }

    form td strong,
    form label,
    form p {
        font-size: 18px !important;
        line-height: 1.5;
    }

    .input,
    textarea,
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="submit"] {
        width: 100% !important;
        max-width: 100%;
        font-size: 18px !important;
        line-height: 1.4;
    }

    .input,
    textarea,
    input[type="text"],
    input[type="email"],
    input[type="tel"] {
        min-height: 52px;
        padding: 12px 14px !important;
        border: 1px solid #b7c1cc;
        color: #123a61;
        background: #fff !important;
    }

    textarea {
        min-height: 140px;
    }

    .button,
    input[type="submit"] {
        min-height: 54px;
        padding: 14px 18px !important;
        font-weight: bold;
        border: 1px solid #0b3f70;
        background: linear-gradient(180deg, #1d5f97 0%, #0c356a 100%) !important;
        color: #fff !important;
        border-radius: 4px;
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset;
    }

    input[type="checkbox"] {
        width: auto !important;
        margin-right: 8px;
        transform: scale(1.25);
        transform-origin: left center;
    }

    label {
        display: inline-block;
        max-width: 100%;
    }

    #main_content_left,
    #main_content_right,
    #main_content_left_secondary {
        width: 100% !important;
        float: none !important;
        padding: 15px !important;
        box-sizing: border-box;
        margin: 0 !important;
    }

    #main_content_right {
        background: #fff !important;
        border-top: 1px solid #d9e2ec;
        padding-top: 24px !important;
    }

    #main_content_right ul {
        margin-left: 0 !important;
    }

    p {
        width: 100% !important;
        padding-right: 0 !important;
    }

    .sub_box,
    .sub_box_right {
        width: 100% !important;
        float: none !important;
        background: #f9f9f9 !important;
        border: 1px solid #eee;
        border-bottom: 2px solid #ddd;
        padding: 20px !important;
        box-sizing: border-box;
        height: auto !important;
        margin-bottom: 10px;
    }

    #footer_wrap,
    #footer {
        height: auto !important;
        width: 100% !important;
        background-color: #0C356A !important;
    }

    #footer_l,
    #footer_r {
        float: none !important;
        width: 100% !important;
        text-align: center !important;
        padding: 15px;
        color: #fff !important;
    }

    #footer a {
        color: #fff !important;
        text-decoration: underline;
    }

    #navs_flags {
        display: none;
    }

    /* Portfolio/Reference Grid */
    .portfolio_cell,
    .portfolio_featured_cell {
        width: 100% !important;
        float: none !important;
        height: auto !important;
        display: flow-root;
        padding: 0 !important;
        margin-bottom: 20px;
    }

    .portfolio_featured_description,
    .portfolio_featured_image,
    .portfolio_description {
        float: none !important;
        width: 100% !important;
        display: block;
        margin-bottom: 15px;
    }

    .portfolio_image,
    .image_portfolio_small {
        width: auto !important;
        max-width: 80%;
        /* increased from 48% to look better centered */
        min-width: 140px;
        height: auto !important;
        float: none !important;
        /* Centering */
        display: block !important;
        margin: 0 auto 20px auto !important;
        /* Center margin */
        padding: 5px;
        text-align: center;
        border: 0px solid #eee;
        /* Maintain user's border removal */
    }

    .portfolio_image img {
        max-width: 100%;
        height: auto;
        display: block;
        margin: 0 auto;
    }

    .page_column,
    .page_column_double {
        width: 100% !important;
        float: none !important;
        background: #f9f9f9 !important;
        border: 1px solid #eee;
        margin: 10px 0 !important;
        padding: 15px !important;
        height: auto !important;
    }

    .page_column .img,
    .page_column_double .img {
        float: left;
        margin-right: 15px;
        margin-bottom: 10px;
    }

    .portfolio_featured_bottom {
        display: none;
    }
}

@media screen and (min-width: 981px) {
    .mobile-banner-img {
        display: none;
    }
}

#mobile-menu-toggle {
    display: none;
}
