/* Define CSS Variables for easy color management */
:root {
    /* Default Light Mode Colors */
    --primary-color: #003366; /* Darker Blue for header/footer */
    --secondary-color: #f2f2f2; /* Light Gray for alternating sections */
    --body-bg: var(--secondary-color); /* General page background */
    --content-bg: #ffffff; /* Background for main content cards/sections */
    --body-text-color: #333; /* Default text color for body/light backgrounds */
    --header-text-color: #fff; /* Text color for dark header/footer */
    --footer-text-color: #fff; /* Text color for dark header/footer */
    --accent-color: #ff9900; /* Orange accent */
    --border-color: #ddd; /* Light border color */
    /* USA Flag colors */
    --usa-blue: #002868;
    --usa-red: #bf0a30;
    --usa-white: #ffffff;
}
/* Dark Mode Overrides - Activated by user's system preference */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #0d1e3a; /* Even darker blue for primary elements in dark mode */
        --secondary-color: #1a1a1a; /* Very dark gray for overall background */
        --body-bg: var(--secondary-color);
        --content-bg: #2a2a2a; /* Slightly lighter dark for content areas */
        --body-text-color: #e0e0e0; /* Lighter text for dark backgrounds */
        --header-text-color: #f0f0f0; /* Very light text for dark header */
        --footer-text-color: #f0f0f0; /* Very light text for dark footer */
        --accent-color: #ffc466; /* Brighter orange for better visibility in dark mode */
        --border-color: #444; /* Darker border color */
        /* Adjust USA Flag colors for dark mode if needed, usually not necessary for flags */
    }
    /* Adjust specific elements for dark mode visibility */
    .bbb-seal img {
        /* Slightly brighten the BBB seal for visibility on dark backgrounds */
        filter: brightness(1.1) contrast(1.1);
    }
    .manufacturer-item img {
        /* Reduce grayscale intensity and slightly brighten for dark mode */
        filter: grayscale(70%) brightness(1.1) contrast(1.1);
    }
    .manufacturer-item:hover img {
        /* Restore full color and brightness on hover in dark mode */
        filter: grayscale(0%);
        opacity: 1;
    }
}

/* Basic body styling */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    color: var(--body-text-color); /* Use variable for general text color */
    line-height: 1.6;
    background-color: var(--body-bg); /* Use variable for body background */
    overflow-x: hidden; /* Prevent horizontal scroll on small screens */
}
/* Universal container for content width */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box; /* Include padding in element's total width and height */
}
/* Header Styling */
header {
    background-color: var(--primary-color); /* Header uses primary color */
    color: var(--header-text-color); /* Header text color */
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 15px; /* Add gap between elements for better spacing */
}
.logo {
    color: var(--header-text-color); /* Logo link color, though usually overridden by img */
    text-decoration: none;
    flex-shrink: 0;
}
.logo img {
    max-height: 50px;
    width: auto;
    display: block;
}
/* "Get a Quote" Button Styling */
.get-a-quote-btn {
    background-color: var(--accent-color);
    color: var(--primary-color); /* Dark text on accent background */
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap; /* Prevent text from breaking */
    transition: background-color 0.3s ease, color 0.3s ease;
    margin-left: auto; /* Push it to the far right */
}
.get-a-quote-btn:hover {
    background-color: #e68a00; /* Slightly darker orange on hover */
    color: var(--header-text-color); /* Lighter text on hover */
}

