/*!
Theme Name: MarineGrade
Text Domain: marinegrade
*/

/* --- 1. RESET & BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 19px;
    line-height: 1.8;
    color: #333;
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
}

/* --- BASE TYPOGRAPHY --- */

h2, h3, h4, h5 {
    font-weight: 700;
    line-height: 1.3;
    margin-top: 1.5em; 
    margin-bottom: 0.75em;
}

h2 { font-size: 30px; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }
h5 { font-size: 18px; }

p {
    margin-bottom: 1.5em;
}

/* Content Typography & Spacing */
.entry-content h2, 
.entry-content h3, 
.entry-content h4 {
    color: #1b354e;
    line-height: 1.3;
    font-weight: 700;
    margin-top: 2.2em; 
    margin-bottom: 0.8em;
}

.entry-content h2 { font-size: 2.2rem; }
.entry-content h3 { font-size: 1.8rem; }
.entry-content h4 { font-size: 1.5rem; }

.entry-content > *:first-child {
    margin-top: 0 !important;
}

.entry-content p {
    margin-bottom: 1.6em;
}

ul {
    list-style: none;
}

/* GLOBAL LINKS */
a {
    color: #28608f;
    text-decoration: none;
    transition: 0.3s ease;
}

a:hover {
    color: #ffb400;
}

.entry-content a, 
.entry-summary a,
#content a {
    color: #28608f;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.entry-content a:hover, 
.entry-summary a:hover,
#content a:hover {
    color: #ffb400;
    text-decoration: none;
}

.container {
    max-width: 1440px; 
    margin: 0 auto;
    padding: 0 40px;
}

/* --- Content Structure Fix --- */

.entry-content p {
    margin-bottom: 1.6em;
}

.entry-content ul, 
.entry-content ol {
    margin-top: 1.2em;
    margin-bottom: 1.6em;
    list-style-type: none;
    padding-left: 0;
}

.entry-content ul li {
    position: relative;
    margin-bottom: 0.6em;
    padding-left: 1.2rem;
}

.entry-content ul li::before {
    content: "\2022";
    color: #ff6600;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1.2rem;
}

.entry-content ol {
    padding-left: 1.5rem;
    list-style-type: decimal;
}

.entry-content ol li {
    margin-bottom: 0.6em;
}

/* --- FEED ITEMS SPACING --- */
.site-main article, 
.content-area-main article {
    display: block;
    width: 100%;
    margin-bottom: 60px;
    padding-bottom: 60px;
    border-bottom: 1px solid #eeeeee;
}

.site-main article:last-child,
.content-area-main article:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* --- MAIN CONTENT SPACING --- */
.main-content-wrapper {
    margin-bottom: 100px;
}

@media (max-width: 991px) {
    .main-content-wrapper {
        margin-bottom: 60px;
    }
}

/* --- 2. TOP BAR --- */
.header-top {
    background-color: #ffb400;
    padding: 10px 0;
    font-size: 15px;
    color: #fff;
}

.header-top-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-left-nav ul {
    display: flex;
    gap: 25px;
}

.top-left-nav a {
    color: #fff;
    font-weight: 600;
}



/* --- 3. MAIN HEADER --- */
.header-main {
    padding: 40px 0; 
    background: #fff;
    border-bottom: 1px solid #eee;
    position: relative;
    z-index: 100;
    transition: all 0.3s ease;
}

@media screen and (min-width: 769px) {
    .header-main.is-sticky {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 999;
        padding: 10px 0;
        box-shadow: 0 2px 15px rgba(0,0,0,0.1);
        animation: slideDown 0.3s ease-out;
    }

    .admin-bar .header-main.is-sticky {
        top: 32px;
    }

    .header-main.is-sticky .header-inner {
        min-height: 70px;
    }

    .header-main.is-sticky .site-branding img {
        max-height: 60px;
    }

    @keyframes slideDown {
        from { transform: translateY(-100%); }
        to { transform: translateY(0); }
    }
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 100px; 
    transition: all 0.3s ease;
}

