/* ==========================================================================
   YASKAWA MODERN THEME OVERRIDES
   Contains styles for the modernized header, footer, mega-menu, and country picker.
   ========================================================================== */

/* --- HEADER STYLES --- */
main,
#page>main {
    position: relative;
    z-index: 1 !important;
    display: flex;
    flex-direction: column;
}

#modern-site-header {
    height: auto !important;
}

#modern-yaskawa-header {
    background: #fff;
    margin-bottom: 0 !important;
    position: relative !important;
    z-index: 9999 !important;
    height: auto !important;
    border-bottom: 1px solid #dcdcdc !important;
}

.modern-meta-nav a {
    color: #005CA9;
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s;
}

.modern-meta-nav a:hover {
    color: #003a6b;
}

.meta-nav-pipe {
    color: #ccc;
    margin-left: 20px;
    font-size: 0.9rem;
}

/* Clean up main nav layout in new container */
.modern-header-mainNav .navbar-nav {
    flex-direction: row;
    margin-bottom: 0;
}

.modern-header-mainNav .navbar-nav .nav-item {
    margin-left: 25px;
}

.modern-header-mainNav .navbar-nav .nav-item:first-child {
    margin-left: 0 !important;
}

.modern-header-mainNav .navbar-nav .nav-link.level-1 {
    padding: 20px 0 17px 0 !important;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    text-transform: uppercase;
    transition: color 0.2s;
}

