.product-subtype-list {
    margin-top: 1rem;
    padding-left: 1.5rem;
    list-style-type: disc;
    color: #333;
    font-size: 1rem;
}
/**
 * ===================================
 *      GLOBAL SETUP & VARIABLES
 * ===================================
 */
:root {
    --primary-color: #005A9C;    /* Royal Blue for branding, buttons, and links */
    --primary-dark: #004a80;     /* Darker blue for hover states */
    --accent-color: #28A745;     /* Green for success states, highlights */
    --text-primary: #2d3748;     /* Dark gray for main text (more accessible) */
    --text-secondary: #718096;   /* Lighter gray for subtitles and secondary info */
    --bg-primary: #F7FAFC;       /* Very light gray for the main page background */
    --bg-surface: #FFFFFF;       /* White for cards, headers, and modals */
    --border-color: #E2E8F0;     /* Light gray for borders and dividers */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --header-height: 74px;       /* Centralized header height for layout calculations */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
    font-size: 100%; /* 1rem = 16px */
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    overflow-x: hidden; /* Prevents horizontal scroll caused by minor layout shifts */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-primary);
}



/**
 * ===================================
 *      LAYOUT & UTILITY CLASSES
 * ===================================
 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page {
    display: none; /* Pages are hidden by default */
}

.page.active {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

/* Main content container needs padding to avoid being hidden by the sticky header */
 main, #main-content-container {
    padding-top: var(--header-height); 
    flex: 1 0 auto;
    min-height: 400px; /* adjust as needed */
    padding-bottom: 40px; /* enough space above footer */
}

/* Hero Section Specifics for Animation */
.hero-section-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    animation: kenburns 20s ease-out infinite;
}

.hero-content {
    position: relative;
    z-index: 10; 
}

/**
 * ===================================
 *      COMPONENT: HEADER & NAVIGATION
 * ===================================
 */
.site-header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
}

.site-title {
    font-weight: 700;
    font-size: 0.875rem; /* 14px */
    color: var(--text-primary);
    line-height: 1.2;
}

.site-slogan {
    font-size: 0.75rem; /* 12px */
    color: var(--primary-color);
    font-weight: 500;
}

.main-nav ul {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 0.5rem;
}

.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem; /* 15px */
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background-color: #eef5ff;
}

.nav-link.apply-now {
    background-color: var(--primary-color);
    color: var(--bg-surface);
    box-shadow: 0 4px 14px 0 rgba(0, 90, 156, 0.3);
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.nav-link.apply-now:hover {
    background-color: var(--primary-dark);
    color: var(--bg-surface);
    transform: translateY(-2px);
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content; /* Auto-width based on content */
    padding: 0.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    list-style: none;
    z-index: 1010;
    /* Animation */
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

/* --- Navigation Dropdown --- */
.nav-item-with-dropdown {
    position: relative;
}

.nav-item-with-dropdown:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown a {
    display: block;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

/* --- Mobile Navigation --- */
.mobile-menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1051; /* Above nav content */
}

.mobile-menu-toggle .icon-bar {
    display: block;
    width: 24px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

/* Animate hamburger to 'X' */
.mobile-menu-toggle.is-active .icon-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.mobile-menu-toggle.is-active .icon-bar:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.is-active .icon-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/**
 * ===================================
 *      COMPONENT: BUTTONS
 * ===================================
 */
.btn-highlight {
    animation: pulse 2.5s infinite;
}

/**
 * ===================================
 *      COMPONENT: FORMS & FAQ
 * ===================================
*/

/* A reusable class for primary form submission buttons */
.btn-form-submit {
    background-color: var(--primary-color);
    padding: 0.8rem 1.5rem;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 0.5rem;
    border: none !important; /* Override potential conflicts */
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 14px 0 rgba(0, 90, 156, 0.35);
}

.btn-form-submit:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(0, 90, 156, 0.4);
}

.sidebar-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-left: 3px solid transparent;
    border-radius: 0 0.375rem 0.375rem 0;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.sidebar-link.active,
.sidebar-link:hover {
    background-color: rgba(0, 90, 156, 0.1);
    color: var(--primary-color);
    font-weight: 600;
    border-left-color: var(--primary-color);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-in-out;
}

/**
 * ===================================
 *      COMPONENT: FOOTER
 * ===================================
 */
.site-footer, footer {
    background-color: #1a202c; /* Darker than text-primary */
    color: #a0aec0; /* Lighter gray for footer text */
    margin-top: auto;
    width: 100%;
    position: relative;
    z-index: 999;
    padding-top: 40px;
    padding-bottom: 40px;
}

.footer-link {
    color: #a0aec0;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--bg-surface);
}

/**
 * ===================================
 *      COMPONENT: CHATBOT
 * ===================================
 */
#chat-toggle-button {
    position: fixed;
    bottom: 1.25rem; /* 20px */
    right: 1.25rem; /* 20px */
    width: 140px;
    height: 140px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    transition: transform 0.3s ease;
}

#chat-toggle-button:hover {
    transform: scale(1.1);
}