/* BBB Seal container styling for footer placement */
.bbb-seal {
    flex-shrink: 0;
    margin-left: auto; /* Pushes it to the far right when space allows */
    padding-right: 10px; /* Consistent padding with other footer columns */
    text-align: right; /* Align content inside to the right */
    align-self: flex-start; /* Align to the start of the cross-axis */
    min-width: 150px; /* Give it a minimum width */
    order: 5; /* Ensure it appears after other columns */
}
.bbb-seal img {
    max-width: 100%;
    height: auto;
    border: none;
    display: block;
    margin: 0 0 0 auto; /* Align the image itself to the right within its flex item */
}
/* Navigation Styling */
nav {
    /* Allow nav to take remaining space but prefer to stay compact */
    flex-grow: 1;
    display: flex;
    justify-content: flex-end; /* Push nav content to the right */
}
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end; /* Ensure links stay right-aligned */
    gap: 10px; /* Gap between top-level nav items */
}
nav ul li {
    margin-left: 15px; /* Adjust spacing between nav items */
    position: relative; /* Needed for dropdown positioning */
    margin-bottom: 5px; /* For wrapping behavior */
}
nav ul li a {
    color: var(--header-text-color); /* Nav links use header text color */
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s ease;
    white-space: nowrap; /* Prevent links from breaking into multiple lines */
    padding: 5px 0; /* Add some padding for clickable area */
    display: block; /* Make the whole link clickable */
}
nav ul li a:hover {
    color: var(--accent-color);
}
/* Dropdown specific styles */
.dropdown .dropdown-content {
    display: none; /* Hidden by default */
    position: absolute;
    background-color: var(--primary-color); /* Use primary color for dropdown background */
    min-width: 180px; /* Slightly wider dropdown for content */
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1; /* Ensure it appears above other content */
    left: 0; /* Align to the left of its parent li */
    top: 100%; /* Position below the parent link */
    padding: 10px 0; /* Padding inside dropdown */
    border-radius: 5px;
}
.dropdown .dropdown-content a {
    color: var(--header-text-color); /* Links within dropdown */
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    white-space: nowrap;
}
.dropdown .dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Slight highlight on hover */
    color: var(--accent-color);
}
.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content { /* Show dropdown on hover or when a child element has focus */
    display: block;
}
/* Indicator for dropdown (optional) */
.dropdown > a::after {
    content: ' \25BC'; /* Unicode for a down arrow */
    font-size: 0.7em;
    margin-left: 5px;
    vertical-align: middle;
}

/* Hero Section Styling */
.hero-section {
    /* Background uses the new image URL */
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fimages.pexels.com%2Fphotos%2F13558863%2Fpexels-photo-13558863.jpeg%3Fauto%3Dcompress%26cs%3Dtinysrgb%26h%3D627%26fit%3Dcrop%26w%3D1200&f=1&nofb=1&ipt=58e05b7faafc84c578f26e6c8af1616be555a4f59ebefad0543692353ca16d99') no-repeat center center/cover;
    color: var(--header-text-color); /* Hero text uses light text color */
    text-align: center;
    padding: 100px 20px;
    position: relative;
}
.hero-section h1 {
    font-size: 3.5em;
    margin-bottom: 20px;
    font-weight: 700;
}
.hero-section p {
    font-size: 1.3em;
    max-width: 800px;
    margin: 0 auto 40px auto;
}
/* Hero specific paragraph for justification */
.hero-description-text {
    text-align: justify; /* Justify text as requested */
    text-align-last: center; /* Tries to center the last line if not full */
}

/* General Content Section Styling */
.content-section {
    background-color: var(--content-bg); /* Content section background */
    padding: 60px 0;
    border-bottom: 1px solid var(--border-color); /* Border color */
}
.content-section h2 {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 40px;
    color: var(--primary-color); /* Headings use primary color */
}
.content-section p {
    font-size: 1.1em;
    margin-bottom: 20px;
}
/* Services Grid Styling */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}
.service-item {
    background-color: var(--body-bg); /* Service item background */
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}
.service-item:hover {
    transform: translateY(-5px);
}
.service-item h3 {
    color: var(--primary-color); /* Service item headings use primary color */
    font-size: 1.5em;
    margin-bottom: 15px;
}

/* Federal Partners Section (New Slider) */
.federal-partners-section {
    background-color: var(--primary-color); /* Darker background to match screenshot */
    padding: 60px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color); /* Add a separator */
    color: var(--header-text-color); /* Ensure text is visible on dark background */
}

.federal-partners-section h2 {
    font-size: 2.5em;
    margin-bottom: 40px;
    color: var(--header-text-color); /* Heading color for dark background */
}

.federal-partners-slider {
    position: relative; /* For positioning controls */
    width: 100%;
    overflow: hidden; /* Hide overflowing items */
    padding: 20px 0; /* Vertical padding for the slider itself */
}

.slider-track {
    display: flex; /* Arrange items horizontally */
    gap: 30px; /* Space between logos */
    padding: 10px; /* Padding around logos in the track */
    justify-content: flex-start; /* Align items to the start initially */
    align-items: center;
    flex-wrap: nowrap; /* Ensure items stay in a single line */
    transition: transform 0.5s linear; /* Use linear for continuous scroll, shorter duration */
    will-change: transform; /* Hint to browsers for performance */
    /* Remove cursor: grab; as it's not a draggable slider anymore */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    /* The width of the track will be managed by JS to accommodate cloned items */
}