.site-branding img {
    display: block;
    width: auto;
    max-height: 100px; 
    transition: all 0.3s ease;
}

.d-only-mobile {
    display: none;
}

/* --- 4. DESKTOP NAVIGATION --- */
@media screen and (min-width: 769px) {
    .menu-toggle,
    .menu-close-button,
    .sub-menu-trigger {
        display: none !important;
    }

    .mobile-menu {
        display: none !important;
    }

    .header-navigation-wrapper {
        display: flex;
        align-items: center;
        gap: 35px;
    }

    .main-navigation ul {
        display: flex;
        gap: 25px;
    }

    .main-navigation li {
        position: relative;
    }

    .main-navigation a {
        font-weight: 600;
        color: #333;
        font-size: 20px; 
        padding: 10px 0;
    }

    .main-navigation li.current-menu-item > a,
    .main-navigation li.current-page-ancestor > a,
    .main-navigation a:hover {
        color: #ffb400 !important;
    }

    .main-navigation .menu-item-has-children > a::after {
        content: '▼';
        font-size: 9px;
        margin-left: 6px;
        vertical-align: middle;
    }

    .main-navigation ul ul {
        position: absolute;
        top: 100%;
        left: 0;
        background: #fff;
        min-width: 280px; 
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        display: none;
        padding: 15px 0; 
        z-index: 999;
        border-top: 3px solid #ffb400; 
    }

    .main-navigation li:hover > ul {
        display: block;
    }

    .main-navigation ul ul li {
        width: 100%;
    }

    .main-navigation ul ul a {
        padding: 12px 25px; 
        font-size: 20px; 
        color: #333;
        display: block;
        line-height: 1.4;
    }

    .main-navigation ul ul a:hover {
        background-color: #f9f9f9;
        color: #ffb400 !important;
        padding-left: 30px; 
    }
}

.button-quote {
    display: inline-block;
    background-color: #ffb400;
    color: #fff !important;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.button-quote:hover {
    background-color: #28608f;
    box-shadow: 0 4px 12px rgba(40, 96, 143, 0.3);
}