.modern-header-mainNav .navbar-nav .nav-link.level-1:hover {
    color: var(--menu-theme-color, #005CA9) !important;
}


/* --- MEGAMENU OVERRIDES --- */

.nav-item.theme-robotics {
    --menu-theme-color: #26EBDE;
}

.nav-item.theme-ac-drives {
    --menu-theme-color: #00C224;
}

.nav-item.theme-motion-control {
    --menu-theme-color: #8F94FF;
}

.nav-item.theme-default {
    --menu-theme-color: #005CA9;
}

.header__mainNav,
#menu.navbar-collapse,
.navbar-nav,
.navbar-nav .nav-item.megamenu {
    position: static !important;
}

/* Set the main row as the relative container so the megamenu spans from Robotics to Search */
.modern-header-main-row {
    position: relative !important;
}

@media (min-width: 992px) {

    .navbar-nav .nav-item.dropdown:hover .dropdown-menu {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .navbar-nav .dropdown-menu.new-megamenu::before {
        content: '';
        position: absolute;
        top: -30px;
        left: 0;
        right: 0;
        height: 30px;
        background: transparent;
    }
}

/* Remove old blue background from active states */
.navbar-nav .active,
.navbar-nav .nav-item.active,
.navbar-nav .nav-link.active,
.navbar-nav .nav-item.active .nav-link,
.navbar-nav .nav-item .nav-link.active {
    background-color: transparent !important;
}

/* Base styles for level-1 (Main tabs) */
.navbar-nav .nav-item .level-1 {
    transition: color 200ms, border-bottom-color 200ms !important;
    border-bottom: 3px solid transparent !important;
    padding-bottom: 17px !important;
    color: #000 !important;
}

/* Hover & Active states for level-1 */
.navbar-nav .nav-item:hover .level-1,
.navbar-nav .nav-item.active .level-1,
.navbar-nav .nav-item.show .level-1,
.navbar-nav .nav-item .level-1[aria-expanded="true"],
.navbar-nav .nav-item .level-1.active {
    color: var(--menu-theme-color, #005CA9) !important;
    border-bottom-color: var(--menu-theme-color, #005CA9) !important;
    background-color: transparent !important;
}

.navbar-nav .dropdown-menu.new-megamenu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 2rem 0 !important;
    background: #fff !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
    z-index: 2147483647 !important;
    height: auto !important;
    max-height: calc(100vh - 120px) !important;
    overflow-y: auto !important;
}

.new-megamenu .container {
    max-width: 1140px;
    margin: 0 auto;
}


/* --- COUNTRY PICKER STYLES --- */

.modern-country-picker-wrapper {
    margin-bottom: 0 !important;
}

.modern-country-picker-toggle {
    background: transparent !important;
    border: 1px solid transparent !important;
    padding: 8px 12px !important;
    width: auto !important;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0 !important;
}

.modern-country-picker-toggle img {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modern-country-picker-toggle:hover {
    background-color: #f8f9fa !important;
}

.modern-country-picker-wrapper.show .modern-country-picker-toggle {
    background-color: #fff !important;
    border-color: #dcdcdc !important;
    border-bottom-color: #fff !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    position: relative;
    z-index: 10002;
}

.modern-country-picker {
    z-index: 10001 !important;
    width: 400px !important;
    padding: 24px 20px !important;
    border: 1px solid #dcdcdc !important;
    border-radius: 6px !important;
    border-top-right-radius: 0 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
    right: 0 !important;
    left: auto !important;
    background: #fff !important;
    font-size: 0.95rem;
    margin-top: -1px !important;
}

/* Vertical divider in the middle of the dropdown */
.modern-country-picker::before {
    content: '';
    position: absolute;
    top: 70px;
    bottom: 24px;
    left: 50%;
    width: 1px;
    background: #eaeaea;
}

.modern-country-picker__headline {
    display: none;
}

.modern-country-picker__grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px 24px;
    position: relative;
    z-index: 2;
}

.modern-country-picker__item {
    display: flex;
    align-items: center;
    padding: 6px 0;
    break-inside: avoid;
}

.modern-country-picker__item img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modern-country-picker__item a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
    font-size: 0.95rem;
    font-weight: 400;
}

.modern-country-picker__item a:hover {
    color: #005CA9;
}

.modern-country-picker__item.active a {
    color: #005CA9;
    border-bottom: 2px solid #005CA9;
    padding-bottom: 2px;
    font-weight: 500;
}


.slider-nav,
.slider-dot,
.slick-arrow,
.slick-dots,
.owl-nav,
.owl-dots,
.carousel-control-prev,
.carousel-control-next,
.carousel-indicators,
aside.sidebar,
.sidebar-contact {
    z-index: 10 !important;
}

.large-headerswiper,
.small-headerswiper,
.content-swiper {
    position: relative;
    z-index: 0;
}


.modern-header-container {
    padding-bottom: 0 !important;
}

/* --- ADDITIONAL MEGAMENU STYLES --- */

.megamenu-masonry {
    column-count: 3;
    column-gap: 40px;
}

@media (max-width: 991px) {
    .megamenu-masonry {
        column-count: 1;
    }
}

.megamenu-section {
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin-bottom: 15px !important;
    display: block;
    width: 100%;
}

.megamenu-section-lonely {
    margin-bottom: 15px !important;
}

.megamenu-section-lonely a {
    color: #000 !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    padding: 0 !important;
    display: inline-block;
    transition: color 200ms !important;
    text-decoration: none !important;
}

.megamenu-section-lonely a:hover {
    color: var(--menu-theme-color, #005CA9) !important;
    text-decoration: underline !important;
}

/* Fix the misaligned image which was absolutely positioned by old CSS */
.navbar-nav .dropdown-menu.new-megamenu .nav-image {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    height: 120px !important;
    width: 100% !important;
    margin-top: 15px !important;
    border-radius: 4px;
}

.level-2-heading {
    margin-bottom: 8px !important;
}

.level-2-heading a {
    color: #000 !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    /* Smaller heading font size */
    text-decoration: none !important;
    padding: 0 !important;
    /* Strip bootstrap nav-link padding */
    display: inline-block;
    transition: color 200ms !important;
}

.level-2-heading a:hover {
    color: var(--menu-theme-color, #005CA9) !important;
    text-decoration: underline !important;
}

.level-3-items {
    display: flex;
    flex-direction: column;
    gap: 0px !important;
}

.level-3-items .dropdown-item {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.level-3-items .level-3 {
    padding: 1px 0 1px 12px !important;
    border-left: 2px solid var(--menu-theme-color, #005CA9) !important;
    color: #000 !important;
    font-weight: normal !important;
    font-size: 0.85rem !important;
    line-height: 1.3 !important;
    transition: color 200ms !important;
    display: inline-block !important;
}

.level-3-items .level-3:after {
    display: none !important;
    /* Hide old chevrons */
}

.level-3-items .level-3:hover {
    color: var(--menu-theme-color, #005CA9) !important;
    text-decoration: none !important;
}

/* ==========================================================================
   MEGA FOOTER STYLES
   ========================================================================== */

:root {
    --footer-navy: #1C2341;
    --footer-navy-dark: #12172b;
    --footer-robotics: #26EBDE;
    --footer-acdrives: #00C224;
    --footer-motion: #8F94FF;
    --footer-controls: #005CA9;
}

/* ── Base ── */
.footer-mega {
    background-color: var(--footer-navy);
    color: #fff;
    position: relative;
    font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    margin-top: auto;
    max-width: none;
}

/* ── Gradient bar ── */
.footer-mega-gradient-bar {
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg,
            var(--footer-robotics),
            var(--footer-acdrives),
            var(--footer-motion),
            var(--footer-controls));
}

/* ── Container ── */
.footer-mega-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Footer Top ── */
.footer-mega-top {
    padding: 60px 0 30px;
}

/* ── CSS Grid Layout ── */
.footer-mega-grid {
    display: grid;
    grid-template-columns: 260px repeat(4, 1fr);
    gap: 20px 35px;
}

/* ── Branding column (spans 2 rows) ── */
.footer-mega-col-branding {
    grid-row: 1 / 3;
    padding-right: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-mega-logo {
    filter: brightness(0) invert(1);
    max-height: 36px;
    margin-bottom: 20px;
}

.footer-mega-tagline {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.88rem;
    line-height: 1.7;
    margin: 0 0 24px;
}

/* ── Company links (horizontal under tagline) ── */
.footer-mega-company-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 0 0 28px;
    padding: 0;
    list-style: none;
}

.footer-mega-company-links ul li a {
    color: #fff !important;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
    position: relative;
}

.footer-mega-company-links ul li a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--footer-controls);
    transition: width 0.3s ease;
}

.footer-mega-company-links ul li a:hover::after {
    width: 100%;
}

/* ── Social icons ── */
.footer-mega-social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-mega-social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-mega-social-icons a:hover {
    background: var(--footer-controls);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 92, 169, 0.4);
}

/* ── Navigation link columns ── */
.footer-mega-col-links {
    min-width: 0;
    /* prevent grid blowout */
}

.footer-mega-col-links h5 {
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0 0 16px;
    padding-bottom: 10px;
    color: #fff;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.footer-mega-col-links h5:empty {
    display: none;
}

.footer-mega-col-links h5 a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-mega-col-links h5 a:hover {
    color: var(--footer-controls);
}

.footer-mega-col-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-mega-col-links ul li {
    margin-bottom: 7px;
}

.footer-mega-col-links ul li a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: 0.82rem;
    line-height: 1.4;
    transition: all 0.25s ease;
    display: inline-block;
}

.footer-mega-col-links ul li a:hover {
    color: #fff;
    padding-left: 4px;
}

/* ==========================================================================
   MEGA FOOTER – OLD SNIPPET INTEGRATION OVERRIDES
   ========================================================================== */

.footer-mega-snippet-bottom>footer {
    display: contents;
}

.footer-mega-snippet-bottom .footer-columns {
    display: none !important;
}

.footer-mega-snippet-bottom .footer-informations {
    background-color: var(--footer-navy-dark) !important;
    border-top: none !important;
    padding: 18px 0 !important;
    font-size: 0.82rem !important;
    color: rgba(255, 255, 255, 0.45) !important;
    max-width: none !important;
}

.footer-mega-snippet-bottom .footer-informations .container {
    max-width: 1200px !important;
}

.footer-mega-snippet-bottom .footer-informations .row {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.footer-mega-snippet-bottom .footer-informations a {
    color: rgba(255, 255, 255, 0.45) !important;
    text-decoration: none !important;
    transition: color 0.3s !important;
}

.footer-mega-snippet-bottom .footer-informations a:hover {
    color: #fff !important;
}

.footer-mega-snippet-bottom .footer-informations ul li {
    display: inline-block;
}

.footer-mega-snippet-bottom .footer-informations ul li:after {
    border-right-color: rgba(255, 255, 255, 0.2) !important;
}

/* ==========================================================================
   MEGA FOOTER – RESPONSIVE
   ========================================================================== */

@media (max-width: 1100px) {
    .footer-mega-grid {
        grid-template-columns: 240px repeat(3, 1fr);
    }

    .footer-mega-col-branding {
        grid-row: 1 / 4;
    }
}

@media (max-width: 991px) {
    .footer-mega-top {
        padding: 40px 0 20px;
    }

    .footer-mega-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px 30px;
    }

    .footer-mega-col-branding {
        grid-column: 1 / -1;
        /* full width */
        grid-row: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding-right: 0;
        padding-bottom: 30px;
    }

    .footer-mega-social-icons {
        margin-bottom: 10px;
    }
}

@media (max-width: 575px) {
    .footer-mega-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-mega-snippet-bottom .footer-informations .row {
        flex-direction: column !important;
        text-align: center !important;
    }

    .footer-mega-company-links ul {
        flex-wrap: wrap;
    }
}

/* --- REFACTORED INLINE STYLES --- */
#modern-site-header {
    z-index: 2147483647;
}

.modern-header-top-row {
    position: relative;
    z-index: 1000;
}

.modern-header-logo {
    margin-left: 0px;
}

.modern-header-logo-img {
    max-height: 45px;
    display: block;
}

.modern-header-countryPicker {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.modern-header-bottom-row {
    border-bottom: 1px solid #eaeaea;
    position: relative;
    z-index: 10;
}

.modern-search-wrapper {
    position: static !important;
    transform: none !important;
}

.modern-search-icon {
    position: static !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    font-size: 1.2rem;
    cursor: pointer;
    color: #000;
    margin: 0;
}