/* Custom Navigation Styles */
.site-header {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-header .section-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-header .site-branding {
    display: flex;
    align-items: center;
}

.site-header .site-description {
    display: none;
}

.site-header .site-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
    color: #1a1a1a;
}

.site-header .site-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}

.site-header .site-title a:hover {
    color: #CC0000;
}

.site-header nav#site-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0rem 0rem 0.5rem 2rem;
}

.site-header #primary-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
}

.site-header #primary-menu > li {
    position: relative;
}

.site-header #primary-menu a {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 0;
    display: block;
    position: relative;
}

.site-header #primary-menu a:hover,
.site-header #primary-menu a:visited:hover {
    color: #CC0000;
}

.site-header #primary-menu a:visited {
    color: #1a1a1a;
}

/* Dropdown Submenu Styles */
.site-header #primary-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 250px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 0.5rem 0;
    margin-top: 0; /* Removed gap that was causing hover to break */
    z-index: 100;
}

.site-header #primary-menu li:hover > .sub-menu {
    display: block;
}

.site-header #primary-menu .sub-menu li {
    display: block;
    width: 100%;
}

.site-header #primary-menu .sub-menu a {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    color: #4a4a4a;
    font-weight: normal;
}

.site-header #primary-menu .sub-menu a:hover {
    background-color: #f5f5f5;
    color: #CC0000;
}

/* Add arrow to parent items */
.site-header #primary-menu .menu-item-has-children > a:after {
    content: " ▼";
    font-size: 0.7em;
    opacity: 0.6;
}

/* Active/Current Page Indicators */
.site-header #primary-menu .current-menu-item > a,
.site-header #primary-menu .current-page-parent > a,
.site-header #primary-menu .current_page_item > a,
.site-header #primary-menu .current_page_parent > a {
    color: #CC0000;
    position: relative;
}

.site-header #primary-menu .current-menu-item > a:after,
.site-header #primary-menu .current-page-parent > a:after,
.site-header #primary-menu .current_page_item > a:after,
.site-header #primary-menu .current_page_parent > a:after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #CC0000;
    border-radius: 2px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: scaleX(0);
        opacity: 0;
    }
    to {
        transform: scaleX(1);
        opacity: 1;
    }
}

/* Add buffer space between navigation and content */
main#main {
    padding-top: 1rem;
}

/* Ensure hero sections don't get extra padding */
.main-hero,
.hero-section,
section:first-of-type {
    margin-top: -1rem;
}

/* Current submenu items */
.site-header #primary-menu .sub-menu .current-menu-item > a,
.site-header #primary-menu .sub-menu .current_page_item > a {
    color: #CC0000;
    background-color: #fff5f5;
    font-weight: 600;
}

/* Adjust dropdown arrow position for active items with long underlines */
.site-header #primary-menu .menu-item-has-children.current-menu-item > a:after,
.site-header #primary-menu .menu-item-has-children.current-page-parent > a:after {
    margin-left: 5px;
}

/* Ensure underline doesn't interfere with dropdown positioning */
.site-header #primary-menu .menu-item-has-children.current-menu-item .sub-menu,
.site-header #primary-menu .menu-item-has-children.current-page-parent .sub-menu {
    margin-top: 3px;
}

/* Header layout - Desktop */
.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 2rem;
    position: relative;
}

.header-top-row .site-branding {
    display: flex;
    align-items: center;
}
.subhead_phone {
    font-size: 1.2em;
    font-weight: bold;
    a {
        color: rgb(204 0 0);
        &:hover {
            text-decoration: underline;
        }
    }
}
/* Hide mobile button on desktop */
.menu-toggle {
    display: none;
}

/* Fix visited link colors for buttons */
.bg-white.text-nexus-red:visited {
    color: #CC0000 !important;
}

.text-white:visited {
    color: white !important;
}

/* Footer link visited states - ensure they match non-visited */
.footer-links a:visited {
    color: #bdc3c7 !important;
}

.footer-legal-links a:visited {
    color: #95a5a6 !important;
}

.footer-parent-company a:visited {
    color: #bdc3c7 !important;
}

/* Industry page button text visibility fixes */
.bg-white.text-green-600 {
    color: #16a34a !important;
}

.bg-white.text-blue-600 {
    color: #2563eb !important;
}

.bg-white.text-orange-600 {
    color: #ea580c !important;
}

.bg-white.text-purple-600 {
    color: #9333ea !important;
}

.bg-white.text-indigo-600 {
    color: #4f46e5 !important;
}

.bg-white.text-gray-600 {
    color: #4b5563 !important;
}

/* WPForms Custom Styling for Nexus Alarm & Suppression */
.wpforms-nexus-contact {
    --wpforms-field-border-radius: 0.375rem;
    --wpforms-field-border-color: #d1d5db;
    --wpforms-field-border-color-focus: #CC0000;
    --wpforms-field-text-color: #374151;
    --wpforms-field-background-color: #ffffff;
    --wpforms-button-background-color: #CC0000;
    --wpforms-button-background-color-hover: #b91c1c;
}

