﻿/* MFRural Style Header - Refined Green Theme */

:root {
    --mfr-green: #28a745;
    --mfr-green-dark: #218838;
    --white: #ffffff;
    --text-muted: #e9ecef;
}

.main-header-wrapper {
    background: white !important;
    width: 100%;
    position: relative;
    /* Garantir que o z-index funcione mesmo sem ser sticky */
    z-index: 1001;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}


.main-header-wrapper.sticky {
    position: sticky;
    top: 0;
}

/* TOP BAR */
.top-header-bar {
    padding: 15px 0;
    border-bottom: none;
    /* Removida linha que gerava aparência de margem */
}

.header-flex-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

/* Logo Section - NO BEGE BACKGROUND */
.logo {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.logo img {
    height: 50px !important;
    /* Increased size as requested */
    width: auto !important;
    display: block;
}

.logo-tagline {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-top: 5px;
    display: block;
    color: var(--white) !important;
}

/* Integrated Search Bar */
.header-search-wrap {
    flex: 1;
    max-width: 500px;
}

.search-inner {
    position: relative;
}

.search-inner input {
    width: 100%;
    height: 48px;
    padding: 0 50px 0 20px;
    border: none;
    border-radius: 50px;
    /* Pill search bar */
    font-size: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    outline: none;
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 5px;
    height: 38px;
    width: 38px;
    background: var(--mfr-green);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

/* Right Meta (Auth & Pill Button) */
.header-right-meta {
    display: flex;
    align-items: center;
    gap: 20px;
}

.auth-links a {
    color: green !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.auth-links a:hover {
    color: black !important;
}

/* PILL BUTTON - WHITE */
.btn-pill-white {
    background-color: var(--mfr-green-dark) !important;
    color: var(--white) !important;
    padding: 10px 25px !important;
    border-radius: 50px !important;
    /* Maximum rounding */
    font-weight: 800 !important;
    font-size: 13px;
    text-decoration: none !important;
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-pill-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.top-header-bar,
.bottom-header-bar {
    margin: 0 !important;
}

/* BOTTOM BAR */
.bottom-header-bar {
    background: var(--mfr-green-dark);
    /* Slightly darker for contrast */
    padding: 10px 0;
    position: relative;
}

.bottom-inner {
    display: flex;
    align-items: center;
    gap: 50px;
}

/* Mega Menu Toggle */
.mega-menu-item {
    position: static;
    /* Required for 100% width dropdown */
}

.mega-toggle {
    color: var(--white) !important;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    text-decoration: none !important;
    display: flex;
    align-items: center;
}

/* MEGA MENU CONTENT - 100% Width */
.mega-menu-dropdown {
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    background: #fff;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    padding: 40px 0;
    z-index: 1000;
    display: none;
    border-top: 2px solid var(--white);
}

.mega-menu-dropdown.active {
    display: block;
    animation: fadeInDown 0.3s ease;
}

.mega-col-title {
    font-weight: 800;
    font-size: 14px;
    color: var(--mfr-green);
    text-transform: uppercase;
    margin-bottom: 20px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.mega-menu-dropdown ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu-dropdown ul li {
    margin-bottom: 10px;
}

.mega-menu-dropdown ul li a {
    color: #444;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.mega-menu-dropdown ul li a:hover {
    color: var(--mfr-green);
    padding-left: 5px;
}

/* Secondary Horizontal Nav */
.secondary-nav-horizontal ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 40px;
}

.secondary-nav-horizontal a {
    color: var(--white) !important;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none !important;
}

.secondary-nav-horizontal a:hover {
    color: #ccffdd !important;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Adjustments */
@media (max-width: 991px) {
    .header-flex-wrapper {
        flex-direction: column;
        gap: 15px;
    }

    .header-search-wrap {
        max-width: 100%;
    }

    .bottom-inner {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .secondary-nav-horizontal ul {
        flex-wrap: wrap;
        gap: 15px;
    }
}

/* Fix for white bar on dashboard pages */
.dashboard-area {
    padding-top: 10px !important;
    /* Minimized padding */
    margin-top: 0 !important;
}

.dashboard-area>.container {
    padding-top: 0 !important;
}

.dashboard-area .section-title {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.dashboard-area .section-title h2 {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Ensure header doesn't push down weirdly */
.main-header-wrapper {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Global fix for the white bar between header and content */
.breadcrumb-area,
.banner-area,
.dashboard-area,
section:first-of-type,
div[style*="background-image"],
div[style*="background: url"] {
    margin-top: 0 !important;
}