.federal-partner-item {
    display: flex; /* Use flex for internal centering */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--content-bg); /* White/light background for logo cards */
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2); /* Stronger shadow for card effect */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0; /* Prevent items from shrinking */
    width: 120px; /* Fixed width for square-ish items */
    height: 120px; /* Fixed height for square-ish items */
}

.federal-partner-item:hover {
    transform: translateY(-5px); /* Lift effect on hover */
    box-shadow: 0 8px 16px rgba(0,0,0,0.3); /* Stronger shadow on hover */
}

.federal-partner-item img {
    max-width: 90%; /* Ensure images don't overflow their container */
    max-height: 90%; /* Control image height within the item */
    object-fit: contain; /* Ensure images fit within their bounds without cropping */
    filter: grayscale(100%) brightness(0.8); /* Grayscale and slightly darker on default */
    opacity: 0.7;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.federal-partner-item:hover img {
    filter: grayscale(0%) brightness(1); /* Full color and brightness on hover */
    opacity: 1;
}

.federal-partner-item a {
    display: flex; /* Make the whole link area flexible for centering content */
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

/* No slider controls (buttons/dots) in this version for continuous scroll */
.slider-controls, .slider-btn, .slider-dots, .dot {
    display: none; /* Hide these elements as they are not used for continuous scroll */
}


/* Manufacturers Section Styling */
.manufacturers-section {
    background-color: var(--secondary-color); /* Manufacturers section background */
    padding: 60px 0;
    text-align: center;
}
.manufacturers-section h2 {
    font-size: 2.5em;
    margin-bottom: 40px;
    color: var(--primary-color); /* Manufacturers heading uses primary color */
}
/* Sub-sections for Made in USA / Others */
.manufacturer-group {
    margin-bottom: 40px; /* Space between groups */
}
.manufacturer-group:last-of-type {
    margin-bottom: 0;
}
.manufacturer-group h3 {
    font-size: 1.8em;
    color: var(--primary-color);
    margin-bottom: 25px;
    text-align: center;
}

.manufacturer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    padding: 0 20px;
    justify-content: center; /* Center items in the grid if not full rows */
}
.manufacturer-item {
    background-color: var(--content-bg); /* Manufacturer item background */
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex; /* Use flexbox for vertical stacking of logo and badge */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 120px; /* Increased height to accommodate badge */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.manufacturer-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.manufacturer-item img {
    max-width: 90%;
    max-height: 70px;
    display: block;
    margin: 0 auto 5px auto; /* Add margin below logo for the badge */
    filter: grayscale(100%);
    opacity: 0.7;
    transition: filter 0.3s ease, opacity 0.3s ease;
}
.manufacturer-item:hover img {
    filter: grayscale(0%);
    opacity: 1;
}
.manufacturer-item a {
    display: block;
    text-decoration: none;
    color: inherit;
    width: 100%; /* Ensure link takes full width for click area */
    height: auto; /* Let content determine height */
    text-align: center; /* Center the logo within the link */
}
/* Made in USA Badge Styling */
.made-in-usa-badge {
    display: flex; /* Use flex for icon and text side-by-side */
    align-items: center;
    gap: 5px; /* Space between icon and text */
    font-size: 0.75em;
    font-weight: 600;
    color: var(--primary-color); /* Text color for the badge */
    white-space: nowrap; /* Prevent text wrapping */
    margin-top: 5px; /* Space above the badge */
    opacity: 0; /* Hidden by default */
    visibility: hidden; /* Also hide from screen readers when off */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.manufacturer-item.is-made-in-usa .made-in-usa-badge {
    opacity: 1; /* Show when parent has class */
    visibility: visible;
}
.usa-flag-icon {
    width: 20px; /* Size of the SVG icon */
    height: 12px;
    flex-shrink: 0; /* Prevent icon from shrinking */
}
/* SVG specific colors */
.usa-flag-icon .star {
    fill: var(--usa-white); /* Stars are white */
}
.usa-flag-icon .blue-field {
    fill: var(--usa-blue); /* Blue field */
}
.usa-flag-icon .red-stripe {
    fill: var(--usa-red); /* Red stripes */
}
.usa-flag-icon .white-stripe {
    fill: var(--usa-white); /* White stripes */
}
/* Footer Styling */
footer {
    background-color: var(--primary-color); /* Footer uses primary color */
    color: var(--footer-text-color); /* Footer text color */
    padding: 40px 0;
    font-size: 0.9em;
    text-align: center;
}
footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
}
footer .footer-col {
    flex: 1;
    min-width: 220px;
    margin-bottom: 20px;
    padding: 0 10px;
}
footer .footer-col h4 {
    color: var(--accent-color); /* Footer headings use accent color */
    margin-bottom: 15px;
    font-size: 1.1em;
}
footer .footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
footer .footer-col ul li {
    margin-bottom: 10px;
}
footer .footer-col ul li a {
    color: var(--footer-text-color); /* Footer links use footer text color */
    text-decoration: none;
    transition: color 0.3s ease;
}
footer .footer-col ul li a:hover {
    color: var(--accent-color);
}
footer .contact-info p {
    margin-bottom: 10px;
}
footer .copyright {
    width: 100%;
    margin-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 20px;
    text-align: center;
}
/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
        gap: 10px; /* Reduce gap on small screens */
    }

    .logo {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .get-a-quote-btn {
        width: 100%; /* Make button full width on mobile */
        margin-left: 0; /* Remove auto margin */
        order: -1; /* Place button above logo and nav */
    }
    nav {
        width: 100%; /* Make nav take full width */
        justify-content: center; /* Center nav content */
    }
    nav ul {
        flex-direction: column;
        margin-top: 15px;
        align-items: center;
        width: 100%;
        gap: 0; /* Remove gap for stacked list items */
    }
    nav ul li {
        margin: 0; /* Remove margin-left */
        padding: 10px 0; /* Add vertical padding for touch targets */
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1); /* Separator for stacked links */
    }
    nav ul li:last-child {
        border-bottom: none; /* No border for the last item */
    }
    /* Dropdown on mobile should not be absolute or tiny */
    .dropdown .dropdown-content {
        position: static; /* Remove absolute positioning */
        width: 100%; /* Take full width */
        box-shadow: none; /* Remove shadow */
        border-top: 1px solid rgba(255,255,255,0.1); /* Add a separator */
        border-radius: 0;
        padding: 0; /* Adjust padding */
    }
    .dropdown .dropdown-content a {
        padding: 10px 20px; /* Adjust padding for mobile dropdown items */
        text-align: center; /* Center links */
    }
    /* Remove dropdown arrow on mobile to simplify */
    .dropdown > a::after {
        content: none;
    }
    .hero-section {
        padding: 80px 20px;
    }
    .hero-section h1 {
        font-size: 2.5em;
    }
    .hero-section p {
        font-size: 1em;
    }
    .content-section h2, .manufacturers-section h2, .federal-partners-section h2 {
        font-size: 2em;
    }
    .services-grid {
        grid-template-columns: 1fr;
    }
    .manufacturer-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    /* Adjust footer container for smaller screens */
    footer .container {
        flex-direction: column; /* Stack columns vertically on smaller screens */
        align-items: center; /* Center stacked columns */
    }
    footer .footer-col {
        width: 100%; /* Take full width when stacked */
        text-align: center; /* Center content when stacked */
        margin-bottom: 20px;
        min-width: unset; /* Remove min-width to allow full flexibility */
    }
    /* BBB seal will always be last and centered on small screens */
    .bbb-seal {
        order: 100; /* Pushes it to the very bottom */
        margin-left: 0;
        margin-right: 0;
        text-align: center;
        padding-right: 0;
        width: 100%;
    }
    .bbb-seal img {
        margin: 0 auto; /* Center the image in stacked layout */
    }
}
/* For very small screens (e.g., old mobile landscape) */
@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 2em;
    }

    .manufacturer-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 10px;
    }
    .manufacturer-item {
        padding: 10px;
        min-height: 70px;
    }
    .manufacturer-item img {
        max-height: 50px;
    }
    .federal-partner-item {
        min-width: 100px; /* Adjust min-width for very small screens */
        height: 100px; /* Adjust height for very small screens */
    }
}