#chat-toggle-button img {
    width: 124px;
    height: 124px;
}

#chat-window {
    position: fixed;
    bottom: calc(1.25rem + 60px + 0.5rem); /* Position above toggle button */
    right: 1.25rem;
    width: 370px;
    max-width: 90vw;
    height: 600px;
    max-height: 75vh;
    background: var(--bg-surface);
    border-radius: 0.75rem; 
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); 
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
    /* Animation properties for desktop */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

/* Style for when the chat window is open */
#chat-window.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

 #chat-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

#chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#chat-header-info img {
    width: 40px;
    height: 40px;
}

#chat-header-info h3 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

#chat-header-info p {
    font-size: 0.75rem;
    opacity: 0.9;
    line-height: 1;
}

#chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.75rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#chat-close-btn:hover {
    opacity: 1;
}

#chat-messages {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    background-color: var(--bg-primary);
}

.chat-bubble {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    line-height: 1.5;
    animation: slide-in 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.user-bubble {
    background-color: var(--primary-color);
    color: white;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 0.25rem;
}

.ai-bubble {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#chat-input-container {
    border-top: 1px solid var(--border-color);
    padding: 0.75rem;
    display: flex;
    gap: 0.5rem;
    background-color: var(--bg-surface);
    flex-shrink: 0;
}

#chat-input {
    flex-grow: 1;
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

#chat-send-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 1.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

#chat-send-btn:hover {
    background-color: var(--primary-dark);
}

/* Backdrop for chat on mobile to improve focus */
#chat-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#chat-backdrop.is-open {
    opacity: 1;
}

/* New close button that replaces the toggle icon */
#chat-main-close-btn {
    position: fixed;
    bottom: calc(1.25rem + 60px + 0.5rem + 600px - 30px); /* Position above the chat window */
    right: 1.25rem; /* Align with the right edge of the chat window */
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    justify-content: center; /* This was already correct, but the issue was the initial state */
    align-items: center;    
    z-index: 1002; /* Above the chat window */
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: background-color 0.2s, transform 0.2s;
}
#chat-main-close-btn:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    #chat-main-close-btn {
        top: 1rem; /* On mobile, the chat is full screen, so just position from top */
        right: 1rem; /* Align with the right edge of the chat window */
        bottom: auto; /* Reset bottom positioning */
    }
}

/* Ensure the close button is hidden by default using the 'hidden' utility class */
.hidden {
    display: none !important;
}

/* Add a handle at the top of the mobile chat window */
.chat-handle {
    display: none; /* Hidden by default, shown on mobile */
}


/**
 * ===================================
 *      COMPONENT: MISCELLANEOUS
 * ===================================
 */
