/* ================= ACTIVE MENU STATE ================= */
nav li a.active {
    color: var(--green);
    background: rgba(22, 163, 74, 0.1);
    border-radius: 6px;
    position: relative;
}

nav li a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 12px;
    right: 12px;
    height: 2px;
    background: var(--green);
}

/* ================= PREMIUM SEARCH UI ================= */
.search-container {
    margin: 0 15px;
    flex: 0 1 300px; /* Limits search width */
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 100%;
    padding: 8px 35px 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
}

.search-box input:focus {
    background: #fff;
    color: var(--black);
    border-color: var(--green);
    box-shadow: 0 0 15px rgba(22, 163, 74, 0.3);
}

.search-icon {
    position: absolute;
    right: 12px;
    font-size: 14px;
    pointer-events: none;
    opacity: 0.6;
}

.search-box input:focus + .search-icon {
    color: var(--green);
    opacity: 1;
}

/* Responsive Search */
@media (max-width: 992px) {
    .search-container {
        order: 3; /* Move to end on mobile */
        flex: 1;
        margin: 10px 0;
    }
    
    header {
        flex-wrap: wrap; /* Allows search to drop below logo/burger if needed */
    }
}

/* ================= PREMIUM SEARCH & AUTO-SUGGEST ================= */
.search-container {
    position: relative;
    margin: 0 15px;
    flex: 0 1 350px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
}

.search-box input:focus {
    background: #fff;
    color: var(--black);
    border-color: var(--green);
    box-shadow: 0 0 20px rgba(22, 163, 74, 0.25);
}

.search-icon {
    position: absolute;
    right: 15px;
    opacity: 0.5;
    pointer-events: none;
}

.search-box input:focus + .search-icon {
    color: var(--green);
    opacity: 1;
}

/* Auto-suggest Dropdown */
.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: none; /* Hidden by default */
    max-height: 300px;
    overflow-y: auto;
    z-index: 1100;
    border: 1px solid #e2e8f0;
}

.suggestion-item {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.suggestion-item:last-child { border-bottom: none; }

.suggestion-item:hover {
    background: #f0fdf4;
    color: var(--green);
}

.suggestion-item .category {
    font-size: 11px;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
    color: #64748b;
}

/* Mobile Search Fix */
@media (max-width: 992px) {
    .search-container {
        order: 4;
        flex: 1 1 100%;
        margin: 10px 0;
    }
}