.wpforms-nexus-contact .wpforms-form {
    padding: 0;
}

.wpforms-nexus-contact .wpforms-field-container {
    margin-bottom: 0;
}

.wpforms-nexus-contact .wpforms-field {
    margin-bottom: 1.5rem;
}

.wpforms-nexus-contact .wpforms-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: start;
}

.wpforms-nexus-contact .wpforms-field-row .wpforms-field {
    margin-bottom: 0;
    align-self: start;
}

.wpforms-nexus-contact .wpforms-field-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
    line-height: 1.25;
}

.wpforms-nexus-contact .wpforms-field-row .wpforms-field-label {
    margin-top: 0;
}

.wpforms-nexus-contact .wpforms-field-required {
    color: #CC0000;
}

.wpforms-nexus-contact input[type="text"],
.wpforms-nexus-contact input[type="email"],
.wpforms-nexus-contact input[type="tel"],
.wpforms-nexus-contact select,
.wpforms-nexus-contact textarea {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wpforms-nexus-contact input[type="text"]:focus,
.wpforms-nexus-contact input[type="email"]:focus,
.wpforms-nexus-contact input[type="tel"]:focus,
.wpforms-nexus-contact select:focus,
.wpforms-nexus-contact textarea:focus {
    outline: none;
    border-color: #CC0000;
    box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.1);
}

.wpforms-nexus-contact textarea {
    resize: vertical;
    min-height: 100px;
}

.wpforms-nexus-contact .wpforms-submit-container {
    margin-top: 1.5rem;
    margin-bottom: 0;
}

.wpforms-nexus-contact .wpforms-submit {
    display: inline-block;
    background-color: #CC0000;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 0.375rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 1rem;
}

.wpforms-nexus-contact .wpforms-submit:hover {
    background-color: #b91c1c;
}

.wpforms-nexus-contact .wpforms-confirmation-container {
    background-color: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #0369a1;
}

.wpforms-nexus-contact .wpforms-error {
    background-color: #fef2f2;
    border: 1px solid #f87171;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #dc2626;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wpforms-nexus-contact .wpforms-field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .wpforms-nexus-contact .wpforms-submit {
        width: 100%;
        text-align: center;
    }
}

/* Mobile Navigation Improvements */
@media (max-width: 768px) {
    /* Mobile header layout - hamburger on left, logo immediately after */
    .header-top-row {
        padding: 0.5rem 1rem;
        gap: 0.75rem;
    }
    
    .header-top-row .site-branding {
        margin: 0;
    }
    .subhead_phone {
        font-size: 0.9em;
    }
    .hide_mob {
        display: none;
    }
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.5rem;
        color: #1a1a1a;
        transition: color 0.2s;
        border-radius: 4px;
        margin: 0;
        flex-shrink: 0;
    }
    
    .menu-toggle:hover {
        color: #CC0000;
        background-color: #f5f5f5;
    }
    
    .menu-toggle svg {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    /* Navigation menu positioning */
    .site-header #site-navigation {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        border-top: none;
        padding: 0;
    }
    
    .site-header #primary-menu {
        display: none;
        background: white;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        flex-direction: column;
        padding: 1rem 0;
        gap: 0;
        margin: 0;
        list-style: none;
    }
    
    .site-header #site-navigation.toggled #primary-menu {
        display: flex;
    }
    
    .site-header #primary-menu > li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .site-header #primary-menu > li:last-child {
        border-bottom: none;
    }
    
    .site-header #primary-menu a {
        padding: 1rem 2rem;
        font-size: 1rem;
        display: block;
        border-radius: 0;
    }
    
    .site-header #primary-menu a:hover {
        background-color: #f5f5f5;
    }
    
    /* Mobile submenu styles */
    .site-header #primary-menu .sub-menu {
        position: static;
        display: none;
        box-shadow: none;
        background: #f9f9f9;
        border-radius: 0;
        padding: 0;
        margin: 0;
    }
    
    .site-header #primary-menu .menu-item-has-children.toggled .sub-menu,
    .site-header #primary-menu .menu-item-has-children.focus .sub-menu {
        display: block;
    }
    
    .site-header #primary-menu .sub-menu a {
        padding-left: 3rem;
        font-size: 0.95rem;
        background: #f9f9f9;
        border-bottom: 1px solid #e5e5e5;
    }
    
    .site-header #primary-menu .sub-menu a:hover {
        background-color: #f0f0f0;
    }
    
    /* Adjust header layout for mobile */
    .site-header > div:first-child {
        padding: 0 1rem;
    }
    
    /* Hide desktop navigation completely on mobile */
    .site-header nav#site-navigation {
        position: relative;
    }
}