/* --- 5. MOBILE NAVIGATION --- */
@media screen and (max-width: 768px) {
    .admin-bar .header-navigation-wrapper {
        top: 46px !important; 
    }

    .d-none-mobile {
        display: none !important;
    }

    .d-only-mobile {
        display: block !important;
    }

    .desktop-menu {
        display: none !important;
    }
    .mobile-menu {
        display: block !important;
    }

    .header-main {
        padding: 20px 0;
    }

    .header-navigation-wrapper {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background-color: #ffb400;
        z-index: 99999;
        padding-top: 0 !important;
        transition: right 0.3s cubic-bezier(0.77,0.2,0.05,1.0);
        overflow-y: auto;
    }

    .header-navigation-wrapper.is-open {
        right: 0;
        box-shadow: -5px 0 20px rgba(0,0,0,0.2);
    }

    .panel-top-bar {
        background-color: #ffb400;
        height: 60px;
        display: flex !important;
        width: 100%;
        padding: 0 10px;
        align-items: center;
    }

    .menu-close-button {
        width: 44px;
        height: 44px;
        background: transparent;
        border: none;
        cursor: pointer;
        position: relative;
        margin-left: auto !important; 
        margin-right: 5px;
        display: block !important;
    }

    .close-icon::before, .close-icon::after {
        content: "";
        position: absolute;
        top: 20px;
        left: 8px;
        width: 28px;
        height: 4px;
        background-color: #28608f;
        border-radius: 2px;
    }
    .close-icon::before { transform: rotate(45deg); }
    .close-icon::after { transform: rotate(-45deg); }

    .panel-languages-bar {
        background-color: rgba(0, 0, 0, 0.05);
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .panel-languages-bar ul {
        display: flex !important;
        flex-direction: row !important;
        gap: 20px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .panel-languages-bar li { 
        border: none !important; 
        padding: 0 !important; 
    }

    .toggled-on .menu-toggle {
        display: none !important;
    }

    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background-color: #ffb400 !important;
        border: none !important;
        width: 44px;
        height: 44px;
        border-radius: 4px;
        cursor: pointer;
        position: relative;
        z-index: 10001; 
    }

    .hamburger-box {
        width: 24px;
        height: 18px;
        position: relative;
    }

    .hamburger-inner,
    .hamburger-inner::before,
    .hamburger-inner::after {
        width: 24px;
        height: 2px;
        background-color: #fff;
        position: absolute;
        left: 0;
        transition: 0.3s;
    }

    .hamburger-inner { top: 50%; margin-top: -1px; }
    .hamburger-inner::before { content: ""; top: -8px; }
    .hamburger-inner::after { content: ""; top: 8px; }

    .main-navigation {
        margin-top: 0;
    }

    .main-navigation ul {
        flex-direction: column;
        width: 100%;
    }

    .main-navigation li {
        position: relative;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .main-navigation a {
        color: #fff !important;
        padding: 16px 20px;
        display: block;
        font-size: 18px;
        font-weight: 600;
    }

    .main-navigation li.current-menu-item > a,
    .main-navigation li.current-page-ancestor > a {
        background-color: #28608f !important;
    }

    .main-navigation ul ul {
        display: none !important;
        background: rgba(0, 0, 0, 0.1);
    }

    .main-navigation li.sub-menu-open > ul {
        display: block !important;
    }

    .main-navigation ul ul a {
        padding-left: 35px;
        font-size: 16px;
        background-color: transparent !important;
    }

    .sub-menu-trigger {
        position: absolute;
        right: 0;
        top: 0;
        width: 55px;
        height: 55px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 26px;
        cursor: pointer;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 5;
    }
}

/* --- 6. FOOTER --- */
.site-footer {
    background-color: #28608e; 
    color: #ffffff; 
    padding: 60px 0 0;
}

.footer-widgets {
    display: grid;
    /* Default: 4 columns for desktop */
    grid-template-columns: repeat(4, 1fr); 
    gap: 40px;
    padding-bottom: 20px;
}

.site-footer .widget-title {
    color: #ffffff; 
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 25px;
    border: none;
    padding: 0;
}

/* Force all links and text in footer to be white */
.footer-widget-col,
.footer-copyright,
.footer-legal-menu a,
.footer-widget-col a,
.footer-brand-link,
.site-footer .widget,
.site-footer .widget a,
.site-footer ul li,
.site-footer ul li a {
    color: #ffffff;
    font-size: 0.95rem;
    line-height: 1.6;
    text-decoration: none;
}

/* Hover state: white with underline for visual feedback */
.footer-widget-col a:hover,
.footer-legal-menu a:hover,
.footer-brand-link:hover,
.site-footer a:hover {
    color: #ffffff;
    text-decoration: underline; 
}

.footer-brand-link {
    color: #ffffff;
    font-weight: 700;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 30px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; 
    gap: 20px;
}

.footer-legal-menu {
    display: flex;
    gap: 25px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Remove visual divider lines while preserving layout geometry */
.site-footer .widget ul li, 
.site-footer .widget ol li {
    border-bottom-color: transparent !important; /* Make the line invisible */
    border-top-color: transparent !important;    /* In case the line is on top */
    box-shadow: none !important;                 /* In case the line is a shadow */
}

/* Remove divider lines if created via pseudo-elements (::after/::before) */
.site-footer .widget ul li::after,
.site-footer .widget ul li::before {
    content: none !important;
    display: none !important;
}

/* Fix for third column alignment: remove background patterns/stripes */
.site-footer .widget_nav_menu ul li,
.site-footer .widget_archive ul li,
.site-footer .widget_categories ul li,
.site-footer .widget_meta ul li,
.site-footer .widget_pages ul li {
    background: none !important; 
}

/* Tablets: 2 columns */
@media screen and (max-width: 1024px) {
    .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile phones: 1 column */
@media screen and (max-width: 600px) {
    .footer-widgets {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-legal-menu {
        justify-content: center;
        flex-wrap: wrap;
    }
}
/* --- 7. UTILS --- */
.text-center { text-align: center; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }


/* --- 9. Pagination --- */
.navigation.pagination,
.page-links {
    margin: 80px 0 40px; 
    display: flex;
    justify-content: center;
    width: 100%;
    clear: both;
}

.nav-links {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a,
.nav-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 55px;
    height: 55px;
    padding: 0 15px;
    background: #ffffff;
    color: #1b354e;
    text-decoration: none;
    border: 2px solid #eee;
    border-radius: 4px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    border-color: #28608f;
    color: #28608f;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.nav-links .current {
    background: #1b354e;
    color: #ffffff;
    border-color: #1b354e;
    cursor: default;
}

.nav-links .prev,
.nav-links .next {
    text-transform: none;
    font-size: 0.85rem;
    letter-spacing: 1px;
    padding: 0 20px;
}

@media (max-width: 576px) {
    .nav-links a, .nav-links span {
        min-width: 48px;
        height: 48px;
        font-size: 1rem;
    }
}

/* --- 10. Sidebar & Widgets --- */
.sidebar {
    width: 300px;
    flex-shrink: 0;
}

.widget {
    margin-bottom: 40px;
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #28608f; 
    color: #1b354e;
    text-transform: none;
}

/* --- 10. Sidebar & Widgets --- */
.sidebar {
    width: 300px;
    flex-shrink: 0;
}

.widget {
    margin-bottom: 40px;
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #28608f; 
    color: #1b354e;
    text-transform: none;
}

/* Evergreen Posts Widget Adaptation */
.mgrd-sidebar-feed .standard-feed-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.mgrd-sidebar-feed .standard-feed-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Точный селектор для заголовка внутри виджета */
.mgrd-sidebar-feed .standard-feed-item .entry-title {
    font-size: 20px;
    margin: 5px 0 8px 0;
    line-height: 1.3;
}

.mgrd-sidebar-feed .standard-feed-item .entry-title a {
    font-size: 20px;
    text-decoration: none;
}

.mgrd-sidebar-feed .entry-summary p {
    margin-bottom: 0;
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.sidebar .widget ul li a:hover {
    color: #ffb400;
}

@media (max-width: 991px) {
    .sidebar {
        width: 100%;
        margin-top: 40px;
    }
}

/* --- 11. Posts Feed & Buttons --- */

.standard-feed-item {
    margin-bottom: 100px;
    border-bottom: 1px solid #eee;
    padding-bottom: 60px;
    max-width: 100%;
}

.standard-feed-item:last-child {
    border-bottom: none;
}

.post-thumbnail {
    margin-bottom: 35px;
    overflow: hidden;
    max-height: 550px;
    border-radius: 4px;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.entry-meta {
    font-size: 1.05rem; 
    color: #888;
    margin-bottom: 15px;
    text-transform: none; 
    letter-spacing: normal;
}

.entry-meta a {
    color: #28608f; 
}

.entry-meta a:hover,
.entry-title a:hover {
    color: #ffb400 !important;
}

.entry-title {
    font-size: 2.2rem !important;
    margin-top: 0 !important;
    margin-bottom: 25px !important;
    line-height: 1.2 !important;
}

.entry-title a {
    color: #1b354e; 
    text-decoration: none;
}

.mgrd-button-primary {
    display: inline-block;
    background-color: #ffb400; 
    color: #ffffff !important;
    padding: 14px 32px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: none;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
}

.mgrd-button-primary:hover {
    background-color: #1b354e; 
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.read-more-wrapper {
    margin-top: 35px;
}

/* --- 12. Home Page Slider Gap --- */
.home .site-main {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.home .page-title-section {
    display: none !important;
}

.home .main-content-wrapper {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* --- 26. TITLE SECTION --- */
.page-title-section {
    position: relative;
    width: 100% !important;
    padding: 0 !important; 
    color: #ffffff !important;
    background-color: #1b354e;
    background-attachment: fixed !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    min-height: 400px !important; 
    text-align: left !important;
    overflow: hidden;
    z-index: 1;
}

.page-title-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5); 
    z-index: 1;
}

.page-title-section .container {
    position: relative;
    z-index: 2;
    width: 100%;
}

.page-title-section .entry-title {
    margin: 0 0 15px 0 !important;
    font-size: 3.5rem !important; 
    font-weight: 700 !important;
    color: #ffffff !important;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
    line-height: 1.2 !important;
}

.mgrd-breadcrumbs {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.mgrd-breadcrumbs a {
    color: #ffffff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    text-decoration: none;
}

.mgrd-breadcrumbs a:hover {
    color: #ffb400 !important; 
    border-color: #ffb400;
}

@media (max-width: 1024px) {
    .page-title-section {
        background-attachment: scroll !important;
        background-position: center top !important;
        min-height: auto !important;
        padding: 80px 0 !important;
    }
    
    .page-title-section .entry-title {
        font-size: 2.2rem !important;
    }
}

/* --- 30. LAYOUT: CONTENT + SIDEBAR --- */

.main-content-wrapper {
    display: flex !important;
    display: -webkit-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 60px !important; /* Distance between text and sidebar */
    width: 100% !important;
    margin-top: 40px;
}

.content-area-main {
    flex: 1 !important;
    min-width: 0 !important;
}

.sidebar {
    width: 300px !important;
    flex: 0 0 300px !important;
    min-width: 300px !important;
}

@media (max-width: 991px) {
    .main-content-wrapper {
        flex-direction: column !important;
    }
    .sidebar {
        width: 100% !important;
        flex: none !important;
        margin-top: 50px !important;
    }
}

/* --- 35. CALL TO ACTION PARALLAX --- */

.mgrd-cta-parallax-section {
    position: relative;
    width: auto;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    min-height: 280px; 
    display: flex !important;
    align-items: center !important; 
    justify-content: center !important;
    background-attachment: fixed;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    overflow: hidden;
    margin-top: 40px;
    margin-bottom: 40px;
}

.mgrd-cta-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(27, 53, 78, 0.4); 
    z-index: 1;
}

.mgrd-cta-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.mgrd-cta-title {
    font-size: 2.2rem !important; 
    font-weight: 700 !important;
    color: #ffffff !important;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.4);
    line-height: 1.2 !important;
    margin-top: 0 !important;
    margin-bottom: 20px !important; 
}

/* Максимально специфичный селектор: 
   Цепочка .класс-родитель .класс-контейнер тег.класс-кнопки */
.mgrd-cta-parallax-section .mgrd-cta-content a.mgrd-button-primary {
    text-decoration: none;
    margin-bottom: 0 !important;
}

.mgrd-cta-parallax-section .mgrd-cta-content a.mgrd-button-primary:hover {
    text-decoration: none;
    background-color: #28608f !important;
    color: #ffffff !important;
    border-color: #28608f !important;
}

@media (max-width: 1024px) {
    .mgrd-cta-parallax-section {
        background-attachment: fixed !important;
        min-height: 200px;
        margin-left: -15px !important;
        margin-right: -15px !important;
        width: calc(100% + 30px) !important;
    }
    .mgrd-cta-title {
        font-size: 1.6rem !important;
    }
}
/* --- 36. FORMS: CONTACT FORM 7 --- */

div.wpcf7 .mgrd-form-container {
    background-color: #ffb400 !important;
    padding: 60px !important;
    margin: 60px 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    color: #ffffff !important;
    font-size: 18px !important; 
}

.mgrd-label {
    display: block !important;
    font-size: 35px !important;
    font-weight: 900 !important;
    margin-bottom: 40px !important;
    line-height: 1.1 !important;
}

.mgrd-mini-label, 
.mgrd-messenger-row .wpcf7-list-item {
    display: block !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    margin-bottom: 12px !important;
}

.mgrd-messenger-row .wpcf7-list-item {
    display: inline-block !important;
    margin-right: 35px !important;
    margin-bottom: 0 !important;
}

.mgrd-messenger-row input[type="checkbox"] {
    width: 36px !important;
    height: 36px !important;
    vertical-align: middle !important;
    margin-right: 12px !important;
    cursor: pointer !important;
    appearance: auto !important; 
}

.mgrd-custom-radio input[type="radio"] {
    display: none !important; 
}

.mgrd-custom-radio span.wpcf7-list-item-label {
    display: inline-block !important;
    padding: 15px 30px !important;
    background: #ffffff !important;
    border: 2px solid #1b354e !important;
    color: #1b354e !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    margin-right: 10px !important;
    margin-bottom: 10px !important;
    cursor: pointer !important;
}

.mgrd-custom-radio .wpcf7-list-item {
    margin: 0 !important;
}

.mgrd-custom-radio input[type="radio"]:checked + span.wpcf7-list-item-label {
    background: #1b354e !important;
    color: #ffffff !important;
}

.mgrd-form-grid { display: flex !important; gap: 20px !important; }
.mgrd-field, .mgrd-info-block { margin-bottom: 25px !important; flex: 1; }

/* 1. Base styles for all text fields and dropdowns */
div.wpcf7 input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]), 
div.wpcf7 textarea,
div.wpcf7 select {
    width: 100% !important;
    padding: 20px 25px !important;
    background: #ffffff !important;
    border: 1px solid #1b354e !important;
    border-radius: 0 !important;
    font-size: 18px !important;
    color: #1b354e !important;
    box-sizing: border-box !important;
}

/* 2. Remove default OS styling from select and add custom arrow */
div.wpcf7 select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    cursor: pointer !important;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%231b354e%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22/%3E%3C/svg%3E') !important;
    background-repeat: no-repeat !important;
    background-position: right 25px center !important;
    background-size: 12px auto !important;
}

.wpcf7-form-control-wrap {
    display: block !important;
}

.mgrd-submit-btn {
    background: #1b354e !important;
    color: #fff !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    padding: 25px !important;
    width: 100% !important;
    border: none !important;
    cursor: pointer !important;
    text-transform: none !important;
}

@media (max-width: 768px) {
    .mgrd-form-grid { flex-direction: column !important; }
    .mgrd-label { font-size: 32px !important; }
}

/* --- 37. COMPONENT: COUNTER --- */

.mgrd-counter-item {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important; 
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important; 
    overflow: hidden !important;
    padding-top: 60px !important;    
    padding-bottom: 90px !important; 
}

.mgrd-counter-data {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.mgrd-counter-number-wrap {
    display: flex !important;
    align-items: baseline !important;
    justify-content: center !important;
    font-size: 64px !important;
    font-weight: 800 !important;
    line-height: 0.8 !important; 
    margin: 0 !important;
    letter-spacing: -1.5px !important; 
}

.mgrd-counter-text {
    margin: 0 !important;
    padding: 0 !important;
    margin-top: 12px !important; 
    font-size: 24px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important; 
    text-transform: none;
}

.mgrd-counter-sfx {
    font-size: 32px !important;
    line-height: 1 !important;
    margin-left: 2px !important;
}

@media (max-width: 768px) {
    .mgrd-counter-number-wrap {
        font-size: 48px !important;
    }
    .mgrd-counter-text {
        font-size: 16px !important;
    }
    .mgrd-counter-item {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }
}

.mgrd-counter-data {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* --- 38. FOUNDER SECTION --- */

.founder-section {
    position: relative;
    z-index: 1;
    overflow: visible !important;
}

.founder-section > .vc_column_container:last-child {
    position: relative;
    overflow: visible !important;
}

.founder-section > .vc_column_container:last-child::before {
    content: "";
    position: absolute;
    background-color: #f4f4f4; 
    top: 32%;      
    bottom: -5%;   
    left: -35%;    
    right: -5%;    
    z-index: -1;   
    pointer-events: none; 
}

/* --- 39. FINAL LAYOUT & HOME PAGE FIXES --- */

/* 1. Global Reset: Prevent horizontal scroll and allow WPBakery scripts to work */
html, body {
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* 2. Slider Revolution: Allow full width on Front Page */
.home #primary .container {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
}

/* 3. WPBakery Rows: Constrain content on Home Page */
.home .vc_row:not(.vc_row-no-padding) {
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}



/* --- 40. MOBILE ADJUSTMENTS --- */

@media (max-width: 768px) {
    /* Container padding for mobile */
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Founder section: Mobile background fix */
    .founder-section > .vc_column_container:last-child::before {
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        border-radius: 0 !important;
    }
}

/* --- 14. NUCLEAR FIX FOR IMAGE GALLERY (KILLING JS POSITIONING) --- */

/* 1. Force container to ignore JS height and use flex */
.wpb_gallery .wpb_image_grid_ul {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    height: auto !important; /* Kill Isotope height calculation */
    position: relative !important;
    padding: 0 !important;
}

/* 2. Force items to stay in flex flow instead of absolute positioning */
.wpb_gallery .wpb_image_grid_ul li {
    position: static !important; /* THIS KILLS ISOTOPE ABSOLUTE LOGIC */
    float: none !important;
    margin: 15px !important;
    width: auto !important; /* Let the image size define width */
    opacity: 1 !important; /* Ensure they don't stay hidden if JS fails */
}

/* 3. Smooth images */
.wpb_gallery .wpb_image_grid_ul img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}


/* STYLE FOR THE BUTTON LOAD MORE !!! */
.vc_grid-btn-load-more .vc_btn3 {
    /* Наследуем всё из нашего класса .mgrd-main-btn !!! */
    background-color: #ffb400 !important; /* Наш желтый */
    border: 2px solid #ffb400 !important;
    color: #ffffff !important;
    padding: 10px 24px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 24px !important;
    border-radius: 4px !important;
    text-transform: none !important; /* Твое жесткое правило: никакого капса !!! */
    transition: all 0.3s ease-in-out !important;
    box-shadow: none !important;
    background-image: none !important; /* Убираем градиенты VC, если есть */
}

.vc_grid-btn-load-more .vc_btn3:hover {
    background-color: #28608f !important; /* Тот самый темно-синий из .mgrd-main-btn:hover */
    border-color: #28608f !important;
    color: #ffffff !important;
}

/* --- Pixel Perfect Search --- */

/* Скрываем заголовки виджета и лишний текст */
.widget_search .widget-title,
.widget_search .screen-reader-text {
    display: none !important;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    border: 1px solid #ccc; /* Цвет рамки как в оригинале */
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

.search-field {
    width: 100%;
    border: none !important;
    padding: 10px 45px 10px 12px !important; /* Место справа под лупу */
    font-size: 15px !important;
    outline: none !important;
    color: #333 !important;
}

/* Настройка плейсхолдера (светло-серый) */
.search-field::placeholder {
    color: #bbb !important;
    opacity: 1;
}

/* Иконка-кнопка справа */
.search-submit-icon {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 42px;
    background: transparent;
    border: none;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s;
}

.search-submit-icon:hover {
    color: #000;
}

/* Final fix for button decoration in slider */
/* Nuclear fix to remove underline from the quote button */
#content a.button-quote, 
#content .button-quote,
.button-quote {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* Ensure no underline on hover as well */
#content a.button-quote:hover, 
.button-quote:hover {
    text-decoration: none !important;
    color: #ffffff !important;
}

/* Фикс горизонтального скролла для мобильных браузеров */
.site {
    overflow-x: hidden;
    width: 100%;
}

/*TEST*/

@media screen and (max-width: 768px) {
    /* 1. ГЛАВНАЯ СТРАНИЦА: Твой исходный код без изменений */
    .home .container, 
    .home .main-content-wrapper, 
    .home .content-area-main,
    .home .site-main,
    .home article,
    .home .entry-content,
    .home .vc_row, 
    .home .vc_column-inner, 
    .home .vc_column_container {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
    }
	
	/* Specific fix for Contacts: removing internal column padding */
body:not(.home) .vc_column-inner {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Ensure the row doesn't shift the content */
body:not(.home) .vc_row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

    /* 2. ВСЕ ОСТАЛЬНЫЕ СТРАНИЦЫ: Даем отступ тексту, чтобы не лип к краю */
    body:not(.home) .container,
    body:not(.home) .site-main,
    body:not(.home) article,
    body:not(.home) .entry-content {
        padding-left: 7px !important;
        padding-right: 7px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 3. ФОРМА НА ВНУТРЕННИХ СТРАНИЦАХ: Растягиваем в края, игнорируя отступы из п.2 */
    body:not(.home) .mgrd-form-container {
        margin-left: -15px !important;
        margin-right: -15px !important;
        width: calc(100% + 30px) !important;
        padding: 25px 15px !important;
        box-sizing: border-box !important;
        border-radius: 0 !important;
    }

    /* 4. ПОЛЯ ФОРМЫ: Вертикальный стек и полная ширина */
    .wpcf7-form-control-wrap,
    .mgrd-field,
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea {
        width: 100% !important;
        margin: 0 0 10px 0 !important;
        display: block !important;
        box-sizing: border-box !important;
    }
	
	/* Bringing select/dropbox to the same size as inputs */
.mgrd-field select,
select.wpcf7-form-control {
    width: 100% !important;
    height: 50px !important; /* Убедись, что высота совпадает с остальными полями */
    padding: 0 10px !important;
    font-size: 16px !important;
    line-height: 50px !important;
    border: 1px solid #1b354e !important;
    background-color: #fff !important;
    border-radius: 4px !important;
    appearance: none !important; /* Removes default OS styling */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    box-sizing: border-box !important;
    display: block !important;
}

/* Optional: adding back a custom arrow for the dropdown */
.mgrd-field select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%231b354e%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E') !important;
    background-repeat: no-repeat !important;
    background-position: right 15px top 50% !important;
    background-size: 12px auto !important;
}

    /* 5. ФУТЕР: Твой рабочий код */
    .site-footer .container,
    .footer-widgets,
    .site-info {
        padding-left: 20px !important;
        padding-right: 20px !important;
        box-sizing: border-box !important;
    }

    /* 6. Убираем центрирование */
    center {
        display: block;
        text-align: left;
    }
    
/* --- ГЛОБАЛЬНЫЙ ФИКС МОБИЛЬНОЙ ВЕРСИИ --- */
@media screen and (max-width: 768px) {

    /* 1. Запрещаем горизонтальный скролл на корню */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
    }

    /* 2. Делаем основной контейнер "резиновым" */
    .main-content-area,
    .main-content-wrapper,
    .content-area-main,
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        display: block !important; /* Отключаем flex, чтобы блоки падали друг под друга */
    }

    /* 3. Убираем "минусовые" отступы WPBakery, которые выталкивают блоки за край */
    .vc_row {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    /* 4. ТВОИ ЗАКОННЫЕ 7 ПИКСЕЛЕЙ */
    /* Применяем их к внутренним колонкам, чтобы текст не лип к стеклу */
    .vc_column-inner, 
    .wpb_wrapper {
        padding-left: 7px !important;
        padding-right: 7px !important;
        box-sizing: border-box !important;
    }

    /* 5. Картинки никогда не шире экрана */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
}

@media screen and (max-width: 768px) {
    /* Precise fix for stretched rows within our isolated container */
    .mgrd-page-content-area .vc_row[data-vc-full-width="true"] {
        left: 0 !important;
        /* Calculate width to fit exactly, accounting for the 7px offset */
        width: calc(100% + 14px) !important; 
        margin-left: -7px !important;
        margin-right: -7px !important;
        padding-left: 7px !important;
        padding-right: 7px !important;
        box-sizing: border-box !important;
        max-width: none !important;
    }

    /* Prevent any accidental horizontal scrolling on the wrapper level */
    .mgrd-page-content-area {
        overflow-x: hidden !important;
    }
}