#back-to-top-btn {
    position: fixed;
    bottom: 1.25rem;
    right: calc(1.25rem + 140px + 0.75rem); /* Position left of chat button */
    background-color: var(--bg-surface);
    color: var(--primary-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s, transform 0.3s, box-shadow 0.3s;
}

#back-to-top-btn:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

#back-to-top-btn.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* --- CSS Marquee for Brand Logos --- */
.marquee {
    overflow: hidden;
    position: relative;
    -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.marquee-content {
    display: inline-flex;
    align-items: center;
    animation: marquee 40s linear infinite;
}

.marquee-content img {
    height: 3rem; /* 48px */
    margin: 0 2.5rem; /* 40px */
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: filter 0.3s, opacity 0.3s;
}

.marquee:hover .marquee-content {
    animation-play-state: paused;
}

.marquee-content:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/**
 * ===================================
 *      ANIMATIONS & KEYFRAMES
 * ===================================
 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 14px 0 rgba(0, 90, 156, 0.3);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 6px 20px 0 rgba(0, 90, 156, 0.35);
    }
}

@keyframes marquee {
    from { transform: translateX(0%); }
    to { transform: translateX(-50%); }
}

@keyframes kenburns {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.1);
    }
}

@keyframes textFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/**
 * ===================================
 *      RESPONSIVE OVERRIDES
 * ===================================
 */

/* Tablet and below (<= 1024px) */
@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        position: absolute;
        top: calc(var(--header-height) + 10px);
        right: 1rem;
        width: 280px;
        background: var(--bg-surface);
        border-radius: 0.75rem;
        border: 1px solid var(--border-color);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
        padding: 1rem;
        /* Animation */
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px) scale(0.98);
        transform-origin: top right;
        transition: all 0.2s ease-out;
    }

    .main-nav.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }

    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }

    .nav-item-with-dropdown .nav-dropdown {
        display: none; /* Hide dropdowns on mobile; handled by main nav */
    }

    /* Stack the about page layout on smaller screens */
    .about-layout-container {
        flex-direction: column;
    }
    .right-sidebar {
        width: 100%;
        position: static; /* Remove sticky positioning */
    }
}

/* Mobile devices (<= 768px) */
@media (max-width: 768px) {
    /* Professional mobile chat window styling */
    #chat-window {
        /* Center the modal on the mobile screen */
        top: 50%;
        left: 50%;
        width: 90vw; 
        height: 80vh; 
        max-height: 600px;
        border-radius: 1rem; /* Rounded corners on all sides */
        box-shadow: 0 10px 30px rgba(0,0,0,0.2); /* A more prominent shadow */
        
        /* Inherit desktop animation properties but adjust transform for centering */
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0; /* Start hidden */
        visibility: hidden; /* Start hidden */
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    }

    #chat-window.is-open {
        transform: translate(-50%, -50%) scale(1); /* Scale up to full size when open */
        opacity: 1;
        visibility: visible;
    }

    .chat-handle {
        display: block;
        width: 40px;
        height: 4px;
        background-color: #d1d5db; /* gray-300 */
        border-radius: 2px;
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
    }

    /* Adjust AI chat button size for mobile */
    #chat-toggle-button {
        width: 100px;
        height: 100px;
        bottom: 1rem;
        right: 1rem;
    }

    #chat-toggle-button img {
        width: 90px;
        height: 90px;
    }

    /* Adjust back-to-top button position to not overlap */
    #back-to-top-btn {
        bottom: 1rem;
        right: calc(1rem + 100px + 0.5rem); /* Position left of the smaller chat button */
    }

}

/* Small mobile devices (<= 480px) */
@media (max-width: 480px) {
    html {
        font-size: 94%; /* Slightly scale down all rem-based units */
    }

    .site-title {
        font-size: 0.8rem;
    }

    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Privacy Modal Visibility */
.privacy-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Fix for on-page amortization table */
.amortization-wrap .amo-scroll{ background:#fff; }
.amortization-wrap table th, .amortization-wrap table td{ white-space:nowrap; }
