/* --- BASE HEADER --- */
.freshink-site-header {
    background-color: #ffffff;
    border-bottom: 1px solid #f2f2f2;
    position: relative;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
}

/* Fixed Sticky Toggle */
.freshink-site-header.fi-is-sticky {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
}

.fi-header-container { max-width: 1192px; margin: 0 auto; padding: 0 24px; height: 57px; display: flex; justify-content: space-between; align-items: center; }
.fi-header-container.fi-full-width { max-width: none !important; }

/* --- LEFT SIDE: LOGO & SEARCH --- */
.fi-header-left { display: flex; align-items: center; gap: 16px; height: 100%; }
.fi-logo { display: flex; align-items: center; border: none !important; text-decoration: none !important; }
.fi-logo img { margin: 0; }
.fi-logo h2 { margin: 0; font-size: 22px; color: #000; font-weight: bold; }

.freshink-site-header form { margin: 0; padding: 0; display: flex; align-items: center; }
.fi-search-bar { background-color: #f9f9f9; border-radius: 20px; padding: 0 14px; display: flex; align-items: center; height: 36px; border: 1px solid transparent; }
.fi-search-bar:focus-within { background-color: #fff; border-color: #ccc; }
.fi-search-bar svg { color: #6b6b6b; width: 20px; height: 20px; display: block; }
.fi-search-bar input[type="search"] { border: none; background: transparent; padding: 0 0 0 8px; font-size: 14px; outline: none; width: 200px; box-shadow: none; height: 100%; margin: 0; color: #242424; }

/* --- RIGHT SIDE: HORIZONTAL MENU & AUTH --- */
.fi-header-right { display: flex; align-items: center; gap: 24px; height: 100%; }
.fi-horizontal-nav-list { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; align-items: center; }
.fi-horizontal-nav-list li { margin: 0; padding: 0; }
.fi-horizontal-nav-list a { color: #242424; text-decoration: none; font-size: 14px; display: flex; align-items: center; }
.fi-horizontal-nav-list a:hover { color: #000; }
.fi-nav-link { color: #242424; text-decoration: none; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.fi-nav-link:hover { color: #000; }

.fi-btn-primary { background-color: #1a8917; color: #fff; padding: 7px 16px; border-radius: 20px; text-decoration: none; font-size: 14px; display: inline-block; line-height: 1.2; border: none; }
.fi-btn-primary:hover { background-color: #156d12; color: #fff; }

/* --- USER DROPDOWN --- */
.fi-user-menu-wrapper { position: relative; }
.fi-avatar-btn { background: transparent; border: none; padding: 0; cursor: pointer; display: flex; align-items: center; }
.fi-avatar-btn img { border-radius: 50%; height: 32px; width: 32px; margin: 0; }
.fi-dropdown-menu { position: absolute; top: 45px; right: 0; background: #ffffff; min-width: 200px; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); padding: 8px 0; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.2s ease; z-index: 10000; border: 1px solid #e6e6e6; }
.fi-dropdown-menu.active { opacity: 1; visibility: visible; transform: translateY(0); }
.fi-dropdown-nav-list { list-style: none; margin: 0; padding: 0; }
.fi-dropdown-nav-list a { display: block; padding: 8px 20px; color: #242424; text-decoration: none; font-size: 14px; }
.fi-dropdown-nav-list a:hover { color: #1a8917; background-color: #f9f9f9; }

/* --- SLIDE-UNDER OVERLAY SIDEBAR --- */
.fi-hamburger-btn { 
    position: relative; 
    background: transparent !important; 
    border: none !important; 
    box-shadow: none !important;
    cursor: pointer; 
    padding: 0 !important; 
    display: flex; 
    align-items: center; 
    color: #242424; 
    margin-right: 8px; 
    min-width: 24px !important;
}
.fi-hamburger-btn svg {
    width: 24px !important;
    height: 24px !important;
    display: block !important;
}

/* Custom Instant Tooltip */
.fi-hamburger-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -34px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #242424;
    color: #ffffff;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.fi-hamburger-btn:hover::after { opacity: 1; visibility: visible; }

.fi-left-sidebar {
    position: fixed; top: 0; left: 0; width: 200px; height: 100vh;
    background-color: #ffffff; z-index: 9999; border-right: 1px solid #f2f2f2;
    transform: translateX(-100%); transition: transform 0.3s ease-in-out;
    display: flex; flex-direction: column; padding-top: 57px; 
}
.fi-left-sidebar.active { transform: translateX(0); box-shadow: 2px 0 10px rgba(0,0,0,0.05); }

/* The invisible overlay behind the sidebar (No more grey!) */
.fi-sidebar-overlay { 
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; 
    background-color: transparent; 
    z-index: 9998; display: none; 
}
.fi-sidebar-overlay.active { display: block; }

.fi-sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid #f2f2f2; }
.fi-sidebar-header h3 { margin: 0; font-size: 18px; font-weight: 600; }
.fi-close-sidebar { background: transparent; border: none; font-size: 28px; cursor: pointer; color: #6b6b6b; }

.fi-sidebar-nav-list { list-style: none; padding: 24px; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.fi-sidebar-nav-list a { text-decoration: none; color: #242424; font-size: 15px; font-weight: 500; display: block; }
.fi-sidebar-nav-list a:hover { color: #1a8917; }

/* --- FONTAWESOME MENU ICONS --- */
.fi-sidebar-nav-list a i, .fi-horizontal-nav-list a i, .fi-dropdown-nav-list a i {
    width: 24px; text-align: center; color: #6b6b6b; margin-right: 6px;
}
.fi-sidebar-nav-list a:hover i, .fi-horizontal-nav-list a:hover i, .fi-dropdown-nav-list a:hover i {
    color: #1a8917;
}

/* --- AGGRESSIVE THEME OVERRIDES --- */

/* Force menu text to use normal fonts, ignoring icon font bleed */
.fi-menu-text, 
.fi-sidebar-nav-list a, 
.fi-horizontal-nav-list a {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-style: normal !important;
    font-weight: 500 !important;
    letter-spacing: normal !important;
}

/* Ensure the stealth hamburger div ignores theme borders */
.fi-hamburger-btn {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    min-width: 24px !important;
    min-height: 24px !important;
}
.fi-hamburger-btn svg {
    display: block !important;
    margin: 0 !important;
}

/* --- KILL THEME FOCUS OUTLINES GLOBALLY --- */
/* This stops the blue squares and weird borders when you click anything in the header/sidebar */
.freshink-site-header a:focus,
.freshink-site-header button:focus,
.freshink-site-header div:focus,
.fi-left-sidebar a:focus,
.fi-left-sidebar button:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Hard reset for the specific buttons just in case */
.fi-close-sidebar:focus,
.fi-close-sidebar:active,
.fi-avatar-btn:focus,
.fi-avatar-btn:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    background-color: transparent !important;
}

/* --- PROTECT ICONS FROM TEXT FONT OVERRIDES --- */
/* Ensures the theme's text font doesn't break the FontAwesome icons */
.fi-sidebar-nav-list a i, 
.fi-horizontal-nav-list a i, 
.fi-dropdown-nav-list a i {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
}
i.fa-solid { font-weight: 900 !important; }
i.fa-regular { font-weight: 400 !important; }

/* =========================================================
   MOBILE RESPONSIVE STYLES (Tablets & Phones)
   ========================================================= */

@media screen and (max-width: 850px) {
    /* Hide the horizontal menu to prevent layout breaking */
    /* Ensure these links are added to your Left Sidebar menu! */
    .fi-horizontal-menu { 
        display: none !important; 
    }
}

@media screen and (max-width: 768px) {
    .fi-header-container { 
        padding: 0 16px !important; 
    }
    .fi-header-left { gap: 12px !important; }
    .fi-header-right { gap: 16px !important; }
    
    /* Shrink the search bar */
    .fi-search-bar input[type="search"] { 
        width: 120px !important; 
    }
    
    /* Adjust button sizes */
    .fi-btn-primary { 
        padding: 6px 12px !important; 
        font-size: 13px !important; 
    }
    
    /* Ensure logo scales nicely without getting stretched */
    .fi-logo img { 
        max-height: 30px !important; 
        width: auto !important; 
    }
}

@media screen and (max-width: 480px) {
    .fi-header-container { padding: 0 12px !important; }
    .fi-header-left { gap: 8px !important; }
    .fi-header-right { gap: 12px !important; }
    
    /* Shrink search even further for small phones */
    .fi-search-bar { padding: 0 8px !important; }
    .fi-search-bar input[type="search"] { 
        width: 80px !important; 
        padding: 0 0 0 4px !important;
        font-size: 13px !important;
    }
    .fi-search-bar svg { width: 16px !important; height: 16px !important; }
    
    /* Shrink text and avatars */
    .fi-nav-link.fi-signin { font-size: 13px !important; }
    .fi-avatar-btn img { height: 28px !important; width: 28px !important; }
    .fi-hamburger-btn { margin-right: 4px !important; }
}