/* ==================================
   MACHINERIES MARKET - TABLE LAYOUT HEADER
   ================================== */

:root {
    --mm-dark-panel: #111827;
    --mm-accent-blue: #3b82f6;
    --mm-text: #F9FAFB;
    --site-header-height: 80px;
    --font-primary: 'Orbitron', sans-serif;
    --font-secondary: 'Roboto', sans-serif;
}

/* When the header is injected into a holder, ensure it's normal-flow */
#header-holder {
    display: block;
}

/* --- MAIN CONTAINER --- */
.nav-bar {
    position: relative;
    width: 100%;
    min-height: var(--site-header-height);
    height: auto;
    background-color: var(--mm-dark-panel);
    border-bottom: 3px solid var(--mm-accent-blue);
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    overflow: visible;
}

/* --- THE TABLE STRUCTURE --- */
.navbar-table {
    width: 100%;
    min-height: var(--site-header-height);
    table-layout: fixed;
    border-collapse: collapse;
}

/* 1. LEFT CELL (Logo) */
.logo-cell {
    width: 25%;
    vertical-align: middle;
    padding-left: 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-container img {
    height: 40px;
}

.brand-name {
    font-family: var(--font-primary);
    font-size: 1.2rem;
    color: var(--mm-text);
    text-transform: uppercase;
}

/* 2. CENTER CELL (Links) */
.links-cell {
    width: 50%;
    vertical-align: middle;
    text-align: center;
}

.links {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    width: 100%;
}

.links a {
    text-decoration: none;
    color: var(--mm-text);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    padding: 10px;
    transition: color 0.2s;
    white-space: nowrap;
}

.links a:hover {
    color: var(--mm-accent-blue);
}

/* DROPDOWN LOGIC */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(17, 24, 39, 0.95);
    min-width: 200px;
    border: 1px solid #333;
    border-top: 2px solid var(--mm-accent-blue);
    z-index: 1001;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    display: block;
    text-align: left;
    padding: 10px 15px;
    border-bottom: 1px solid #222;
}

/* 3. RIGHT CELL (Search) */
.search-cell {
    width: 25%;
    vertical-align: middle;
    padding-right: 20px;
    text-align: right;
}

.mm-search-form {
    display: inline-flex;
    align-items: center;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 4px;
    padding: 5px;
}

.mm-search-input {
    background: transparent;
    border: none;
    color: white;
    padding: 5px;
    outline: none;
    width: 150px;
}

.mm-search-btn {
    background: transparent;
    border: none;
    color: #aaa;
    cursor: pointer;
}

.mm-search-btn:hover {
    color: var(--mm-accent-blue);
}

/* --- MOBILE & RESPONSIVE LOGIC --- */
.mobile-only,
.mm-mobile-nav {
    display: none;
}

@media (max-width: 1100px) {
    :root {
        --site-header-height: 70px;
    }

    .nav-bar {
        min-height: var(--site-header-height);
    }

    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        height: 100%;
        background: var(--mm-dark-panel);
        padding: 0 20px;
    }

    .mm-mobile-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
    }

    .mm-mobile-toggle .bar {
        width: 25px;
        height: 3px;
        background: white;
    }

    .mm-mobile-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--mm-dark-panel);
        z-index: 1001;
        box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    }

    #site-header.mobile-nav-active .mm-mobile-nav {
        display: block;
    }

    .mm-mobile-nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mm-mobile-nav a {
        display: block;
        padding: 15px;
        color: white;
        border-bottom: 1px solid #333;
        text-decoration: none;
    }
}
.mm-ai-entry {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    color: #fff;
    text-decoration: none;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    white-space: nowrap;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 8px 20px rgba(59,130,246,0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.mm-ai-entry:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(59,130,246,0.35);
    filter: brightness(1.05);
}

.mm-mobile-ai-link {
    color: var(--mm-accent-blue);
    font-family: var(--font-primary);
}