/* Billy Bargain - Refined Superhero Stylesheet */

:root {
    /* Primary Brand Colors */
    --ps-nav-bg: #002d58;    /* Deep Navy Header (PriceSpy style) */
    --billy-blue: #004a99;   /* Superhero Blue */
    --billy-yellow: #ffd700; /* Superhero Yellow/Gold */
    --billy-red: #d90429;    /* Alert/Price Drop Red */
    
    /* UI Colors */
    --bg-light: #f2f4f5;     /* Light Grey Body Background */
    --border-color: #e2e6e9; /* Soft Borders */
    --text-main: #1a1b1c;    /* High Contrast Text */
    --green-save: #1f8a70;   /* Success/Savings Green */
}

/* Global Reset & Base */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    margin: 0;
    padding: 0;
}

/* --- HEADER SECTION --- */
.navbar-custom {
    background-color: var(--ps-nav-bg);
    padding: 8px 16px;
    border-bottom: 3px solid var(--billy-yellow);
}

/* Logo and Text Alignment */
.header-logo-profile {
    height: 65px; /* Sized for the header */
    width: auto;
    display: block;
    filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.3));
}

.brand-text {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: #ffffff;
    text-transform: uppercase;
    line-height: 1;
}

.text-yellow {
    color: var(--billy-yellow);
}

/* Hamburger / Categories Button */
.btn-categories {
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-right: 1rem;
}

.btn-categories:hover {
    background-color: rgba(255,255,255,0.1);
    color: var(--billy-yellow);
    border-color: var(--billy-yellow);
}

/* Centered Search Bar */
.header-search-wrap {
    flex-grow: 1;
    max-width: 650px;
    margin: 0 25px;
}

.header-search-wrap .form-control {
    border-radius: 4px 0 0 4px;
    border: none;
    height: 42px;
    font-size: 0.95rem;
}

.header-search-wrap .btn-search-main {
    border-radius: 0 4px 4px 0;
    background-color: var(--billy-yellow);
    border: none;
    color: #000;
    font-weight: 700;
    height: 42px;
    padding: 0 20px;
}

.header-search-wrap .btn-search-main:hover {
    background-color: #e6c200;
}

/* --- SIDEBAR & NAVIGATION --- */
.sidebar-title {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #70767a;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

/* Centering Logic */
.container-fluid {
    display: flex;
    align-items: center;
}

/* Force left and right to take up equal space */
.nav-left, .nav-right {
    flex: 1; 
    min-width: 0; /* Prevents flex items from overflowing */
}

/* Middle section stays as wide as its content (max 650px) */
.nav-middle {
    flex: 0 0 auto;
    width: 100%;
    max-width: 650px;
    display: flex;
    justify-content: center;
}

/* Ensure search wrap fills its container */
.header-search-wrap {
    width: 100%;
    margin: 0 !important; /* Remove old margins */
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .nav-middle {
        display: none; /* Hide center search on mobile as per your logic */
    }
    .nav-right {
        flex: 0 0 auto; /* Let the mobile search icon sit tight to the right */
    }
}

/* --- Desktop Centering Logic (Same as before) --- */
@media (min-width: 768px) {
    .nav-left, .nav-right { flex: 1; }
    .nav-logo-center { flex: 0 0 auto; }
    .nav-middle { 
        flex: 0 0 auto; 
        width: 100%; 
        max-width: 650px; 
        margin: 0 20px;
    }
}

/* --- Mobile Specific Centering & Layout --- */
@media (max-width: 767.98px) {
    .navbar-custom .container-fluid {
        justify-content: space-between;
    }

    /* Left and Right spacers for the logo */
    .nav-left, .nav-right {
        flex: 1; 
        display: flex;
        align-items: center;
    }

    /* Ensure Logo is absolute center */
    .nav-logo-center {
        flex: 0 0 auto;
        display: flex;
        justify-content: center;
    }

    /* Force Search Bar to take its own line */
    .nav-middle {
        flex: 0 0 100%; 
        display: flex;
        justify-content: center;
        padding-bottom: 5px;
    }

    .header-search-wrap {
        max-width: 100%;
    }
    
    .brand-text {
        font-size: 1.1rem;
    }
}